[openaz-1] - Applying "astyle" to the Java source
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Action.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Action.java
index 9ba721d..f43d1af 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Action.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Action.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi;
@@ -26,57 +26,57 @@
 
 /**
  * Container class that maps attributes to predefined XACML Action category.
- * 
+ *
  * @author Ajith Nair, David Laurance, Darshak Kothari
  *
  */
 public class Action extends CategoryContainer {
 
-        public static final String ACTION_ID_KEY = "ACTION_ID_KEY";
-        
-        private String actionIdValue;
-        
-        private Action() {
-                super(XACML3.ID_ATTRIBUTE_CATEGORY_ACTION);
-        }
-        
-        /**
-         * Creates a new Action instance
-         * 
-         * @return
-         */
-        public static Action newInstance() {
-                return new Action();
-        }
-        
-        /**
-         * Create a new Action instance containing a single default attribute with the given value
-         * 
-         * @param actionIdValue
-         * @return
-         */
-        public static Action newInstance(String actionIdValue) {
-                Action a = new Action();
-                a.actionIdValue = actionIdValue;
-                a.addAttribute(ACTION_ID_KEY, actionIdValue);
-                return a;
-        }
-        
-        /**
-         * Get the value for default attribute.
-         * 
-         * @return
-         */
-        public String getActionIdValue() {
-                return actionIdValue;
-        }
+    public static final String ACTION_ID_KEY = "ACTION_ID_KEY";
 
-        @Override
-        public String toString() {
-                StringBuilder builder = new StringBuilder();
-                builder.append("action-id value: " + actionIdValue);
-                builder.append("\n");
-                builder.append(super.toString());
-                return builder.toString();
-        }
+    private String actionIdValue;
+
+    private Action() {
+        super(XACML3.ID_ATTRIBUTE_CATEGORY_ACTION);
+    }
+
+    /**
+     * Creates a new Action instance
+     *
+     * @return
+     */
+    public static Action newInstance() {
+        return new Action();
+    }
+
+    /**
+     * Create a new Action instance containing a single default attribute with the given value
+     *
+     * @param actionIdValue
+     * @return
+     */
+    public static Action newInstance(String actionIdValue) {
+        Action a = new Action();
+        a.actionIdValue = actionIdValue;
+        a.addAttribute(ACTION_ID_KEY, actionIdValue);
+        return a;
+    }
+
+    /**
+     * Get the value for default attribute.
+     *
+     * @return
+     */
+    public String getActionIdValue() {
+        return actionIdValue;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("action-id value: " + actionIdValue);
+        builder.append("\n");
+        builder.append(super.toString());
+        return builder.toString();
+    }
 }
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ActionResourcePair.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ActionResourcePair.java
index 102c1ef..9b0691b 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ActionResourcePair.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ActionResourcePair.java
@@ -1,112 +1,112 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 

 /**

  * A convenient abstraction for an action - resource pair.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

- * 

+ *

  */

 public final class ActionResourcePair {

-        

-        private final Object action;

 

-        private final Object resource;

-        

-        /**

-         * Creates a new action - resource pair

-         * 

-         * @param action	an Object representing the action being performed.

-         * @param resource	an Object representing the resource on which the action is being performed.

-         */

-        public ActionResourcePair(Object action, Object resource){

-                this.resource = resource;

-                this.action = action;

+    private final Object action;

+

+    private final Object resource;

+

+    /**

+     * Creates a new action - resource pair

+     *

+     * @param action	an Object representing the action being performed.

+     * @param resource	an Object representing the resource on which the action is being performed.

+     */

+    public ActionResourcePair(Object action, Object resource) {

+        this.resource = resource;

+        this.action = action;

+    }

+

+    /**

+     * Returns the resource associated with this action - resource pair

+     *

+     * @return an Object representing the resource.

+     */

+    public Object getResource() {

+        return resource;

+    }

+

+    /**

+     * Returns the action associated with this action - resource pair.

+     *

+     * @return an Object representing the action.

+     */

+    public Object getAction() {

+        return action;

+    }

+

+    @Override

+    public int hashCode() {

+        final int prime = 31;

+        int result = 1;

+        result = prime * result + ((action == null) ? 0 : action.hashCode());

+        result = prime * result

+                 + ((resource == null) ? 0 : resource.hashCode());

+        return result;

+    }

+

+    @Override

+    public boolean equals(Object obj) {

+        if (this == obj) {

+            return true;

         }

-        

-        /**

-         * Returns the resource associated with this action - resource pair

-         * 

-         * @return an Object representing the resource.

-         */

-        public Object getResource() {

-                return resource;

+        if (obj == null) {

+            return false;

         }

-        

-        /**

-         * Returns the action associated with this action - resource pair.

-         * 

-         * @return an Object representing the action.

-         */

-        public Object getAction() {

-                return action;

+        if (getClass() != obj.getClass()) {

+            return false;

+        }

+        ActionResourcePair other = (ActionResourcePair) obj;

+        if (action == null) {

+            if (other.action != null)

+                return false;

+        } else if (!action.equals(other.action)) {

+            return false;

         }

 

-        @Override

-        public int hashCode() {

-                final int prime = 31;

-                int result = 1;

-                result = prime * result + ((action == null) ? 0 : action.hashCode());

-                result = prime * result

-                                + ((resource == null) ? 0 : resource.hashCode());

-                return result;

+        if (resource == null) {

+            if (other.resource != null) {

+                return false;

+            }

+        } else if (!resource.equals(other.resource)) {

+            return false;

         }

+        return true;

+    }

 

-        @Override

-        public boolean equals(Object obj) {

-                if (this == obj) {

-                        return true;

-                }

-                if (obj == null) {

-                        return false;

-                }

-                if (getClass() != obj.getClass()) {

-                        return false;

-                }

-                ActionResourcePair other = (ActionResourcePair) obj;

-                if (action == null) {

-                        if (other.action != null)

-                                return false;

-                } else if (!action.equals(other.action)) {

-                        return false;

-                }

-                

-                if (resource == null) {

-                        if (other.resource != null) {

-                                return false;

-                        }

-                } else if (!resource.equals(other.resource)) {

-                        return false;

-                }

-                return true;

-        }

-        

-        @Override

-        public String toString() {

-                StringBuilder builder = new StringBuilder();

-                builder.append("\nAction: " + action.toString());

-                builder.append("\nResource: " + resource.toString());

-                return builder.toString();

-        }

-        

+    @Override

+    public String toString() {

+        StringBuilder builder = new StringBuilder();

+        builder.append("\nAction: " + action.toString());

+        builder.append("\nResource: " + resource.toString());

+        return builder.toString();

+    }

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Advice.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Advice.java
index f398d91..57f8f18 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Advice.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Advice.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi;
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Attribute.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Attribute.java
index 3d3d162..ef21690 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Attribute.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Attribute.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import java.lang.annotation.Retention;

@@ -25,26 +25,26 @@
 import java.lang.annotation.Target;

 

 /**

- * 

+ *

  * Represents an Attribute match criterion, where an attribute with the given Id can take any of the values provided.

- * If no value is available, then value matching is ignored. 

- * 

+ * If no value is available, then value matching is ignored.

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 @Target({})

 @Retention(RetentionPolicy.CLASS)

 public @interface Attribute {

-        

-        /**

-         * 

-         * @return

-         */

-        String id();

-        

-        /**

-         * 

-         * @return

-         */

-        String[] anyValue() default {};

+

+    /**

+     *

+     * @return

+     */

+    String id();

+

+    /**

+     *

+     * @return

+     */

+String[] anyValue() default {};

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/CategoryContainer.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/CategoryContainer.java
index 7c30a73..d340077 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/CategoryContainer.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/CategoryContainer.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import com.att.research.xacml.api.Identifier;

@@ -31,130 +31,130 @@
 

 /**

  * Abstraction for an attribute container of a specific XACML category.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

- * 

+ *

  */

 public class CategoryContainer {

 

-        private final Map<String, Object[]> attributeMap;

-        

-        private final Identifier categoryIdentifier;

+    private final Map<String, Object[]> attributeMap;

 

-        CategoryContainer(Identifier categoryIdentifier) {

-                this.categoryIdentifier = categoryIdentifier;

-                this.attributeMap = new HashMap<String, Object[]>();

-        }

+    private final Identifier categoryIdentifier;

 

-        private final void addToMap(String id, Object[] values) {

-                if (values != null && values.length > 0) {

-                        attributeMap.put(id, values);

-                }else {

-                        throw new IllegalArgumentException("Values cannot be null");

-                }

-        }

-        

-        public Identifier getCategoryIdentifier() {

-                return this.categoryIdentifier;

-        }

-        

-        /**

-         * Returns all the contained attributes as a Map of key - value pairs.

-         * 

-         * @return

-         */

-        public Map<String, Object[]> getAttributeMap() {

-                return Collections.unmodifiableMap(attributeMap);

-        }

-        

-        /**

-         * Add a new attribute with the given id and one or more String values

-         * 

-         * @param id

-         * @param values

-         * @throws IllegalArgumentException, if values are null;

-         */

-        public void addAttribute(String id, String... values) {

-                addToMap(id, values);

-        }

-        

-        /**

-         * Add a new attribute with the given id and one or more Long values

-         * 

-         * @param id

-         * @param values

-         * @throws IllegalArgumentException, if values are null;

-         */

-        public void addAttribute(String id, Long... values) {

-                addToMap(id, values);

-        }

-        

-        /**

-         * Add a new attribute with the given id and one or more Integer values

-         * 

-         * @param id

-         * @param values

-         * @throws IllegalArgumentException, if values are null;

-         */

-        public void addAttribute(String id, Integer... values) {

-                addToMap(id, values);

-        }

-        

-        /**

-         * Add a new attribute with the given id and one or more Double values

-         * 

-         * @param id

-         * @param values

-         * @throws IllegalArgumentException, if values are null;

-         */

-        public void addAttribute(String id, Double... values) {

-                addToMap(id, values);

-        }

-        

-        /**

-         * Add a new attribute with the given id and one or more Boolean values

-         * 

-         * @param id

-         * @param values

-         * @throws IllegalArgumentException, if values are null;

-         */

-        public void addAttribute(String id, Boolean... values) {

-                addToMap(id, values);

-        }

-        

-        /**

-         * Add a new attribute with the given id and one or more <code>java.util.Date</code> values

-         * 

-         * @param id

-         * @param values

-         * @throws IllegalArgumentException, if values are null;

-         */

-        public void addAttribute(String id, Date... values) {

-                addToMap(id, values);

-        }

-        

-        /**

-         * Add a new attribute with the given id and one or more URI values

-         * 

-         * @param id

-         * @param values

-         * @throws IllegalArgumentException, if values are null;

-         */

-        public void addAttribute(String id, URI... values) {

-                addToMap(id, values);

-        }

+    CategoryContainer(Identifier categoryIdentifier) {

+        this.categoryIdentifier = categoryIdentifier;

+        this.attributeMap = new HashMap<String, Object[]>();

+    }

 

-        @Override

-        public String toString() {

-                StringBuilder builder = new StringBuilder();

-                for(Entry<String, Object[]> e: attributeMap.entrySet()) {

-                        builder.append("Attribute Id: " + e.getKey());

-                        builder.append(", Attribute Values: ");

-                        for(Object o: e.getValue()) {

-                                builder.append(o.toString() + ", ");

-                        }

-                        builder.append("\n");

-                }

-                return builder.toString();

+    private final void addToMap(String id, Object[] values) {

+        if (values != null && values.length > 0) {

+            attributeMap.put(id, values);

+        } else {

+            throw new IllegalArgumentException("Values cannot be null");

         }

+    }

+

+    public Identifier getCategoryIdentifier() {

+        return this.categoryIdentifier;

+    }

+

+    /**

+     * Returns all the contained attributes as a Map of key - value pairs.

+     *

+     * @return

+     */

+    public Map<String, Object[]> getAttributeMap() {

+        return Collections.unmodifiableMap(attributeMap);

+    }

+

+    /**

+     * Add a new attribute with the given id and one or more String values

+     *

+     * @param id

+     * @param values

+     * @throws IllegalArgumentException, if values are null;

+     */

+    public void addAttribute(String id, String... values) {

+        addToMap(id, values);

+    }

+

+    /**

+     * Add a new attribute with the given id and one or more Long values

+     *

+     * @param id

+     * @param values

+     * @throws IllegalArgumentException, if values are null;

+     */

+    public void addAttribute(String id, Long... values) {

+        addToMap(id, values);

+    }

+

+    /**

+     * Add a new attribute with the given id and one or more Integer values

+     *

+     * @param id

+     * @param values

+     * @throws IllegalArgumentException, if values are null;

+     */

+    public void addAttribute(String id, Integer... values) {

+        addToMap(id, values);

+    }

+

+    /**

+     * Add a new attribute with the given id and one or more Double values

+     *

+     * @param id

+     * @param values

+     * @throws IllegalArgumentException, if values are null;

+     */

+    public void addAttribute(String id, Double... values) {

+        addToMap(id, values);

+    }

+

+    /**

+     * Add a new attribute with the given id and one or more Boolean values

+     *

+     * @param id

+     * @param values

+     * @throws IllegalArgumentException, if values are null;

+     */

+    public void addAttribute(String id, Boolean... values) {

+        addToMap(id, values);

+    }

+

+    /**

+     * Add a new attribute with the given id and one or more <code>java.util.Date</code> values

+     *

+     * @param id

+     * @param values

+     * @throws IllegalArgumentException, if values are null;

+     */

+    public void addAttribute(String id, Date... values) {

+        addToMap(id, values);

+    }

+

+    /**

+     * Add a new attribute with the given id and one or more URI values

+     *

+     * @param id

+     * @param values

+     * @throws IllegalArgumentException, if values are null;

+     */

+    public void addAttribute(String id, URI... values) {

+        addToMap(id, values);

+    }

+

+    @Override

+    public String toString() {

+        StringBuilder builder = new StringBuilder();

+        for(Entry<String, Object[]> e: attributeMap.entrySet()) {

+            builder.append("Attribute Id: " + e.getKey());

+            builder.append(", Attribute Values: ");

+            for(Object o: e.getValue()) {

+                builder.append(o.toString() + ", ");

+            }

+            builder.append("\n");

+        }

+        return builder.toString();

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Environment.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Environment.java
index 4fce42c..da90722 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Environment.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Environment.java
@@ -1,47 +1,47 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import com.att.research.xacml.api.XACML3;

 

 /**

- * 

+ *

  * Container class that maps attributes to predefined XACML Environment category.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 public final class Environment extends CategoryContainer {

 

-        private Environment() {

-                super(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT);

-        }

-        

-        /**

-         * Creates a new Environment instance

-         * 

-         * @return

-         */

-        public static Environment newInstance() {

-                return new Environment();

-        }

+    private Environment() {

+        super(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT);

+    }

+

+    /**

+     * Creates a new Environment instance

+     *

+     * @return

+     */

+    public static Environment newInstance() {

+        return new Environment();

+    }

 

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/InvalidAnnotationException.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/InvalidAnnotationException.java
index c58bf26..e9c7d63 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/InvalidAnnotationException.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/InvalidAnnotationException.java
@@ -1,49 +1,49 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 /**

- * RuntimeException thrown when a registered handler class does not contain one of the 

+ * RuntimeException thrown when a registered handler class does not contain one of the

  * required annotations - <code>@MatchAnyObligation</code>, <code>@MatchAllObligationAttributes</code>.

- *   

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 @SuppressWarnings("serial")

 public class InvalidAnnotationException extends RuntimeException {

 

-        public InvalidAnnotationException() {

-                super();

-        }

+    public InvalidAnnotationException() {

+        super();

+    }

 

-        public InvalidAnnotationException(String message, Throwable cause) {

-                super(message, cause);

-        }

+    public InvalidAnnotationException(String message, Throwable cause) {

+        super(message, cause);

+    }

 

-        public InvalidAnnotationException(String message) {

-                super(message);

-        }

+    public InvalidAnnotationException(String message) {

+        super(message);

+    }

 

-        public InvalidAnnotationException(Throwable cause) {

-                super(cause);

-        }

+    public InvalidAnnotationException(Throwable cause) {

+        super(cause);

+    }

 

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MapperRegistry.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MapperRegistry.java
index e49215e..fd23408 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MapperRegistry.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MapperRegistry.java
@@ -1,55 +1,55 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 

 /**

  * Container that holds <code>ObjectMapper</code> instances registered with the framework.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 public interface MapperRegistry {

-        

-        /**

-         * Registers the provided ObjectMapper instance 

-         * 

-         * @param mapper

-         */

-        public void registerMapper(ObjectMapper mapper);

 

-        /**

-         * Registers the provided ObjectMapper instances

-         *

-         * @param mappers

-         */

-        public void registerMappers(Iterable<? extends ObjectMapper> mappers);

+    /**

+     * Registers the provided ObjectMapper instance

+     *

+     * @param mapper

+     */

+    public void registerMapper(ObjectMapper mapper);

 

-        /**

-         * Returns the ObjectMapper instance registered for the given Class.

-         * 

-         * @param clazz 

-         * @return an ObjectMapper instance

-         * @throws org.openliberty.openaz.pepapi.PepException if no ObjectMapper could be found for class clazz;

-         */

-        public ObjectMapper getMapper(Class<?> clazz);

-        

+    /**

+     * Registers the provided ObjectMapper instances

+     *

+     * @param mappers

+     */

+    public void registerMappers(Iterable<? extends ObjectMapper> mappers);

+

+    /**

+     * Returns the ObjectMapper instance registered for the given Class.

+     *

+     * @param clazz

+     * @return an ObjectMapper instance

+     * @throws org.openliberty.openaz.pepapi.PepException if no ObjectMapper could be found for class clazz;

+     */

+    public ObjectMapper getMapper(Class<?> clazz);

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MatchAllObligationAttributes.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MatchAllObligationAttributes.java
index 555f6b5..5976d4c 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MatchAllObligationAttributes.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MatchAllObligationAttributes.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import java.lang.annotation.ElementType;

@@ -26,20 +26,20 @@
 import java.lang.annotation.Target;

 

 /**

- * Represents a union of Obligation Attribute match criterion. 

+ * Represents a union of Obligation Attribute match criterion.

  * All attribute criterion supplied will be conjunctively matched by the framework.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 @Target(ElementType.TYPE)

 @Retention(RetentionPolicy.RUNTIME)

 public @interface MatchAllObligationAttributes {

-        

-        /**

-         * 

-         * @return

-         */

-        Attribute[] value();

-        

+

+    /**

+     *

+     * @return

+     */

+    Attribute[] value();

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MatchAnyObligation.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MatchAnyObligation.java
index d5cd127..4aee710 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MatchAnyObligation.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/MatchAnyObligation.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import java.lang.annotation.ElementType;

@@ -27,19 +27,19 @@
 

 /**

  * Represents an Obligation criteria that matches any of the supplied Obligation ids.

- * If no ids are provided, then any Obligation will be matched(catch-all).   

- * 

+ * If no ids are provided, then any Obligation will be matched(catch-all).

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 @Target(ElementType.TYPE)

 @Retention(RetentionPolicy.RUNTIME)

 public @interface MatchAnyObligation {

-        

-        /**

-         * 

-         * @return

-         */

-        String[] value() default {};

-                

+

+    /**

+     *

+     * @return

+     */

+String[] value() default {};

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Matchable.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Matchable.java
index 74763c6..7325616 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Matchable.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Matchable.java
@@ -6,34 +6,34 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi;

-

-/**

- * Interface that abstracts an object that can be matched. Concrete implementations provide a match() function. 

- * 

- * @author Ajith Nair, David Laurance, Darshak Kothari

- * @param <T>

- */

-public interface Matchable<T> {

-        

-        /**

-         * Returns a boolean result after matching the given Object 

-         * 

-         * @param t

-         * @return a <code>boolean</code> value 

-         */

-        public boolean match(T t);

-        

-}

+package org.openliberty.openaz.pepapi;
+
+/**
+ * Interface that abstracts an object that can be matched. Concrete implementations provide a match() function.
+ *
+ * @author Ajith Nair, David Laurance, Darshak Kothari
+ * @param <T>
+ */
+public interface Matchable<T> {
+
+    /**
+     * Returns a boolean result after matching the given Object
+     *
+     * @param t
+     * @return a <code>boolean</code> value
+     */
+    public boolean match(T t);
+
+}
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObjectMapper.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObjectMapper.java
index d54f3b9..b3c99ee 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObjectMapper.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObjectMapper.java
@@ -1,67 +1,67 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 

 

 /**

- * Converts a Java Class (typically an application Domain Object) into request attributes of some Category. 

+ * Converts a Java Class (typically an application Domain Object) into request attributes of some Category.

  * Applications are expected to provide only a single ObjectMapper instance per Domain Type.

- * 

+ *

  * Typically, there is a one-to-one relationship between the Domain Type and Attribute Category. The interface, however, takes

  * a general approach allowing a Domain Type to be mapped to multiple categories.

- * 

+ *

  * The conversion for the most part involves obtaining a <code>CategoryAttributes</code> instance for a specific category from the

  * request context and then mapping Object properties as name-value pairs using one of the overloaded <code>setAttribute</code>

  * methods.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 public interface ObjectMapper {

 

-        /**

-         * Returns a Class that represents the mapped domain type.

-         * 

-         * @return a Class object

-         */

-        public Class<?> getMappedClass();

-        

-        /**

-         * Maps Object properties to attributes

-         * 

-         * @param o - an instance of the domain object to be mapped

-         * @param pepRequest - the current Request Context

-         */

-        public void map(Object o, PepRequest pepRequest);

+    /**

+     * Returns a Class that represents the mapped domain type.

+     *

+     * @return a Class object

+     */

+    public Class<?> getMappedClass();

 

-        /**

-         *

-         * @param mapperRegistry

-         */

-        public void setMapperRegistry(MapperRegistry mapperRegistry);

+    /**

+     * Maps Object properties to attributes

+     *

+     * @param o - an instance of the domain object to be mapped

+     * @param pepRequest - the current Request Context

+     */

+    public void map(Object o, PepRequest pepRequest);

 

-        /**

-         *

-         * @param pepConfig

-         */

-        public void setPepConfig(PepConfig pepConfig);

+    /**

+     *

+     * @param mapperRegistry

+     */

+    public void setMapperRegistry(MapperRegistry mapperRegistry);

+

+    /**

+     *

+     * @param pepConfig

+     */

+    public void setPepConfig(PepConfig pepConfig);

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Obligation.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Obligation.java
index 1106117..508a101 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Obligation.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Obligation.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import java.util.Map;

@@ -28,7 +28,7 @@
  * Attributes.

  * <p>

  * The Obligation has an id: {@link #getId()}

- * <p> 

+ * <p>

  * Each attribute has an id, as well, which are used as the key Strings

  * of the Maps returned by method:

  * <ul>

@@ -42,21 +42,21 @@
  *

  */

 public interface Obligation {

-        

+

     /**

      * Return the Id for this Obligation.

      *

      * @return a string containing the Id of this Obligation

      */

     public String getId();

-    

+

     /**

      * Returns a Map of Obligation Attribute name,object-value-array pairs,

      * indexed by name, where name is the AttributeId and the value

      * is an array of one or more Object values of the "attribute"

      * (where an array with length > 1 indicates a multi-valued attribute).

      * <p>

-     * @return a Map of String (AttributeId name), Object array 

+     * @return a Map of String (AttributeId name), Object array

      * (Attribute values) pairs

      */

     public Map<String, Object[]> getAttributeMap();

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationHandler.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationHandler.java
index d016cd5..7ae2556 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationHandler.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationHandler.java
@@ -6,26 +6,26 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi;

-

-

-/**

- * 

- * @author Ajith Nair, David Laurance, Darshak Kothari

- *

- */

-public interface ObligationHandler extends Matchable<Obligation>, ObligationStoreAware {

-        

-}

+package org.openliberty.openaz.pepapi;
+
+
+/**
+ *
+ * @author Ajith Nair, David Laurance, Darshak Kothari
+ *
+ */
+public interface ObligationHandler extends Matchable<Obligation>, ObligationStoreAware {
+
+}
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationHandlerRegistry.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationHandlerRegistry.java
index a796e50..b3590d2 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationHandlerRegistry.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationHandlerRegistry.java
@@ -1,40 +1,40 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 

 import java.util.Map;

 

 /**

- * Abstraction for a Obligation Handler registration mechanism. Subclasses provide specific implementations.   

- * 

+ * Abstraction for a Obligation Handler registration mechanism. Subclasses provide specific implementations.

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  */

 public interface ObligationHandlerRegistry {

-        

-        /**

-         * Returns a Map of <code>Matchable</code> implementations keyed by handler Class. 

-         * 

-         * @return

-         */

-        public Map<Class<?>, Matchable<Obligation>> getRegisteredHandlerMap();

-        

+

+    /**

+     * Returns a Map of <code>Matchable</code> implementations keyed by handler Class.

+     *

+     * @return

+     */

+    public Map<Class<?>, Matchable<Obligation>> getRegisteredHandlerMap();

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationRouter.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationRouter.java
index 7560535..d15b238 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationRouter.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationRouter.java
@@ -6,33 +6,33 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi;

-

-import java.util.Map;

-

-/**

- * 

- * @author Ajith Nair, David Laurance, Darshak Kothari

- *

- */

-public interface ObligationRouter {

-        

-        /**

-         * 

-         * @param obligationMap

-         */

-        public void routeObligations(Map<String, Obligation> obligationMap);

-        

-}

+package org.openliberty.openaz.pepapi;
+
+import java.util.Map;
+
+/**
+ *
+ * @author Ajith Nair, David Laurance, Darshak Kothari
+ *
+ */
+public interface ObligationRouter {
+
+    /**
+     *
+     * @param obligationMap
+     */
+    public void routeObligations(Map<String, Obligation> obligationMap);
+
+}
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationStore.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationStore.java
index a9ca1e8..f209e88 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationStore.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationStore.java
@@ -1,47 +1,47 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import java.util.Set;

 

 /**

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 public interface ObligationStore {

-        

-        /**

-         * 

-         * @param oHandlerClass

-         * @return

-         */

-        public Set<Obligation> getHandlerObligations(Class<?> oHandlerClass);

-        

-        /**

-         * 

-         * @param oHandlerClass

-         * @param obligationId

-         * @return

-         */

-        public Obligation getHandlerObligationById(Class<?> oHandlerClass, String obligationId);

-        

+

+    /**

+     *

+     * @param oHandlerClass

+     * @return

+     */

+    public Set<Obligation> getHandlerObligations(Class<?> oHandlerClass);

+

+    /**

+     *

+     * @param oHandlerClass

+     * @param obligationId

+     * @return

+     */

+    public Obligation getHandlerObligationById(Class<?> oHandlerClass, String obligationId);

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationStoreAware.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationStoreAware.java
index 73a6d72..3496f25 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationStoreAware.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/ObligationStoreAware.java
@@ -6,32 +6,32 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi;

-

-

-/**

- * 

- * @author Ajith Nair, David Laurance, Darshak Kothari

- *

- */

-public interface ObligationStoreAware {

-        

-        /**

-         * 

-         * @param oStore

-         */

-        public void setObligationStore(ObligationStore oStore);

-        

-}

+package org.openliberty.openaz.pepapi;
+
+
+/**
+ *
+ * @author Ajith Nair, David Laurance, Darshak Kothari
+ *
+ */
+public interface ObligationStoreAware {
+
+    /**
+     *
+     * @param oStore
+     */
+    public void setObligationStore(ObligationStore oStore);
+
+}
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepAgent.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepAgent.java
index 4ce359a..a86771c 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepAgent.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepAgent.java
@@ -1,109 +1,109 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import java.util.List;

 

 /**

- * 

- * Serves as the main entry point into the PepAPI framework. It coordinates authorization request creation, execution and 

+ *

+ * Serves as the main entry point into the PepAPI framework. It coordinates authorization request creation, execution and

  * response assemblage. Applications typically work with a single instance of PepAgent which is thread-safe.

- * 

+ *

  * The <code>decide()</code> method, which provides the most general mechanism for authorization, accepts a collection of application Domain Objects,

  * each with it's own <code>ObjectMapper</code> defined.  The client application thus passes these Domain Objects directly,  <code>decide()</code> uses

  * reflection to determine their type, and then finds a type-specific mapper.

- * 

+ *

  * This mechanism relies on application defined library of Object Mappers, one for each Domain Object that the client

  * program expects to use in an authorization call.

- * 

- * It is important to note that Java Primitives/Wrappers and other standard types(except Collections) are not supported out of the box. 

- * This is primarily because there is no sensible default mapping between a Java Standard Type and a XACML category and hence 

- * it's impossible for the framework to make a mapping decision at runtime. However, client applications may enforce their own rules as 

+ *

+ * It is important to note that Java Primitives/Wrappers and other standard types(except Collections) are not supported out of the box.

+ * This is primarily because there is no sensible default mapping between a Java Standard Type and a XACML category and hence

+ * it's impossible for the framework to make a mapping decision at runtime. However, client applications may enforce their own rules as

  * they see fit by providing Custom ObjectMapper(s) for these types.

- * 

+ *

  * <code>simpleDecide()</code> method addresses the simplest of use cases where attributes involved are simple userId, actionId and resourceId Strings.

- * 

- * <code>bulkDecide()</code> provides an abstraction for a MultiRequest, where in client applications may provide collection of Domain Object 

- * bindings/associations each of which map to individual requests. The method separates out Domain Object associations with multiple cardinality 

+ *

+ * <code>bulkDecide()</code> provides an abstraction for a MultiRequest, where in client applications may provide collection of Domain Object

+ * bindings/associations each of which map to individual requests. The method separates out Domain Object associations with multiple cardinality

  * from the ones shared across requests.

- * 

- * Thus, in a <code>bulkDecide()</code> call applications provide two sets of arguments: 

+ *

+ * Thus, in a <code>bulkDecide()</code> call applications provide two sets of arguments:

  * 		- a List of Domain Object bindings, each of which map to an individual request.

  * 		- a collection of common Domain Objects shared across all requests.

- * 

- * Specific AzService implementations(PDP Providers) may implement bulkDecide() as a XACML MultiRequest (Note: XACML Multi Decision Profile is optional) 

- * or as individual requests executed iteratively. 

- * 

+ *

+ * Specific AzService implementations(PDP Providers) may implement bulkDecide() as a XACML MultiRequest (Note: XACML Multi Decision Profile is optional)

+ * or as individual requests executed iteratively.

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 public interface PepAgent {

-        

-        

-        /**

-         * Returns a authorization decision for the given subjectId, actionId, 

-         * resourceId Strings.

-         * 

-         * @param subjectId

-         * @param actionId

-         * @param resourceId

-         * @return

-         * @throws PepException 

-         * 			- if an appropriate ObjectMapper cannot be found.

-         * 			- if the underlying AzService instance/PDP throws an exception

-         * 			- if the PepAgent is configured to throw PepExceptions for "Indeterminate" or "Not Applicable" decisions.

-         * @throws IllegalArgumentException if any of the arguments are null

-         */

-        public PepResponse simpleDecide(String subjectId, String actionId, String resourceId);

-        

-        /**

-         * Returns an authorization decision for the given collection of Domain Objects each with it's own 

-         * ObjectMapper instance. Java Primitives/Wrappers or other Standard types (except Collections) are not supported

-         * out of the box. However, client applications may enforce their own rules as they see fit by providing Custom ObjectMapper(s) 

-         * for these types.

-         *  

-         * @param objects

-         * @return 

-         * @throws PepException 

-         * 			- if an appropriate ObjectMapper cannot be found.

-         * 			- if the underlying AzService instance/PDP throws an exception

-         * 			- if the PepAgent is configured to throw PepException for "Indeterminate" or "Not Applicable" decisions.

-         * @throws IllegalArgumentException if any of the arguments are null

-         */

-        public PepResponse decide(Object... objects);

-        

-        /**

-         * Returns a PepResponse instance representing a collection of decisions, each of which corresponds to

-         * an association. Each association represents a specific instance of Domain Object binding. A typical example for an association 

-         * would be an Action-Resource pair.     

-         * 

-         * @param associations a list of Domain Object bindings, each of which maps to a individual Request.

-         * @param objects a collection of common Domain Objects shared across all Requests.

-         * @return

-         * @throws PepException 

-         * 			- if an appropriate ObjectMapper cannot be found.

-         * 			- if the underlying AzService instance/PDP throws an exception

-         * 			- if the PepAgent is configured to throw PepExceptions for "Indeterminate" or "Not Applicable" decisions.

-         * @throws IllegalArgumentException if any of the arguments are null

-         */

-        public List<PepResponse> bulkDecide(List<?> associations, Object... objects);

-        

+

+

+    /**

+     * Returns a authorization decision for the given subjectId, actionId,

+     * resourceId Strings.

+     *

+     * @param subjectId

+     * @param actionId

+     * @param resourceId

+     * @return

+     * @throws PepException

+     * 			- if an appropriate ObjectMapper cannot be found.

+     * 			- if the underlying AzService instance/PDP throws an exception

+     * 			- if the PepAgent is configured to throw PepExceptions for "Indeterminate" or "Not Applicable" decisions.

+     * @throws IllegalArgumentException if any of the arguments are null

+     */

+    public PepResponse simpleDecide(String subjectId, String actionId, String resourceId);

+

+    /**

+     * Returns an authorization decision for the given collection of Domain Objects each with it's own

+     * ObjectMapper instance. Java Primitives/Wrappers or other Standard types (except Collections) are not supported

+     * out of the box. However, client applications may enforce their own rules as they see fit by providing Custom ObjectMapper(s)

+     * for these types.

+     *

+     * @param objects

+     * @return

+     * @throws PepException

+     * 			- if an appropriate ObjectMapper cannot be found.

+     * 			- if the underlying AzService instance/PDP throws an exception

+     * 			- if the PepAgent is configured to throw PepException for "Indeterminate" or "Not Applicable" decisions.

+     * @throws IllegalArgumentException if any of the arguments are null

+     */

+    public PepResponse decide(Object... objects);

+

+    /**

+     * Returns a PepResponse instance representing a collection of decisions, each of which corresponds to

+     * an association. Each association represents a specific instance of Domain Object binding. A typical example for an association

+     * would be an Action-Resource pair.

+     *

+     * @param associations a list of Domain Object bindings, each of which maps to a individual Request.

+     * @param objects a collection of common Domain Objects shared across all Requests.

+     * @return

+     * @throws PepException

+     * 			- if an appropriate ObjectMapper cannot be found.

+     * 			- if the underlying AzService instance/PDP throws an exception

+     * 			- if the PepAgent is configured to throw PepExceptions for "Indeterminate" or "Not Applicable" decisions.

+     * @throws IllegalArgumentException if any of the arguments are null

+     */

+    public List<PepResponse> bulkDecide(List<?> associations, Object... objects);

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepAgentFactory.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepAgentFactory.java
index da87dd3..94da7d0 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepAgentFactory.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepAgentFactory.java
@@ -6,31 +6,31 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi;

-

-/**

- * 

- * @author Ajith Nair, David Laurance, Darshak Kothari

- *

- */

-public interface PepAgentFactory {

-        

-        /**

-         * Returns a PepAgent instance

-         * 

-         * @return

-         */

-        public PepAgent getPepAgent();

-}

+package org.openliberty.openaz.pepapi;
+
+/**
+ *
+ * @author Ajith Nair, David Laurance, Darshak Kothari
+ *
+ */
+public interface PepAgentFactory {
+
+    /**
+     * Returns a PepAgent instance
+     *
+     * @return
+     */
+    public PepAgent getPepAgent();
+}
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepConfig.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepConfig.java
index f0fa0c4..6e22ebb 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepConfig.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepConfig.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi;
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepException.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepException.java
index 015ac72..a79266f 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepException.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepException.java
@@ -1,13 +1,13 @@
 /**

  * Copyright 2009-2011 Oracle, 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 

+ * 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.

  *

  * Authors:

@@ -31,24 +31,24 @@
  */

 public class PepException extends RuntimeException {

 

-        private static final long serialVersionUID = 1L;

+    private static final long serialVersionUID = 1L;

 

-        /** 

-         * Create a PepException containing a Throwable that

-         * specifies the cause of this PepException.

-         * @param cause

-         */

-        public PepException(Throwable cause) {

+    /**

+     * Create a PepException containing a Throwable that

+     * specifies the cause of this PepException.

+     * @param cause

+     */

+    public PepException(Throwable cause) {

         super(cause);

     }

 

-        /**

-         * Create a PepException containing the message provided

-         * and a Throwable containing further information as to

-         * the cause of the PepException.

-         * @param message

-         * @param cause

-         */

+    /**

+     * Create a PepException containing the message provided

+     * and a Throwable containing further information as to

+     * the cause of the PepException.

+     * @param message

+     * @param cause

+     */

     public PepException(String message, Throwable cause) {

         super(message, cause);

     }

@@ -61,6 +61,8 @@
         super(message);

     }

 

-        public PepException() {super();}

+    public PepException() {

+        super();

+    }

 }

 

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequest.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequest.java
index fe7391c..0e1c428 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequest.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequest.java
@@ -1,13 +1,13 @@
 /**

  * Copyright 2009-2011 Oracle, 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 

+ * 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.

  *

  * Authors:

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequestAttributes.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequestAttributes.java
index 176ab0c..9e1f0d7 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequestAttributes.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequestAttributes.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import com.att.research.xacml.api.Identifier;

@@ -33,116 +33,116 @@
  */

 public interface PepRequestAttributes {

 

-        /**

-         * Returns an Indentifier representing the attribute category that the PepRequestAttributes encapsulates

-         *

-         * @return Identifier

-         */

-        public Identifier getCategory();

+    /**

+     * Returns an Indentifier representing the attribute category that the PepRequestAttributes encapsulates

+     *

+     * @return Identifier

+     */

+    public Identifier getCategory();

 

-        /**

-         * Returns an id representing the xml:id

-         *

-         * @return Identifier

-         */

-        public String getId();

+    /**

+     * Returns an id representing the xml:id

+     *

+     * @return Identifier

+     */

+    public String getId();

 

-        /**

-         * Creates and adds an attribute with the name as the AttributeId,

-         * Date array elements as AttributeValue(s) into the underlying attribute collection.

-         * The attribute will NOT be returned by the PDP in the response after request evaluation.

-         * 

-         * @param name

-         *            a string with a name to be used as AttributeId

-         * @param values

-         *            a Date array to be used as AttributeValue(s)

-         * @throws IllegalArgumentException if the array is null

-         */

-        public void addAttribute(String name, Date... values);

+    /**

+     * Creates and adds an attribute with the name as the AttributeId,

+     * Date array elements as AttributeValue(s) into the underlying attribute collection.

+     * The attribute will NOT be returned by the PDP in the response after request evaluation.

+     *

+     * @param name

+     *            a string with a name to be used as AttributeId

+     * @param values

+     *            a Date array to be used as AttributeValue(s)

+     * @throws IllegalArgumentException if the array is null

+     */

+    public void addAttribute(String name, Date... values);

 

-        /**

-         * Creates and adds an attribute with the name as the AttributeId,

-         * String array elements as AttributeValue(s) into the underlying attribute collection.

-         * The attribute will NOT be returned by the PDP in the response after request evaluation.

-         *

-         * @param name

-         *            a string with a name to be used as AttributeId

-         * @param values

-         *            a String array to be used as AttributeValue(s)

-         * @throws IllegalArgumentException if the array is null

-         */

-        public void addAttribute(String name, String... values);

+    /**

+     * Creates and adds an attribute with the name as the AttributeId,

+     * String array elements as AttributeValue(s) into the underlying attribute collection.

+     * The attribute will NOT be returned by the PDP in the response after request evaluation.

+     *

+     * @param name

+     *            a string with a name to be used as AttributeId

+     * @param values

+     *            a String array to be used as AttributeValue(s)

+     * @throws IllegalArgumentException if the array is null

+     */

+    public void addAttribute(String name, String... values);

 

-        /**

-         * Creates and adds an attribute with the name as the AttributeId,

-         * Integer array elements as AttributeValue(s) into the underlying attribute collection.

-         * The attribute will NOT be returned by the PDP in the response after request evaluation.

-         *

-         * @param name

-         *            a string with a name to be used as AttributeId

-         * @param values

-         *            an Integer array to be used as AttributeValue(s)

-         * @throws IllegalArgumentException if the array is null

-         */

-        public void addAttribute(String name, Integer... values);

+    /**

+     * Creates and adds an attribute with the name as the AttributeId,

+     * Integer array elements as AttributeValue(s) into the underlying attribute collection.

+     * The attribute will NOT be returned by the PDP in the response after request evaluation.

+     *

+     * @param name

+     *            a string with a name to be used as AttributeId

+     * @param values

+     *            an Integer array to be used as AttributeValue(s)

+     * @throws IllegalArgumentException if the array is null

+     */

+    public void addAttribute(String name, Integer... values);

 

-        /**

-         * Creates and adds an attribute with the name as the AttributeId,

-         * Boolean array elements as AttributeValue(s) into the underlying attribute collection.

-         * The attribute will NOT be returned by the PDP in the response after request evaluation.

-         *

-         * @param name

-         *            a string with a name to be used as AttributeId

-         * @param values

-         *            a Boolean array to be used as AttributeValue(s)

-         * @throws IllegalArgumentException if the array is null

-         */

-        public void addAttribute(String name, Boolean... values);

+    /**

+     * Creates and adds an attribute with the name as the AttributeId,

+     * Boolean array elements as AttributeValue(s) into the underlying attribute collection.

+     * The attribute will NOT be returned by the PDP in the response after request evaluation.

+     *

+     * @param name

+     *            a string with a name to be used as AttributeId

+     * @param values

+     *            a Boolean array to be used as AttributeValue(s)

+     * @throws IllegalArgumentException if the array is null

+     */

+    public void addAttribute(String name, Boolean... values);

 

 

-        /**

-         * Creates and adds an attribute with the name as the AttributeId,

-         * Long array elements as AttributeValue(s) into the underlying attribute collection.

-         * The attribute will NOT be returned by the PDP in the response after request evaluation.

-         *

-         * @param name

-         *            a string with a name to be used as AttributeId

-         * @param values

-         *            a Long array to be used as AttributeValue(s)

-         * @throws IllegalArgumentException if the array is null

-         */

-        public void addAttribute(String name, Long... values);

+    /**

+     * Creates and adds an attribute with the name as the AttributeId,

+     * Long array elements as AttributeValue(s) into the underlying attribute collection.

+     * The attribute will NOT be returned by the PDP in the response after request evaluation.

+     *

+     * @param name

+     *            a string with a name to be used as AttributeId

+     * @param values

+     *            a Long array to be used as AttributeValue(s)

+     * @throws IllegalArgumentException if the array is null

+     */

+    public void addAttribute(String name, Long... values);

 

-        /**

-         * Creates and adds an attribute with the name as the AttributeId,

-         * Double array elements as AttributeValue(s) into the underlying attribute collection.

-         * The attribute will NOT be returned by the PDP in the response after request evaluation.

-         *

-         * @param name

-         *            a string with a name to be used as AttributeId

-         * @param values

-         *            a Double array to be used as AttributeValue(s)

-         * @throws IllegalArgumentException if the array is null

-         */

-        public void addAttribute(String name, Double... values);

+    /**

+     * Creates and adds an attribute with the name as the AttributeId,

+     * Double array elements as AttributeValue(s) into the underlying attribute collection.

+     * The attribute will NOT be returned by the PDP in the response after request evaluation.

+     *

+     * @param name

+     *            a string with a name to be used as AttributeId

+     * @param values

+     *            a Double array to be used as AttributeValue(s)

+     * @throws IllegalArgumentException if the array is null

+     */

+    public void addAttribute(String name, Double... values);

 

-        /**

-         * Creates and adds an attribute with the name as the AttributeId,

-         * URI array elements as AttributeValue(s) into the underlying attribute collection.

-         * The attribute will NOT be returned by the PDP in the response after request evaluation.

-         * 

-         * @param name

-         *            a string AttributeId of the attribute being set

-         * @param values

-         *            a URI array to be used as AttributeValue(s

-         * @throws IllegalArgumentException if the array is null

-         */

-        public void addAttribute(String name, URI... values);

+    /**

+     * Creates and adds an attribute with the name as the AttributeId,

+     * URI array elements as AttributeValue(s) into the underlying attribute collection.

+     * The attribute will NOT be returned by the PDP in the response after request evaluation.

+     *

+     * @param name

+     *            a string AttributeId of the attribute being set

+     * @param values

+     *            a URI array to be used as AttributeValue(s

+     * @throws IllegalArgumentException if the array is null

+     */

+    public void addAttribute(String name, URI... values);

 

-        /**

-         *

-         * @return

-         */

-        public RequestAttributes getWrappedRequestAttributes();

+    /**

+     *

+     * @return

+     */

+    public RequestAttributes getWrappedRequestAttributes();

 

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequestFactory.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequestFactory.java
index d6e6059..e752cc9 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequestFactory.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepRequestFactory.java
@@ -1,13 +1,13 @@
 /**

  * Copyright 2009-2011 Oracle, 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 

+ * 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.

  *

  * Authors:

@@ -26,7 +26,7 @@
  *

  */

 public interface PepRequestFactory {

-        

+

     /**

      *

      * @return

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponse.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponse.java
index 903bfa2..76c558f 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponse.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponse.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import com.att.research.xacml.api.Attribute;

@@ -31,15 +31,15 @@
  * @author Josh Bregman, Rich Levinson, Prateek Mishra

  */

 public interface PepResponse {

-         

-        /**

-         * Returns the decision associated with the current result.

-         * @return true if the user was granted access to the resource, 

-         * otherwise false

-         * @throws PepException if the {@link PepResponseBehavior} 

-         * configured in the {@link PepResponseFactory}

-         * indicates that for the response should be thrown

-         */

+

+    /**

+     * Returns the decision associated with the current result.

+     * @return true if the user was granted access to the resource,

+     * otherwise false

+     * @throws PepException if the {@link PepResponseBehavior}

+     * configured in the {@link PepResponseFactory}

+     * indicates that for the response should be thrown

+     */

     public boolean allowed() throws PepException;

 

     /**

@@ -60,15 +60,15 @@
      */

     public Map<String, Advice> getAdvices() throws PepException;

 

-         /**

-     * Return the object association that is tied to the current

-     * result. The association is the same object that was

-     * used to create the PepRequest and may be used to 

-     * correlate the PepResponse results with the association

-     * pairs that were used to create the PepRequest.

-     * @return an object that was used as the action-resource in the PepRequest

-     * @throws PepException

-     */

+    /**

+    * Return the object association that is tied to the current

+    * result. The association is the same object that was

+    * used to create the PepRequest and may be used to

+    * correlate the PepResponse results with the association

+    * pairs that were used to create the PepRequest.

+    * @return an object that was used as the action-resource in the PepRequest

+    * @throws PepException

+    */

     public Object getAssociation() throws PepException;

 

     /**

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseBehavior.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseBehavior.java
index 1a281e1..1195188 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseBehavior.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseBehavior.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 /**

@@ -30,13 +30,13 @@
  *

  */

 public enum PepResponseBehavior {

-        

-        /** The behavior is to allow (Permit) access by returning true when the condition for which this behavior is assigned occurs  */

+

+    /** The behavior is to allow (Permit) access by returning true when the condition for which this behavior is assigned occurs  */

     RETURN_YES,

-    

-        /** The behavior is to disallow (Deny) access by returning false when the condition for which this behavior is assigned occurs  */

+

+    /** The behavior is to disallow (Deny) access by returning false when the condition for which this behavior is assigned occurs  */

     RETURN_NO,

-    

-        /** The behavior is to disallow (Deny) access by throwing a PepException when the condition for which this behavior is assigned occurs  */

+

+    /** The behavior is to disallow (Deny) access by throwing a PepException when the condition for which this behavior is assigned occurs  */

     THROW_EXCEPTION

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseFactory.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseFactory.java
index 3aa34bc..b4d1c5d 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseFactory.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseFactory.java
@@ -1,39 +1,39 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import com.att.research.xacml.api.Result;

 

 /**

  * Factory for creating and configuring <code>PepResponse</code>.

- * <br>  

+ * <br>

  * This class creates {@link org.openliberty.openaz.pepapi.PepResponse} objects and configures

- * the behavior of how the <code>PepResponse</code> interprets the 

+ * the behavior of how the <code>PepResponse</code> interprets the

  * results from the AzService or any other PDP that is supported

- * by an implementation of PepApi (org.openliberty.openaz.azapi.pep.*).  

+ * by an implementation of PepApi (org.openliberty.openaz.azapi.pep.*).

  * <br>

  * The {@link PepResponseBehavior} that is invoked when

  * {@link org.openliberty.openaz.pepapi.PepResponse#allowed()} is called and the associated status code

  * has been returned by the PDP and is being handled by the PepResponse

- * provider impl, can be configured to be one of: 

+ * provider impl, can be configured to be one of:

  * <ul>

  * <li>

  * {@link org.openliberty.openaz.pepapi.PepResponse#allowed()} returns true (PERMIT: {@link PepResponseBehavior#RETURN_YES}),

@@ -43,12 +43,12 @@
  * or{@link org.openliberty.openaz.pepapi.PepResponse#allowed()} throws an exception (DENY: {@link PepResponseBehavior#THROW_EXCEPTION}).

  * </ul>

  * <p>

- * In general, a Permit returns true, and a Deny returns false, 

- * but there are also other types of returns, including 

- * NotApplicable and Indeterminate. The configuration is to 

- * specify for each of the 4 xacml-defined conditions, what 

- * the behavior will be. i.e. for each of the "special" 

- * conditions there is a choice to return either true (Permit), 

+ * In general, a Permit returns true, and a Deny returns false,

+ * but there are also other types of returns, including

+ * NotApplicable and Indeterminate. The configuration is to

+ * specify for each of the 4 xacml-defined conditions, what

+ * the behavior will be. i.e. for each of the "special"

+ * conditions there is a choice to return either true (Permit),

  * false (Deny), or throw an Exception.

  * <p>

  * In addition, PDP-specific status codes can be specified, such

@@ -65,7 +65,7 @@
  * @author Josh Bregman, Rich Levinson, Prateek Mishra

  */

 public interface PepResponseFactory {

-        

-        public PepResponse newPepResponse(Result result);

-    

+

+    public PepResponse newPepResponse(Result result);

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseType.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseType.java
index 8ede1fb..4d8f7da 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseType.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PepResponseType.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 /**

@@ -25,21 +25,21 @@
  * @author Josh Bregman, Rich Levinson, Prateek Mishra

  */

 public enum PepResponseType {

-        /** The PepResponse returned for this query type will contain

-         * only the list of resource action associations that are

-         * allowed.

-         */

-        ONLY_ALLOWED_RESULTS, 

-        /**

-         * The PepResponse returned for this query type will contain

-         * only the list of resource action associations that are

-         * denied.

-         */

-        ONLY_DENIED_RESULTS, 

-        /** The PepResponse returned for this query type will contain

-         * the complete list of results for each resource action association

-         * that was requested, including allowed, denied, notapplicable,

-         * and indeterminate.

-         */

-        ALL_RESULTS;

+    /** The PepResponse returned for this query type will contain

+     * only the list of resource action associations that are

+     * allowed.

+     */

+    ONLY_ALLOWED_RESULTS,

+    /**

+     * The PepResponse returned for this query type will contain

+     * only the list of resource action associations that are

+     * denied.

+     */

+    ONLY_DENIED_RESULTS,

+    /** The PepResponse returned for this query type will contain

+     * the complete list of results for each resource action association

+     * that was requested, including allowed, denied, notapplicable,

+     * and indeterminate.

+     */

+    ALL_RESULTS;

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PostDecisionHandler.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PostDecisionHandler.java
index a6b948b..8a7e70e 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PostDecisionHandler.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PostDecisionHandler.java
@@ -1,27 +1,27 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 /**

- * An interface that may be implemented to process the 

+ * An interface that may be implemented to process the

  * PepResponse that is returned from the main decide()

  * call before the final results are returned to the user.

  *

@@ -29,16 +29,16 @@
  *

  */

 public interface PostDecisionHandler {

-    

-        /** 

-         * This method is used to apply post-decision custom

-         * processing to the {@link org.openliberty.openaz.pepapi.PepResponse} after it has

-         * been returned.

-         *

-         * @param request

-         * @throws org.openliberty.openaz.pepapi.PepException

-         */

-    public void postDecide(PepRequest request, PepResponse response) 

-        throws PepException;

-    

+

+    /**

+     * This method is used to apply post-decision custom

+     * processing to the {@link org.openliberty.openaz.pepapi.PepResponse} after it has

+     * been returned.

+     *

+     * @param request

+     * @throws org.openliberty.openaz.pepapi.PepException

+     */

+    public void postDecide(PepRequest request, PepResponse response)

+    throws PepException;

+

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PreDecisionHandler.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PreDecisionHandler.java
index 1150e20..e09423c 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PreDecisionHandler.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/PreDecisionHandler.java
@@ -1,43 +1,43 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 /**

  * An interface that can be used for preliminary processing

- * of a PepRequest before it is actually submitted to the 

+ * of a PepRequest before it is actually submitted to the

  * main decide() method.

  *

  * @author Josh Bregman, Rich Levinson, Prateek Mishra

  *

  */

 public interface PreDecisionHandler {

-    

-        /** 

-         * This method is used to apply preliminary custom

-         * processing to the {@link org.openliberty.openaz.pepapi.PepRequest} prior to its

-         * being submitted.

-         *

-         * @param request

-         * @throws org.openliberty.openaz.pepapi.PepException

-         */

-        public void preDecide(PepRequest request) 

-        throws PepException;

+

+    /**

+     * This method is used to apply preliminary custom

+     * processing to the {@link org.openliberty.openaz.pepapi.PepRequest} prior to its

+     * being submitted.

+     *

+     * @param request

+     * @throws org.openliberty.openaz.pepapi.PepException

+     */

+    public void preDecide(PepRequest request)

+    throws PepException;

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Resource.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Resource.java
index ab7acba..9ff80cb 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Resource.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Resource.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 import com.att.research.xacml.api.XACML3;

@@ -27,123 +27,123 @@
 

 /**

  * Container class that maps attributes to predefined XACML Resource category.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

  *

  */

 public final class Resource extends CategoryContainer {

 

-        public static final String RESOURCE_ID_KEY = "RESOURCE_ID_KEY";

-        

-        private Object resourceIdValue;

-        

-        private Resource(){

-                super(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);

-        }

-        

-        /**

-         * Creates a new Resource instance

-         * 

-         * @return

-         */

-        public static Resource newInstance() {

-                return new Resource();

-        }

-        

-        /**

-         * Creates a new Resource instance containing a single default attribute with the given String value.

-         * 

-         * @param resourceIdValue

-         * @return

-         */

-        public static Resource newInstance(String resourceIdValue) {

-                Resource r = new Resource();

-                r.resourceIdValue = resourceIdValue;

-                r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

-                return r;

-        }

-        

-        /**

-         * Creates a new Resource instance containing a single default attribute with the given URI value.

-         * 

-         * @param resourceIdValue

-         * @return

-         */

-        public static Resource newInstance(URI resourceIdValue) {

-                Resource r = new Resource();

-                r.resourceIdValue = resourceIdValue;

-                r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

-                return r;

-        }

-        

-        /**

-         * Creates a new Resource instance containing a single default attribute with the given Long value.

-         * 

-         * @param resourceIdValue

-         * @return

-         */

-        public static Resource newInstance(Long resourceIdValue) {

-                Resource r = new Resource();

-                r.resourceIdValue = resourceIdValue;

-                r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

-                return r;

-        }

-        

-        /**

-         * Creates a new Resource instance containing a single default attribute with the given Double value.

-         * 

-         * @param resourceIdValue

-         * @return

-         */

-        public static Resource newInstance(Double resourceIdValue) {

-                Resource r = new Resource();

-                r.resourceIdValue = resourceIdValue;

-                r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

-                return r;

-        }

-        

-        /**

-         * Creates a new Resource instance containing a single default attribute with the given Boolean value.

-         * 

-         * @param resourceIdValue

-         * @return

-         */

-        public static Resource newInstance(Boolean resourceIdValue) {

-                Resource r = new Resource();

-                r.resourceIdValue = resourceIdValue;

-                r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

-                return r;

-        }

-        

-        /**

-         * Creates a new Resource instance containing a single default attribute with the given <code>java.util.Date</code> value.

-         * 

-         * @param resourceIdValue

-         * @return

-         */

-        public static Resource newInstance(Date resourceIdValue) {

-                Resource r = new Resource();

-                r.resourceIdValue = resourceIdValue;

-                r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

-                return r;

-        }

-        

-        /**

-         * Returns the value of the default resourceIdValue attribute

-         * 

-         * @return

-         */

-        public Object getResourceIdValue() {

-                return resourceIdValue;

-        }

+    public static final String RESOURCE_ID_KEY = "RESOURCE_ID_KEY";

+

+    private Object resourceIdValue;

+

+    private Resource() {

+        super(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);

+    }

+

+    /**

+     * Creates a new Resource instance

+     *

+     * @return

+     */

+    public static Resource newInstance() {

+        return new Resource();

+    }

+

+    /**

+     * Creates a new Resource instance containing a single default attribute with the given String value.

+     *

+     * @param resourceIdValue

+     * @return

+     */

+    public static Resource newInstance(String resourceIdValue) {

+        Resource r = new Resource();

+        r.resourceIdValue = resourceIdValue;

+        r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

+        return r;

+    }

+

+    /**

+     * Creates a new Resource instance containing a single default attribute with the given URI value.

+     *

+     * @param resourceIdValue

+     * @return

+     */

+    public static Resource newInstance(URI resourceIdValue) {

+        Resource r = new Resource();

+        r.resourceIdValue = resourceIdValue;

+        r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

+        return r;

+    }

+

+    /**

+     * Creates a new Resource instance containing a single default attribute with the given Long value.

+     *

+     * @param resourceIdValue

+     * @return

+     */

+    public static Resource newInstance(Long resourceIdValue) {

+        Resource r = new Resource();

+        r.resourceIdValue = resourceIdValue;

+        r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

+        return r;

+    }

+

+    /**

+     * Creates a new Resource instance containing a single default attribute with the given Double value.

+     *

+     * @param resourceIdValue

+     * @return

+     */

+    public static Resource newInstance(Double resourceIdValue) {

+        Resource r = new Resource();

+        r.resourceIdValue = resourceIdValue;

+        r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

+        return r;

+    }

+

+    /**

+     * Creates a new Resource instance containing a single default attribute with the given Boolean value.

+     *

+     * @param resourceIdValue

+     * @return

+     */

+    public static Resource newInstance(Boolean resourceIdValue) {

+        Resource r = new Resource();

+        r.resourceIdValue = resourceIdValue;

+        r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

+        return r;

+    }

+

+    /**

+     * Creates a new Resource instance containing a single default attribute with the given <code>java.util.Date</code> value.

+     *

+     * @param resourceIdValue

+     * @return

+     */

+    public static Resource newInstance(Date resourceIdValue) {

+        Resource r = new Resource();

+        r.resourceIdValue = resourceIdValue;

+        r.addAttribute(RESOURCE_ID_KEY, resourceIdValue);

+        return r;

+    }

+

+    /**

+     * Returns the value of the default resourceIdValue attribute

+     *

+     * @return

+     */

+    public Object getResourceIdValue() {

+        return resourceIdValue;

+    }

 

 

-        @Override

-        public String toString() {

-                StringBuilder builder = new StringBuilder();

-                builder.append("resource-id value : " + resourceIdValue);

-                builder.append("\n");

-                builder.append(super.toString());

-                return builder.toString();

-        }

+    @Override

+    public String toString() {

+        StringBuilder builder = new StringBuilder();

+        builder.append("resource-id value : " + resourceIdValue);

+        builder.append("\n");

+        builder.append(super.toString());

+        return builder.toString();

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Subject.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Subject.java
index 337f7f2..6cc9574 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Subject.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/Subject.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi;
@@ -24,57 +24,57 @@
 
 /**
  * Container class that maps attributes to predefined XACML AccessSubject category.
- * 
+ *
  * @author Ajith Nair, David Laurance, Darshak Kothari
  *
  */
 public class Subject extends CategoryContainer {
 
-        public static final String SUBJECT_ID_KEY = "SUBJECT_ID_KEY";
-        
-        private String subjectIdValue;
-        
-        private Subject() {
-                super(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT);
-        }
-        
-        /**
-         * Creates a new Subject instance
-         * 
-         * @return
-         */
-        public static Subject newInstance() {
-                return new Subject();
-        }
-        
-        /**
-         * Creates a new Subject instance containing a single default attribute with the given String value.
-         * 
-         * @param subjectIdValue
-         * @return
-         */
-        public static Subject newInstance(String subjectIdValue) {
-                Subject s = new Subject();
-                s.subjectIdValue = subjectIdValue;
-                s.addAttribute(SUBJECT_ID_KEY, subjectIdValue);
-                return s;
-        }
-        
-        /**
-         * Returns the value of the default subjectIdValue attribute
-         * 
-         * @return
-         */
-        public String getSubjectIdValue() {
-                return subjectIdValue;
-        }
+    public static final String SUBJECT_ID_KEY = "SUBJECT_ID_KEY";
 
-        @Override
-        public String toString() {
-                StringBuilder builder = new StringBuilder();
-                builder.append("subject-id value : " + subjectIdValue);
-                builder.append("\n");
-                builder.append(super.toString());
-                return builder.toString();
-        }
+    private String subjectIdValue;
+
+    private Subject() {
+        super(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT);
+    }
+
+    /**
+     * Creates a new Subject instance
+     *
+     * @return
+     */
+    public static Subject newInstance() {
+        return new Subject();
+    }
+
+    /**
+     * Creates a new Subject instance containing a single default attribute with the given String value.
+     *
+     * @param subjectIdValue
+     * @return
+     */
+    public static Subject newInstance(String subjectIdValue) {
+        Subject s = new Subject();
+        s.subjectIdValue = subjectIdValue;
+        s.addAttribute(SUBJECT_ID_KEY, subjectIdValue);
+        return s;
+    }
+
+    /**
+     * Returns the value of the default subjectIdValue attribute
+     *
+     * @return
+     */
+    public String getSubjectIdValue() {
+        return subjectIdValue;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("subject-id value : " + subjectIdValue);
+        builder.append("\n");
+        builder.append(super.toString());
+        return builder.toString();
+    }
 }
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/UnhandleableObligationException.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/UnhandleableObligationException.java
index 8ae48d1..4c21495 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/UnhandleableObligationException.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/UnhandleableObligationException.java
@@ -1,47 +1,47 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi;

 

 /**

  * Runtime Exception thrown when the framework cannot find a registered handler to deal with the obligation.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

- * 

+ *

  */

 @SuppressWarnings("serial")

 public class UnhandleableObligationException extends RuntimeException {

-        

-        public UnhandleableObligationException() {

-                super();

-        }

 

-        public UnhandleableObligationException(String message, Throwable cause) {

-                super(message, cause);

-        }

+    public UnhandleableObligationException() {

+        super();

+    }

 

-        public UnhandleableObligationException(String message) {

-                super(message);

-        }

+    public UnhandleableObligationException(String message, Throwable cause) {

+        super(message, cause);

+    }

 

-        public UnhandleableObligationException(Throwable cause) {

-                super(cause);

-        }

+    public UnhandleableObligationException(String message) {

+        super(message);

+    }

+

+    public UnhandleableObligationException(Throwable cause) {

+        super(cause);

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ActionMapper.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ActionMapper.java
index c3383a9..483d6ca 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ActionMapper.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ActionMapper.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi.std;
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ActionResourcePairMapper.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ActionResourcePairMapper.java
index b4773af..7c678ed 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ActionResourcePairMapper.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ActionResourcePairMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 

@@ -25,31 +25,31 @@
 

 public final class ActionResourcePairMapper implements ObjectMapper {

 

-        private MapperRegistry mapperRegistry;

+    private MapperRegistry mapperRegistry;

 

-        private PepConfig pepConfig;

-        

-        @Override

-        public Class<?> getMappedClass() {

-                return ActionResourcePair.class;

-        }

+    private PepConfig pepConfig;

 

-        @Override

-        public void map(Object o, PepRequest pepRequest) {

-                ActionResourcePair actionResource = (ActionResourcePair)o;

-                Object action = actionResource.getAction();

-                Object resource = actionResource.getResource();

-                mapperRegistry.getMapper(action.getClass()).map(action, pepRequest);

-                mapperRegistry.getMapper(resource.getClass()).map(resource, pepRequest);

-        }

+    @Override

+    public Class<?> getMappedClass() {

+        return ActionResourcePair.class;

+    }

 

-        @Override

-        public void setMapperRegistry(MapperRegistry mapperRegistry) {

-                this.mapperRegistry = mapperRegistry;

-        }

+    @Override

+    public void map(Object o, PepRequest pepRequest) {

+        ActionResourcePair actionResource = (ActionResourcePair)o;

+        Object action = actionResource.getAction();

+        Object resource = actionResource.getResource();

+        mapperRegistry.getMapper(action.getClass()).map(action, pepRequest);

+        mapperRegistry.getMapper(resource.getClass()).map(resource, pepRequest);

+    }

 

-        @Override

-        public void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    @Override

+    public void setMapperRegistry(MapperRegistry mapperRegistry) {

+        this.mapperRegistry = mapperRegistry;

+    }

+

+    @Override

+    public void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ArrayMapper.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ArrayMapper.java
index b593634..cfb5b00 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ArrayMapper.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ArrayMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.apache.commons.logging.Log;

@@ -26,41 +26,41 @@
 

 

 public final class ArrayMapper implements ObjectMapper {

-        

-        private static final Log logger = LogFactory.getLog(ArrayMapper.class);

 

-        private PepConfig pepConfig;

+    private static final Log logger = LogFactory.getLog(ArrayMapper.class);

 

-        private MapperRegistry mapperRegistry;

+    private PepConfig pepConfig;

 

-        @Override

-        public Class<Object[]> getMappedClass() {

-                return Object[].class;

-        }

+    private MapperRegistry mapperRegistry;

 

-        @Override

-        public void map(Object o, PepRequest pepRequest) {

-                Object[] array = (Object[])o;

-                if(array != null && array.length > 0) {

-                        ObjectMapper mapper = mapperRegistry.getMapper(array[0].getClass());

-                        if(mapper != null) {

-                                for(Object item: array) {

-                                        mapper.map(item, pepRequest);

-                                }

-                        }else {

-                                logger.error("Can't map an Object of class: " + array[0].getClass().getName());

-                                throw new PepException("Can't map an Object of class: " + array[0].getClass().getName());

-                        }

+    @Override

+    public Class<Object[]> getMappedClass() {

+        return Object[].class;

+    }

+

+    @Override

+    public void map(Object o, PepRequest pepRequest) {

+        Object[] array = (Object[])o;

+        if(array != null && array.length > 0) {

+            ObjectMapper mapper = mapperRegistry.getMapper(array[0].getClass());

+            if(mapper != null) {

+                for(Object item: array) {

+                    mapper.map(item, pepRequest);

                 }

+            } else {

+                logger.error("Can't map an Object of class: " + array[0].getClass().getName());

+                throw new PepException("Can't map an Object of class: " + array[0].getClass().getName());

+            }

         }

+    }

 

-        @Override

-        public void setMapperRegistry(MapperRegistry mapperRegistry) {

-                this.mapperRegistry = mapperRegistry;

-        }

+    @Override

+    public void setMapperRegistry(MapperRegistry mapperRegistry) {

+        this.mapperRegistry = mapperRegistry;

+    }

 

-        @Override

-        public void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    @Override

+    public void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/CategoryContainerMapper.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/CategoryContainerMapper.java
index fe67a96..ed657e8 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/CategoryContainerMapper.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/CategoryContainerMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 

@@ -33,83 +33,83 @@
 

 public class CategoryContainerMapper implements ObjectMapper {

 

-        private static final Log logger = LogFactory.getLog(CategoryContainerMapper.class);

+    private static final Log logger = LogFactory.getLog(CategoryContainerMapper.class);

 

-        private Class<?> mappedClass;

+    private Class<?> mappedClass;

 

-        private MapperRegistry mapperRegistry;

+    private MapperRegistry mapperRegistry;

 

-        private PepConfig pepConfig;

+    private PepConfig pepConfig;

 

-        public CategoryContainerMapper(Class<?> mappedClass) {

-                this.mappedClass = mappedClass;

-        }

+    public CategoryContainerMapper(Class<?> mappedClass) {

+        this.mappedClass = mappedClass;

+    }

 

-        @Override

-        public Class<?> getMappedClass() {

-                return this.mappedClass;

-        }

+    @Override

+    public Class<?> getMappedClass() {

+        return this.mappedClass;

+    }

 

-        @Override

-        public void map(Object o, PepRequest pepRequest) {

-                CategoryContainer a = (CategoryContainer)o;

-                PepRequestAttributes pepRequestAttributes = pepRequest.getPepRequestAttributes(a.getCategoryIdentifier());

-                Map<String, Object[]> aMap = a.getAttributeMap();

-                if(aMap != null) {

-                        for(Entry<String, Object[]> e: aMap.entrySet()) {

-                                String attributeId = resolveAttributeId(e.getKey());

-                                Object[] values = e.getValue();

-                                if(values != null && values.length > 0) {

-                                        map(pepRequestAttributes, attributeId, values);

-                                } else {

-                                        logger.error("No value assigned for attribute : " + attributeId);

-                                        throw new IllegalArgumentException("No or null value for attribute : " + attributeId);

-                                }

-                        }

+    @Override

+    public void map(Object o, PepRequest pepRequest) {

+        CategoryContainer a = (CategoryContainer)o;

+        PepRequestAttributes pepRequestAttributes = pepRequest.getPepRequestAttributes(a.getCategoryIdentifier());

+        Map<String, Object[]> aMap = a.getAttributeMap();

+        if(aMap != null) {

+            for(Entry<String, Object[]> e: aMap.entrySet()) {

+                String attributeId = resolveAttributeId(e.getKey());

+                Object[] values = e.getValue();

+                if(values != null && values.length > 0) {

+                    map(pepRequestAttributes, attributeId, values);

+                } else {

+                    logger.error("No value assigned for attribute : " + attributeId);

+                    throw new IllegalArgumentException("No or null value for attribute : " + attributeId);

                 }

+            }

         }

+    }

 

-        @Override

-        public void setMapperRegistry(MapperRegistry mapperRegistry) {

-                this.mapperRegistry = mapperRegistry;

-        }

+    @Override

+    public void setMapperRegistry(MapperRegistry mapperRegistry) {

+        this.mapperRegistry = mapperRegistry;

+    }

 

-        @Override

-        public void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    @Override

+    public void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 

-        protected String resolveAttributeId(String attributeId) {

-                return attributeId;

-        }

+    protected String resolveAttributeId(String attributeId) {

+        return attributeId;

+    }

 

-        private final void map(PepRequestAttributes pepRequestAttributes, String key, Object... values) {

-                Object value = values[0];

-                if (value instanceof String) {

-                pepRequestAttributes.addAttribute(key, (String[]) values);

+    private final void map(PepRequestAttributes pepRequestAttributes, String key, Object... values) {

+        Object value = values[0];

+        if (value instanceof String) {

+            pepRequestAttributes.addAttribute(key, (String[]) values);

         } else if (value instanceof Long) {

-                pepRequestAttributes.addAttribute(key, (Long[]) values);

+            pepRequestAttributes.addAttribute(key, (Long[]) values);

         } else if (value instanceof Integer) {

-                pepRequestAttributes.addAttribute(key, (Integer[]) values);

+            pepRequestAttributes.addAttribute(key, (Integer[]) values);

         } else if (value instanceof Double) {

-                pepRequestAttributes.addAttribute(key, (Double[]) values);

+            pepRequestAttributes.addAttribute(key, (Double[]) values);

         } else if (value instanceof Boolean) {

-                pepRequestAttributes.addAttribute(key, (Boolean[]) values);

+            pepRequestAttributes.addAttribute(key, (Boolean[]) values);

         } else if (value instanceof URI) {

-                pepRequestAttributes.addAttribute(key, (URI[]) values);

+            pepRequestAttributes.addAttribute(key, (URI[]) values);

         } else if (value instanceof Date) {

-                pepRequestAttributes.addAttribute(key, (Date[]) values);

-        }else {

-                        logger.error("Type: " + value.getClass().getName() + " cannot be mapped for attribute: " + key);

-                throw new PepException("Can't map an object of class: " + value.getClass().getName());

+            pepRequestAttributes.addAttribute(key, (Date[]) values);

+        } else {

+            logger.error("Type: " + value.getClass().getName() + " cannot be mapped for attribute: " + key);

+            throw new PepException("Can't map an object of class: " + value.getClass().getName());

         }

-        }

+    }

 

-        protected PepConfig getPepConfig() {

-                return this.pepConfig;

-        }

+    protected PepConfig getPepConfig() {

+        return this.pepConfig;

+    }

 

-        protected MapperRegistry getMapperRegistry() {

-                return this.mapperRegistry;

-        }

+    protected MapperRegistry getMapperRegistry() {

+        return this.mapperRegistry;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/CollectionMapper.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/CollectionMapper.java
index 001a75b..9219436 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/CollectionMapper.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/CollectionMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.apache.commons.logging.Log;

@@ -28,39 +28,39 @@
 

 

 public final class CollectionMapper implements ObjectMapper {

-        

-        private static final Log logger = LogFactory.getLog(CollectionMapper.class);

 

-        private MapperRegistry mapperRegistry;

+    private static final Log logger = LogFactory.getLog(CollectionMapper.class);

 

-        private PepConfig pepConfig;

-        

-        @Override

-        public Class<?> getMappedClass() {

-                return Collection.class;

+    private MapperRegistry mapperRegistry;

+

+    private PepConfig pepConfig;

+

+    @Override

+    public Class<?> getMappedClass() {

+        return Collection.class;

+    }

+

+    @Override

+    public void map(Object o, PepRequest pepRequest) {

+        Collection<?> collection = (Collection<?>)o;

+        for(Object item: collection) {

+            ObjectMapper mapper = mapperRegistry.getMapper(item.getClass());

+            if(mapper != null) {

+                mapper.map(item, pepRequest);

+            } else {

+                logger.error("Can't map an Object of class: " + item.getClass().getName());

+                throw new PepException("Can't map an Object of class: " + item.getClass().getName());

+            }

         }

+    }

 

-        @Override

-        public void map(Object o, PepRequest pepRequest) {

-                Collection<?> collection = (Collection<?>)o;

-                for(Object item: collection) {

-                        ObjectMapper mapper = mapperRegistry.getMapper(item.getClass());

-                        if(mapper != null) {

-                                mapper.map(item, pepRequest);

-                        }else {

-                                logger.error("Can't map an Object of class: " + item.getClass().getName());

-                                throw new PepException("Can't map an Object of class: " + item.getClass().getName());

-                        }

-                }

-        }

+    @Override

+    public void setMapperRegistry(MapperRegistry mapperRegistry) {

+        this.mapperRegistry = mapperRegistry;

+    }

 

-        @Override

-        public void setMapperRegistry(MapperRegistry mapperRegistry) {

-                this.mapperRegistry = mapperRegistry;

-        }

-

-        @Override

-        public void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    @Override

+    public void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/MatchAnyCriterion.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/MatchAnyCriterion.java
index ab68add..89f10a9 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/MatchAnyCriterion.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/MatchAnyCriterion.java
@@ -6,28 +6,28 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi.std;

-

-

-import org.openliberty.openaz.pepapi.Obligation;

-

-public final class MatchAnyCriterion implements ObligationCriterion {

-

-        @Override

-        public boolean match(Obligation obligation) {

-                return true;

-        }

-

-}

+package org.openliberty.openaz.pepapi.std;
+
+
+import org.openliberty.openaz.pepapi.Obligation;
+
+public final class MatchAnyCriterion implements ObligationCriterion {
+
+    @Override
+    public boolean match(Obligation obligation) {
+        return true;
+    }
+
+}
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/MultiRequest.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/MultiRequest.java
index 70993f5..a236b5f 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/MultiRequest.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/MultiRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi.std;
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationAttributeCriterion.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationAttributeCriterion.java
index 41cf1b9..407af2e 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationAttributeCriterion.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationAttributeCriterion.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.openliberty.openaz.pepapi.Obligation;

@@ -25,83 +25,83 @@
 import java.util.*;

 

 public final class ObligationAttributeCriterion implements ObligationCriterion {

-        

-        private String id;

-        

-        private Set<String> valueSet;

-        

-        public ObligationAttributeCriterion(String id) {

-                this.id = id;

-                this.valueSet = new HashSet<String>();

-        }

-        

-        ObligationAttributeCriterion(String id, String...values) {

-                this(id);

-                if(values != null && values.length > 0){

-                        this.valueSet.addAll(Arrays.asList(values));

-                }

-        }

-        

-        @Override

-        public int hashCode() {

-                final int prime = 31;

-                int result = 1;

-                result = prime * result + ((id == null) ? 0 : id.hashCode());

-                result = prime * result

-                                + ((valueSet == null) ? 0 : valueSet.hashCode());

-                return result;

-        }

 

-        @Override

-        public boolean equals(Object obj) {

-                if (this == obj)

-                        return true;

-                if (obj == null)

-                        return false;

-                if (getClass() != obj.getClass())

-                        return false;

-                ObligationAttributeCriterion other = (ObligationAttributeCriterion) obj;

-                if (id == null) {

-                        if (other.id != null)

-                                return false;

-                } else if (!id.equals(other.id))

-                        return false;

-                if (valueSet == null) {

-                        if (other.valueSet != null)

-                                return false;

-                } else if (!valueSet.equals(other.valueSet))

-                        return false;

-                return true;

-        }

+    private String id;

 

-        public String getId() {

-                return id;

-        }

+    private Set<String> valueSet;

 

-        public Set<String> getValueSet() {

-                return Collections.unmodifiableSet(valueSet);

+    public ObligationAttributeCriterion(String id) {

+        this.id = id;

+        this.valueSet = new HashSet<String>();

+    }

+

+    ObligationAttributeCriterion(String id, String...values) {

+        this(id);

+        if(values != null && values.length > 0) {

+            this.valueSet.addAll(Arrays.asList(values));

         }

-        

-        @Override

-        public boolean match(Obligation obligation) {

-                Map<String, Object[]> obligationAttrMap = obligation.getAttributeMap();

-                if(!obligationAttrMap.containsKey(this.id)) {

-                        return false;

-                }

-                //Proceed with value matching, if the AttributeMatch has a defined value set to match.

-                if(!valueSet.isEmpty()) {

-                        Object[] attributeValues = obligationAttrMap.get(this.id);

-                        boolean valueFound = false;

-                        if(attributeValues != null) {

-                                for(Object attributeValue: attributeValues) {

-                                        if(valueSet.contains(attributeValue)) {

-                                                valueFound = true;

-                                                break;

-                                        }

-                                }

-                        }

-                        return valueFound;

-                }

-                return true;

+    }

+

+    @Override

+    public int hashCode() {

+        final int prime = 31;

+        int result = 1;

+        result = prime * result + ((id == null) ? 0 : id.hashCode());

+        result = prime * result

+                 + ((valueSet == null) ? 0 : valueSet.hashCode());

+        return result;

+    }

+

+    @Override

+    public boolean equals(Object obj) {

+        if (this == obj)

+            return true;

+        if (obj == null)

+            return false;

+        if (getClass() != obj.getClass())

+            return false;

+        ObligationAttributeCriterion other = (ObligationAttributeCriterion) obj;

+        if (id == null) {

+            if (other.id != null)

+                return false;

+        } else if (!id.equals(other.id))

+            return false;

+        if (valueSet == null) {

+            if (other.valueSet != null)

+                return false;

+        } else if (!valueSet.equals(other.valueSet))

+            return false;

+        return true;

+    }

+

+    public String getId() {

+        return id;

+    }

+

+    public Set<String> getValueSet() {

+        return Collections.unmodifiableSet(valueSet);

+    }

+

+    @Override

+    public boolean match(Obligation obligation) {

+        Map<String, Object[]> obligationAttrMap = obligation.getAttributeMap();

+        if(!obligationAttrMap.containsKey(this.id)) {

+            return false;

         }

+        //Proceed with value matching, if the AttributeMatch has a defined value set to match.

+        if(!valueSet.isEmpty()) {

+            Object[] attributeValues = obligationAttrMap.get(this.id);

+            boolean valueFound = false;

+            if(attributeValues != null) {

+                for(Object attributeValue: attributeValues) {

+                    if(valueSet.contains(attributeValue)) {

+                        valueFound = true;

+                        break;

+                    }

+                }

+            }

+            return valueFound;

+        }

+        return true;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriteria.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriteria.java
index 05cdea6..3f04967 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriteria.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriteria.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.openliberty.openaz.pepapi.Obligation;

@@ -28,21 +28,21 @@
 import java.util.Set;

 

 public final class ObligationCriteria implements Matchable<Obligation> {

-        

-        private Set<ObligationCriterion> criteria;

-        

-        ObligationCriteria(Collection<ObligationCriterion> criteria){

-                this.criteria = new HashSet<ObligationCriterion>();

-                this.criteria.addAll(criteria);

-        }

 

-        @Override

-        public boolean match(Obligation obligation) {

-                for(ObligationCriterion criterion: criteria){

-                        if(!criterion.match(obligation)){

-                                return false;

-                        }

-                }

-                return true;

+    private Set<ObligationCriterion> criteria;

+

+    ObligationCriteria(Collection<ObligationCriterion> criteria) {

+        this.criteria = new HashSet<ObligationCriterion>();

+        this.criteria.addAll(criteria);

+    }

+

+    @Override

+    public boolean match(Obligation obligation) {

+        for(ObligationCriterion criterion: criteria) {

+            if(!criterion.match(obligation)) {

+                return false;

+            }

         }

+        return true;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriteriaBuilder.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriteriaBuilder.java
index e9157d6..ebe6a6f 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriteriaBuilder.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriteriaBuilder.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 

@@ -28,30 +28,30 @@
 

 public final class ObligationCriteriaBuilder {

 

-        private Set<ObligationCriterion> criteria = new HashSet<ObligationCriterion>();

+    private Set<ObligationCriterion> criteria = new HashSet<ObligationCriterion>();

 

-        public ObligationCriteriaBuilder matchAttribute(String attributeId) {

-                criteria.add(new ObligationAttributeCriterion(attributeId));

-                return this;

-        }

+    public ObligationCriteriaBuilder matchAttribute(String attributeId) {

+        criteria.add(new ObligationAttributeCriterion(attributeId));

+        return this;

+    }

 

-        public ObligationCriteriaBuilder matchAttributeWithAnyGivenValue(String attributeId,

-                        String... values) {

-                criteria.add(new ObligationAttributeCriterion(attributeId, values));

-                return this;

-        }

-        

-        public ObligationCriteriaBuilder matchAnyObligationId(String... obligationIds) {

-                criteria.add(new ObligationIdCriterion(obligationIds));

-                return this;

-        }

-        

-        public ObligationCriteriaBuilder matchAnyObligation() {

-                criteria.add(new MatchAnyCriterion());

-                return this;

-        }

-        

-        public final ObligationCriteria build() {

-                return new ObligationCriteria(criteria);

-        }

+    public ObligationCriteriaBuilder matchAttributeWithAnyGivenValue(String attributeId,

+            String... values) {

+        criteria.add(new ObligationAttributeCriterion(attributeId, values));

+        return this;

+    }

+

+    public ObligationCriteriaBuilder matchAnyObligationId(String... obligationIds) {

+        criteria.add(new ObligationIdCriterion(obligationIds));

+        return this;

+    }

+

+    public ObligationCriteriaBuilder matchAnyObligation() {

+        criteria.add(new MatchAnyCriterion());

+        return this;

+    }

+

+    public final ObligationCriteria build() {

+        return new ObligationCriteria(criteria);

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriterion.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriterion.java
index c9df970..2f3de72 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriterion.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationCriterion.java
@@ -6,25 +6,25 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi.std;

-

-

-import org.openliberty.openaz.pepapi.Obligation;

-

-public interface ObligationCriterion {

-        

-        public boolean match(Obligation obligation);

-        

-}

+package org.openliberty.openaz.pepapi.std;
+
+
+import org.openliberty.openaz.pepapi.Obligation;
+
+public interface ObligationCriterion {
+
+    public boolean match(Obligation obligation);
+
+}
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationIdCriterion.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationIdCriterion.java
index a973b59..738602e 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationIdCriterion.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ObligationIdCriterion.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.openliberty.openaz.pepapi.Obligation;

@@ -27,19 +27,19 @@
 import java.util.Set;

 

 public final class ObligationIdCriterion implements ObligationCriterion {

-        

-        private Set<String> obligationIdSet;

-        

-        public ObligationIdCriterion(String... obligationIds){

-                this.obligationIdSet = new HashSet<String>();

-                if(obligationIds != null) {

-                        this.obligationIdSet.addAll(Arrays.asList(obligationIds));

-                }

+

+    private Set<String> obligationIdSet;

+

+    public ObligationIdCriterion(String... obligationIds) {

+        this.obligationIdSet = new HashSet<String>();

+        if(obligationIds != null) {

+            this.obligationIdSet.addAll(Arrays.asList(obligationIds));

         }

-        

-        @Override

-        public boolean match(Obligation obligation) {

-                return this.obligationIdSet.contains(obligation.getId());

-        }

+    }

+

+    @Override

+    public boolean match(Obligation obligation) {

+        return this.obligationIdSet.contains(obligation.getId());

+    }

 

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/PepUtils.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/PepUtils.java
index b8d2b62..b718695 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/PepUtils.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/PepUtils.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi.std;
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ResourceMapper.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ResourceMapper.java
index 30d74e1..b879953 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ResourceMapper.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ResourceMapper.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi.std;
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdAdvice.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdAdvice.java
index 84f7124..463e12f 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdAdvice.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdAdvice.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi.std;
@@ -42,7 +42,7 @@
      *
      * @return a string containing the Id of this Advice
      */
-    public String getId(){
+    public String getId() {
         return wrappedAdvice.getId().stringValue();
     }
 
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdMapperRegistry.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdMapperRegistry.java
index ffc271a..5c8a6e0 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdMapperRegistry.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdMapperRegistry.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.apache.commons.logging.Log;

@@ -31,89 +31,89 @@
 

 public final class StdMapperRegistry implements MapperRegistry {

 

-        private static final Log logger = LogFactory.getLog(StdMapperRegistry.class);

-        

-        private final Map<Class<?>, ObjectMapper> map;

+    private static final Log logger = LogFactory.getLog(StdMapperRegistry.class);

 

-        private PepConfig pepConfig;

+    private final Map<Class<?>, ObjectMapper> map;

 

-        private StdMapperRegistry(PepConfig pepConfig) {

-                //Register defaults.

-                this.pepConfig = pepConfig;

-                map = new HashMap<Class<?>, ObjectMapper>();

-                registerMapper(new CollectionMapper());

-                registerMapper(new ArrayMapper());

-                registerMapper(new SubjectMapper());

-                registerMapper(new ActionMapper());

-                registerMapper(new ResourceMapper());

-                registerMapper(new CategoryContainerMapper(Environment.class));

-                registerMapper(new CategoryContainerMapper(CategoryContainer.class));

-                registerMapper(new ActionResourcePairMapper());

+    private PepConfig pepConfig;

+

+    private StdMapperRegistry(PepConfig pepConfig) {

+        //Register defaults.

+        this.pepConfig = pepConfig;

+        map = new HashMap<Class<?>, ObjectMapper>();

+        registerMapper(new CollectionMapper());

+        registerMapper(new ArrayMapper());

+        registerMapper(new SubjectMapper());

+        registerMapper(new ActionMapper());

+        registerMapper(new ResourceMapper());

+        registerMapper(new CategoryContainerMapper(Environment.class));

+        registerMapper(new CategoryContainerMapper(CategoryContainer.class));

+        registerMapper(new ActionResourcePairMapper());

+    }

+

+    public static MapperRegistry newInstance(PepConfig pepConfig) {

+        return new StdMapperRegistry(pepConfig);

+    }

+

+    public static MapperRegistry newInstance(PepConfig pepConfig, List<ObjectMapper> mappers) {

+        MapperRegistry mapperRegistry = newInstance(pepConfig);

+        if(mappers != null) {

+            mapperRegistry.registerMappers(mappers);

+        }

+        return mapperRegistry;

+    }

+

+    @Override

+    public void registerMapper(ObjectMapper mapper) {

+        mapper.setPepConfig(pepConfig);

+        mapper.setMapperRegistry(this);

+        map.put(mapper.getMappedClass(), mapper);

+    }

+

+    @Override

+    public void registerMappers(Iterable<? extends ObjectMapper> mappers) {

+        for(ObjectMapper mapper: mappers) {

+            registerMapper(mapper);

+        }

+    }

+

+    @Override

+    public ObjectMapper getMapper(Class<?> clazz) {

+        ObjectMapper mapper = null;

+        Class<?> c = clazz;

+        while(mapper == null && !c.equals(Object.class)) {

+            mapper = getClassMapper(c);

+            c = c.getSuperclass();

         }

 

-        public static MapperRegistry newInstance(PepConfig pepConfig) {

-                return new StdMapperRegistry(pepConfig);

-        }

-        

-        public static MapperRegistry newInstance(PepConfig pepConfig, List<ObjectMapper> mappers) {

-                MapperRegistry mapperRegistry = newInstance(pepConfig);

-                if(mappers != null) {

-                        mapperRegistry.registerMappers(mappers);

-                }

-                return mapperRegistry;

-        }

-        

-        @Override

-        public void registerMapper(ObjectMapper mapper) {

-                mapper.setPepConfig(pepConfig);

-                mapper.setMapperRegistry(this);

-                map.put(mapper.getMappedClass(), mapper);

-        }

-

-        @Override

-        public void registerMappers(Iterable<? extends ObjectMapper> mappers) {

-                for(ObjectMapper mapper: mappers) {

-                        registerMapper(mapper);

-                }

-        }

-

-        @Override

-        public ObjectMapper getMapper(Class<?> clazz) {

-                ObjectMapper mapper = null;

-                Class<?> c = clazz;

-                while(mapper == null && !c.equals(Object.class)) {

-                        mapper = getClassMapper(c);

-                        c = c.getSuperclass();

-                }

-                

-                //Handle Arrays.

+        //Handle Arrays.

         if(mapper == null) {

-                if(clazz.isArray()) {

-                        mapper = getMapper(Object[].class);

-                }

+            if(clazz.isArray()) {

+                mapper = getMapper(Object[].class);

+            }

         }

-        

+

         if(mapper != null) {

-                        logger.debug("Mapper :" + mapper.getClass().getName() + " found for class: " + clazz);

-                return mapper;

-        }else {

-                throw new PepException("No ObjectMapper found for Object of Class: " + clazz);

+            logger.debug("Mapper :" + mapper.getClass().getName() + " found for class: " + clazz);

+            return mapper;

+        } else {

+            throw new PepException("No ObjectMapper found for Object of Class: " + clazz);

         }

-        }

-        

-        private ObjectMapper getClassMapper(Class<?> clazz) {

-                ObjectMapper mapper = map.get(clazz);

-                if(mapper == null) {

-                        Class<?>[] interfaces = clazz.getInterfaces();

-                        if(interfaces != null && interfaces.length > 0) {

-                                for(Class<?> inf: interfaces) {

-                                        mapper = map.get(inf);

-                                        if(mapper != null) {

-                                                break;

-                                        }

-                                }

-                        }

+    }

+

+    private ObjectMapper getClassMapper(Class<?> clazz) {

+        ObjectMapper mapper = map.get(clazz);

+        if(mapper == null) {

+            Class<?>[] interfaces = clazz.getInterfaces();

+            if(interfaces != null && interfaces.length > 0) {

+                for(Class<?> inf: interfaces) {

+                    mapper = map.get(inf);

+                    if(mapper != null) {

+                        break;

+                    }

                 }

-                return mapper;

+            }

         }

+        return mapper;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligation.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligation.java
index 7f008a9..964174c 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligation.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligation.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import com.att.research.xacml.api.AttributeAssignment;

@@ -31,38 +31,38 @@
 

 final class StdObligation implements Obligation {

 

-        private com.att.research.xacml.api.Obligation wrappedObligation;

+    private com.att.research.xacml.api.Obligation wrappedObligation;

 

-        StdObligation(com.att.research.xacml.api.Obligation obligation) {

-                this.wrappedObligation = obligation;

-        }

-

-        /**

-     * Return the Id for this Obligation.

-     *

-     * @return a string containing the Id of this Obligation

-     */

-    public String getId(){

-                return wrappedObligation.getId().stringValue();

+    StdObligation(com.att.research.xacml.api.Obligation obligation) {

+        this.wrappedObligation = obligation;

     }

 

-        @Override

-        public Map<String, Object[]> getAttributeMap() {

-                Map<String, List<Object>> map = new HashMap<String, List<Object>>();

-                for(AttributeAssignment a: wrappedObligation.getAttributeAssignments()) {

-                        String attributeId = a.getAttributeId().stringValue();

-                        List<Object> values = map.get(attributeId);

-                        if(values == null) {

-                                values = new ArrayList<Object>();

-                                map.put(attributeId, values);

-                        }

-                        values.add(a.getAttributeValue().getValue());

-                }

+    /**

+    * Return the Id for this Obligation.

+    *

+    * @return a string containing the Id of this Obligation

+    */

+    public String getId() {

+        return wrappedObligation.getId().stringValue();

+    }

 

-                Map<String, Object[]> attributeMap = new HashMap<String, Object[]>();

-                for(Map.Entry<String, List<Object>> e: map.entrySet()) {

-                        attributeMap.put(e.getKey(), e.getValue().toArray(new Object[1]));

-                }

-                return attributeMap;

+    @Override

+    public Map<String, Object[]> getAttributeMap() {

+        Map<String, List<Object>> map = new HashMap<String, List<Object>>();

+        for(AttributeAssignment a: wrappedObligation.getAttributeAssignments()) {

+            String attributeId = a.getAttributeId().stringValue();

+            List<Object> values = map.get(attributeId);

+            if(values == null) {

+                values = new ArrayList<Object>();

+                map.put(attributeId, values);

+            }

+            values.add(a.getAttributeValue().getValue());

         }

+

+        Map<String, Object[]> attributeMap = new HashMap<String, Object[]>();

+        for(Map.Entry<String, List<Object>> e: map.entrySet()) {

+            attributeMap.put(e.getKey(), e.getValue().toArray(new Object[1]));

+        }

+        return attributeMap;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligationHandlerRegistry.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligationHandlerRegistry.java
index 1929356..f7808d6 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligationHandlerRegistry.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligationHandlerRegistry.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.apache.commons.logging.Log;

@@ -36,91 +36,91 @@
 import java.util.Map;

 

 /**

- * An <code>ObligationHandlerRegistry</code> implementation that accept handler classes that are either ObligationHandler instances 

- * or contain any of the following annotations - <code> @MatchAnyObligation, @MatchAllObligationAttributes</code> 

+ * An <code>ObligationHandlerRegistry</code> implementation that accept handler classes that are either ObligationHandler instances

+ * or contain any of the following annotations - <code> @MatchAnyObligation, @MatchAllObligationAttributes</code>

  * that represents Obligation criteria for registration.

- * 

+ *

  * @author Ajith Nair

  *

  */

 public class StdObligationHandlerRegistry implements ObligationHandlerRegistry {

 

-        private static final Log logger = LogFactory.getLog(StdObligationHandlerRegistry.class);

+    private static final Log logger = LogFactory.getLog(StdObligationHandlerRegistry.class);

 

-        private final Map<Class<?>, Matchable<Obligation>> oHandlerCriteriaMap;

+    private final Map<Class<?>, Matchable<Obligation>> oHandlerCriteriaMap;

 

-        private StdObligationHandlerRegistry(List<?> oHandlers) {

-                oHandlerCriteriaMap = new HashMap<Class<?>, Matchable<Obligation>>();

-                for (Object oHandler : oHandlers) {

-                        Class<?> oHandlerClass = oHandler.getClass();

-                        Matchable<Obligation> matchable = null;

-                        if(oHandler instanceof ObligationHandler) {

-                                matchable = (ObligationHandler)oHandler;

-                        }else {

-                                matchable = processAnnotation(oHandlerClass);

-                        }

-                        

-                        if (matchable != null) {

-                                oHandlerCriteriaMap.put(oHandlerClass, matchable);

-                        }else {

-                                logger.error("Obligation Handler Class: " + oHandlerClass

-                                                + " is not an instance of ObligationHandler or doesn't contain a valid Annotation");

-                                throw new IllegalArgumentException("Obligation Handler Class: " + oHandlerClass

-                                                + " is not an instance of ObligationHandler or doesn't contain a valid Annotation");

-                        }

+    private StdObligationHandlerRegistry(List<?> oHandlers) {

+        oHandlerCriteriaMap = new HashMap<Class<?>, Matchable<Obligation>>();

+        for (Object oHandler : oHandlers) {

+            Class<?> oHandlerClass = oHandler.getClass();

+            Matchable<Obligation> matchable = null;

+            if(oHandler instanceof ObligationHandler) {

+                matchable = (ObligationHandler)oHandler;

+            } else {

+                matchable = processAnnotation(oHandlerClass);

+            }

+

+            if (matchable != null) {

+                oHandlerCriteriaMap.put(oHandlerClass, matchable);

+            } else {

+                logger.error("Obligation Handler Class: " + oHandlerClass

+                             + " is not an instance of ObligationHandler or doesn't contain a valid Annotation");

+                throw new IllegalArgumentException("Obligation Handler Class: " + oHandlerClass

+                                                   + " is not an instance of ObligationHandler or doesn't contain a valid Annotation");

+            }

+        }

+    }

+

+    /**

+     * Process Annotations in the classes provided and translate those into <code>ObligationCriteria</code>.

+     *

+     * @param oHandlerClass

+     * @return an ObligationCriteria instance.

+     */

+    private ObligationCriteria processAnnotation(Class<?> oHandlerClass) {

+        ObligationCriteria criteria = null;

+        for (Annotation a : oHandlerClass.getAnnotations()) {

+            if (a.annotationType().equals(MatchAnyObligation.class)) {

+                String[] obligationIds = ((MatchAnyObligation) a).value();

+                ObligationCriteriaBuilder criteriaBuilder = new ObligationCriteriaBuilder();

+                if (obligationIds != null && obligationIds.length > 0) {

+                    criteriaBuilder.matchAnyObligationId(obligationIds);

+                } else {

+                    criteriaBuilder.matchAnyObligation();

                 }

-        }

-        

-        /**

-         * Process Annotations in the classes provided and translate those into <code>ObligationCriteria</code>.

-         * 

-         * @param oHandlerClass

-         * @return an ObligationCriteria instance.

-         */

-        private ObligationCriteria processAnnotation(Class<?> oHandlerClass) {

-                ObligationCriteria criteria = null;

-                for (Annotation a : oHandlerClass.getAnnotations()) {

-                        if (a.annotationType().equals(MatchAnyObligation.class)) {

-                                String[] obligationIds = ((MatchAnyObligation) a).value();

-                                ObligationCriteriaBuilder criteriaBuilder = new ObligationCriteriaBuilder();

-                                if (obligationIds != null && obligationIds.length > 0) {

-                                        criteriaBuilder.matchAnyObligationId(obligationIds);

-                                } else {

-                                        criteriaBuilder.matchAnyObligation();

-                                }

-                                criteria = criteriaBuilder.build();

-                        } else if (a.annotationType().equals(MatchAllObligationAttributes.class)) {

-                                ObligationCriteriaBuilder criteriaBuilder = new ObligationCriteriaBuilder();

-                                MatchAllObligationAttributes attributeObligationAnnotation = 

-                                                (MatchAllObligationAttributes) a;

-                                for (Attribute attribute : attributeObligationAnnotation.value()) {

-                                        String attributeId = attribute.id();

-                                        String[] anyValue = attribute.anyValue();

-                                        if (anyValue != null && anyValue.length > 0) {

-                                                criteriaBuilder.matchAttributeWithAnyGivenValue(

-                                                                attributeId, anyValue);

-                                        } else {

-                                                criteriaBuilder.matchAttribute(attributeId);

-                                        }

-                                }

-                                criteria = criteriaBuilder.build();

-                        }

+                criteria = criteriaBuilder.build();

+            } else if (a.annotationType().equals(MatchAllObligationAttributes.class)) {

+                ObligationCriteriaBuilder criteriaBuilder = new ObligationCriteriaBuilder();

+                MatchAllObligationAttributes attributeObligationAnnotation =

+                    (MatchAllObligationAttributes) a;

+                for (Attribute attribute : attributeObligationAnnotation.value()) {

+                    String attributeId = attribute.id();

+                    String[] anyValue = attribute.anyValue();

+                    if (anyValue != null && anyValue.length > 0) {

+                        criteriaBuilder.matchAttributeWithAnyGivenValue(

+                            attributeId, anyValue);

+                    } else {

+                        criteriaBuilder.matchAttribute(attributeId);

+                    }

                 }

-                return criteria;

+                criteria = criteriaBuilder.build();

+            }

         }

-        

-        /**

-         * Returns a new instance of <code>StdObligationHandlerRegistry</code>.

-         * 

-         * @param oHandlers

-         * @return

-         */

-        public static ObligationHandlerRegistry newInstance(List<?> oHandlers) {

-                return new StdObligationHandlerRegistry(oHandlers);

-        }

+        return criteria;

+    }

 

-        @Override

-        public Map<Class<?>, Matchable<Obligation>> getRegisteredHandlerMap() {

-                return this.oHandlerCriteriaMap;

-        }

+    /**

+     * Returns a new instance of <code>StdObligationHandlerRegistry</code>.

+     *

+     * @param oHandlers

+     * @return

+     */

+    public static ObligationHandlerRegistry newInstance(List<?> oHandlers) {

+        return new StdObligationHandlerRegistry(oHandlers);

+    }

+

+    @Override

+    public Map<Class<?>, Matchable<Obligation>> getRegisteredHandlerMap() {

+        return this.oHandlerCriteriaMap;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligationRouter.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligationRouter.java
index 5175c1e..fbf605a 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligationRouter.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdObligationRouter.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.apache.commons.logging.Log;

@@ -36,72 +36,72 @@
 

 /**

  * Entity that routes obligations at runtime.

- * 

+ *

  * @see org.openliberty.openaz.pepapi.Obligation

  * @author Ajith Nair

  */

 public final class StdObligationRouter implements ObligationRouter {

-        

-        private static final Log logger = LogFactory.getLog(StdObligationRouter.class);

-        

-        private final ObligationHandlerRegistry registrationHandler;

-        

-        private final ThreadLocalObligationStore obligationStore;

-        

-        StdObligationRouter(ObligationHandlerRegistry registrationHandler,

-                                                ThreadLocalObligationStore threadLocalOStore) {

-                this.registrationHandler = registrationHandler;

-                this.obligationStore = threadLocalOStore;

-        }

 

-        public static StdObligationRouter newInstance(

-                        ObligationHandlerRegistry registrationHandler,

+    private static final Log logger = LogFactory.getLog(StdObligationRouter.class);

+

+    private final ObligationHandlerRegistry registrationHandler;

+

+    private final ThreadLocalObligationStore obligationStore;

+

+    StdObligationRouter(ObligationHandlerRegistry registrationHandler,

                         ThreadLocalObligationStore threadLocalOStore) {

-                return new StdObligationRouter(registrationHandler,

-                                threadLocalOStore);

-        }

-        

-        /**

-         * Handles runtime obligations and routes to appropriate policy enforcement points as required.

-         * 

-         * @param obligationMap	a <code>Map</code> of <code>Obligation</code>s keyed by Obligation ID.

-         * @throws org.openliberty.openaz.pepapi.UnhandleableObligationException	if an Obligation cannot be handled/routed.

-         */

-        @Override

-        public void routeObligations(Map<String, Obligation> obligationMap) {

-                //Clear any stale Obligations on the current thread.

-                obligationStore.clear();

-                if(obligationMap != null) {

-                        Map<Class<?>, Set<Obligation>> obligationMapByHandlerClass 

-                                                                        = new HashMap<Class<?>, Set<Obligation>>();

-                        for(Entry<String, Obligation> oe: obligationMap.entrySet()) {

-                                boolean isObligationHandleable = false;

-                                String obligationId = oe.getKey();

-                                Obligation obligation = oe.getValue();

-                                for(Entry<Class<?>, Matchable<Obligation>> pe :

-                                                                this.registrationHandler.getRegisteredHandlerMap().entrySet()) {

-                                        Class<?> handlerClass = pe.getKey();

-                                        Matchable<Obligation> matchable = pe.getValue();

-                                        if(matchable.match(obligation)) {

-                                                Set<Obligation> handlerObligationSet = obligationMapByHandlerClass.get(handlerClass);

-                                                if(handlerObligationSet == null){

-                                                        handlerObligationSet = new HashSet<Obligation>();

-                                                        obligationMapByHandlerClass.put(handlerClass, handlerObligationSet);

-                                                }

-                                                handlerObligationSet.add(obligation);

-                                                isObligationHandleable = true;

-                                                if(logger.isDebugEnabled()) {

-                                                        logger.debug("Obligation - " + obligationId + " matched by Handler - " + handlerClass);

-                                                }

-                                        }

-                                }

-                                if(!isObligationHandleable) {

-                                        throw new UnhandleableObligationException(

-                                                        "No ObligationHandlers available for handling Obligation: "

-                                                                        + oe.getKey());

-                                }

+        this.registrationHandler = registrationHandler;

+        this.obligationStore = threadLocalOStore;

+    }

+

+    public static StdObligationRouter newInstance(

+        ObligationHandlerRegistry registrationHandler,

+        ThreadLocalObligationStore threadLocalOStore) {

+        return new StdObligationRouter(registrationHandler,

+                                       threadLocalOStore);

+    }

+

+    /**

+     * Handles runtime obligations and routes to appropriate policy enforcement points as required.

+     *

+     * @param obligationMap	a <code>Map</code> of <code>Obligation</code>s keyed by Obligation ID.

+     * @throws org.openliberty.openaz.pepapi.UnhandleableObligationException	if an Obligation cannot be handled/routed.

+     */

+    @Override

+    public void routeObligations(Map<String, Obligation> obligationMap) {

+        //Clear any stale Obligations on the current thread.

+        obligationStore.clear();

+        if(obligationMap != null) {

+            Map<Class<?>, Set<Obligation>> obligationMapByHandlerClass

+                = new HashMap<Class<?>, Set<Obligation>>();

+            for(Entry<String, Obligation> oe: obligationMap.entrySet()) {

+                boolean isObligationHandleable = false;

+                String obligationId = oe.getKey();

+                Obligation obligation = oe.getValue();

+                for(Entry<Class<?>, Matchable<Obligation>> pe :

+                        this.registrationHandler.getRegisteredHandlerMap().entrySet()) {

+                    Class<?> handlerClass = pe.getKey();

+                    Matchable<Obligation> matchable = pe.getValue();

+                    if(matchable.match(obligation)) {

+                        Set<Obligation> handlerObligationSet = obligationMapByHandlerClass.get(handlerClass);

+                        if(handlerObligationSet == null) {

+                            handlerObligationSet = new HashSet<Obligation>();

+                            obligationMapByHandlerClass.put(handlerClass, handlerObligationSet);

                         }

-                        obligationStore.setObligations(obligationMapByHandlerClass);

+                        handlerObligationSet.add(obligation);

+                        isObligationHandleable = true;

+                        if(logger.isDebugEnabled()) {

+                            logger.debug("Obligation - " + obligationId + " matched by Handler - " + handlerClass);

+                        }

+                    }

                 }

+                if(!isObligationHandleable) {

+                    throw new UnhandleableObligationException(

+                        "No ObligationHandlers available for handling Obligation: "

+                        + oe.getKey());

+                }

+            }

+            obligationStore.setObligations(obligationMapByHandlerClass);

         }

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepAgent.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepAgent.java
index 9b26852..dad3f5e 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepAgent.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepAgent.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import com.att.research.xacml.api.Request;

@@ -42,171 +42,171 @@
 

 

 final class StdPepAgent implements PepAgent {

-        

-        @SuppressWarnings("unused")

-        private static final Log logger = LogFactory.getLog(StdPepAgent.class);

 

-        private Properties xacmlProperties;

+    @SuppressWarnings("unused")

+    private static final Log logger = LogFactory.getLog(StdPepAgent.class);

 

-        private PepConfig pepConfig;

+    private Properties xacmlProperties;

 

-        private PDPEngine pdpEngine;

+    private PepConfig pepConfig;

 

-        private PDPEngineFactory pdpEngineFactory;

+    private PDPEngine pdpEngine;

 

-        private List<ObligationStoreAware> obligationHandlers;

-        

-        private PepRequestFactory pepRequestFactory;

-        

-        private PepResponseFactory pepResponseFactory;

-        

-        StdPepAgent() {

-                obligationHandlers = new ArrayList<ObligationStoreAware>();

-        }

-        

-        final void initialize() {

-                assert(pdpEngineFactory != null);

+    private PDPEngineFactory pdpEngineFactory;

 

-                //Instantiate PDPEngine

-                if(pdpEngine == null) {

-                        try {

-                                pdpEngine = pdpEngineFactory.newEngine(xacmlProperties);

-                        } catch (FactoryException e) {

-                                throw new PepException(e);

-                        }

-                }

+    private List<ObligationStoreAware> obligationHandlers;

 

-                List<ObjectMapper> objectMappers = new ArrayList<ObjectMapper>();

-                for(String mapperClassName: pepConfig.getMapperClassNames()) {

-                        Class<? extends ObjectMapper> clazz = (Class<? extends ObjectMapper>)PepUtils.loadClass(mapperClassName);

-                        objectMappers.add(PepUtils.instantiateClass(clazz));

-                }

-                MapperRegistry mapperRegistry = StdMapperRegistry.newInstance(pepConfig, objectMappers);

+    private PepRequestFactory pepRequestFactory;

 

-                ObligationRouter oRouter = null;

-                if(!obligationHandlers.isEmpty()) {

-                        ObligationHandlerRegistry oHandlerRegistry = StdObligationHandlerRegistry.newInstance(obligationHandlers);

-                        ThreadLocalObligationStore oStore = ThreadLocalObligationStore.newInstance();

-                        for(ObligationStoreAware oHandler: obligationHandlers) {

-                                oHandler.setObligationStore(oStore);

-                        }

-            oRouter = StdObligationRouter.newInstance(oHandlerRegistry, oStore);

-                }

-                

-                //Instantiate PepRequestFactory

-                pepRequestFactory = new StdPepRequestFactory(pepConfig, mapperRegistry);

-                //Instantiate PepResponseFactory

-                pepResponseFactory = new StdPepResponseFactory(pepConfig, oRouter);

-        }

-        

-        @Override

-        public PepResponse decide(Object... objects) {

-                return decide(pepRequestFactory.newPepRequest(objects)).get(0);

-        }

-        

-        @Override

-        public PepResponse simpleDecide(String subjectId, String actionId,

-                        String resourceId) {

-                return decide(Subject.newInstance(subjectId), Action.newInstance(actionId), Resource.newInstance(resourceId));

-        }

-        

-        @Override

-        public List<PepResponse> bulkDecide(List<?> actionResourcePairs, Object... objects) {

-                return decide(pepRequestFactory.newBulkPepRequest(actionResourcePairs, objects));

-        }

-                

-        private List<PepResponse> decide(PepRequest pepRequest) {

-                List<PepResponse> pepResponses = new ArrayList<PepResponse>();

-                Request request = pepRequest.getWrappedRequest();

+    private PepResponseFactory pepResponseFactory;

 

-                //Log request

-                if(logger.isDebugEnabled()) {

-                        logRequest(request);

-                }

-

-                Response response;

-                try {

-                        response = pdpEngine.decide(request);

-                } catch (PDPException e) {

-                        logger.error(e);

-                        throw new PepException(e);

-                }

-

-                //Log the response

-                if(logger.isDebugEnabled()) {

-                        logResponse(response);

-                }

-

-                for(Result result: response.getResults()) {

-                        pepResponses.add(pepResponseFactory.newPepResponse(result));

-                }

-                return pepResponses;

+    StdPepAgent() {

+        obligationHandlers = new ArrayList<ObligationStoreAware>();

     }

 

-        private void logRequest(Request request) {

-                ByteArrayOutputStream out = new ByteArrayOutputStream();

+    final void initialize() {

+        assert(pdpEngineFactory != null);

+

+        //Instantiate PDPEngine

+        if(pdpEngine == null) {

+            try {

+                pdpEngine = pdpEngineFactory.newEngine(xacmlProperties);

+            } catch (FactoryException e) {

+                throw new PepException(e);

+            }

+        }

+

+        List<ObjectMapper> objectMappers = new ArrayList<ObjectMapper>();

+        for(String mapperClassName: pepConfig.getMapperClassNames()) {

+            Class<? extends ObjectMapper> clazz = (Class<? extends ObjectMapper>)PepUtils.loadClass(mapperClassName);

+            objectMappers.add(PepUtils.instantiateClass(clazz));

+        }

+        MapperRegistry mapperRegistry = StdMapperRegistry.newInstance(pepConfig, objectMappers);

+

+        ObligationRouter oRouter = null;

+        if(!obligationHandlers.isEmpty()) {

+            ObligationHandlerRegistry oHandlerRegistry = StdObligationHandlerRegistry.newInstance(obligationHandlers);

+            ThreadLocalObligationStore oStore = ThreadLocalObligationStore.newInstance();

+            for(ObligationStoreAware oHandler: obligationHandlers) {

+                oHandler.setObligationStore(oStore);

+            }

+            oRouter = StdObligationRouter.newInstance(oHandlerRegistry, oStore);

+        }

+

+        //Instantiate PepRequestFactory

+        pepRequestFactory = new StdPepRequestFactory(pepConfig, mapperRegistry);

+        //Instantiate PepResponseFactory

+        pepResponseFactory = new StdPepResponseFactory(pepConfig, oRouter);

+    }

+

+    @Override

+    public PepResponse decide(Object... objects) {

+        return decide(pepRequestFactory.newPepRequest(objects)).get(0);

+    }

+

+    @Override

+    public PepResponse simpleDecide(String subjectId, String actionId,

+                                    String resourceId) {

+        return decide(Subject.newInstance(subjectId), Action.newInstance(actionId), Resource.newInstance(resourceId));

+    }

+

+    @Override

+    public List<PepResponse> bulkDecide(List<?> actionResourcePairs, Object... objects) {

+        return decide(pepRequestFactory.newBulkPepRequest(actionResourcePairs, objects));

+    }

+

+    private List<PepResponse> decide(PepRequest pepRequest) {

+        List<PepResponse> pepResponses = new ArrayList<PepResponse>();

+        Request request = pepRequest.getWrappedRequest();

+

+        //Log request

+        if(logger.isDebugEnabled()) {

+            logRequest(request);

+        }

+

+        Response response;

+        try {

+            response = pdpEngine.decide(request);

+        } catch (PDPException e) {

+            logger.error(e);

+            throw new PepException(e);

+        }

+

+        //Log the response

+        if(logger.isDebugEnabled()) {

+            logResponse(response);

+        }

+

+        for(Result result: response.getResults()) {

+            pepResponses.add(pepResponseFactory.newPepResponse(result));

+        }

+        return pepResponses;

+    }

+

+    private void logRequest(Request request) {

+        ByteArrayOutputStream out = new ByteArrayOutputStream();

+        try {

+            JSONRequest.convert(request, out);

+            logger.debug(out.toString("UTF-8"));

+        } catch (IOException e) {

+            logger.debug("Error printing XACML request in JSON", e);

+        } catch (JSONStructureException e) {

+            logger.debug("Error printing XACML request in JSON", e);

+        } finally {

+            if(out != null) {

                 try {

-                        JSONRequest.convert(request, out);

-                        logger.debug(out.toString("UTF-8"));

+                    out.close();

                 } catch (IOException e) {

-                        logger.debug("Error printing XACML request in JSON", e);

-                } catch (JSONStructureException e) {

-                        logger.debug("Error printing XACML request in JSON", e);

-                }finally {

-                        if(out != null) {

-                                try {

-                                        out.close();

-                                } catch (IOException e) {

-                                        logger.debug("Error closing stream");

-                                }

-                        }

+                    logger.debug("Error closing stream");

                 }

+            }

         }

+    }

 

-        private void logResponse(Response response) {

-                ByteArrayOutputStream out = new ByteArrayOutputStream();

+    private void logResponse(Response response) {

+        ByteArrayOutputStream out = new ByteArrayOutputStream();

+        try {

+            JSONResponse.convert(response, out);

+            logger.debug(out.toString("UTF-8"));

+        } catch (IOException e) {

+            logger.debug("Error printing XACML response in JSON", e);

+        } catch (JSONStructureException e) {

+            logger.debug("Error printing XACML response in JSON", e);

+        } finally {

+            if(out != null) {

                 try {

-                        JSONResponse.convert(response, out);

-                        logger.debug(out.toString("UTF-8"));

+                    out.close();

                 } catch (IOException e) {

-                        logger.debug("Error printing XACML response in JSON", e);

-                } catch (JSONStructureException e) {

-                        logger.debug("Error printing XACML response in JSON", e);

-                }finally {

-                        if(out != null) {

-                                try {

-                                        out.close();

-                                } catch (IOException e) {

-                                        logger.debug("Error closing stream");

-                                }

-                        }

+                    logger.debug("Error closing stream");

                 }

+            }

         }

+    }

 

-        public PDPEngine getPdpEngine() {

-                return pdpEngine;

-        }

+    public PDPEngine getPdpEngine() {

+        return pdpEngine;

+    }

 

-        public PepConfig getPepConfig() {

-                return pepConfig;

-        }

+    public PepConfig getPepConfig() {

+        return pepConfig;

+    }

 

-        void setPdpEngineFactory(PDPEngineFactory pdpEngineFactory) {

-                this.pdpEngineFactory = pdpEngineFactory;

-        }

+    void setPdpEngineFactory(PDPEngineFactory pdpEngineFactory) {

+        this.pdpEngineFactory = pdpEngineFactory;

+    }

 

-        void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 

-        void setXacmlProperties(Properties properties) {

-                this.xacmlProperties = properties;

-        }

+    void setXacmlProperties(Properties properties) {

+        this.xacmlProperties = properties;

+    }

 

-        void setObligationHandlers(List<ObligationStoreAware> obligationHandlers) {

-                if(obligationHandlers != null) {

-                        this.obligationHandlers = new ArrayList<ObligationStoreAware>();

-                        this.obligationHandlers.addAll(obligationHandlers);

-                }

+    void setObligationHandlers(List<ObligationStoreAware> obligationHandlers) {

+        if(obligationHandlers != null) {

+            this.obligationHandlers = new ArrayList<ObligationStoreAware>();

+            this.obligationHandlers.addAll(obligationHandlers);

         }

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepAgentFactory.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepAgentFactory.java
index 63574f0..6b18805 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepAgentFactory.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepAgentFactory.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import com.att.research.xacml.api.pdp.PDPEngineFactory;

@@ -29,51 +29,51 @@
 

 

 public class StdPepAgentFactory implements PepAgentFactory {

-        

-        private volatile PepAgent pepAgent;

 

-        private PDPEngineFactory pdpEngineFactory;

+    private volatile PepAgent pepAgent;

 

-        private Properties xacmlProperties;

+    private PDPEngineFactory pdpEngineFactory;

 

-        private PepConfig pepConfig;

+    private Properties xacmlProperties;

 

-        private List<ObligationStoreAware> obligationHandlers;

+    private PepConfig pepConfig;

 

-        public StdPepAgentFactory(String propertyFile) {

-                this(PepUtils.loadProperties(propertyFile));

+    private List<ObligationStoreAware> obligationHandlers;

+

+    public StdPepAgentFactory(String propertyFile) {

+        this(PepUtils.loadProperties(propertyFile));

+    }

+

+    public StdPepAgentFactory(Properties properties) {

+        this.xacmlProperties = properties;

+        this.pepConfig = new StdPepConfig(properties);

+        try {

+            //FIXME: Error when invoking newInstance() with properties.

+            pdpEngineFactory = PDPEngineFactory.newInstance();

+        } catch (FactoryException e) {

+            throw new PepException(e);

         }

+    }

 

-        public StdPepAgentFactory(Properties properties) {

-                this.xacmlProperties = properties;

-                this.pepConfig = new StdPepConfig(properties);

-                try {

-                        //FIXME: Error when invoking newInstance() with properties.

-                        pdpEngineFactory = PDPEngineFactory.newInstance();

-                } catch (FactoryException e) {

-                        throw new PepException(e);

+    @Override

+    public PepAgent getPepAgent() {

+        if(pepAgent == null) {

+            synchronized(this) {

+                if(this.pepAgent == null) {

+                    StdPepAgent pa = new StdPepAgent();

+                    pa.setPepConfig(pepConfig);

+                    pa.setXacmlProperties(xacmlProperties);

+                    pa.setPdpEngineFactory(pdpEngineFactory);

+                    pa.setObligationHandlers(obligationHandlers);

+                    pa.initialize();

+                    pepAgent = pa;

                 }

+            }

         }

+        return pepAgent;

+    }

 

-        @Override

-        public PepAgent getPepAgent() {

-                if(pepAgent == null) {

-                        synchronized(this) {

-                                if(this.pepAgent == null) {

-                                        StdPepAgent pa = new StdPepAgent();

-                                        pa.setPepConfig(pepConfig);

-                                        pa.setXacmlProperties(xacmlProperties);

-                                        pa.setPdpEngineFactory(pdpEngineFactory);

-                                        pa.setObligationHandlers(obligationHandlers);

-                                        pa.initialize();

-                                        pepAgent = pa;

-                                }

-                        }

-                }

-                return pepAgent;

-        }

-

-        public void setObligationHandlers(List<ObligationStoreAware> obligationHandlers) {

-                this.obligationHandlers = obligationHandlers;

-        }

+    public void setObligationHandlers(List<ObligationStoreAware> obligationHandlers) {

+        this.obligationHandlers = obligationHandlers;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepConfig.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepConfig.java
index c6602ec..9b31c8f 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepConfig.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepConfig.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import com.att.research.xacml.api.XACML3;

@@ -36,129 +36,129 @@
 

 public final class StdPepConfig implements PepConfig {

 

-        private static final Log logger = LogFactory.getLog(StdPepConfig.class);

+    private static final Log logger = LogFactory.getLog(StdPepConfig.class);

 

-        private static final String PEP_ISSUER = "pep.issuer";

+    private static final String PEP_ISSUER = "pep.issuer";

 

-        private static final String PEP_DEFAULT_SUBJECT_ID = "pep.subject.id";

+    private static final String PEP_DEFAULT_SUBJECT_ID = "pep.subject.id";

 

-        private static final String PEP_DEFAULT_ACTION_ID = "pep.action.id";

+    private static final String PEP_DEFAULT_ACTION_ID = "pep.action.id";

 

-        private static final String PEP_DEFAULT_RESOURCE_ID = "pep.resource.id";

+    private static final String PEP_DEFAULT_RESOURCE_ID = "pep.resource.id";

 

-        private static final String PEP_INDETERMINATE_BEHAVIOR = "pep.indeterminate.behavior";

+    private static final String PEP_INDETERMINATE_BEHAVIOR = "pep.indeterminate.behavior";

 

-        private static final String PEP_NOTAPPLICABLE_BEHAVIOR = "pep.notapplicable.behavior";

+    private static final String PEP_NOTAPPLICABLE_BEHAVIOR = "pep.notapplicable.behavior";

 

-        private static final String PEP_MAPPER_CLASSES = "pep.mapper.classes";

+    private static final String PEP_MAPPER_CLASSES = "pep.mapper.classes";

 

-        private String issuer;

+    private String issuer;

 

-        private String subjectIdURI;

+    private String subjectIdURI;

 

-        private String actionIdURI;

+    private String actionIdURI;

 

-        private String resourceIdURI;

+    private String resourceIdURI;

 

-        private PepResponseBehavior indeterminateBehavior;

+    private PepResponseBehavior indeterminateBehavior;

 

-        private PepResponseBehavior notApplicableBehavior;

+    private PepResponseBehavior notApplicableBehavior;

 

-        private List<String> mapperClassNames;

+    private List<String> mapperClassNames;

 

-        public StdPepConfig() {

-                //Defaults

-                subjectIdURI = XACML3.ID_SUBJECT_SUBJECT_ID.stringValue();

-                actionIdURI = XACML3.ID_ACTION_ACTION_ID.stringValue();

-                resourceIdURI = XACML3.ID_RESOURCE_RESOURCE_ID.stringValue();

-                indeterminateBehavior = PepResponseBehavior.THROW_EXCEPTION;

-                notApplicableBehavior = PepResponseBehavior.RETURN_NO;

-                mapperClassNames = Collections.EMPTY_LIST;

+    public StdPepConfig() {

+        //Defaults

+        subjectIdURI = XACML3.ID_SUBJECT_SUBJECT_ID.stringValue();

+        actionIdURI = XACML3.ID_ACTION_ACTION_ID.stringValue();

+        resourceIdURI = XACML3.ID_RESOURCE_RESOURCE_ID.stringValue();

+        indeterminateBehavior = PepResponseBehavior.THROW_EXCEPTION;

+        notApplicableBehavior = PepResponseBehavior.RETURN_NO;

+        mapperClassNames = Collections.EMPTY_LIST;

+    }

+

+    public StdPepConfig(Properties properties) {

+        this();

+        issuer = properties.getProperty(PEP_ISSUER);

+

+        String subjectIdURI = properties.getProperty(PEP_DEFAULT_SUBJECT_ID);

+        if(!StringUtils.isEmpty(subjectIdURI)) {

+            this.subjectIdURI = subjectIdURI;

         }

 

-        public StdPepConfig(Properties properties) {

-                this();

-                issuer = properties.getProperty(PEP_ISSUER);

-

-                String subjectIdURI = properties.getProperty(PEP_DEFAULT_SUBJECT_ID);

-                if(!StringUtils.isEmpty(subjectIdURI)){

-                        this.subjectIdURI = subjectIdURI;

-                }

-

-                String actionIdURI = properties.getProperty(PEP_DEFAULT_ACTION_ID);

-                if(!StringUtils.isEmpty(actionIdURI)) {

-                        this.actionIdURI = actionIdURI;

-                }

-

-                String resourceIdURI = properties.getProperty(PEP_DEFAULT_RESOURCE_ID);

-                if(!StringUtils.isEmpty(resourceIdURI)) {

-                        this.resourceIdURI = resourceIdURI;

-                }

-

-                String indeterminateString = properties.getProperty(PEP_INDETERMINATE_BEHAVIOR);

-                if(!StringUtils.isEmpty(indeterminateString)) {

-                        PepResponseBehavior indeterminateBehavior = PepResponseBehavior.valueOf(indeterminateString);

-                        if(indeterminateBehavior == null) {

-                                logger.error("Invalid indeterminate behavior found in configuration.");

-                                //TODO: Throw exception ?

-                        }

-                        this.indeterminateBehavior = indeterminateBehavior;

-                }

-

-                String notapplicableString = properties.getProperty(PEP_NOTAPPLICABLE_BEHAVIOR);

-                if(!StringUtils.isEmpty(notapplicableString)) {

-                        PepResponseBehavior notApplicableBehavior = PepResponseBehavior.valueOf(notapplicableString);

-                        if(notApplicableBehavior == null) {

-                                logger.error("Invalid notapplicable behavior found in configuration.");

-                                //TODO: Throw exception ?

-                        }

-                        this.notApplicableBehavior = notApplicableBehavior;

-                }

-

-

-                String mapperClassNameString = properties.getProperty(PEP_MAPPER_CLASSES);

-                if(!StringUtils.isEmpty(mapperClassNameString)) {

-                        List mapperClassNames = new ArrayList<String>();

-                        for(String className: Splitter.on(",").omitEmptyStrings().trimResults().split(mapperClassNameString)) {

-                                mapperClassNames.add(className);

-                        }

-                        this.mapperClassNames = Collections.unmodifiableList(mapperClassNames);

-                }

-

+        String actionIdURI = properties.getProperty(PEP_DEFAULT_ACTION_ID);

+        if(!StringUtils.isEmpty(actionIdURI)) {

+            this.actionIdURI = actionIdURI;

         }

 

-        @Override

-        public String getIssuer() {

-                return issuer;

+        String resourceIdURI = properties.getProperty(PEP_DEFAULT_RESOURCE_ID);

+        if(!StringUtils.isEmpty(resourceIdURI)) {

+            this.resourceIdURI = resourceIdURI;

         }

 

-        @Override

-        public String getDefaultSubjectId() {

-                return subjectIdURI;

+        String indeterminateString = properties.getProperty(PEP_INDETERMINATE_BEHAVIOR);

+        if(!StringUtils.isEmpty(indeterminateString)) {

+            PepResponseBehavior indeterminateBehavior = PepResponseBehavior.valueOf(indeterminateString);

+            if(indeterminateBehavior == null) {

+                logger.error("Invalid indeterminate behavior found in configuration.");

+                //TODO: Throw exception ?

+            }

+            this.indeterminateBehavior = indeterminateBehavior;

         }

 

-        @Override

-        public String getDefaultResourceId() {

-                return resourceIdURI;

+        String notapplicableString = properties.getProperty(PEP_NOTAPPLICABLE_BEHAVIOR);

+        if(!StringUtils.isEmpty(notapplicableString)) {

+            PepResponseBehavior notApplicableBehavior = PepResponseBehavior.valueOf(notapplicableString);

+            if(notApplicableBehavior == null) {

+                logger.error("Invalid notapplicable behavior found in configuration.");

+                //TODO: Throw exception ?

+            }

+            this.notApplicableBehavior = notApplicableBehavior;

         }

 

-        @Override

-        public String getDefaultActionId() {

-                return actionIdURI;

+

+        String mapperClassNameString = properties.getProperty(PEP_MAPPER_CLASSES);

+        if(!StringUtils.isEmpty(mapperClassNameString)) {

+            List mapperClassNames = new ArrayList<String>();

+            for(String className: Splitter.on(",").omitEmptyStrings().trimResults().split(mapperClassNameString)) {

+                mapperClassNames.add(className);

+            }

+            this.mapperClassNames = Collections.unmodifiableList(mapperClassNames);

         }

 

-        @Override

-        public PepResponseBehavior getIndeterminateBehavior() {

-                return indeterminateBehavior;

-        }

+    }

 

-        @Override

-        public PepResponseBehavior getNotApplicableBehavior() {

-                return notApplicableBehavior;

-        }

+    @Override

+    public String getIssuer() {

+        return issuer;

+    }

 

-        @Override

-        public List<String> getMapperClassNames() {

-                return mapperClassNames;

-        }

+    @Override

+    public String getDefaultSubjectId() {

+        return subjectIdURI;

+    }

+

+    @Override

+    public String getDefaultResourceId() {

+        return resourceIdURI;

+    }

+

+    @Override

+    public String getDefaultActionId() {

+        return actionIdURI;

+    }

+

+    @Override

+    public PepResponseBehavior getIndeterminateBehavior() {

+        return indeterminateBehavior;

+    }

+

+    @Override

+    public PepResponseBehavior getNotApplicableBehavior() {

+        return notApplicableBehavior;

+    }

+

+    @Override

+    public List<String> getMapperClassNames() {

+        return mapperClassNames;

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequest.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequest.java
index e72745e..07cfaec 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequest.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi.std;
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequestAttributes.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequestAttributes.java
index c16fa78..6fccdf9 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequestAttributes.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequestAttributes.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import com.att.research.xacml.api.Identifier;

@@ -38,108 +38,108 @@
 

 

 final class StdPepRequestAttributes implements PepRequestAttributes {

-        

-        private static final Log log = LogFactory.getLog(StdPepRequestAttributes.class);

 

-        private final String id;

+    private static final Log log = LogFactory.getLog(StdPepRequestAttributes.class);

 

-        private final Identifier categoryIdentifier;

+    private final String id;

 

-        private String issuer;

+    private final Identifier categoryIdentifier;

 

-        private StdMutableRequestAttributes wrappedRequestAttributes;

+    private String issuer;

 

-        //Internal map to hold mutable attributes as StdMutableRequestAttributes

-        // does not return a mutable view of Attributes.

-        private Map<Identifier, StdMutableAttribute> attributeMapById;

+    private StdMutableRequestAttributes wrappedRequestAttributes;

 

-        StdPepRequestAttributes(String id, Identifier categoryIdentifier) {

-                this.id = id;

-                this.categoryIdentifier = categoryIdentifier;

-                this.attributeMapById = new HashMap<Identifier, StdMutableAttribute>();

-                this.wrappedRequestAttributes =  new StdMutableRequestAttributes();

-                this.wrappedRequestAttributes.setCategory(categoryIdentifier);

-                this.wrappedRequestAttributes.setXmlId(id);

+    //Internal map to hold mutable attributes as StdMutableRequestAttributes

+    // does not return a mutable view of Attributes.

+    private Map<Identifier, StdMutableAttribute> attributeMapById;

+

+    StdPepRequestAttributes(String id, Identifier categoryIdentifier) {

+        this.id = id;

+        this.categoryIdentifier = categoryIdentifier;

+        this.attributeMapById = new HashMap<Identifier, StdMutableAttribute>();

+        this.wrappedRequestAttributes =  new StdMutableRequestAttributes();

+        this.wrappedRequestAttributes.setCategory(categoryIdentifier);

+        this.wrappedRequestAttributes.setXmlId(id);

+    }

+

+    @Override

+    public Identifier getCategory() {

+        return categoryIdentifier;

+    }

+

+    @Override

+    public void addAttribute(String name, Date... values) {

+        addAttribute(name, values, XACML3.ID_DATATYPE_DATE);

+    }

+

+    @Override

+    public void addAttribute(String name, String... values) {

+        addAttribute(name, values, XACML3.ID_DATATYPE_STRING);

+    }

+

+    @Override

+    public void addAttribute(String name, Integer... values) {

+        addAttribute(name, values, XACML3.ID_DATATYPE_INTEGER);

+    }

+

+    @Override

+    public void addAttribute(String name, Boolean... values) {

+        addAttribute(name, values, XACML3.ID_DATATYPE_BOOLEAN);

+    }

+

+    @Override

+    public void addAttribute(String name, Long... values) {

+        addAttribute(name, values, XACML3.ID_DATATYPE_INTEGER);

+    }

+

+    @Override

+    public void addAttribute(String name, Double... values) {

+        addAttribute(name, values, XACML3.ID_DATATYPE_DOUBLE);

+    }

+

+    @Override

+    public void addAttribute(String name, URI... values) {

+        addAttribute(name, values, XACML3.ID_DATATYPE_ANYURI);

+    }

+

+    private <T> void addAttribute(String name, T[] values, Identifier dataTypeId) {

+        if(values == null) {

+            throw new IllegalArgumentException("Null attribute value provided for attribute: " + name);

         }

-

-        @Override

-        public Identifier getCategory() {

-                return categoryIdentifier;

+        Identifier attributeId = new IdentifierImpl(name);

+        StdMutableAttribute mutableAttribute = attributeMapById.get(attributeId);

+        if(mutableAttribute == null) {

+            mutableAttribute = new StdMutableAttribute();

+            mutableAttribute.setAttributeId(new IdentifierImpl(name));

+            mutableAttribute.setCategory(categoryIdentifier);

+            mutableAttribute.setIncludeInResults(false);

+            mutableAttribute.setIssuer(issuer == null?"":issuer);

+            attributeMapById.put(attributeId, mutableAttribute);

+            wrappedRequestAttributes.add(mutableAttribute);

         }

-

-        @Override

-        public void addAttribute(String name, Date... values) {

-                addAttribute(name, values, XACML3.ID_DATATYPE_DATE);

+        for(T value: values) {

+            if(value != null) {

+                mutableAttribute.addValue(new StdAttributeValue<T>(dataTypeId, value));

+            }

         }

+    }

 

-        @Override

-        public void addAttribute(String name, String... values) {

-                addAttribute(name, values, XACML3.ID_DATATYPE_STRING);

-        }

+    @Override

+    public RequestAttributes getWrappedRequestAttributes() {

+        return wrappedRequestAttributes;

+    }

 

-        @Override

-        public void addAttribute(String name, Integer... values) {

-                addAttribute(name, values, XACML3.ID_DATATYPE_INTEGER);

-        }

+    @Override

+    public String getId() {

+        return id;

+    }

 

-        @Override

-        public void addAttribute(String name, Boolean... values) {

-                addAttribute(name, values, XACML3.ID_DATATYPE_BOOLEAN);

-        }

+    public String getIssuer() {

+        return issuer;

+    }

 

-        @Override

-        public void addAttribute(String name, Long... values) {

-                addAttribute(name, values, XACML3.ID_DATATYPE_INTEGER);

-        }

-

-        @Override

-        public void addAttribute(String name, Double... values) {

-                addAttribute(name, values, XACML3.ID_DATATYPE_DOUBLE);

-        }

-

-        @Override

-        public void addAttribute(String name, URI... values) {

-                addAttribute(name, values, XACML3.ID_DATATYPE_ANYURI);

-        }

-

-        private <T> void addAttribute(String name, T[] values, Identifier dataTypeId) {

-                if(values == null) {

-                        throw new IllegalArgumentException("Null attribute value provided for attribute: " + name);

-                }

-                Identifier attributeId = new IdentifierImpl(name);

-                StdMutableAttribute mutableAttribute = attributeMapById.get(attributeId);

-                if(mutableAttribute == null) {

-                        mutableAttribute = new StdMutableAttribute();

-                        mutableAttribute.setAttributeId(new IdentifierImpl(name));

-                        mutableAttribute.setCategory(categoryIdentifier);

-                        mutableAttribute.setIncludeInResults(false);

-                        mutableAttribute.setIssuer(issuer == null?"":issuer);

-                        attributeMapById.put(attributeId, mutableAttribute);

-                        wrappedRequestAttributes.add(mutableAttribute);

-                }

-                for(T value: values) {

-                        if(value != null) {

-                                mutableAttribute.addValue(new StdAttributeValue<T>(dataTypeId, value));

-                        }

-                }

-        }

-

-        @Override

-        public RequestAttributes getWrappedRequestAttributes() {

-                return wrappedRequestAttributes;

-        }

-

-        @Override

-        public String getId() {

-                return id;

-        }

-

-        public String getIssuer() {

-                return issuer;

-        }

-

-        public void setIssuer(String issuer) {

-                this.issuer = issuer;

-        }

+    public void setIssuer(String issuer) {

+        this.issuer = issuer;

+    }

 

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequestFactory.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequestFactory.java
index 604ca4d..b8f1c1f 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequestFactory.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepRequestFactory.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import org.apache.commons.logging.Log;

@@ -31,30 +31,30 @@
 

 

 final class StdPepRequestFactory implements PepRequestFactory {

-        

-        private static final Log logger = LogFactory.getLog(StdPepRequestFactory.class);

 

-        private final PepConfig pepConfig;

+    private static final Log logger = LogFactory.getLog(StdPepRequestFactory.class);

 

-        private final MapperRegistry mapperRegistry;

+    private final PepConfig pepConfig;

 

-        /**

-         *

-         * @param pepConfig

-         */

-        StdPepRequestFactory(PepConfig pepConfig, MapperRegistry mapperRegistry) {

-                this.pepConfig = pepConfig;

-                this.mapperRegistry = mapperRegistry;

-        }

+    private final MapperRegistry mapperRegistry;

 

-        @Override

-        public PepRequest newPepRequest(Object[] objects) {

-                return StdPepRequest.newInstance(pepConfig, mapperRegistry, objects);

-        }

+    /**

+     *

+     * @param pepConfig

+     */

+    StdPepRequestFactory(PepConfig pepConfig, MapperRegistry mapperRegistry) {

+        this.pepConfig = pepConfig;

+        this.mapperRegistry = mapperRegistry;

+    }

 

-        @Override

-        public PepRequest newBulkPepRequest(List<?> associations, Object[] objects) {

-                return MultiRequest.newInstance(pepConfig, mapperRegistry, associations, objects);

-        }

+    @Override

+    public PepRequest newPepRequest(Object[] objects) {

+        return StdPepRequest.newInstance(pepConfig, mapperRegistry, objects);

+    }

+

+    @Override

+    public PepRequest newBulkPepRequest(List<?> associations, Object[] objects) {

+        return MultiRequest.newInstance(pepConfig, mapperRegistry, associations, objects);

+    }

 

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepResponse.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepResponse.java
index 89386eb..f76aa4c 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepResponse.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepResponse.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import com.att.research.xacml.api.*;

@@ -35,113 +35,113 @@
 

 

 final class StdPepResponse implements PepResponse {

-        

-        private static final Log logger = LogFactory.getLog(StdPepResponse.class);

-        

-        private final Result wrappedResult;

 

-        private final PepConfig pepConfig;

+    private static final Log logger = LogFactory.getLog(StdPepResponse.class);

 

-        private final ObligationRouter obligationRouter;

+    private final Result wrappedResult;

 

-        static PepResponse newInstance(PepConfig pepConfig, ObligationRouter obligationRouter, Result result) {

-                return new StdPepResponse(pepConfig, obligationRouter, result);

+    private final PepConfig pepConfig;

+

+    private final ObligationRouter obligationRouter;

+

+    static PepResponse newInstance(PepConfig pepConfig, ObligationRouter obligationRouter, Result result) {

+        return new StdPepResponse(pepConfig, obligationRouter, result);

+    }

+

+    private StdPepResponse(PepConfig pepConfig, ObligationRouter obligationRouter, Result result) {

+        this.pepConfig = pepConfig;

+        this.wrappedResult = result;

+        this.obligationRouter = obligationRouter;

+    }

+

+    @Override

+    public boolean allowed() throws PepException {

+        if(obligationRouter != null) {

+            obligationRouter.routeObligations(getObligations());

         }

+        switch(wrappedResult.getDecision()) {

+        case PERMIT:

+            return true;

+        case DENY:

+            return false;

+        case NOTAPPLICABLE:

+            return enforceBehavior(pepConfig.getNotApplicableBehavior(), "Not Applicable");

+        //TODO: Handle various indeterminate status codes.

+        case INDETERMINATE:

+        case INDETERMINATE_DENY:

+        case INDETERMINATE_DENYPERMIT:

+        case INDETERMINATE_PERMIT:

+            Status status = wrappedResult.getStatus();

+            String formatted = String.format("Decision: Indeterminate, Status Code: %s, Status Message: %s",

+                                             status.getStatusCode(), status.getStatusMessage());

+            logger.error(formatted);

+            throw new PepException(formatted);

+        default:

+            throw new PepException("Invalid response from PDP");

+        }

+    }

 

-        private StdPepResponse(PepConfig pepConfig, ObligationRouter obligationRouter, Result result) {

-                this.pepConfig = pepConfig;

-                this.wrappedResult = result;

-                this.obligationRouter = obligationRouter;

+    @Override

+    public Map<String, Obligation> getObligations() throws PepException {

+        Map<String, Obligation> obligationMap = new HashMap<String, Obligation>();

+        for(com.att.research.xacml.api.Obligation wrappedObligation: wrappedResult.getObligations()) {

+            Obligation obligation = new StdObligation(wrappedObligation);

+            obligationMap.put(obligation.getId(), obligation);

         }

+        return obligationMap;

+    }

 

-        @Override

-        public boolean allowed() throws PepException {

-                if(obligationRouter != null) {

-                        obligationRouter.routeObligations(getObligations());

-                }

-                switch(wrappedResult.getDecision()) {

-                        case PERMIT:

-                                return true;

-                        case DENY:

-                                return false;

-                        case NOTAPPLICABLE:

-                                return enforceBehavior(pepConfig.getNotApplicableBehavior(), "Not Applicable");

-                        //TODO: Handle various indeterminate status codes.

-                        case INDETERMINATE:

-                        case INDETERMINATE_DENY:

-                        case INDETERMINATE_DENYPERMIT:

-                        case INDETERMINATE_PERMIT:

-                                Status status = wrappedResult.getStatus();

-                                String formatted = String.format("Decision: Indeterminate, Status Code: %s, Status Message: %s",

-                                                status.getStatusCode(), status.getStatusMessage());

-                                logger.error(formatted);

-                                throw new PepException(formatted);

-                        default:

-                                throw new PepException("Invalid response from PDP");

-                }

+    @Override

+    public Map<String, Advice> getAdvices() throws PepException {

+        Map<String, Advice> adviceMap = new HashMap<String, Advice>();

+        for(com.att.research.xacml.api.Advice wrappedAdvice: wrappedResult.getAssociatedAdvice()) {

+            Advice advice = new StdAdvice(wrappedAdvice);

+            adviceMap.put(advice.getId(), advice);

         }

-        

-        @Override

-        public Map<String, Obligation> getObligations() throws PepException {

-                Map<String, Obligation> obligationMap = new HashMap<String, Obligation>();

-                for(com.att.research.xacml.api.Obligation wrappedObligation: wrappedResult.getObligations()) {

-                        Obligation obligation = new StdObligation(wrappedObligation);

-                        obligationMap.put(obligation.getId(), obligation);

-                }

-                return obligationMap;

-        }

+        return adviceMap;

+    }

 

-        @Override

-        public Map<String, Advice> getAdvices() throws PepException {

-                Map<String, Advice> adviceMap = new HashMap<String, Advice>();

-                for(com.att.research.xacml.api.Advice wrappedAdvice: wrappedResult.getAssociatedAdvice()) {

-                        Advice advice = new StdAdvice(wrappedAdvice);

-                        adviceMap.put(advice.getId(), advice);

-                }

-                return adviceMap;

-        }

+    @Override

+    public Object getAssociation() throws PepException {

+        return null;

+    }

 

-        @Override

-        public Object getAssociation() throws PepException {

-                return null;

+    @Override

+    public Collection<Attribute> getAttributes() {

+        Collection<Attribute> attributes = new ArrayList<Attribute>();

+        for(AttributeCategory category: wrappedResult.getAttributes()) {

+            attributes.addAll(category.getAttributes());

         }

+        return attributes;

+    }

 

-        @Override

-        public Collection<Attribute> getAttributes() {

-                Collection<Attribute> attributes = new ArrayList<Attribute>();

-                for(AttributeCategory category: wrappedResult.getAttributes()) {

-                        attributes.addAll(category.getAttributes());

-                }

-                return attributes;

+    @Override

+    public Map<Identifier, Collection<Attribute>> getAttributesByCategory() {

+        Map<Identifier, Collection<Attribute>> attributesByCategory = new HashMap<Identifier, Collection<Attribute>>();

+        for(AttributeCategory category: wrappedResult.getAttributes()) {

+            attributesByCategory.put(category.getCategory(), category.getAttributes());

         }

+        return attributesByCategory;

+    }

 

-        @Override

-        public Map<Identifier, Collection<Attribute>> getAttributesByCategory() {

-                Map<Identifier, Collection<Attribute>> attributesByCategory = new HashMap<Identifier, Collection<Attribute>>();

-                for(AttributeCategory category: wrappedResult.getAttributes()) {

-                        attributesByCategory.put(category.getCategory(), category.getAttributes());

-                }

-                return attributesByCategory;

-        }

+    @Override

+    public Result getWrappedResult() {

+        return wrappedResult;

+    }

 

-        @Override

-        public Result getWrappedResult() {

-                return wrappedResult;

+    private boolean enforceBehavior(

+        PepResponseBehavior pepResponseBehavior, String decision) throws PepException {

+        switch (pepResponseBehavior) {

+        case RETURN_YES:

+            return true;

+        case RETURN_NO:

+            return false;

+        case THROW_EXCEPTION:

+            logger.info("Throwing an exception as per configured behavior for decision: " + decision);

+            throw new PepException("Exception being thrown based on configured " +

+                                   "behavior for decision: " + decision);

+        default:

+            throw new PepException("Invalid PepResponseBehavior");

         }

-

-        private boolean enforceBehavior(

-                        PepResponseBehavior pepResponseBehavior, String decision) throws PepException {

-                switch (pepResponseBehavior) {

-                        case RETURN_YES:

-                                return true;

-                        case RETURN_NO:

-                                return false;

-                        case THROW_EXCEPTION:

-                                logger.info("Throwing an exception as per configured behavior for decision: " + decision);

-                                throw new PepException("Exception being thrown based on configured " +

-                                        "behavior for decision: " + decision);

-                        default:

-                                throw new PepException("Invalid PepResponseBehavior");

-                }

-        }

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepResponseFactory.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepResponseFactory.java
index 73e0a6a..88dfec9 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepResponseFactory.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/StdPepResponseFactory.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 import com.att.research.xacml.api.Result;

@@ -30,20 +30,20 @@
 

 

 final class StdPepResponseFactory implements PepResponseFactory {

-    

-        private static final Log logger = LogFactory.getLog(StdPepResponseFactory.class);

 

-        private PepConfig pepConfig;

-        

-        private ObligationRouter obligationRouter;

+    private static final Log logger = LogFactory.getLog(StdPepResponseFactory.class);

 

-        StdPepResponseFactory(PepConfig pepConfig, ObligationRouter obligationRouter) {

-                this.pepConfig = pepConfig;

-                this.obligationRouter = obligationRouter;

-        }

-        

-        @Override

-        public PepResponse newPepResponse(Result result) {

-                return StdPepResponse.newInstance(pepConfig, obligationRouter, result);

-        }

+    private PepConfig pepConfig;

+

+    private ObligationRouter obligationRouter;

+

+    StdPepResponseFactory(PepConfig pepConfig, ObligationRouter obligationRouter) {

+        this.pepConfig = pepConfig;

+        this.obligationRouter = obligationRouter;

+    }

+

+    @Override

+    public PepResponse newPepResponse(Result result) {

+        return StdPepResponse.newInstance(pepConfig, obligationRouter, result);

+    }

 }

diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/SubjectMapper.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/SubjectMapper.java
index 4fdbc2b..75a52c5 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/SubjectMapper.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/SubjectMapper.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.openliberty.openaz.pepapi.std;
diff --git a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ThreadLocalObligationStore.java b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ThreadLocalObligationStore.java
index 016a6c4..fe14e9d 100644
--- a/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ThreadLocalObligationStore.java
+++ b/openaz-pep/src/main/java/org/openliberty/openaz/pepapi/std/ThreadLocalObligationStore.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std;

 

 

@@ -32,85 +32,85 @@
 

 /**

  * Acts as a store for Obligation instances in the current thread of execution.

- * 

+ *

  * @author Ajith Nair, David Laurance, Darshak Kothari

- * 

+ *

  */

 public final class ThreadLocalObligationStore implements ObligationStore {

-        

-        private static final ThreadLocal<Map<Class<?>, Set<Obligation>>> obligationMapContainer =

-                        new ThreadLocal<Map<Class<?>, Set<Obligation>>>();

-        

-        private ThreadLocalObligationStore(){}

-        

-        public static ThreadLocalObligationStore newInstance() {

-                return new ThreadLocalObligationStore();

-        }

-        

-        /**

-         * Set Obligations for the current thread of execution.

-         * 

-         * @param obligationMap	a <code>Map</code> containing <code>Obligation</code> instances keyed by ObligationHandler Class.

-         */

-        void setObligations(Map<Class<?>, Set<Obligation>> obligationMap) {

-                if(obligationMap != null && !obligationMap.isEmpty()) {

-                        obligationMapContainer.set(Collections.unmodifiableMap(obligationMap));

-                }else {

-                        obligationMapContainer.set(null);

-                }

-        }

-        

-        /**

-         * Returns all obligations in the current thread of execution. 

-         * 

-         * @return	a <code>Set</code> of <code>Obligation</code> instances.

-         */

-        public Set<Obligation> getAllObligations() {

-                Set<Obligation> allObligations = new HashSet<Obligation>();

-                Map<Class<?>, Set<Obligation>> obligationMap = obligationMapContainer.get();

-                if(obligationMap != null){

-                        for(Entry<Class<?>, Set<Obligation>> e: obligationMap.entrySet()){

-                                allObligations.addAll(e.getValue());

-                        }

-                }

-                return allObligations;

-        }

-        

-        /**

-         * Returns all obligations that the given ObligationHandler can handle, in the current thread of execution.

-         * 

-         * @param oHandlerClass

-         * @return a <code>Set</code> of <code>Obligation</code> instances.

-         */

-        @Override

-        public Set<Obligation> getHandlerObligations(Class<?> oHandlerClass) {

-                Set<Obligation> obligations = new HashSet<Obligation>();

-                Map<Class<?>, Set<Obligation>> obligationMap = obligationMapContainer.get();

-                if(obligationMap != null && obligationMap.get(oHandlerClass) != null){

-                        obligations.addAll(obligationMap.get(oHandlerClass));

-                }

-                return obligations;

-        }

-        

 

-        @Override

-        public Obligation getHandlerObligationById(Class<?> oHandlerClass,

-                        String obligationId) {

-                Set<Obligation> obligations = getHandlerObligations(oHandlerClass);

-                if(obligations != null){

-                        for(Obligation obligation: obligations){

-                                if(obligation.getId().equals(obligationId)){

-                                        return obligation;

-                                }

-                        }

+    private static final ThreadLocal<Map<Class<?>, Set<Obligation>>> obligationMapContainer =

+        new ThreadLocal<Map<Class<?>, Set<Obligation>>>();

+

+    private ThreadLocalObligationStore() {}

+

+    public static ThreadLocalObligationStore newInstance() {

+        return new ThreadLocalObligationStore();

+    }

+

+    /**

+     * Set Obligations for the current thread of execution.

+     *

+     * @param obligationMap	a <code>Map</code> containing <code>Obligation</code> instances keyed by ObligationHandler Class.

+     */

+    void setObligations(Map<Class<?>, Set<Obligation>> obligationMap) {

+        if(obligationMap != null && !obligationMap.isEmpty()) {

+            obligationMapContainer.set(Collections.unmodifiableMap(obligationMap));

+        } else {

+            obligationMapContainer.set(null);

+        }

+    }

+

+    /**

+     * Returns all obligations in the current thread of execution.

+     *

+     * @return	a <code>Set</code> of <code>Obligation</code> instances.

+     */

+    public Set<Obligation> getAllObligations() {

+        Set<Obligation> allObligations = new HashSet<Obligation>();

+        Map<Class<?>, Set<Obligation>> obligationMap = obligationMapContainer.get();

+        if(obligationMap != null) {

+            for(Entry<Class<?>, Set<Obligation>> e: obligationMap.entrySet()) {

+                allObligations.addAll(e.getValue());

+            }

+        }

+        return allObligations;

+    }

+

+    /**

+     * Returns all obligations that the given ObligationHandler can handle, in the current thread of execution.

+     *

+     * @param oHandlerClass

+     * @return a <code>Set</code> of <code>Obligation</code> instances.

+     */

+    @Override

+    public Set<Obligation> getHandlerObligations(Class<?> oHandlerClass) {

+        Set<Obligation> obligations = new HashSet<Obligation>();

+        Map<Class<?>, Set<Obligation>> obligationMap = obligationMapContainer.get();

+        if(obligationMap != null && obligationMap.get(oHandlerClass) != null) {

+            obligations.addAll(obligationMap.get(oHandlerClass));

+        }

+        return obligations;

+    }

+

+

+    @Override

+    public Obligation getHandlerObligationById(Class<?> oHandlerClass,

+            String obligationId) {

+        Set<Obligation> obligations = getHandlerObligations(oHandlerClass);

+        if(obligations != null) {

+            for(Obligation obligation: obligations) {

+                if(obligation.getId().equals(obligationId)) {

+                    return obligation;

                 }

-                return null;

+            }

         }

-        

-        /**

-         * Clear all obligations in the current thread.

-         */

-        void clear() {

-                obligationMapContainer.remove();

-        }

+        return null;

+    }

+

+    /**

+     * Clear all obligations in the current thread.

+     */

+    void clear() {

+        obligationMapContainer.remove();

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAPI.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAPI.java
index 9ffb040..54ef688 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAPI.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAPI.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test;

 

 import org.junit.Assert;

@@ -32,70 +32,70 @@
 

 public class TestAPI {

 

-        private PepAgentFactory pepAgentFactory;

+    private PepAgentFactory pepAgentFactory;

 

-        @Before

-        public void setup() {

-                pepAgentFactory = new StdPepAgentFactory("/properties/testapi.xacml.properties");

-        }

-        

-        

-        /**

-         * 

-         */

-        @Test

-        public void testPepAgent() {

-                Assert.assertNotNull(getPepAgent());

-        }

+    @Before

+    public void setup() {

+        pepAgentFactory = new StdPepAgentFactory("/properties/testapi.xacml.properties");

+    }

 

-        

-        /**

-         * 

-         */

-        @Test

-        public void testPermit(){

-                PepResponse response = getPepAgent().simpleDecide("Julius Hibbert",

-                                "read", "http://medico.com/record/patient/BartSimpson");

-                Assert.assertNotNull(response);

-                Assert.assertEquals(true, response.allowed());

-        }

 

-        

-        /**

-         * 

-         */

-        @Test

-        public void testNotApplicable(){

-                PepResponse response = getPepAgent().simpleDecide("Julius Hibbert",

-                                "read","http://medico.com/record/patient/JohnSmith");

-                Assert.assertNotNull(response);

-                Assert.assertEquals(false, response.allowed());

-        }

+    /**

+     *

+     */

+    @Test

+    public void testPepAgent() {

+        Assert.assertNotNull(getPepAgent());

+    }

 

-        

-        /**

-         * 

-         */

-        @Test

-        public void testMultiRequest() {

-                List<Action> actions = new ArrayList<Action>();

-                actions.add(Action.newInstance("read"));

-                actions.add(Action.newInstance("write"));

-                actions.add(Action.newInstance("update"));

-                actions.add(Action.newInstance("delete"));

 

-                List<PepResponse> responses = getPepAgent().bulkDecide(actions,

-                                Subject.newInstance("Julius Hibbert"),

-                                Resource.newInstance("http://medico.com/record/patient/BartSimpson"));

-                Assert.assertNotNull(responses);

-                Assert.assertEquals(true, responses.get(0).allowed());

-                Assert.assertEquals(true, responses.get(1).allowed());

-                Assert.assertEquals(false, responses.get(2).allowed());

-                Assert.assertEquals(false, responses.get(3).allowed());

+    /**

+     *

+     */

+    @Test

+    public void testPermit() {

+        PepResponse response = getPepAgent().simpleDecide("Julius Hibbert",

+                               "read", "http://medico.com/record/patient/BartSimpson");

+        Assert.assertNotNull(response);

+        Assert.assertEquals(true, response.allowed());

+    }

 

-        }

 

-        public PepAgent getPepAgent() {

-                return pepAgentFactory.getPepAgent();

-        }

+    /**

+     *

+     */

+    @Test

+    public void testNotApplicable() {

+        PepResponse response = getPepAgent().simpleDecide("Julius Hibbert",

+                               "read","http://medico.com/record/patient/JohnSmith");

+        Assert.assertNotNull(response);

+        Assert.assertEquals(false, response.allowed());

+    }

+

+

+    /**

+     *

+     */

+    @Test

+    public void testMultiRequest() {

+        List<Action> actions = new ArrayList<Action>();

+        actions.add(Action.newInstance("read"));

+        actions.add(Action.newInstance("write"));

+        actions.add(Action.newInstance("update"));

+        actions.add(Action.newInstance("delete"));

+

+        List<PepResponse> responses = getPepAgent().bulkDecide(actions,

+                                      Subject.newInstance("Julius Hibbert"),

+                                      Resource.newInstance("http://medico.com/record/patient/BartSimpson"));

+        Assert.assertNotNull(responses);

+        Assert.assertEquals(true, responses.get(0).allowed());

+        Assert.assertEquals(true, responses.get(1).allowed());

+        Assert.assertEquals(false, responses.get(2).allowed());

+        Assert.assertEquals(false, responses.get(3).allowed());

+

+    }

+

+    public PepAgent getPepAgent() {

+        return pepAgentFactory.getPepAgent();

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAPIWithPIP.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAPIWithPIP.java
index aa12103..cd9c4e0 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAPIWithPIP.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAPIWithPIP.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test;

 

 import org.apache.commons.logging.Log;

@@ -34,85 +34,85 @@
 

 

 public class TestAPIWithPIP {

-        

-        private static final Log log = LogFactory.getLog(TestAPIWithPIP.class);

 

-        private PepAgentFactory pepAgentFactory;

+    private static final Log log = LogFactory.getLog(TestAPIWithPIP.class);

 

-        @Before

-        public void setup() {

-                pepAgentFactory = new StdPepAgentFactory("xacml.properties");

+    private PepAgentFactory pepAgentFactory;

+

+    @Before

+    public void setup() {

+        pepAgentFactory = new StdPepAgentFactory("xacml.properties");

+    }

+

+

+    /**

+     *

+     */

+    @Ignore

+    @Test

+    public void testPepAgent() {

+        Assert.assertNotNull(getPepAgent());

+    }

+

+

+    /**

+     *

+     */

+    @Ignore

+    @Test

+    public void testPermit() {

+        PepResponse response = getPepAgent()

+                               .simpleDecide("John Doe",

+                                             "read",

+                                             "http://medico.com/record/patient/BartSimpson");

+        Assert.assertNotNull(response);

+        Assert.assertEquals(true, response.allowed());

+    }

+

+

+    /**

+     *

+     */

+    @Ignore

+    @Test

+    public void testNotApplicable() {

+        PepResponse response = getPepAgent()

+                               .simpleDecide("John Smith",

+                                             "read",

+                                             "http://medico.com/record/patient/BartSimpson");

+        Assert.assertNotNull(response);

+        Assert.assertEquals(false, response.allowed());

+    }

+

+

+    /**

+     *

+     */

+    @Ignore

+    @Test

+    public void testMultiRequest() {

+        List<Action> actions = new ArrayList<Action>();

+        actions.add(Action.newInstance("read"));

+        actions.add(Action.newInstance("update"));

+        actions.add(Action.newInstance("write"));

+        actions.add(Action.newInstance("modify"));

+

+        Resource resource = Resource.newInstance("http://medico.com/record/patient/BartSimpson");

+        Subject subject = Subject.newInstance("John Doe");

+

+        List<PepResponse> responses = getPepAgent().bulkDecide(actions, resource, subject);

+        Assert.assertNotNull(responses);

+        Assert.assertEquals(actions.size(), responses.size());

+        Assert.assertEquals(true, responses.get(0).allowed());

+        Assert.assertEquals(false, responses.get(1).allowed());

+        Assert.assertEquals(true, responses.get(2).allowed());

+        Assert.assertEquals(false, responses.get(3).allowed());

+        for(PepResponse response: responses) {

+            log.debug(response.getAssociation());

         }

-        

+    }

 

-        /**

-         * 

-         */

-        @Ignore

-        @Test

-        public void testPepAgent() {

-                Assert.assertNotNull(getPepAgent());

-        }

-

-        

-        /**

-         * 

-         */

-        @Ignore

-        @Test

-        public void testPermit() {

-                PepResponse response = getPepAgent()

-                                .simpleDecide("John Doe",

-                                                "read",

-                                                "http://medico.com/record/patient/BartSimpson");

-                Assert.assertNotNull(response);

-                Assert.assertEquals(true, response.allowed());

-        }

-

-        

-        /**

-         * 

-         */

-        @Ignore

-        @Test

-        public void testNotApplicable() {

-                PepResponse response = getPepAgent()

-                                .simpleDecide("John Smith",

-                                                "read",

-                                                "http://medico.com/record/patient/BartSimpson");

-                Assert.assertNotNull(response);

-                Assert.assertEquals(false, response.allowed());

-        }

-

-        

-        /**

-         * 

-         */

-        @Ignore

-        @Test

-        public void testMultiRequest() {

-                List<Action> actions = new ArrayList<Action>();

-                actions.add(Action.newInstance("read"));

-                actions.add(Action.newInstance("update"));

-                actions.add(Action.newInstance("write"));

-                actions.add(Action.newInstance("modify"));

-

-                Resource resource = Resource.newInstance("http://medico.com/record/patient/BartSimpson");

-                Subject subject = Subject.newInstance("John Doe");

-

-                List<PepResponse> responses = getPepAgent().bulkDecide(actions, resource, subject);

-                Assert.assertNotNull(responses);

-                Assert.assertEquals(actions.size(), responses.size());

-                Assert.assertEquals(true, responses.get(0).allowed());

-                Assert.assertEquals(false, responses.get(1).allowed());

-                Assert.assertEquals(true, responses.get(2).allowed());

-                Assert.assertEquals(false, responses.get(3).allowed());

-                for(PepResponse response: responses) {

-                        log.debug(response.getAssociation());

-                }

-        }

-        

-        public PepAgent getPepAgent() {

-                return pepAgentFactory.getPepAgent();

-        }

+    public PepAgent getPepAgent() {

+        return pepAgentFactory.getPepAgent();

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAnnotatedHandlerRegistration.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAnnotatedHandlerRegistration.java
index 5869573..f6f3b53 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAnnotatedHandlerRegistration.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestAnnotatedHandlerRegistration.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test;

 

 import org.apache.commons.logging.Log;

@@ -34,59 +34,59 @@
 

 

 public class TestAnnotatedHandlerRegistration {

-        

-        @SuppressWarnings("unused")

-        private static Log log = LogFactory.getLog(TestAnnotatedHandlerRegistration.class);

 

-        private PepAgentFactory pepAgentFactory;

+    @SuppressWarnings("unused")

+    private static Log log = LogFactory.getLog(TestAnnotatedHandlerRegistration.class);

 

-        //TODO: Need to wire

-        private AnnotatedFilteringObligationHandler filterHandler;

+    private PepAgentFactory pepAgentFactory;

 

-        //TODO: Need to wire

-        private AnnotatedRedactionObligationHandler redactionHandler;

+    //TODO: Need to wire

+    private AnnotatedFilteringObligationHandler filterHandler;

 

-        //TODO: Need to wire

-        private AnnotatedCatchAllObligationHandler catchAllHandler;

+    //TODO: Need to wire

+    private AnnotatedRedactionObligationHandler redactionHandler;

+

+    //TODO: Need to wire

+    private AnnotatedCatchAllObligationHandler catchAllHandler;

 

 

-        @Before

-        public void setup() {

-                pepAgentFactory = new StdPepAgentFactory("xacml.properties");

-        }

-        

+    @Before

+    public void setup() {

+        pepAgentFactory = new StdPepAgentFactory("xacml.properties");

+    }

 

-        

-        /**

-         * 

-         */

-        @Ignore

-        @Test

-        public void testPepAgent() {

-                Assert.assertNotNull(getPepAgent());

-        }

-        

-        

-        

-        /**

-         * 

-         */

-        @Ignore

-        @Test

-        public void testRegistration() {

-                Subject subject = Subject.newInstance("John Smith");

-                subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:age", "45");

-                PepResponse response = getPepAgent().decide(subject, Action.newInstance("view"),

-                                Resource.newInstance("resource1"));

-                Assert.assertNotNull(response);

-                Assert.assertEquals(true, response.allowed());

-                filterHandler.enforce();

-                redactionHandler.enforce();

-                catchAllHandler.enforce();

-        }

 

-        public PepAgent getPepAgent() {

-                return pepAgentFactory.getPepAgent();

-        }

+

+    /**

+     *

+     */

+    @Ignore

+    @Test

+    public void testPepAgent() {

+        Assert.assertNotNull(getPepAgent());

+    }

+

+

+

+    /**

+     *

+     */

+    @Ignore

+    @Test

+    public void testRegistration() {

+        Subject subject = Subject.newInstance("John Smith");

+        subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:age", "45");

+        PepResponse response = getPepAgent().decide(subject, Action.newInstance("view"),

+                               Resource.newInstance("resource1"));

+        Assert.assertNotNull(response);

+        Assert.assertEquals(true, response.allowed());

+        filterHandler.enforce();

+        redactionHandler.enforce();

+        catchAllHandler.enforce();

+    }

+

+    public PepAgent getPepAgent() {

+        return pepAgentFactory.getPepAgent();

+    }

 

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestDataTypes.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestDataTypes.java
index 4f9497f..0333bee 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestDataTypes.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestDataTypes.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test;

 

 import org.junit.Assert;

@@ -33,73 +33,73 @@
 

 public class TestDataTypes {

 

-        private PepAgentFactory pepAgentFactory;

+    private PepAgentFactory pepAgentFactory;

 

-        @Before

-        public void setup() {

-                /*System.setProperty("xacml.properties" ,

-                                getClass().getClassLoader().getResource("properties/testdatatypes.xacml.properties").getPath());*/

-                pepAgentFactory = new StdPepAgentFactory("/properties/testdatatypes.xacml.properties");

+    @Before

+    public void setup() {

+        /*System.setProperty("xacml.properties" ,

+                        getClass().getClassLoader().getResource("properties/testdatatypes.xacml.properties").getPath());*/

+        pepAgentFactory = new StdPepAgentFactory("/properties/testdatatypes.xacml.properties");

+    }

+

+

+    /**

+     *

+     */

+    @Test

+    public void testPepAgent() {

+        Assert.assertNotNull(getPepAgent());

+    }

+

+

+    /**

+     *

+     */

+    @Test

+    public void testPermitWithURIResource() {

+        Subject subject = Subject.newInstance("John Smith");

+        Action action = Action.newInstance("view");

+        Resource resource = Resource.newInstance(URI.create("file://repository/classified/abc"));

+        PepResponse response = getPepAgent().decide(subject, action, resource);

+        Assert.assertNotNull(response);

+        Assert.assertEquals(true, response.allowed());

+    }

+

+

+    /**

+     *

+     */

+    @Test

+    public void testPermitWithIntegerResource() {

+        Subject subject = Subject.newInstance("John Smith");

+        Action action = Action.newInstance("view");

+        Resource resource = Resource.newInstance(101L);

+        PepResponse response = getPepAgent().decide(subject, action, resource);

+        Assert.assertNotNull(response);

+        Assert.assertEquals(true, response.allowed());

+    }

+

+

+    /**

+     *

+     */

+    @Test

+    public void testMultiRequestWithURI() {

+        List<Resource> resources = new ArrayList<Resource>();

+        resources.add(Resource.newInstance(URI.create("file://repository/classified/abc")));

+        resources.add(Resource.newInstance(URI.create("file://repository/classified/xyz")));

+

+        Subject subject = Subject.newInstance("John Smith");

+        Action action = Action.newInstance("view");

+

+        List<PepResponse> responses = getPepAgent().bulkDecide(resources, action, subject);

+        Assert.assertNotNull(responses);

+        for(PepResponse response: responses) {

+            Assert.assertEquals(true, response.allowed());

         }

-        

-        

-        /**

-         * 

-         */

-        @Test

-        public void testPepAgent() {

-                Assert.assertNotNull(getPepAgent());

-        }

+    }

 

-        

-        /**

-         * 

-         */

-        @Test

-        public void testPermitWithURIResource() {

-                Subject subject = Subject.newInstance("John Smith");

-                Action action = Action.newInstance("view");

-                Resource resource = Resource.newInstance(URI.create("file://repository/classified/abc"));

-                PepResponse response = getPepAgent().decide(subject, action, resource);

-                Assert.assertNotNull(response);

-                Assert.assertEquals(true, response.allowed());

-        }

-        

-

-        /**

-         * 

-         */

-        @Test

-        public void testPermitWithIntegerResource() {

-                Subject subject = Subject.newInstance("John Smith");

-                Action action = Action.newInstance("view");

-                Resource resource = Resource.newInstance(101L);

-                PepResponse response = getPepAgent().decide(subject, action, resource);

-                Assert.assertNotNull(response);

-                Assert.assertEquals(true, response.allowed());

-        }

-

-        

-        /**

-         * 

-         */

-        @Test

-        public void testMultiRequestWithURI() {

-                List<Resource> resources = new ArrayList<Resource>();

-                resources.add(Resource.newInstance(URI.create("file://repository/classified/abc")));

-                resources.add(Resource.newInstance(URI.create("file://repository/classified/xyz")));

-

-                Subject subject = Subject.newInstance("John Smith");

-                Action action = Action.newInstance("view");

-

-                List<PepResponse> responses = getPepAgent().bulkDecide(resources, action, subject);

-                Assert.assertNotNull(responses);

-                for(PepResponse response: responses) {

-                        Assert.assertEquals(true, response.allowed());

-                }

-        }

-

-        public PepAgent getPepAgent() {

-                return pepAgentFactory.getPepAgent();

-        }

+    public PepAgent getPepAgent() {

+        return pepAgentFactory.getPepAgent();

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestMapper.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestMapper.java
index a122688..37aacad 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestMapper.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/TestMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test;

 

 import org.apache.commons.logging.Log;

@@ -36,108 +36,108 @@
 

 

 public class TestMapper {

-        

-        @SuppressWarnings("unused")

-        private static Log logger = LogFactory.getLog(TestMapper.class);

 

-        private PepAgentFactory pepAgentFactory;

+    @SuppressWarnings("unused")

+    private static Log logger = LogFactory.getLog(TestMapper.class);

 

-        @Before

-        public void setup() {

-                this.pepAgentFactory = new StdPepAgentFactory("/properties/testmapper.xacml.properties");

-        }

-        

-        /**

-         * 

-         */

-        @Test

-        public void testPepAgent() {

-                Assert.assertNotNull(getPepAgent());

-        }

-        

-        /**

-         * 

-         */

-        @Test

-        public void testPermit() {

-                Subject subject = Subject.newInstance("John Smith");

-                subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_WRITER");

+    private PepAgentFactory pepAgentFactory;

 

-                Action action = Action.newInstance("write");

+    @Before

+    public void setup() {

+        this.pepAgentFactory = new StdPepAgentFactory("/properties/testmapper.xacml.properties");

+    }

 

-                Document doc = new Document(1, "OnBoarding Document", "ABC Corporation", "John Smith");

-                PepResponse response = getPepAgent().decide(subject, action, doc);

-                Assert.assertNotNull(response);

-                Assert.assertEquals(true, response.allowed());

-        }

-        

-        /**

-         * 

-         */

-        @Test

-        public void testNotApplicable(){

-                Subject subject = Subject.newInstance("John Smith");

-                subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_WRITER");

+    /**

+     *

+     */

+    @Test

+    public void testPepAgent() {

+        Assert.assertNotNull(getPepAgent());

+    }

 

-                Action action = Action.newInstance("write");

-                Document doc = new Document(2, "OnBoarding Document", "XYZ Corporation", "Jim Doe");

-                PepResponse response = getPepAgent().decide(subject,  action, doc);

-                Assert.assertNotNull(response);

-                Assert.assertEquals(false, response.allowed());

-        }

-        

-        @Test(expected=PepException.class)

-        public void testMix(){

-                Subject subject = Subject.newInstance("John Smith");

-                subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_WRITER");

+    /**

+     *

+     */

+    @Test

+    public void testPermit() {

+        Subject subject = Subject.newInstance("John Smith");

+        subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_WRITER");

 

-                Action action = Action.newInstance("write");

+        Action action = Action.newInstance("write");

 

-                Document doc1 = new Document(1, "OnBoarding Document", "ABC Corporation", "John Smith");

-                Document doc2 = new Document(2, "OnBoarding Document", "XYZ Corporation", "Jim Doe");

-                List<Object> resourceList = new ArrayList<Object>();

-                resourceList.add(doc1);

-                resourceList.add(doc2);

-                

-                PepResponse response = getPepAgent().decide(subject, action, resourceList);

-                Assert.assertNotNull(response);

-                response.allowed();

-        }

-        

-        @Test

-        public void testVarArgsPermit(){

-                Subject subject = Subject.newInstance("John Smith");

-                subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_READER");

-                BusinessRequestContext bc = new BusinessRequestContext("USA", "05:00 EST");

+        Document doc = new Document(1, "OnBoarding Document", "ABC Corporation", "John Smith");

+        PepResponse response = getPepAgent().decide(subject, action, doc);

+        Assert.assertNotNull(response);

+        Assert.assertEquals(true, response.allowed());

+    }

 

-                Action action = Action.newInstance("read");

-                List<Object> resources = new ArrayList<Object>();

-                resources.add(new Document(1, "OnBoarding Document", "XYZ Corporation", "Jim Doe"));

-                resources.add(new Client("XYZ Corporation", "USA"));

-                

-                PepResponse response = getPepAgent().decide(subject, action, resources, bc);

-                Assert.assertNotNull(response);

-                Assert.assertEquals(true, response.allowed());

-        }

-        

-        @Test

-        public void testVarArgsDeny(){

-                Subject subject = Subject.newInstance("John Smith");

-                subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_READER");

-                BusinessRequestContext bc = new BusinessRequestContext("INDIA", "05:00 IST");

-                

-                List<Object> resources = new ArrayList<Object>();

-                resources.add(new Document(2, "OnBoarding Document", "XYZ Corporation", "Jim Doe"));

-                resources.add(new Client("XYZ Corporation", "USA"));

+    /**

+     *

+     */

+    @Test

+    public void testNotApplicable() {

+        Subject subject = Subject.newInstance("John Smith");

+        subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_WRITER");

 

-                Action action = Action.newInstance("write");

+        Action action = Action.newInstance("write");

+        Document doc = new Document(2, "OnBoarding Document", "XYZ Corporation", "Jim Doe");

+        PepResponse response = getPepAgent().decide(subject,  action, doc);

+        Assert.assertNotNull(response);

+        Assert.assertEquals(false, response.allowed());

+    }

 

-                PepResponse response = getPepAgent().decide(subject, action, resources, bc);

-                Assert.assertNotNull(response);

-                Assert.assertEquals(false, response.allowed());

-        }

+    @Test(expected=PepException.class)

+    public void testMix() {

+        Subject subject = Subject.newInstance("John Smith");

+        subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_WRITER");

 

-        public PepAgent getPepAgent() {

-                return pepAgentFactory.getPepAgent();

-        }

+        Action action = Action.newInstance("write");

+

+        Document doc1 = new Document(1, "OnBoarding Document", "ABC Corporation", "John Smith");

+        Document doc2 = new Document(2, "OnBoarding Document", "XYZ Corporation", "Jim Doe");

+        List<Object> resourceList = new ArrayList<Object>();

+        resourceList.add(doc1);

+        resourceList.add(doc2);

+

+        PepResponse response = getPepAgent().decide(subject, action, resourceList);

+        Assert.assertNotNull(response);

+        response.allowed();

+    }

+

+    @Test

+    public void testVarArgsPermit() {

+        Subject subject = Subject.newInstance("John Smith");

+        subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_READER");

+        BusinessRequestContext bc = new BusinessRequestContext("USA", "05:00 EST");

+

+        Action action = Action.newInstance("read");

+        List<Object> resources = new ArrayList<Object>();

+        resources.add(new Document(1, "OnBoarding Document", "XYZ Corporation", "Jim Doe"));

+        resources.add(new Client("XYZ Corporation", "USA"));

+

+        PepResponse response = getPepAgent().decide(subject, action, resources, bc);

+        Assert.assertNotNull(response);

+        Assert.assertEquals(true, response.allowed());

+    }

+

+    @Test

+    public void testVarArgsDeny() {

+        Subject subject = Subject.newInstance("John Smith");

+        subject.addAttribute("urn:oasis:names:tc:xacml:1.0:subject:role-id", "ROLE_DOCUMENT_READER");

+        BusinessRequestContext bc = new BusinessRequestContext("INDIA", "05:00 IST");

+

+        List<Object> resources = new ArrayList<Object>();

+        resources.add(new Document(2, "OnBoarding Document", "XYZ Corporation", "Jim Doe"));

+        resources.add(new Client("XYZ Corporation", "USA"));

+

+        Action action = Action.newInstance("write");

+

+        PepResponse response = getPepAgent().decide(subject, action, resources, bc);

+        Assert.assertNotNull(response);

+        Assert.assertEquals(false, response.allowed());

+    }

+

+    public PepAgent getPepAgent() {

+        return pepAgentFactory.getPepAgent();

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/BusinessRequestContext.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/BusinessRequestContext.java
index 27965c3..cc6bad8 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/BusinessRequestContext.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/BusinessRequestContext.java
@@ -1,41 +1,41 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.mapper;

 

 public class BusinessRequestContext {

-        

-        private final String requestCountry;

-        

-        private final String requestTime;

 

-        public BusinessRequestContext(String country, String time){

-                this.requestCountry = country;

-                this.requestTime = time;

-        }

-        

-        public String getRequestCountry() {

-                return requestCountry;

-        }

+    private final String requestCountry;

 

-        public String getRequestTime() {

-                return requestTime;

-        }

+    private final String requestTime;

+

+    public BusinessRequestContext(String country, String time) {

+        this.requestCountry = country;

+        this.requestTime = time;

+    }

+

+    public String getRequestCountry() {

+        return requestCountry;

+    }

+

+    public String getRequestTime() {

+        return requestTime;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/BusinessRequestContextMapper.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/BusinessRequestContextMapper.java
index 9e6dfdd..6b6ac79 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/BusinessRequestContextMapper.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/BusinessRequestContextMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.mapper;

 

 import com.att.research.xacml.api.XACML3;

@@ -25,30 +25,30 @@
 

 public class BusinessRequestContextMapper implements ObjectMapper {

 

-        private MapperRegistry mapperRegistry;

+    private MapperRegistry mapperRegistry;

 

-        private PepConfig pepConfig;

+    private PepConfig pepConfig;

 

-        @Override

-        public Class<?> getMappedClass() {

-                return BusinessRequestContext.class;

-        }

+    @Override

+    public Class<?> getMappedClass() {

+        return BusinessRequestContext.class;

+    }

 

-        @Override

-        public void map(Object o, PepRequest pepRequest) {

-                BusinessRequestContext bc = (BusinessRequestContext)o;

-                PepRequestAttributes envAttributes = pepRequest.getPepRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT);

-                envAttributes.addAttribute("jpmc:request-context:country", bc.getRequestCountry());

-                envAttributes.addAttribute("jpmc:request-context:time", bc.getRequestTime());

-        }

+    @Override

+    public void map(Object o, PepRequest pepRequest) {

+        BusinessRequestContext bc = (BusinessRequestContext)o;

+        PepRequestAttributes envAttributes = pepRequest.getPepRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT);

+        envAttributes.addAttribute("jpmc:request-context:country", bc.getRequestCountry());

+        envAttributes.addAttribute("jpmc:request-context:time", bc.getRequestTime());

+    }

 

-        @Override

-        public void setMapperRegistry(MapperRegistry mapperRegistry) {

-                this.mapperRegistry = mapperRegistry;

-        }

+    @Override

+    public void setMapperRegistry(MapperRegistry mapperRegistry) {

+        this.mapperRegistry = mapperRegistry;

+    }

 

-        @Override

-        public void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    @Override

+    public void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/Client.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/Client.java
index 9b185be..4f83bc8 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/Client.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/Client.java
@@ -1,40 +1,40 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.mapper;

 

 public class Client {

-        

-        private final String name;

-        

-        private final String countryOfDomicile;

-        

-        public Client(String name, String countryOfDomicile){

-                this.name = name;

-                this.countryOfDomicile = countryOfDomicile;

-        }

 

-        public String getName() {

-                return name;

-        }

-        public String getCountryOfDomicile() {

-                return countryOfDomicile;

-        }

+    private final String name;

+

+    private final String countryOfDomicile;

+

+    public Client(String name, String countryOfDomicile) {

+        this.name = name;

+        this.countryOfDomicile = countryOfDomicile;

+    }

+

+    public String getName() {

+        return name;

+    }

+    public String getCountryOfDomicile() {

+        return countryOfDomicile;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/ClientMapper.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/ClientMapper.java
index f24c0a4..4211a3b 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/ClientMapper.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/ClientMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.mapper;

 

 import com.att.research.xacml.api.XACML3;

@@ -25,30 +25,30 @@
 

 public class ClientMapper implements ObjectMapper {

 

-        private MapperRegistry mapperRegistry;

+    private MapperRegistry mapperRegistry;

 

-        private PepConfig pepConfig;

-        

-        @Override

-        public Class<?> getMappedClass() {

-                return Client.class;

-        }

+    private PepConfig pepConfig;

 

-        @Override

-        public void map(Object o, PepRequest pepRequest) {

-                Client c = (Client)o;

-                PepRequestAttributes resAttributes = pepRequest.getPepRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);

-                resAttributes.addAttribute("jpmc:client:name", c.getName());

-                resAttributes.addAttribute("jpmc:client:country-of-domicile", c.getCountryOfDomicile());

-        }

+    @Override

+    public Class<?> getMappedClass() {

+        return Client.class;

+    }

 

-        @Override

-        public void setMapperRegistry(MapperRegistry mapperRegistry) {

-                this.mapperRegistry = mapperRegistry;

-        }

+    @Override

+    public void map(Object o, PepRequest pepRequest) {

+        Client c = (Client)o;

+        PepRequestAttributes resAttributes = pepRequest.getPepRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);

+        resAttributes.addAttribute("jpmc:client:name", c.getName());

+        resAttributes.addAttribute("jpmc:client:country-of-domicile", c.getCountryOfDomicile());

+    }

 

-        @Override

-        public void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    @Override

+    public void setMapperRegistry(MapperRegistry mapperRegistry) {

+        this.mapperRegistry = mapperRegistry;

+    }

+

+    @Override

+    public void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/Document.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/Document.java
index 02004ce..719b356 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/Document.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/Document.java
@@ -1,52 +1,52 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.mapper;

 

 public class Document {

-        

-        private final Integer documentId;

-        private final String documentName;

-        private final String clientName;

-        private final String documentOwner;

-        

-        public Document(Integer documentId, String documentName, String clientName, String documentOwner){

-                this.documentId = documentId;

-                this.documentName = documentName;

-                this.clientName = clientName;

-                this.documentOwner = documentOwner;

-        }

-        

-        public Integer getDocumentId() {

-                return documentId;

-        }

-        

-        public String getDocumentName() {

-                return documentName;

-        }

-        

-        public String getDocumentOwner() {

-                return documentOwner;

-        }

 

-        public String getClientName() {

-                return clientName;

-        }

+    private final Integer documentId;

+    private final String documentName;

+    private final String clientName;

+    private final String documentOwner;

+

+    public Document(Integer documentId, String documentName, String clientName, String documentOwner) {

+        this.documentId = documentId;

+        this.documentName = documentName;

+        this.clientName = clientName;

+        this.documentOwner = documentOwner;

+    }

+

+    public Integer getDocumentId() {

+        return documentId;

+    }

+

+    public String getDocumentName() {

+        return documentName;

+    }

+

+    public String getDocumentOwner() {

+        return documentOwner;

+    }

+

+    public String getClientName() {

+        return clientName;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/DocumentMapper.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/DocumentMapper.java
index eafc006..8c93b81 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/DocumentMapper.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/DocumentMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.mapper;

 

 import com.att.research.xacml.api.XACML3;

@@ -25,33 +25,33 @@
 

 public class DocumentMapper implements ObjectMapper {

 

-        private MapperRegistry mapperRegistry;

+    private MapperRegistry mapperRegistry;

 

-        private PepConfig pepConfig;

-        

-        @Override

-        public Class<?> getMappedClass() {

-                return Document.class;

-        }

+    private PepConfig pepConfig;

 

-        @Override

-        public void map(Object o, PepRequest pepRequest) {

-                Document d = (Document)o;

-                PepRequestAttributes resourceAttributes = pepRequest.getPepRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);

-                resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-id", d.getDocumentId());

-                resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-type", "Document");

-                resourceAttributes.addAttribute("jpmc:document:document-name", d.getDocumentName());

-                resourceAttributes.addAttribute("jpmc:document:client-name", d.getClientName());

-                resourceAttributes.addAttribute("jpmc:document:document-owner", d.getDocumentOwner());

-        }

+    @Override

+    public Class<?> getMappedClass() {

+        return Document.class;

+    }

 

-        @Override

-        public void setMapperRegistry(MapperRegistry mapperRegistry) {

-                this.mapperRegistry = mapperRegistry;

-        }

+    @Override

+    public void map(Object o, PepRequest pepRequest) {

+        Document d = (Document)o;

+        PepRequestAttributes resourceAttributes = pepRequest.getPepRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);

+        resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-id", d.getDocumentId());

+        resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-type", "Document");

+        resourceAttributes.addAttribute("jpmc:document:document-name", d.getDocumentName());

+        resourceAttributes.addAttribute("jpmc:document:client-name", d.getClientName());

+        resourceAttributes.addAttribute("jpmc:document:document-owner", d.getDocumentOwner());

+    }

 

-        @Override

-        public void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    @Override

+    public void setMapperRegistry(MapperRegistry mapperRegistry) {

+        this.mapperRegistry = mapperRegistry;

+    }

+

+    @Override

+    public void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 }
\ No newline at end of file
diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/MedicalRecord.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/MedicalRecord.java
index 34189ff..c904393 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/MedicalRecord.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/MedicalRecord.java
@@ -1,57 +1,57 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.mapper;

 

 import java.util.ArrayList;

 import java.util.List;

 

 public class MedicalRecord {

-        

-        private String id;

-        

-        private List<String> accessUserGroup;

-        

-        public MedicalRecord(String id){

-                this.id = id;

-                accessUserGroup = new ArrayList<String>();

-        }

 

-        public String getId() {

-                return id;

-        }

+    private String id;

 

-        public void setId(String id) {

-                this.id = id;

-        }

+    private List<String> accessUserGroup;

 

-        public List<String> getAccessUserGroup() {

-                return accessUserGroup;

-        }

+    public MedicalRecord(String id) {

+        this.id = id;

+        accessUserGroup = new ArrayList<String>();

+    }

 

-        public void setAccessUserGroup(List<String> accessUserGroup) {

-                this.accessUserGroup = accessUserGroup;

-        }

-        

-        public void addUserToAccessGroup(String user) {

-                this.accessUserGroup.add(user);

-        }

-        

+    public String getId() {

+        return id;

+    }

+

+    public void setId(String id) {

+        this.id = id;

+    }

+

+    public List<String> getAccessUserGroup() {

+        return accessUserGroup;

+    }

+

+    public void setAccessUserGroup(List<String> accessUserGroup) {

+        this.accessUserGroup = accessUserGroup;

+    }

+

+    public void addUserToAccessGroup(String user) {

+        this.accessUserGroup.add(user);

+    }

+

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/MedicalRecordMapper.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/MedicalRecordMapper.java
index dad27d7..91d42b7 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/MedicalRecordMapper.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/mapper/MedicalRecordMapper.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.mapper;

 

 import com.att.research.xacml.api.XACML3;

@@ -25,32 +25,32 @@
 

 public class MedicalRecordMapper implements ObjectMapper {

 

-        private MapperRegistry mapperRegistry;

+    private MapperRegistry mapperRegistry;

 

-        private PepConfig pepConfig;

+    private PepConfig pepConfig;

 

-        @Override

-        public Class<?> getMappedClass() {

-                return MedicalRecord.class;

-        }

+    @Override

+    public Class<?> getMappedClass() {

+        return MedicalRecord.class;

+    }

 

-        @Override

-        public void map(Object o, PepRequest pepRequest) {

-                MedicalRecord md = (MedicalRecord) o;

-                PepRequestAttributes resourceAttributes = pepRequest.getPepRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);

-                resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-type", "PatientMedicalRecord");

-                resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-id", md.getId());

-                for(String accessUser: md.getAccessUserGroup()) {

-                        resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-access-group", accessUser);

-                }

+    @Override

+    public void map(Object o, PepRequest pepRequest) {

+        MedicalRecord md = (MedicalRecord) o;

+        PepRequestAttributes resourceAttributes = pepRequest.getPepRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);

+        resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-type", "PatientMedicalRecord");

+        resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-id", md.getId());

+        for(String accessUser: md.getAccessUserGroup()) {

+            resourceAttributes.addAttribute("urn:oasis:names:tc:xacml:1.0:resource:resource-access-group", accessUser);

         }

-        @Override

-        public void setMapperRegistry(MapperRegistry mapperRegistry) {

-                this.mapperRegistry = mapperRegistry;

-        }

+    }

+    @Override

+    public void setMapperRegistry(MapperRegistry mapperRegistry) {

+        this.mapperRegistry = mapperRegistry;

+    }

 

-        @Override

-        public void setPepConfig(PepConfig pepConfig) {

-                this.pepConfig = pepConfig;

-        }

+    @Override

+    public void setPepConfig(PepConfig pepConfig) {

+        this.pepConfig = pepConfig;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AccessRestrictionObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AccessRestrictionObligationHandler.java
index 9fb46ab..497d89b 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AccessRestrictionObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AccessRestrictionObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -33,44 +33,44 @@
 

 

 public class AccessRestrictionObligationHandler implements ObligationHandler {

-        

-        private static Log log = LogFactory.getLog(AccessRestrictionObligationHandler.class);

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> accessOblgSet = obligationStore.getHandlerObligations(this.getClass());

-                Assert.assertEquals(true, accessOblgSet.size() == 1);

-                for(Obligation oblg: accessOblgSet) {

-                        Map<String, Object[]> attributeMap = oblg.getAttributeMap();

-                        Assert.assertNotNull(attributeMap);

-                        for(Entry<String, Object[]> e: attributeMap.entrySet()){

-                                if(e.getKey().equals("urn:oasis:names:tc:xacml:1.0:subject:subject-id")){

-                                        Assert.assertNotNull(e.getValue());

-                                }

-                                if(e.getKey().equals("urn:oasis:names:tc:xacml:1.0:resource:resource-access-group")){

-                                        Object[] values = e.getValue();

-                                        Assert.assertNotNull(values);

-                                        Assert.assertEquals(3, values.length);

-                                }

-                        }

-                }

-                Obligation accessGroupOblg = obligationStore.getHandlerObligationById(

-                                this.getClass(),

-                                "urn:oasis:names:tc:xacml:2.0:obligation:access-restriction");

-                Assert.assertNotNull(accessGroupOblg);

-                log.info(accessGroupOblg.getId());

-        }

-        

-        @Override

-        public boolean match(Obligation obligation) {

-                return obligation.getId().

-                                equals("urn:oasis:names:tc:xacml:2.0:obligation:access-restriction");

-        }

 

-        @Override

-        public void setObligationStore(ObligationStore oStore) {

-                this.obligationStore = oStore;

+    private static Log log = LogFactory.getLog(AccessRestrictionObligationHandler.class);

+

+    private ObligationStore obligationStore;

+

+    public void enforce() {

+        Set<Obligation> accessOblgSet = obligationStore.getHandlerObligations(this.getClass());

+        Assert.assertEquals(true, accessOblgSet.size() == 1);

+        for(Obligation oblg: accessOblgSet) {

+            Map<String, Object[]> attributeMap = oblg.getAttributeMap();

+            Assert.assertNotNull(attributeMap);

+            for(Entry<String, Object[]> e: attributeMap.entrySet()) {

+                if(e.getKey().equals("urn:oasis:names:tc:xacml:1.0:subject:subject-id")) {

+                    Assert.assertNotNull(e.getValue());

+                }

+                if(e.getKey().equals("urn:oasis:names:tc:xacml:1.0:resource:resource-access-group")) {

+                    Object[] values = e.getValue();

+                    Assert.assertNotNull(values);

+                    Assert.assertEquals(3, values.length);

+                }

+            }

         }

+        Obligation accessGroupOblg = obligationStore.getHandlerObligationById(

+                                         this.getClass(),

+                                         "urn:oasis:names:tc:xacml:2.0:obligation:access-restriction");

+        Assert.assertNotNull(accessGroupOblg);

+        log.info(accessGroupOblg.getId());

+    }

+

+    @Override

+    public boolean match(Obligation obligation) {

+        return obligation.getId().

+               equals("urn:oasis:names:tc:xacml:2.0:obligation:access-restriction");

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore oStore) {

+        this.obligationStore = oStore;

+    }

 

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AgeRestrictionObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AgeRestrictionObligationHandler.java
index 6034918..650fce9 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AgeRestrictionObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AgeRestrictionObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -32,41 +32,41 @@
 import java.util.Set;

 

 public class AgeRestrictionObligationHandler implements ObligationHandler, HasResult {

-        

-        private static Log log = LogFactory.getLog(AgeRestrictionObligationHandler.class);

-        

-        private ObligationStore obligationStore;

-        

-        public String enforce() {

-                Set<Obligation> ageOblgSet = obligationStore.getHandlerObligations(this.getClass());

-                Assert.assertEquals(true, ageOblgSet.size() == 1);

-                Obligation ageOblg = obligationStore.getHandlerObligationById(this.getClass(),

-                                "urn:oasis:names:tc:xacml:2.0:obligation:age-restriction");

-                Assert.assertNotNull(ageOblg);

-                String value = null;

-                log.info(ageOblg.getId());

-                //Enforcement Logic

-                Map<String, Object[]> attributeMap = ageOblg.getAttributeMap();

-                Object[] values = attributeMap.get("urn:oasis:names:tc:xacml:1.0:subject:age");

-                if(values != null) {

-                        value = (String)values[0];

-                }

-                return value;

-        }

 

-        @Override

-        public boolean match(Obligation obligation) {

-                return obligation.getId().

-                                equals("urn:oasis:names:tc:xacml:2.0:obligation:age-restriction");

-        }

+    private static Log log = LogFactory.getLog(AgeRestrictionObligationHandler.class);

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

-        }

+    private ObligationStore obligationStore;

 

-        @Override

-        public String getResult() {

-                return enforce();

+    public String enforce() {

+        Set<Obligation> ageOblgSet = obligationStore.getHandlerObligations(this.getClass());

+        Assert.assertEquals(true, ageOblgSet.size() == 1);

+        Obligation ageOblg = obligationStore.getHandlerObligationById(this.getClass(),

+                             "urn:oasis:names:tc:xacml:2.0:obligation:age-restriction");

+        Assert.assertNotNull(ageOblg);

+        String value = null;

+        log.info(ageOblg.getId());

+        //Enforcement Logic

+        Map<String, Object[]> attributeMap = ageOblg.getAttributeMap();

+        Object[] values = attributeMap.get("urn:oasis:names:tc:xacml:1.0:subject:age");

+        if(values != null) {

+            value = (String)values[0];

         }

+        return value;

+    }

+

+    @Override

+    public boolean match(Obligation obligation) {

+        return obligation.getId().

+               equals("urn:oasis:names:tc:xacml:2.0:obligation:age-restriction");

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

+

+    @Override

+    public String getResult() {

+        return enforce();

+    }

 }
\ No newline at end of file
diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAccessRestrictionObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAccessRestrictionObligationHandler.java
index f9bbaed..fe46c0d 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAccessRestrictionObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAccessRestrictionObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -32,33 +32,33 @@
 

 @MatchAnyObligation("urn:oasis:names:tc:xacml:2.0:obligation:access-restriction")

 public class AnnotatedAccessRestrictionObligationHandler implements ObligationStoreAware {

-        

-        private static Log log = LogFactory.getLog(AnnotatedAccessRestrictionObligationHandler.class);

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Obligation accessGroupOblg = obligationStore.getHandlerObligationById(

-                                this.getClass(),

-                                "urn:oasis:names:tc:xacml:2.0:obligation:access-restriction");

-                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:access-restriction", 

-                                accessGroupOblg.getId());

-                log.info(accessGroupOblg.getId());

-                for(Entry<String, Object[]> e: accessGroupOblg.getAttributeMap().entrySet()){

-                        if(e.getKey().equals("urn:oasis:names:tc:xacml:1.0:subject:subject-id")){

-                                Assert.assertNotNull(e.getValue());

-                        }

-                        if(e.getKey().equals("urn:oasis:names:tc:xacml:1.0:resource:resource-access-group")){

-                                Object[] values = e.getValue();

-                                Assert.assertNotNull(values);

-                                Assert.assertEquals(3, values.length);

-                        }

-                }

-                //Enforcement Logic

-        }

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

+    private static Log log = LogFactory.getLog(AnnotatedAccessRestrictionObligationHandler.class);

+

+    private ObligationStore obligationStore;

+

+    public void enforce() {

+        Obligation accessGroupOblg = obligationStore.getHandlerObligationById(

+                                         this.getClass(),

+                                         "urn:oasis:names:tc:xacml:2.0:obligation:access-restriction");

+        Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:access-restriction",

+                            accessGroupOblg.getId());

+        log.info(accessGroupOblg.getId());

+        for(Entry<String, Object[]> e: accessGroupOblg.getAttributeMap().entrySet()) {

+            if(e.getKey().equals("urn:oasis:names:tc:xacml:1.0:subject:subject-id")) {

+                Assert.assertNotNull(e.getValue());

+            }

+            if(e.getKey().equals("urn:oasis:names:tc:xacml:1.0:resource:resource-access-group")) {

+                Object[] values = e.getValue();

+                Assert.assertNotNull(values);

+                Assert.assertEquals(3, values.length);

+            }

         }

+        //Enforcement Logic

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAgeRestrictionObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAgeRestrictionObligationHandler.java
index b144e69..7dfc211 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAgeRestrictionObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAgeRestrictionObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -33,34 +33,34 @@
 

 @MatchAnyObligation("urn:oasis:names:tc:xacml:2.0:obligation:age-restriction")

 public class AnnotatedAgeRestrictionObligationHandler implements ObligationStoreAware, HasResult {

-        

-        private static Log log = LogFactory.getLog(AnnotatedAgeRestrictionObligationHandler.class);

-        

-        private ObligationStore obligationStore;

-        

-        public String enforce() {

-                Obligation ageOblg = obligationStore.getHandlerObligationById(

-                                this.getClass(),

-                                "urn:oasis:names:tc:xacml:2.0:obligation:age-restriction");

-                String value = null;

-                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:age-restriction", ageOblg.getId());

-                log.info(ageOblg.getId());

-                //Enforcement Logic

-                Map<String, Object[]> attributeMap = ageOblg.getAttributeMap();

-                Object[] values = attributeMap.get("urn:oasis:names:tc:xacml:1.0:subject:age");

-                if(values != null) {

-                        value = (String)values[0];

-                }

-                return value;

-        }

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

-        }

+    private static Log log = LogFactory.getLog(AnnotatedAgeRestrictionObligationHandler.class);

 

-        @Override

-        public String getResult() {

-                return enforce();

+    private ObligationStore obligationStore;

+

+    public String enforce() {

+        Obligation ageOblg = obligationStore.getHandlerObligationById(

+                                 this.getClass(),

+                                 "urn:oasis:names:tc:xacml:2.0:obligation:age-restriction");

+        String value = null;

+        Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:age-restriction", ageOblg.getId());

+        log.info(ageOblg.getId());

+        //Enforcement Logic

+        Map<String, Object[]> attributeMap = ageOblg.getAttributeMap();

+        Object[] values = attributeMap.get("urn:oasis:names:tc:xacml:1.0:subject:age");

+        if(values != null) {

+            value = (String)values[0];

         }

+        return value;

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

+

+    @Override

+    public String getResult() {

+        return enforce();

+    }

 }
\ No newline at end of file
diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAuditObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAuditObligationHandler.java
index 28fde57..72e3a1f 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAuditObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedAuditObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -32,25 +32,25 @@
 

 @MatchAnyObligation("urn:oasis:names:tc:xacml:2.0:obligation:audit")

 public class AnnotatedAuditObligationHandler implements ObligationStoreAware {

-        

-        private static Log log = LogFactory.getLog(AnnotatedAuditObligationHandler.class);

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

-                if(obligationSet.size() == 1) {

-                        for(Obligation obligation: obligationSet) {

-                                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:audit", obligation.getId());

-                                log.info(obligation.getId());

-                        }

-                }else {

-                        Assert.assertFalse(true);

-                }

-        }

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

+    private static Log log = LogFactory.getLog(AnnotatedAuditObligationHandler.class);

+

+    private ObligationStore obligationStore;

+

+    public void enforce() {

+        Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

+        if(obligationSet.size() == 1) {

+            for(Obligation obligation: obligationSet) {

+                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:audit", obligation.getId());

+                log.info(obligation.getId());

+            }

+        } else {

+            Assert.assertFalse(true);

         }

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedCatchAllObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedCatchAllObligationHandler.java
index 99d406d..a1fea2f 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedCatchAllObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedCatchAllObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -31,26 +31,26 @@
 

 @MatchAnyObligation

 public class AnnotatedCatchAllObligationHandler implements ObligationStoreAware {

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

-                if(obligationSet.size() == 2) {

-                        Set<String> obligationIds = new HashSet<String>();

-                        for(Obligation oblg: obligationSet){

-                                obligationIds.add(oblg.getId());

-                        }

-                        Assert.assertTrue(obligationIds.contains("urn:oasis:names:tc:xacml:2.0:obligation:obligation-1"));

-                        Assert.assertTrue(obligationIds.contains("urn:oasis:names:tc:xacml:2.0:obligation:obligation-2"));

-                }else {

-                        Assert.assertFalse(true);

-                }

-                

+

+    private ObligationStore obligationStore;

+

+    public void enforce() {

+        Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

+        if(obligationSet.size() == 2) {

+            Set<String> obligationIds = new HashSet<String>();

+            for(Obligation oblg: obligationSet) {

+                obligationIds.add(oblg.getId());

+            }

+            Assert.assertTrue(obligationIds.contains("urn:oasis:names:tc:xacml:2.0:obligation:obligation-1"));

+            Assert.assertTrue(obligationIds.contains("urn:oasis:names:tc:xacml:2.0:obligation:obligation-2"));

+        } else {

+            Assert.assertFalse(true);

         }

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

-        }

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedFilteringObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedFilteringObligationHandler.java
index 62aea09..ebd6e95 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedFilteringObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedFilteringObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -30,27 +30,27 @@
 import java.util.Set;

 

 @MatchAllObligationAttributes({

-                @Attribute(id="jpmc:obligation:obligation-type", anyValue="Filtering"),

-                @Attribute(id="urn:oasis:names:tc:xacml:1.0:subject:subject-id")

+    @Attribute(id="jpmc:obligation:obligation-type", anyValue="Filtering"),

+    @Attribute(id="urn:oasis:names:tc:xacml:1.0:subject:subject-id")

 })

 public class AnnotatedFilteringObligationHandler implements ObligationStoreAware {

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

-                if(obligationSet.size() == 1) {

-                        for(Obligation obligation: obligationSet) {

-                                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:obligation-1", 

-                                                obligation.getId());

-                        }

-                }else {

-                        Assert.assertFalse(true);

-                }

-        }

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

+    private ObligationStore obligationStore;

+

+    public void enforce() {

+        Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

+        if(obligationSet.size() == 1) {

+            for(Obligation obligation: obligationSet) {

+                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:obligation-1",

+                                    obligation.getId());

+            }

+        } else {

+            Assert.assertFalse(true);

         }

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedObligationHandler.java
index e559f76..5c96ae8 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedObligationHandler.java
@@ -6,34 +6,34 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi.std.test.obligation;

-

-import org.openliberty.openaz.pepapi.Attribute;

-import org.openliberty.openaz.pepapi.MatchAllObligationAttributes;

-import org.openliberty.openaz.pepapi.MatchAnyObligation;

-

-@MatchAnyObligation({"jpmc:obligation:one","jpmc:obligation:two","jpmc:obligation:three"})

-@MatchAllObligationAttributes({

-        @Attribute(id="jpmc:obligation:obligation-type", anyValue={"FILTERING","REDACTION"}),

-        @Attribute(id="jpmc:resource:attribute:resource-type", anyValue={"Card"}),

-        @Attribute(id="jpmc:obligation:attribute:attribute-1")

-})

-public class AnnotatedObligationHandler {

-        

-        public void enforce() {

-                

-        }

-        

-}

+package org.openliberty.openaz.pepapi.std.test.obligation;
+
+import org.openliberty.openaz.pepapi.Attribute;
+import org.openliberty.openaz.pepapi.MatchAllObligationAttributes;
+import org.openliberty.openaz.pepapi.MatchAnyObligation;
+
+@MatchAnyObligation({"jpmc:obligation:one","jpmc:obligation:two","jpmc:obligation:three"})
+@MatchAllObligationAttributes({
+    @Attribute(id="jpmc:obligation:obligation-type", anyValue={"FILTERING","REDACTION"}),
+    @Attribute(id="jpmc:resource:attribute:resource-type", anyValue={"Card"}),
+    @Attribute(id="jpmc:obligation:attribute:attribute-1")
+})
+public class AnnotatedObligationHandler {
+
+    public void enforce() {
+
+    }
+
+}
diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedRedactionObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedRedactionObligationHandler.java
index dc07dde..e6a49d8 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedRedactionObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AnnotatedRedactionObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -30,26 +30,26 @@
 import java.util.Set;

 

 @MatchAllObligationAttributes(

-                @Attribute(id="urn:oasis:names:tc:xacml:1.0:subject:age")

+    @Attribute(id="urn:oasis:names:tc:xacml:1.0:subject:age")

 )

 public class AnnotatedRedactionObligationHandler implements ObligationStoreAware {

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

-                if(obligationSet.size() == 1) {

-                        for(Obligation obligation: obligationSet) {

-                                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:obligation-2", 

-                                                obligation.getId());

-                        }

-                }else {

-                        Assert.assertFalse(true);

-                }

-        }

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

+    private ObligationStore obligationStore;

+

+    public void enforce() {

+        Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

+        if(obligationSet.size() == 1) {

+            for(Obligation obligation: obligationSet) {

+                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:obligation-2",

+                                    obligation.getId());

+            }

+        } else {

+            Assert.assertFalse(true);

         }

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AuditObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AuditObligationHandler.java
index 0da3de6..702e5af 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AuditObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/AuditObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -30,28 +30,28 @@
 import java.util.Set;

 

 public class AuditObligationHandler implements ObligationHandler {

-        

-        private static Log log = LogFactory.getLog(AuditObligationHandler.class);

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> auditOblgSet = obligationStore.getHandlerObligations(this.getClass());

-                Assert.assertEquals(true, auditOblgSet.size() == 1);

-                Obligation auditOblg = obligationStore.getHandlerObligationById(

-                                this.getClass(),

-                                "urn:oasis:names:tc:xacml:2.0:obligation:audit");

-                Assert.assertNotNull(auditOblg);

-                log.info(auditOblg.getId());

-        }

 

-        @Override

-        public boolean match(Obligation t) {

-                return t.getId().equals("urn:oasis:names:tc:xacml:2.0:obligation:audit");

-        }

+    private static Log log = LogFactory.getLog(AuditObligationHandler.class);

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

-        }

+    private ObligationStore obligationStore;

+

+    public void enforce() {

+        Set<Obligation> auditOblgSet = obligationStore.getHandlerObligations(this.getClass());

+        Assert.assertEquals(true, auditOblgSet.size() == 1);

+        Obligation auditOblg = obligationStore.getHandlerObligationById(

+                                   this.getClass(),

+                                   "urn:oasis:names:tc:xacml:2.0:obligation:audit");

+        Assert.assertNotNull(auditOblg);

+        log.info(auditOblg.getId());

+    }

+

+    @Override

+    public boolean match(Obligation t) {

+        return t.getId().equals("urn:oasis:names:tc:xacml:2.0:obligation:audit");

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/CatchAllObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/CatchAllObligationHandler.java
index d71c6de..c1eabd4 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/CatchAllObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/CatchAllObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -30,32 +30,32 @@
 

 

 public class CatchAllObligationHandler implements ObligationHandler {

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

-                if(obligationSet.size() == 2) {

-                        Set<String> obligationIds = new HashSet<String>();

-                        for(Obligation oblg: obligationSet){

-                                obligationIds.add(oblg.getId());

-                        }

-                        Assert.assertTrue(obligationIds.contains("urn:oasis:names:tc:xacml:2.0:obligation:obligation-1"));

-                        Assert.assertTrue(obligationIds.contains("urn:oasis:names:tc:xacml:2.0:obligation:obligation-2"));

-                }else {

-                        Assert.assertFalse(true);

-                }

-                

+

+    private ObligationStore obligationStore;

+

+    public void enforce() {

+        Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

+        if(obligationSet.size() == 2) {

+            Set<String> obligationIds = new HashSet<String>();

+            for(Obligation oblg: obligationSet) {

+                obligationIds.add(oblg.getId());

+            }

+            Assert.assertTrue(obligationIds.contains("urn:oasis:names:tc:xacml:2.0:obligation:obligation-1"));

+            Assert.assertTrue(obligationIds.contains("urn:oasis:names:tc:xacml:2.0:obligation:obligation-2"));

+        } else {

+            Assert.assertFalse(true);

         }

 

-        @Override

-        public boolean match(Obligation obligation) {

-                return true;

-        }

+    }

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

-        }

+    @Override

+    public boolean match(Obligation obligation) {

+        return true;

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/FilteringObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/FilteringObligationHandler.java
index 49467f7..3bf2a03 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/FilteringObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/FilteringObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -29,37 +29,37 @@
 import java.util.Set;

 

 public class FilteringObligationHandler implements ObligationHandler {

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

-                if(obligationSet.size() == 1) {

-                        for(Obligation obligation: obligationSet) {

-                                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:obligation-1", 

-                                                obligation.getId());

-                        }

-                }else {

-                        Assert.assertFalse(true);

-                }

-        }

 

-        @Override

-        public boolean match(Obligation obligation) {

-                Map<String, Object[]> map = obligation.getAttributeMap();

-                if(map.containsKey("jpmc:obligation:obligation-type")) {

-                        Object[] values = map.get("jpmc:obligation:obligation-type");

-                        if(values != null && values.length != 0) {

-                                for(Object value: values) {

-                                        return value.equals("Filtering");

-                                }

-                        }

-                }

-                return false;

-        }

+    private ObligationStore obligationStore;

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

+    public void enforce() {

+        Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

+        if(obligationSet.size() == 1) {

+            for(Obligation obligation: obligationSet) {

+                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:obligation-1",

+                                    obligation.getId());

+            }

+        } else {

+            Assert.assertFalse(true);

         }

+    }

+

+    @Override

+    public boolean match(Obligation obligation) {

+        Map<String, Object[]> map = obligation.getAttributeMap();

+        if(map.containsKey("jpmc:obligation:obligation-type")) {

+            Object[] values = map.get("jpmc:obligation:obligation-type");

+            if(values != null && values.length != 0) {

+                for(Object value: values) {

+                    return value.equals("Filtering");

+                }

+            }

+        }

+        return false;

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/RedactionObligationHandler.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/RedactionObligationHandler.java
index 9fda498..4ea6e43 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/RedactionObligationHandler.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/obligation/RedactionObligationHandler.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.obligation;

 

 import junit.framework.Assert;

@@ -29,29 +29,29 @@
 import java.util.Set;

 

 public class RedactionObligationHandler implements ObligationHandler {

-        

-        private ObligationStore obligationStore;

-        

-        public void enforce() {

-                Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

-                if(obligationSet.size() == 1) {

-                        for(Obligation obligation: obligationSet) {

-                                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:obligation-2", 

-                                                obligation.getId());

-                        }

-                }else {

-                        Assert.assertFalse(true);

-                }

-        }

 

-        @Override

-        public boolean match(Obligation obligation) {

-                Map<String, Object[]> map = obligation.getAttributeMap();

-                return map.containsKey("urn:oasis:names:tc:xacml:1.0:subject:age");

-        }

+    private ObligationStore obligationStore;

 

-        @Override

-        public void setObligationStore(ObligationStore obligationStore) {

-                this.obligationStore = obligationStore;

+    public void enforce() {

+        Set<Obligation> obligationSet = obligationStore.getHandlerObligations(this.getClass());

+        if(obligationSet.size() == 1) {

+            for(Obligation obligation: obligationSet) {

+                Assert.assertEquals("urn:oasis:names:tc:xacml:2.0:obligation:obligation-2",

+                                    obligation.getId());

+            }

+        } else {

+            Assert.assertFalse(true);

         }

+    }

+

+    @Override

+    public boolean match(Obligation obligation) {

+        Map<String, Object[]> map = obligation.getAttributeMap();

+        return map.containsKey("urn:oasis:names:tc:xacml:1.0:subject:age");

+    }

+

+    @Override

+    public void setObligationStore(ObligationStore obligationStore) {

+        this.obligationStore = obligationStore;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/util/AzInvoker.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/util/AzInvoker.java
index 7c33312..f46b870 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/util/AzInvoker.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/util/AzInvoker.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 org.openliberty.openaz.pepapi.std.test.util;

 

 import org.openliberty.openaz.pepapi.PepAgent;

@@ -27,47 +27,47 @@
 

 

 public class AzInvoker implements Callable<String> {

-        

-        private final PepAgent pepAgent;

-        

-        private final Object subject;

-        

-        private final Object action;

-        

-        private final Object resource;

-        

-        private final long sleepDuration;

-        

-        private final HasResult handler;

-        

-        public AzInvoker(PepAgent pepAgent, Object subject, Object action,

-                        Object resource, HasResult handler, long sleepDuration) {

-                this.pepAgent = pepAgent;

-                this.subject = subject;

-                this.action = action;

-                this.resource = resource;

-                this.handler = handler;

-                this.sleepDuration = sleepDuration;

-        }

-        

-        private String invoke()throws InterruptedException{

-                PepResponse response = pepAgent.decide(subject, action, resource);

-                if(response != null){

-                        response.allowed();

-                }

-                Thread.sleep(this.sleepDuration);

-                return handler.getResult();

-        }

-        

-        public String call() throws Exception {

-                return invoke();

-        }

 

-        public long getSleepDuration() {

-                return sleepDuration;

-        }

+    private final PepAgent pepAgent;

 

-        public HasResult getPep() {

-                return handler;

+    private final Object subject;

+

+    private final Object action;

+

+    private final Object resource;

+

+    private final long sleepDuration;

+

+    private final HasResult handler;

+

+    public AzInvoker(PepAgent pepAgent, Object subject, Object action,

+                     Object resource, HasResult handler, long sleepDuration) {

+        this.pepAgent = pepAgent;

+        this.subject = subject;

+        this.action = action;

+        this.resource = resource;

+        this.handler = handler;

+        this.sleepDuration = sleepDuration;

+    }

+

+    private String invoke()throws InterruptedException {

+        PepResponse response = pepAgent.decide(subject, action, resource);

+        if(response != null) {

+            response.allowed();

         }

+        Thread.sleep(this.sleepDuration);

+        return handler.getResult();

+    }

+

+    public String call() throws Exception {

+        return invoke();

+    }

+

+    public long getSleepDuration() {

+        return sleepDuration;

+    }

+

+    public HasResult getPep() {

+        return handler;

+    }

 }

diff --git a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/util/HasResult.java b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/util/HasResult.java
index 440cb9d..ec105b7 100644
--- a/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/util/HasResult.java
+++ b/openaz-pep/src/test/java/org/openliberty/openaz/pepapi/std/test/util/HasResult.java
@@ -6,22 +6,22 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
-package org.openliberty.openaz.pepapi.std.test.util;

-

-public interface HasResult {

-        

-        public String getResult();

-        

-}

+package org.openliberty.openaz.pepapi.std.test.util;
+
+public interface HasResult {
+
+    public String getResult();
+
+}
diff --git a/openaz-xacml-pap-rest/src/main/java/com/att/research/xacml/rest/XACMLPapServlet.java b/openaz-xacml-pap-rest/src/main/java/com/att/research/xacml/rest/XACMLPapServlet.java
index 9ce63a9..8d900a8 100644
--- a/openaz-xacml-pap-rest/src/main/java/com/att/research/xacml/rest/XACMLPapServlet.java
+++ b/openaz-xacml-pap-rest/src/main/java/com/att/research/xacml/rest/XACMLPapServlet.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -61,56 +61,56 @@
 
 /**
  * Servlet implementation class XacmlPapServlet
- * 
- * 
+ *
+ *
  * @author pameladragosh
  */
 @WebServlet(
-                description = "Implements the XACML PAP RESTful API.", 
-                urlPatterns = { "/" }, 
-                loadOnStartup=1,
-                initParams = {
-                                @WebInitParam(name = "XACML_PROPERTIES_NAME", value = "xacml.pap.properties", description = "The location of the properties file holding configuration information.")
-                })
+    description = "Implements the XACML PAP RESTful API.",
+    urlPatterns = { "/" },
+    loadOnStartup=1,
+initParams = {
+    @WebInitParam(name = "XACML_PROPERTIES_NAME", value = "xacml.pap.properties", description = "The location of the properties file holding configuration information.")
+})
 
 public class XACMLPapServlet extends HttpServlet implements StdItemSetChangeListener, Runnable {
-        private static final long serialVersionUID = 1L;
-        private static final Log logger	= LogFactory.getLog(XACMLPapServlet.class);
-        
-        /*
-         * 
-         * papEngine - This is our engine workhorse that manages the PDP Groups and Nodes.
-         */
-        private PAPEngine papEngine = null;
-        
-        /*
-         * This PAP instance's own URL.
-         * 
-         * Need this when creating URLs to send to the PDPs so they can GET the Policy files from this process. 
-         */
-        private static String papURL = null;
-        
-        /*
-         * List of Admin Console URLs.
-         * Used to send notifications when configuration changes.
-         * 
-         * The CopyOnWriteArrayList *should* protect from concurrency errors.
-         * This list is seldom changed but often read, so the costs of this approach make sense.
-         */
-        private static final CopyOnWriteArrayList<String> adminConsoleURLStringList = new CopyOnWriteArrayList<String>();
-        
-        /*
-         * This thread may be invoked upon startup to initiate sending PDP policy/pip configuration when
-         * this servlet starts. Its configurable by the admin.
-         */
-        private Thread initiateThread = null;
-        
-        /*
-        // The heartbeat thread.
-        */
-        private static Heartbeat heartbeat = null;
-        private static Thread heartbeatThread = null;
-        
+    private static final long serialVersionUID = 1L;
+    private static final Log logger	= LogFactory.getLog(XACMLPapServlet.class);
+
+    /*
+     *
+     * papEngine - This is our engine workhorse that manages the PDP Groups and Nodes.
+     */
+    private PAPEngine papEngine = null;
+
+    /*
+     * This PAP instance's own URL.
+     *
+     * Need this when creating URLs to send to the PDPs so they can GET the Policy files from this process.
+     */
+    private static String papURL = null;
+
+    /*
+     * List of Admin Console URLs.
+     * Used to send notifications when configuration changes.
+     *
+     * The CopyOnWriteArrayList *should* protect from concurrency errors.
+     * This list is seldom changed but often read, so the costs of this approach make sense.
+     */
+    private static final CopyOnWriteArrayList<String> adminConsoleURLStringList = new CopyOnWriteArrayList<String>();
+
+    /*
+     * This thread may be invoked upon startup to initiate sending PDP policy/pip configuration when
+     * this servlet starts. Its configurable by the admin.
+     */
+    private Thread initiateThread = null;
+
+    /*
+    // The heartbeat thread.
+    */
+    private static Heartbeat heartbeat = null;
+    private static Thread heartbeatThread = null;
+
     /**
      * @see HttpServlet#HttpServlet()
      */
@@ -118,1265 +118,1392 @@
         super();
     }
 
-        /**
-         * @see Servlet#init(ServletConfig)
-         */
-        public void init(ServletConfig config) throws ServletException {
+    /**
+     * @see Servlet#init(ServletConfig)
+     */
+    public void init(ServletConfig config) throws ServletException {
+        try {
+            //
+            // Initialize
+            //
+            XACMLRest.xacmlInit(config);
+            //
+            // Load the properties
+            //
+            XACMLRest.loadXacmlProperties(null, null);
+            //
+            // Load our PAP engine, first create a factory
+            //
+            PAPEngineFactory factory = PAPEngineFactory.newInstance(XACMLProperties.getProperty(XACMLProperties.PROP_PAP_PAPENGINEFACTORY));
+            //
+            // The factory knows how to go about creating a PAP Engine
+            //
+            this.papEngine = factory.newEngine();
+            //
+            // we are about to call the PDPs and give them their configuration.
+            // To do that we need to have the URL of this PAP so we can construct the Policy file URLs
+            //
+            XACMLPapServlet.papURL = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL);
+            //
+            // Sanity check that a URL was defined somewhere, its essential.
+            //
+            // How to check that its valid? We can validate the form, but since we are in the init() method we
+            // are not fully loaded yet so we really couldn't ping ourself to see if the URL will work. One
+            // will have to look for errors in the PDP logs to determine if they are failing to initiate a
+            // request to this servlet.
+            //
+            if (XACMLPapServlet.papURL == null) {
+                throw new PAPException("The property " + XACMLRestProperties.PROP_PAP_URL + " is not valid: " + XACMLPapServlet.papURL);
+            }
+            //
+            // Configurable - have the PAP servlet initiate sending the latest PDP policy/pip configuration
+            // to all its known PDP nodes.
+            //
+            // Note: parseBoolean will return false if there is no property defined. This is fine for a default.
+            //
+            if (Boolean.parseBoolean(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_INITIATE_PDP_CONFIG))) {
+                this.initiateThread = new Thread(this);
+                this.initiateThread.start();
+            }
+            //
+            // After startup, the PAP does Heartbeats to each of the PDPs periodically
+            //
+            XACMLPapServlet.heartbeat = new Heartbeat(this.papEngine);
+            XACMLPapServlet.heartbeatThread = new Thread(XACMLPapServlet.heartbeat);
+            XACMLPapServlet.heartbeatThread.start();
+        } catch (FactoryException | PAPException e) {
+            logger.error("Failed to create engine", e);
+            throw new ServletException ("PAP not initialized; error: "+e);
+        } catch (Exception e) {
+            logger.error("Failed to create engine - unexpected error: ", e);
+            throw new ServletException ("PAP not initialized; unexpected error: "+e);
+        }
+    }
+
+    /**
+     * Thread used only during PAP startup to initiate change messages to all known PDPs.
+     * This must be on a separate thread so that any GET requests from the PDPs during this update can be serviced.
+     */
+    @Override
+    public void run() {
+        //
+        // send the current configuration to all the PDPs that we know about
+        //
+        changed();
+    }
+
+
+    /**
+     * @see Servlet#destroy()
+     *
+     * Depending on how this servlet is run, we may or may not care about cleaning up the resources.
+     * For now we assume that we do care.
+     */
+    public void destroy() {
+        //
+        // Make sure our threads are destroyed
+        //
+        if (XACMLPapServlet.heartbeatThread != null) {
+            //
+            // stop the heartbeat
+            //
+            try {
+                if (XACMLPapServlet.heartbeat != null) {
+                    XACMLPapServlet.heartbeat.terminate();
+                }
+                XACMLPapServlet.heartbeatThread.interrupt();
+                XACMLPapServlet.heartbeatThread.join();
+            } catch (InterruptedException e) {
+                logger.error(e);
+            }
+        }
+        if (this.initiateThread != null) {
+            try {
+                this.initiateThread.interrupt();
+                this.initiateThread.join();
+            } catch (InterruptedException e) {
+                logger.error(e);
+            }
+        }
+    }
+
+    /**
+     *
+     * Called by:
+     * 	- PDP nodes to register themselves with the PAP, and
+     * 	- Admin Console to make changes in the PDP Groups.
+     *
+     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        try {
+
+            XACMLRest.dumpRequest(request);
+
+            // since getParameter reads the content string, explicitly get the content before doing that.
+            // Simply getting the inputStream seems to protect it against being consumed by getParameter.
+            request.getInputStream();
+
+            //
+            // Is this from the Admin Console?
+            //
+            String groupId = request.getParameter("groupId");
+            if (groupId != null) {
+                //
+                // this is from the Admin Console, so handle separately
+                //
+                doACPost(request, response, groupId);
+                return;
+            }
+
+            //
+            //  Request is from a PDP.
+            //	It is coming up and asking for its config
+            //
+
+            //
+            // Get the PDP's ID
+            //
+            String id = this.getPDPID(request);
+            logger.info("doPost from: " + id);
+            //
+            // Get the PDP Object
+            //
+            PDP pdp = this.papEngine.getPDP(id);
+            //
+            // Is it known?
+            //
+            if (pdp == null) {
+                logger.info("Unknown PDP: " + id);
                 try {
-                        //
-                        // Initialize
-                        //
-                        XACMLRest.xacmlInit(config);
-                        //
-                        // Load the properties
-                        //
-                        XACMLRest.loadXacmlProperties(null, null);
-                        //
-                        // Load our PAP engine, first create a factory
-                        //
-                        PAPEngineFactory factory = PAPEngineFactory.newInstance(XACMLProperties.getProperty(XACMLProperties.PROP_PAP_PAPENGINEFACTORY));
-                        //
-                        // The factory knows how to go about creating a PAP Engine
-                        //
-                        this.papEngine = factory.newEngine();			
-                        //
-                        // we are about to call the PDPs and give them their configuration.
-                        // To do that we need to have the URL of this PAP so we can construct the Policy file URLs
-                        //
-                        XACMLPapServlet.papURL = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL);
-                        //
-                        // Sanity check that a URL was defined somewhere, its essential.
-                        //
-                        // How to check that its valid? We can validate the form, but since we are in the init() method we
-                        // are not fully loaded yet so we really couldn't ping ourself to see if the URL will work. One
-                        // will have to look for errors in the PDP logs to determine if they are failing to initiate a
-                        // request to this servlet.
-                        //
-                        if (XACMLPapServlet.papURL == null) {
-                                throw new PAPException("The property " + XACMLRestProperties.PROP_PAP_URL + " is not valid: " + XACMLPapServlet.papURL);
-                        }
-                        //
-                        // Configurable - have the PAP servlet initiate sending the latest PDP policy/pip configuration
-                        // to all its known PDP nodes.
-                        //
-                        // Note: parseBoolean will return false if there is no property defined. This is fine for a default.
-                        //
-                        if (Boolean.parseBoolean(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_INITIATE_PDP_CONFIG))) {
-                                this.initiateThread = new Thread(this);
-                                this.initiateThread.start();
-                        }
-                        //
-                        // After startup, the PAP does Heartbeats to each of the PDPs periodically
-                        //
-                        XACMLPapServlet.heartbeat = new Heartbeat(this.papEngine);
-                        XACMLPapServlet.heartbeatThread = new Thread(XACMLPapServlet.heartbeat);
-                        XACMLPapServlet.heartbeatThread.start();
-                } catch (FactoryException | PAPException e) {
-                        logger.error("Failed to create engine", e);
-                        throw new ServletException ("PAP not initialized; error: "+e);
-                } catch (Exception e) {
-                        logger.error("Failed to create engine - unexpected error: ", e);
-                        throw new ServletException ("PAP not initialized; unexpected error: "+e);		}
-        }
-
-        /**
-         * Thread used only during PAP startup to initiate change messages to all known PDPs.
-         * This must be on a separate thread so that any GET requests from the PDPs during this update can be serviced.
-         */
-        @Override
-        public void run() {
+                    this.papEngine.newPDP(id, this.papEngine.getDefaultGroup(), id, "Registered on first startup");
+                } catch (NullPointerException | PAPException e) {
+                    logger.error("Failed to create new PDP", e);
+                    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
+                    return;
+                }
+                // get the PDP we just created
+                pdp = this.papEngine.getPDP(id);
+                if (pdp == null) {
+                    String message = "Failed to create new PDP for id: " + id;
+                    logger.error(message);
+                    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
+                    return;
+                }
+            }
+            //
+            // Get the PDP's Group
+            //
+            PDPGroup group = this.papEngine.getPDPGroup(pdp);
+            if (group == null) {
+                response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "PDP not associated with any group, even the default");
+                return;
+            }
+            //
+            // Determine what group the PDP node is in and get
+            // its policy/pip properties.
+            //
+            Properties policies = group.getPolicyProperties();
+            Properties pipconfig = group.getPipConfigProperties();
+            //
+            // Get the current policy/pip configuration that the PDP has
+            //
+            Properties pdpProperties = new Properties();
+            pdpProperties.load(request.getInputStream());
+            logger.info("PDP Current Properties: " + pdpProperties.toString());
+            logger.info("Policies: " + (policies != null ? policies.toString() : "null"));
+            logger.info("Pip config: " + (pipconfig != null ? pipconfig.toString() : "null"));
+            //
+            // Validate the node's properties
+            //
+            boolean isCurrent = this.isPDPCurrent(policies, pipconfig, pdpProperties);
+            //
+            // Send back current configuration
+            //
+            if (isCurrent == false) {
                 //
-                // send the current configuration to all the PDPs that we know about
+                // Tell the PDP we are sending back the current policies/pip config
                 //
-                changed();
-        }
-        
-
-        /**
-         * @see Servlet#destroy()
-         * 
-         * Depending on how this servlet is run, we may or may not care about cleaning up the resources.
-         * For now we assume that we do care.
-         */
-        public void destroy() {
-                //
-                // Make sure our threads are destroyed
-                //
-                if (XACMLPapServlet.heartbeatThread != null) {
-                        //
-                        // stop the heartbeat
-                        //
-                        try {
-                                if (XACMLPapServlet.heartbeat != null) {
-                                        XACMLPapServlet.heartbeat.terminate();
-                                }
-                                XACMLPapServlet.heartbeatThread.interrupt();
-                                XACMLPapServlet.heartbeatThread.join();
-                        } catch (InterruptedException e) {
-                                logger.error(e);
-                        }
+                logger.info("PDP configuration NOT current.");
+                if (policies != null) {
+                    //
+                    // Put URL's into the properties in case the PDP needs to
+                    // retrieve them.
+                    //
+                    this.populatePolicyURL(request.getRequestURL(), policies);
+                    //
+                    // Copy the properties to the output stream
+                    //
+                    policies.store(response.getOutputStream(), "");
                 }
-                if (this.initiateThread != null) {
-                        try {
-                                this.initiateThread.interrupt();
-                                this.initiateThread.join();
-                        } catch (InterruptedException e) {
-                                logger.error(e);
-                        }
-                }
-        }
-        
-        /**
-         * 
-         * Called by:
-         * 	- PDP nodes to register themselves with the PAP, and
-         * 	- Admin Console to make changes in the PDP Groups.
-         * 
-         * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
-         */
-        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-                try {
-
-                        XACMLRest.dumpRequest(request);
-
-                        // since getParameter reads the content string, explicitly get the content before doing that.
-                        // Simply getting the inputStream seems to protect it against being consumed by getParameter.
-                        request.getInputStream();
-                        
-                        //
-                        // Is this from the Admin Console?
-                        //
-                        String groupId = request.getParameter("groupId");
-                        if (groupId != null) {
-                                //
-                                // this is from the Admin Console, so handle separately
-                                //
-                                doACPost(request, response, groupId);
-                                return;
-                        }
-                        
-                        //
-                        //  Request is from a PDP.
-                        //	It is coming up and asking for its config
-                        //
-                        
-                        //
-                        // Get the PDP's ID
-                        //
-                        String id = this.getPDPID(request);
-                        logger.info("doPost from: " + id);
-                        //
-                        // Get the PDP Object
-                        //
-                        PDP pdp = this.papEngine.getPDP(id);
-                        //
-                        // Is it known?
-                        //
-                        if (pdp == null) {
-                                logger.info("Unknown PDP: " + id);
-                                try {
-                                        this.papEngine.newPDP(id, this.papEngine.getDefaultGroup(), id, "Registered on first startup");
-                                } catch (NullPointerException | PAPException e) {
-                                        logger.error("Failed to create new PDP", e);
-                                        response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
-                                        return;
-                                }
-                                // get the PDP we just created
-                                pdp = this.papEngine.getPDP(id);
-                                if (pdp == null) {
-                                        String message = "Failed to create new PDP for id: " + id;
-                                        logger.error(message);
-                                        response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
-                                        return;
-                                }
-                        }
-                        //
-                        // Get the PDP's Group
-                        //
-                        PDPGroup group = this.papEngine.getPDPGroup(pdp);
-                        if (group == null) {
-                                response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "PDP not associated with any group, even the default");
-                                return;
-                        }
-                        //
-                        // Determine what group the PDP node is in and get
-                        // its policy/pip properties.
-                        //
-                        Properties policies = group.getPolicyProperties();
-                        Properties pipconfig = group.getPipConfigProperties();
-                        //
-                        // Get the current policy/pip configuration that the PDP has
-                        //
-                        Properties pdpProperties = new Properties();
-                        pdpProperties.load(request.getInputStream());
-                        logger.info("PDP Current Properties: " + pdpProperties.toString());
-                        logger.info("Policies: " + (policies != null ? policies.toString() : "null"));
-                        logger.info("Pip config: " + (pipconfig != null ? pipconfig.toString() : "null"));
-                        //
-                        // Validate the node's properties
-                        //
-                        boolean isCurrent = this.isPDPCurrent(policies, pipconfig, pdpProperties);
-                        //
-                        // Send back current configuration
-                        //
-                        if (isCurrent == false) {
-                                //
-                                // Tell the PDP we are sending back the current policies/pip config
-                                //
-                                logger.info("PDP configuration NOT current.");
-                                if (policies != null) {
-                                        //
-                                        // Put URL's into the properties in case the PDP needs to
-                                        // retrieve them.
-                                        //
-                                        this.populatePolicyURL(request.getRequestURL(), policies);
-                                        //
-                                        // Copy the properties to the output stream
-                                        //
-                                        policies.store(response.getOutputStream(), "");
-                                }
-                                if (pipconfig != null) {
-                                        //
-                                        // Copy the properties to the output stream
-                                        //
-                                        pipconfig.store(response.getOutputStream(), "");
-                                }
-                                //
-                                // We are good - and we are sending them information
-                                //
-                                response.setStatus(HttpServletResponse.SC_OK);
-//TODO - Correct?				
-                                setPDPSummaryStatus(pdp, PDPStatus.Status.OUT_OF_SYNCH);
-                        } else {
-                                //
-                                // Tell them they are good
-                                //
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                
- //TODO - Correct?
-                                setPDPSummaryStatus(pdp, PDPStatus.Status.UP_TO_DATE);
-
-                        }
-                        //
-                        // tell the AC that something changed
-                        //
-                        notifyAC();
-                } catch (PAPException e) {
-                        logger.debug("POST exception: " + e, e);
-                        response.sendError(500, e.getMessage());
-                        return;
-                }
-        }
-
-        
-        /**
-         * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
-         */
-        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-                try {
-                        XACMLRest.dumpRequest(request);
-                        
-                        // Is this from the Admin Console?
-                        String groupId = request.getParameter("groupId");
-                        if (groupId != null) {
-                                // this is from the Admin Console, so handle separately
-                                doACGet(request, response, groupId);
-                                return;
-                        }
-                        //
-                        // Get the PDP's ID
-                        //
-                        String id = this.getPDPID(request);
-                        logger.info("doGet from: " + id);
-                        //
-                        // Get the PDP Object
-                        //
-                        PDP pdp = this.papEngine.getPDP(id);
-                        //
-                        // Is it known?
-                        //
-                        if (pdp == null) {
-                                //
-                                // Check if request came from localhost
-                                //
-                                String message = "Unknown PDP: " + id + " from " + request.getRemoteHost() + " us: " + request.getLocalAddr();
-                                logger.info(message);
-                                if (request.getRemoteHost().equals("localhost") ||
-                                        request.getRemoteHost().equals("127.0.0.1") ||
-                                        request.getRemoteHost().equals(request.getLocalAddr())) {
-                                        //
-                                        // Return status information - basically all the groups
-                                        //
-                                        Set<PDPGroup> groups = papEngine.getPDPGroups();
-                                        
-                                        // convert response object to JSON and include in the response
-                            ObjectMapper mapper = new ObjectMapper();
-                            mapper.writeValue(response.getOutputStream(),  groups);
-                                        response.setHeader("content-type", "application/json");
-                                        response.setStatus(HttpServletResponse.SC_OK);
-                                        return;
-                                }
-                                response.sendError(HttpServletResponse.SC_UNAUTHORIZED, message);
-                                return;
-                        }
-                        //
-                        // Get the PDP's Group
-                        //
-                        PDPGroup group = this.papEngine.getPDPGroup(pdp);
-                        if (group == null) {
-                                String message = "No group associated with pdp " + pdp.getId();
-                                logger.warn(message);
-                                response.sendError(HttpServletResponse.SC_UNAUTHORIZED, message);
-                                return;
-                        }
-                        //
-                        // Which policy do they want?
-                        //
-                        String policyId = request.getParameter("id");
-                        if (policyId == null) {
-                                String message = "Did not specify an id for the policy";
-                                logger.warn(message);
-                                response.sendError(HttpServletResponse.SC_NOT_FOUND, message);
-                                return;
-                        }
-                        PDPPolicy policy = group.getPolicy(policyId);
-                        if (policy == null) {
-                                String message = "Unknown policy: " + policyId;
-                                logger.warn(message);
-                                response.sendError(HttpServletResponse.SC_NOT_FOUND, message);
-                                return;
-                        }
-                        //
-                        // Get its stream
-                        //
-                        try (InputStream is = policy.getStream(); OutputStream os = response.getOutputStream()) {
-                                //
-                                // Send the policy back
-                                //
-                                IOUtils.copy(is, os);
-                                
-                                response.setStatus(HttpServletResponse.SC_OK);
-                        } catch (PAPException e) {
-                                String message = "Failed to open policy id " + policyId;
-                                logger.error(message);
-                                response.sendError(HttpServletResponse.SC_NOT_FOUND, message);
-                        }
-                }  catch (PAPException e) {
-                        logger.error("GET exception: " + e, e);
-                        response.sendError(500, e.getMessage());
-                        return;
-                }
-        }
-
-        protected String	getPDPID(HttpServletRequest request) {
-                String pdpURL = request.getHeader(XACMLRestProperties.PROP_PDP_HTTP_HEADER_ID);
-                if (pdpURL == null || pdpURL.isEmpty()) {
-                        //
-                        // Should send back its port for identification
-                        //
-                        logger.warn("PDP did not send custom header");
-                        pdpURL = "";
-                }
-                return  pdpURL;
-        }
-        
-        private boolean isPDPCurrent(Properties policies, Properties pipconfig, Properties pdpProperties) {
-                String localRootPolicies = policies.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
-                String localReferencedPolicies = policies.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
-                if (localRootPolicies == null || localReferencedPolicies == null) {
-                        logger.warn("Missing property on PAP server: RootPolicies="+localRootPolicies+"  ReferencedPolicies="+localReferencedPolicies);
-                        return false;
+                if (pipconfig != null) {
+                    //
+                    // Copy the properties to the output stream
+                    //
+                    pipconfig.store(response.getOutputStream(), "");
                 }
                 //
-                // Compare the policies and pipconfig properties to the pdpProperties
+                // We are good - and we are sending them information
                 //
-                try {
-                        //
-                        // the policy properties includes only xacml.rootPolicies and 
-                        // xacml.referencedPolicies without any .url entries
-                        //
-                        Properties pdpPolicies = XACMLProperties.getPolicyProperties(pdpProperties, false);
-                        Properties pdpPipConfig = XACMLProperties.getPipProperties(pdpProperties);
-                        if (localRootPolicies.equals(pdpPolicies.getProperty(XACMLProperties.PROP_ROOTPOLICIES)) &&
-                                        localReferencedPolicies.equals(pdpPolicies.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES)) &&
-                                        pdpPipConfig.equals(pipconfig)) {
-                                //
-                                // The PDP is current
-                                //
-                                return true;
-                        }
-                } catch (Exception e) {
-                        // we get here if the PDP did not include either xacml.rootPolicies or xacml.pip.engines,
-                        // or if there are policies that do not have a corresponding ".url" property.
-                        // Either of these cases means that the PDP is not up-to-date, so just drop-through to return false.
-                }
-                return false;
-        }
+                response.setStatus(HttpServletResponse.SC_OK);
+//TODO - Correct?
+                setPDPSummaryStatus(pdp, PDPStatus.Status.OUT_OF_SYNCH);
+            } else {
+                //
+                // Tell them they are good
+                //
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
 
-        private void populatePolicyURL(StringBuffer urlPath, Properties policies) {
-                String lists[] = new String[2];
-                lists[0] = policies.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
-                lists[1] = policies.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
-                for (String list : lists) {
-                        if (list != null && list.isEmpty() == false) {
-                                for (String id : Splitter.on(',').trimResults().omitEmptyStrings().split(list)) {
-                                        String url = urlPath + "?id=" + id;
-                                        logger.info("Policy URL for " + id + ": " + url);
-                                        policies.setProperty(id + ".url", url);
-                                }
-                        }
-                }
+//TODO - Correct?
+                setPDPSummaryStatus(pdp, PDPStatus.Status.UP_TO_DATE);
+
+            }
+            //
+            // tell the AC that something changed
+            //
+            notifyAC();
+        } catch (PAPException e) {
+            logger.debug("POST exception: " + e, e);
+            response.sendError(500, e.getMessage());
+            return;
         }
-        
-        
-        /**
-         * @see HttpServlet#doPut(HttpServletRequest request, HttpServletResponse response)
-         */
-        protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-                XACMLRest.dumpRequest(request);
+    }
+
+
+    /**
+     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        try {
+            XACMLRest.dumpRequest(request);
+
+            // Is this from the Admin Console?
+            String groupId = request.getParameter("groupId");
+            if (groupId != null) {
+                // this is from the Admin Console, so handle separately
+                doACGet(request, response, groupId);
+                return;
+            }
+            //
+            // Get the PDP's ID
+            //
+            String id = this.getPDPID(request);
+            logger.info("doGet from: " + id);
+            //
+            // Get the PDP Object
+            //
+            PDP pdp = this.papEngine.getPDP(id);
+            //
+            // Is it known?
+            //
+            if (pdp == null) {
                 //
-                // since getParameter reads the content string, explicitly get the content before doing that.
-                // Simply getting the inputStream seems to protect it against being consumed by getParameter.
+                // Check if request came from localhost
                 //
-                request.getInputStream();
+                String message = "Unknown PDP: " + id + " from " + request.getRemoteHost() + " us: " + request.getLocalAddr();
+                logger.info(message);
+                if (request.getRemoteHost().equals("localhost") ||
+                        request.getRemoteHost().equals("127.0.0.1") ||
+                        request.getRemoteHost().equals(request.getLocalAddr())) {
+                    //
+                    // Return status information - basically all the groups
+                    //
+                    Set<PDPGroup> groups = papEngine.getPDPGroups();
+
+                    // convert response object to JSON and include in the response
+                    ObjectMapper mapper = new ObjectMapper();
+                    mapper.writeValue(response.getOutputStream(),  groups);
+                    response.setHeader("content-type", "application/json");
+                    response.setStatus(HttpServletResponse.SC_OK);
+                    return;
+                }
+                response.sendError(HttpServletResponse.SC_UNAUTHORIZED, message);
+                return;
+            }
+            //
+            // Get the PDP's Group
+            //
+            PDPGroup group = this.papEngine.getPDPGroup(pdp);
+            if (group == null) {
+                String message = "No group associated with pdp " + pdp.getId();
+                logger.warn(message);
+                response.sendError(HttpServletResponse.SC_UNAUTHORIZED, message);
+                return;
+            }
+            //
+            // Which policy do they want?
+            //
+            String policyId = request.getParameter("id");
+            if (policyId == null) {
+                String message = "Did not specify an id for the policy";
+                logger.warn(message);
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, message);
+                return;
+            }
+            PDPPolicy policy = group.getPolicy(policyId);
+            if (policy == null) {
+                String message = "Unknown policy: " + policyId;
+                logger.warn(message);
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, message);
+                return;
+            }
+            //
+            // Get its stream
+            //
+            try (InputStream is = policy.getStream(); OutputStream os = response.getOutputStream()) {
                 //
-                // See if this is Admin Console registering itself with us
+                // Send the policy back
                 //
-                String acURLString = request.getParameter("adminConsoleURL");
-                if (acURLString != null) {
-                        //
-                        // remember this Admin Console for future updates
-                        //
-                        if ( ! adminConsoleURLStringList.contains(acURLString)) {
-                                adminConsoleURLStringList.add(acURLString);
-                        }
+                IOUtils.copy(is, os);
+
+                response.setStatus(HttpServletResponse.SC_OK);
+            } catch (PAPException e) {
+                String message = "Failed to open policy id " + policyId;
+                logger.error(message);
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, message);
+            }
+        }  catch (PAPException e) {
+            logger.error("GET exception: " + e, e);
+            response.sendError(500, e.getMessage());
+            return;
+        }
+    }
+
+    protected String	getPDPID(HttpServletRequest request) {
+        String pdpURL = request.getHeader(XACMLRestProperties.PROP_PDP_HTTP_HEADER_ID);
+        if (pdpURL == null || pdpURL.isEmpty()) {
+            //
+            // Should send back its port for identification
+            //
+            logger.warn("PDP did not send custom header");
+            pdpURL = "";
+        }
+        return  pdpURL;
+    }
+
+    private boolean isPDPCurrent(Properties policies, Properties pipconfig, Properties pdpProperties) {
+        String localRootPolicies = policies.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
+        String localReferencedPolicies = policies.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
+        if (localRootPolicies == null || localReferencedPolicies == null) {
+            logger.warn("Missing property on PAP server: RootPolicies="+localRootPolicies+"  ReferencedPolicies="+localReferencedPolicies);
+            return false;
+        }
+        //
+        // Compare the policies and pipconfig properties to the pdpProperties
+        //
+        try {
+            //
+            // the policy properties includes only xacml.rootPolicies and
+            // xacml.referencedPolicies without any .url entries
+            //
+            Properties pdpPolicies = XACMLProperties.getPolicyProperties(pdpProperties, false);
+            Properties pdpPipConfig = XACMLProperties.getPipProperties(pdpProperties);
+            if (localRootPolicies.equals(pdpPolicies.getProperty(XACMLProperties.PROP_ROOTPOLICIES)) &&
+                    localReferencedPolicies.equals(pdpPolicies.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES)) &&
+                    pdpPipConfig.equals(pipconfig)) {
+                //
+                // The PDP is current
+                //
+                return true;
+            }
+        } catch (Exception e) {
+            // we get here if the PDP did not include either xacml.rootPolicies or xacml.pip.engines,
+            // or if there are policies that do not have a corresponding ".url" property.
+            // Either of these cases means that the PDP is not up-to-date, so just drop-through to return false.
+        }
+        return false;
+    }
+
+    private void populatePolicyURL(StringBuffer urlPath, Properties policies) {
+        String lists[] = new String[2];
+        lists[0] = policies.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
+        lists[1] = policies.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
+        for (String list : lists) {
+            if (list != null && list.isEmpty() == false) {
+                for (String id : Splitter.on(',').trimResults().omitEmptyStrings().split(list)) {
+                    String url = urlPath + "?id=" + id;
+                    logger.info("Policy URL for " + id + ": " + url);
+                    policies.setProperty(id + ".url", url);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * @see HttpServlet#doPut(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        XACMLRest.dumpRequest(request);
+        //
+        // since getParameter reads the content string, explicitly get the content before doing that.
+        // Simply getting the inputStream seems to protect it against being consumed by getParameter.
+        //
+        request.getInputStream();
+        //
+        // See if this is Admin Console registering itself with us
+        //
+        String acURLString = request.getParameter("adminConsoleURL");
+        if (acURLString != null) {
+            //
+            // remember this Admin Console for future updates
+            //
+            if ( ! adminConsoleURLStringList.contains(acURLString)) {
+                adminConsoleURLStringList.add(acURLString);
+            }
+            if (logger.isDebugEnabled()) {
+                logger.debug("Admin Console registering with URL: " + acURLString);
+            }
+            response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+            return;
+        }
+        //
+        // Is this some other operation from the Admin Console?
+        //
+        String groupId = request.getParameter("groupId");
+        if (groupId != null) {
+            //
+            // this is from the Admin Console, so handle separately
+            //
+            doACPut(request, response, groupId);
+            return;
+        }
+        //
+        // We do not expect anything from anywhere else.
+        // This method is here in case we ever need to support other operations.
+        //
+        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request does not have groupId");
+    }
+
+    /**
+     * @see HttpServlet#doDelete(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        XACMLRest.dumpRequest(request);
+        //
+        // Is this from the Admin Console?
+        //
+        String groupId = request.getParameter("groupId");
+        if (groupId != null) {
+            //
+            // this is from the Admin Console, so handle separately
+            //
+            doACDelete(request, response, groupId);
+            return;
+        }
+        //
+        // We do not expect anything from anywhere else.
+        // This method is here in case we ever need to support other operations.
+        //
+        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request does not have groupId");
+    }
+    //
+    // Admin Console request handling
+    //
+
+    /**
+     * Requests from the Admin Console to GET info about the Groups and PDPs
+     *
+     * @param request
+     * @param response
+     * @param groupId
+     * @throws ServletException
+     * @throws java.io.IOException
+     */
+    private void doACGet(HttpServletRequest request, HttpServletResponse response, String groupId) throws ServletException, IOException {
+        try {
+            String parameterDefault = request.getParameter("default");
+            String pdpId = request.getParameter("pdpId");
+            String pdpGroup = request.getParameter("getPDPGroup");
+            if ("".equals(groupId)) {
+                // request IS from AC but does not identify a group by name
+                if (parameterDefault != null) {
+                    // Request is for the Default group (whatever its id)
+                    PDPGroup group = papEngine.getDefaultGroup();
+
+                    // convert response object to JSON and include in the response
+                    ObjectMapper mapper = new ObjectMapper();
+                    mapper.writeValue(response.getOutputStream(),  group);
+
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("GET Default group req from '" + request.getRequestURL() + "'");
+                    }
+                    response.setStatus(HttpServletResponse.SC_OK);
+                    response.setHeader("content-type", "application/json");
+                    response.getOutputStream().close();
+                    return;
+
+                } else if (pdpId != null) {
+                    // Request is related to a PDP
+                    if (pdpGroup == null) {
+                        // Request is for the PDP itself
+                        // Request is for the (unspecified) group containing a given PDP
+                        PDP pdp = papEngine.getPDP(pdpId);
+
+                        // convert response object to JSON and include in the response
+                        ObjectMapper mapper = new ObjectMapper();
+                        mapper.writeValue(response.getOutputStream(),  pdp);
+
                         if (logger.isDebugEnabled()) {
-                                logger.debug("Admin Console registering with URL: " + acURLString);
+                            logger.debug("GET pdp '" + pdpId + "' req from '" + request.getRequestURL() + "'");
                         }
-                        response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                        response.setStatus(HttpServletResponse.SC_OK);
+                        response.setHeader("content-type", "application/json");
+                        response.getOutputStream().close();
                         return;
-                }
-                //
-                // Is this some other operation from the Admin Console?
-                //
-                String groupId = request.getParameter("groupId");
-                if (groupId != null) {
-                        //
-                        // this is from the Admin Console, so handle separately
-                        //
-                        doACPut(request, response, groupId);
+
+                    } else {
+                        // Request is for the (unspecified) group containing a given PDP
+                        PDP pdp = papEngine.getPDP(pdpId);
+                        PDPGroup group = papEngine.getPDPGroup(pdp);
+
+                        // convert response object to JSON and include in the response
+                        ObjectMapper mapper = new ObjectMapper();
+                        mapper.writeValue(response.getOutputStream(),  group);
+
+                        if (logger.isDebugEnabled()) {
+                            logger.debug("GET PDP '" + pdpId + "' Group req from '" + request.getRequestURL() + "'");
+                        }
+                        response.setStatus(HttpServletResponse.SC_OK);
+                        response.setHeader("content-type", "application/json");
+                        response.getOutputStream().close();
                         return;
-                }
-                //
-                // We do not expect anything from anywhere else.
-                // This method is here in case we ever need to support other operations.
-                //
-                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request does not have groupId");
-        }
-        
-        /**
-         * @see HttpServlet#doDelete(HttpServletRequest request, HttpServletResponse response)
-         */
-        protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-                XACMLRest.dumpRequest(request);
-                //
-                // Is this from the Admin Console?
-                //
-                String groupId = request.getParameter("groupId");
-                if (groupId != null) {
-                        //
-                        // this is from the Admin Console, so handle separately
-                        //
-                        doACDelete(request, response, groupId);
-                        return;
-                }
-                //
-                // We do not expect anything from anywhere else.
-                // This method is here in case we ever need to support other operations.
-                //
-                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request does not have groupId");
-        }
-        //
-        // Admin Console request handling
-        //
-        
-        /**
-         * Requests from the Admin Console to GET info about the Groups and PDPs
-         * 
-         * @param request
-         * @param response
-         * @param groupId
-         * @throws ServletException
-         * @throws java.io.IOException
-         */
-        private void doACGet(HttpServletRequest request, HttpServletResponse response, String groupId) throws ServletException, IOException {
-                try {
-                        String parameterDefault = request.getParameter("default");
-                        String pdpId = request.getParameter("pdpId");
-                        String pdpGroup = request.getParameter("getPDPGroup");
-                        if ("".equals(groupId)) {
-                                // request IS from AC but does not identify a group by name
-                                if (parameterDefault != null) {
-                                        // Request is for the Default group (whatever its id)
-                                        PDPGroup group = papEngine.getDefaultGroup();
-                                        
-                                        // convert response object to JSON and include in the response
-                            ObjectMapper mapper = new ObjectMapper();
-                            mapper.writeValue(response.getOutputStream(),  group);
-                            
-                                        if (logger.isDebugEnabled()) {
-                                                logger.debug("GET Default group req from '" + request.getRequestURL() + "'");
-                                        }
-                                        response.setStatus(HttpServletResponse.SC_OK);
-                                        response.setHeader("content-type", "application/json");
-                                        response.getOutputStream().close();
-                                        return;
-                                        
-                                } else if (pdpId != null) {
-                                        // Request is related to a PDP
-                                        if (pdpGroup == null) {
-                                                // Request is for the PDP itself
-                                                // Request is for the (unspecified) group containing a given PDP
-                                                PDP pdp = papEngine.getPDP(pdpId);
-                                                
-                                                // convert response object to JSON and include in the response
-                                    ObjectMapper mapper = new ObjectMapper();
-                                    mapper.writeValue(response.getOutputStream(),  pdp);
-                                    
-                                                if (logger.isDebugEnabled()) {
-                                                        logger.debug("GET pdp '" + pdpId + "' req from '" + request.getRequestURL() + "'");
-                                                }
-                                                response.setStatus(HttpServletResponse.SC_OK);
-                                                response.setHeader("content-type", "application/json");
-                                                response.getOutputStream().close();
-                                                return;
-                                        
-                                        } else {
-                                                // Request is for the (unspecified) group containing a given PDP
-                                                PDP pdp = papEngine.getPDP(pdpId);
-                                                PDPGroup group = papEngine.getPDPGroup(pdp);
-                                                
-                                                // convert response object to JSON and include in the response
-                                    ObjectMapper mapper = new ObjectMapper();
-                                    mapper.writeValue(response.getOutputStream(),  group);
-                                    
-                                                if (logger.isDebugEnabled()) {
-                                                        logger.debug("GET PDP '" + pdpId + "' Group req from '" + request.getRequestURL() + "'");
-                                                }
-                                                response.setStatus(HttpServletResponse.SC_OK);
-                                                response.setHeader("content-type", "application/json");
-                                                response.getOutputStream().close();
-                                                return;
-                                        }
-                                        
-                                } else {
-                                        // request is for top-level properties about all groups
-                                        Set<PDPGroup> groups = papEngine.getPDPGroups();
-                                        
-                                        // convert response object to JSON and include in the response
-                            ObjectMapper mapper = new ObjectMapper();
-                            mapper.writeValue(response.getOutputStream(),  groups);
-                                        
+                    }
+
+                } else {
+                    // request is for top-level properties about all groups
+                    Set<PDPGroup> groups = papEngine.getPDPGroups();
+
+                    // convert response object to JSON and include in the response
+                    ObjectMapper mapper = new ObjectMapper();
+                    mapper.writeValue(response.getOutputStream(),  groups);
+
 //TODO
 // In "notification" section, ALSO need to tell AC about other changes (made by other ACs)?'
 //TODO add new PDP notification (or just "config changed" notification) in appropriate place
-                            if (logger.isDebugEnabled()) {
-                                logger.debug("GET All groups req");
-                            }
-                                        response.setStatus(HttpServletResponse.SC_OK);
-                                        response.setHeader("content-type", "application/json");
-                                        response.getOutputStream().close();
-                                        return;
-                                }
-                        }
-                        
-                        // for all other GET operations the group must exist before the operation can be done
-                        PDPGroup group = papEngine.getGroup(groupId);
-                        if (group == null) {
-                                logger.error("Unknown groupId '" + groupId + "'");
-                                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId +"'");
-                                return;
-                        }
-                        
-                        
-                        // Figure out which request this is based on the parameters
-                        String policyId = request.getParameter("policyId");
-                        
-                        if (policyId != null) {
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("GET All groups req");
+                    }
+                    response.setStatus(HttpServletResponse.SC_OK);
+                    response.setHeader("content-type", "application/json");
+                    response.getOutputStream().close();
+                    return;
+                }
+            }
+
+            // for all other GET operations the group must exist before the operation can be done
+            PDPGroup group = papEngine.getGroup(groupId);
+            if (group == null) {
+                logger.error("Unknown groupId '" + groupId + "'");
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId +"'");
+                return;
+            }
+
+
+            // Figure out which request this is based on the parameters
+            String policyId = request.getParameter("policyId");
+
+            if (policyId != null) {
 //				// retrieve a policy
 //				PDPPolicy policy = papEngine.getPDPPolicy(policyId);
-//				
+//
 //				// convert response object to JSON and include in the response
 //	            ObjectMapper mapper = new ObjectMapper();
 //	            mapper.writeValue(response.getOutputStream(),  pdp);
-//	            
+//
 //	        	logger.debug("GET group '" + group.getId() + "' req from '" + request.getRequestURL() + "'");
 //				response.setStatus(HttpServletResponse.SC_OK);
 //				response.setHeader("content-type", "application/json");
 //				response.getOutputStream().close();
 //				return;
-                                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "GET Policy not implemented");
-                                
-                        } else {
-                                // No other parameters, so return the identified Group
-                                
-                                // convert response object to JSON and include in the response
-                    ObjectMapper mapper = new ObjectMapper();
-                    mapper.writeValue(response.getOutputStream(),  group);
-                    
-                    if (logger.isDebugEnabled()) {
-                        logger.debug("GET group '" + group.getId() + "' req from '" + request.getRequestURL() + "'");
-                    }
-                                response.setStatus(HttpServletResponse.SC_OK);
-                                response.setHeader("content-type", "application/json");
-                                response.getOutputStream().close();
-                                return;
-                        }
-                        
-                        //
-                        // Currently there are no other GET calls from the AC.
-                        // The AC uses the "GET All Groups" operation to fill its local cache and uses that cache for all other GETs without calling the PAP.
-                        // Other GETs that could be called:
-                        //				Specific Group	(groupId=<groupId>)
-                        //				A Policy		(groupId=<groupId> policyId=<policyId>)
-                        //				A PDP			(groupId=<groupId> pdpId=<pdpId>)
-                
-        //TODO - implement other GET operations if needed
-        
-                        logger.error("UNIMPLEMENTED ");
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
-                } catch (PAPException e) {
-                        logger.error("AC Get exception: " + e, e);
-                        response.sendError(500, e.getMessage());
-                        return;
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "GET Policy not implemented");
+
+            } else {
+                // No other parameters, so return the identified Group
+
+                // convert response object to JSON and include in the response
+                ObjectMapper mapper = new ObjectMapper();
+                mapper.writeValue(response.getOutputStream(),  group);
+
+                if (logger.isDebugEnabled()) {
+                    logger.debug("GET group '" + group.getId() + "' req from '" + request.getRequestURL() + "'");
                 }
-                
+                response.setStatus(HttpServletResponse.SC_OK);
+                response.setHeader("content-type", "application/json");
+                response.getOutputStream().close();
+                return;
+            }
+
+            //
+            // Currently there are no other GET calls from the AC.
+            // The AC uses the "GET All Groups" operation to fill its local cache and uses that cache for all other GETs without calling the PAP.
+            // Other GETs that could be called:
+            //				Specific Group	(groupId=<groupId>)
+            //				A Policy		(groupId=<groupId> policyId=<policyId>)
+            //				A PDP			(groupId=<groupId> pdpId=<pdpId>)
+
+            //TODO - implement other GET operations if needed
+
+            logger.error("UNIMPLEMENTED ");
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
+        } catch (PAPException e) {
+            logger.error("AC Get exception: " + e, e);
+            response.sendError(500, e.getMessage());
+            return;
         }
 
-                
-        /**
-         * Requests from the Admin Console for operations not on single specific objects
-         * 
-         * @param request
-         * @param response
-         * @param groupId
-         * @throws ServletException
-         * @throws java.io.IOException
-         */
-        private void doACPost(HttpServletRequest request, HttpServletResponse response, String groupId) throws ServletException, IOException {
+    }
+
+
+    /**
+     * Requests from the Admin Console for operations not on single specific objects
+     *
+     * @param request
+     * @param response
+     * @param groupId
+     * @throws ServletException
+     * @throws java.io.IOException
+     */
+    private void doACPost(HttpServletRequest request, HttpServletResponse response, String groupId) throws ServletException, IOException {
+        try {
+            String groupName = request.getParameter("groupName");
+            String groupDescription = request.getParameter("groupDescription");
+            if (groupName != null && groupDescription != null) {
+                // Args:	      group=<groupId> groupName=<name> groupDescription=<description>            <= create a new group
+                String unescapedName = URLDecoder.decode(groupName, "UTF-8");
+                String unescapedDescription = URLDecoder.decode(groupDescription, "UTF-8");
                 try {
-                        String groupName = request.getParameter("groupName");
-                        String groupDescription = request.getParameter("groupDescription");
-                        if (groupName != null && groupDescription != null) {
-                                // Args:	      group=<groupId> groupName=<name> groupDescription=<description>            <= create a new group
-                                String unescapedName = URLDecoder.decode(groupName, "UTF-8");
-                                String unescapedDescription = URLDecoder.decode(groupDescription, "UTF-8");
-                                try {
-                                        papEngine.newGroup(unescapedName, unescapedDescription);
-                                } catch (Exception e) {
-                                        logger.error("Unable to create new group: " + e.getLocalizedMessage());
-                                        response.sendError(500, "Unable to create new group '" + groupId + "'");
-                                        return;
-                                }
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("New Group '" + groupId + "' created");
-                                }
-                                // tell the Admin Consoles there is a change
-                                notifyAC();
-                                // new group by definition has no PDPs, so no need to notify them of changes
-                                return;
-                        }
-                        
-                        // for all remaining POST operations the group must exist before the operation can be done
-                        PDPGroup group = papEngine.getGroup(groupId);
-                        if (group == null) {
-                                logger.error("Unknown groupId '" + groupId + "'");
-                                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId +"'");
-                                return;
-                        }
-                        
-                        // determine the operation needed based on the parameters in the request
-                        if (request.getParameter("policyId") != null) {
-                                //	Args:        group=<groupId> policy=<policyId>		<= copy file
-                                // copy a policy from the request contents into a file in the group's directory on this machine
-                                String policyId = request.getParameter("policyId");
-                                try {
-                                        ((StdPDPGroup) group).copyPolicyToFile(policyId, request.getInputStream());
-                                } catch (Exception e) {
-                                        String message = "Policy '" + policyId + "' not copied to group '" + groupId +"': " + e;
-                                        logger.error(message);
-                                        response.sendError(500, message);
-                                        return;
-                                }
-                                // policy file copied ok
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("policy '" + policyId + "' copied to directory for group '" + groupId + "'");
-                                }
-                                return;
-                                
-                        } else if (request.getParameter("default") != null) {
-                                // Args:       group=<groupId> default=true               <= make default
-                                // change the current default group to be the one identified in the request.
-                                //
-                                // This is a POST operation rather than a PUT "update group" because of the side-effect that the current default group is also changed.
-                                // It should never be the case that multiple groups are currently marked as the default, but protect against that anyway.
-                                try {
-                                        papEngine.SetDefaultGroup(group);
-                                } catch (Exception e) {
-                                        logger.error("Unable to set group: " + e.getLocalizedMessage());
-                                        response.sendError(500, "Unable to set group '" + groupId + "' to default");
-                                        return;
-                                }
-                                
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("Group '" + groupId + "' set to be default");
-                                }
-                                // Notify the Admin Consoles that something changed
-                                // For now the AC cannot handle anything more detailed than the whole set of PDPGroups, so just notify on that
+                    papEngine.newGroup(unescapedName, unescapedDescription);
+                } catch (Exception e) {
+                    logger.error("Unable to create new group: " + e.getLocalizedMessage());
+                    response.sendError(500, "Unable to create new group '" + groupId + "'");
+                    return;
+                }
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                if (logger.isDebugEnabled()) {
+                    logger.debug("New Group '" + groupId + "' created");
+                }
+                // tell the Admin Consoles there is a change
+                notifyAC();
+                // new group by definition has no PDPs, so no need to notify them of changes
+                return;
+            }
+
+            // for all remaining POST operations the group must exist before the operation can be done
+            PDPGroup group = papEngine.getGroup(groupId);
+            if (group == null) {
+                logger.error("Unknown groupId '" + groupId + "'");
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId +"'");
+                return;
+            }
+
+            // determine the operation needed based on the parameters in the request
+            if (request.getParameter("policyId") != null) {
+                //	Args:        group=<groupId> policy=<policyId>		<= copy file
+                // copy a policy from the request contents into a file in the group's directory on this machine
+                String policyId = request.getParameter("policyId");
+                try {
+                    ((StdPDPGroup) group).copyPolicyToFile(policyId, request.getInputStream());
+                } catch (Exception e) {
+                    String message = "Policy '" + policyId + "' not copied to group '" + groupId +"': " + e;
+                    logger.error(message);
+                    response.sendError(500, message);
+                    return;
+                }
+                // policy file copied ok
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                if (logger.isDebugEnabled()) {
+                    logger.debug("policy '" + policyId + "' copied to directory for group '" + groupId + "'");
+                }
+                return;
+
+            } else if (request.getParameter("default") != null) {
+                // Args:       group=<groupId> default=true               <= make default
+                // change the current default group to be the one identified in the request.
+                //
+                // This is a POST operation rather than a PUT "update group" because of the side-effect that the current default group is also changed.
+                // It should never be the case that multiple groups are currently marked as the default, but protect against that anyway.
+                try {
+                    papEngine.SetDefaultGroup(group);
+                } catch (Exception e) {
+                    logger.error("Unable to set group: " + e.getLocalizedMessage());
+                    response.sendError(500, "Unable to set group '" + groupId + "' to default");
+                    return;
+                }
+
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Group '" + groupId + "' set to be default");
+                }
+                // Notify the Admin Consoles that something changed
+                // For now the AC cannot handle anything more detailed than the whole set of PDPGroups, so just notify on that
 //TODO - Future: FIGURE OUT WHAT LEVEL TO NOTIFY: 2 groups or entire set - currently notify AC to update whole configuration of all groups
-                                notifyAC();
-                                // This does not affect any PDPs in the existing groups, so no need to notify them of this change
-                                return;
-                                
-                        } else if (request.getParameter("pdpId") != null) {
-                                // Args:       group=<groupId> pdpId=<pdpId>               <= move PDP to group
-                                String pdpId = request.getParameter("pdpId");
-                                PDP pdp = papEngine.getPDP(pdpId);
-                                
-                                PDPGroup originalGroup = papEngine.getPDPGroup(pdp);
-                                
-                                papEngine.movePDP(pdp, group);
-                                
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("PDP '" + pdp.getId() +"' moved to group '" + group.getId() + "' set to be default");
-                                }
-                                
-                                // update the status of both the original group and the new one
-                                ((StdPDPGroup)originalGroup).resetStatus();
-                                ((StdPDPGroup)group).resetStatus();
-                                
-                                // Notify the Admin Consoles that something changed
-                                // For now the AC cannot handle anything more detailed than the whole set of PDPGroups, so just notify on that
-                                notifyAC();
-                                // Need to notify the PDP that it's config may have changed
-                                pdpChanged(pdp);
-                                return;
-                                
-                                
-                        }
-                } catch (PAPException e) {
-                        logger.error("AC POST exception: " + e, e);
-                        response.sendError(500, e.getMessage());
-                        return;
+                notifyAC();
+                // This does not affect any PDPs in the existing groups, so no need to notify them of this change
+                return;
+
+            } else if (request.getParameter("pdpId") != null) {
+                // Args:       group=<groupId> pdpId=<pdpId>               <= move PDP to group
+                String pdpId = request.getParameter("pdpId");
+                PDP pdp = papEngine.getPDP(pdpId);
+
+                PDPGroup originalGroup = papEngine.getPDPGroup(pdp);
+
+                papEngine.movePDP(pdp, group);
+
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                if (logger.isDebugEnabled()) {
+                    logger.debug("PDP '" + pdp.getId() +"' moved to group '" + group.getId() + "' set to be default");
                 }
+
+                // update the status of both the original group and the new one
+                ((StdPDPGroup)originalGroup).resetStatus();
+                ((StdPDPGroup)group).resetStatus();
+
+                // Notify the Admin Consoles that something changed
+                // For now the AC cannot handle anything more detailed than the whole set of PDPGroups, so just notify on that
+                notifyAC();
+                // Need to notify the PDP that it's config may have changed
+                pdpChanged(pdp);
+                return;
+
+
+            }
+        } catch (PAPException e) {
+            logger.error("AC POST exception: " + e, e);
+            response.sendError(500, e.getMessage());
+            return;
         }
+    }
 
-        /**
-         * Requests from the Admin Console to create new items or update existing ones
-         * 
-         * @param request
-         * @param response
-         * @param groupId
-         * @throws ServletException
-         * @throws java.io.IOException
-         */
-        private void doACPut(HttpServletRequest request, HttpServletResponse response, String groupId) throws ServletException, IOException {
-                try {
-                        
-                        
-                        // for PUT operations the group may or may not need to exist before the operation can be done
-                        PDPGroup group = papEngine.getGroup(groupId);
-        
-                        // determine the operation needed based on the parameters in the request
+    /**
+     * Requests from the Admin Console to create new items or update existing ones
+     *
+     * @param request
+     * @param response
+     * @param groupId
+     * @throws ServletException
+     * @throws java.io.IOException
+     */
+    private void doACPut(HttpServletRequest request, HttpServletResponse response, String groupId) throws ServletException, IOException {
+        try {
 
-                        // for remaining operations the group must exist before the operation can be done
-                        if (group == null) {
-                                logger.error("Unknown groupId '" + groupId + "'");
-                                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId +"'");
-                                return;
-                        }
-                        if (request.getParameter("policy") != null) {
-        //        group=<groupId> policy=<policyId> contents=policy file               <= Create new policy file in group dir, or replace it if it already exists (do not touch properties)
-        //TODO - currently this is done by the AC, but it should be done here by getting the policy file out of the contents and saving to disk
-                                logger.error("PARTIALLY IMPLEMENTED!!!  ACTUAL CHANGES SHOULD BE MADE BY PAP SERVLET!!! ");
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                return;
-                        } else if (request.getParameter("pdpId") != null) {
-                                // ARGS:        group=<groupId> pdpId=<pdpId/URL>          <= create a new PDP or Update an Existing one
-                                
-                                String pdpId = request.getParameter("pdpId");
-                                
+
+            // for PUT operations the group may or may not need to exist before the operation can be done
+            PDPGroup group = papEngine.getGroup(groupId);
+
+            // determine the operation needed based on the parameters in the request
+
+            // for remaining operations the group must exist before the operation can be done
+            if (group == null) {
+                logger.error("Unknown groupId '" + groupId + "'");
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId +"'");
+                return;
+            }
+            if (request.getParameter("policy") != null) {
+                //        group=<groupId> policy=<policyId> contents=policy file               <= Create new policy file in group dir, or replace it if it already exists (do not touch properties)
+                //TODO - currently this is done by the AC, but it should be done here by getting the policy file out of the contents and saving to disk
+                logger.error("PARTIALLY IMPLEMENTED!!!  ACTUAL CHANGES SHOULD BE MADE BY PAP SERVLET!!! ");
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                return;
+            } else if (request.getParameter("pdpId") != null) {
+                // ARGS:        group=<groupId> pdpId=<pdpId/URL>          <= create a new PDP or Update an Existing one
+
+                String pdpId = request.getParameter("pdpId");
+
                 // get the request content into a String
                 String json = null;
-                        // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file)
-                    java.util.Scanner scanner = new java.util.Scanner(request.getInputStream());
-                    scanner.useDelimiter("\\A");
-                    json =  scanner.hasNext() ? scanner.next() : "";
-                    scanner.close();
-                    logger.info("JSON request from AC: " + json);
-                
+                // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file)
+                java.util.Scanner scanner = new java.util.Scanner(request.getInputStream());
+                scanner.useDelimiter("\\A");
+                json =  scanner.hasNext() ? scanner.next() : "";
+                scanner.close();
+                logger.info("JSON request from AC: " + json);
+
                 // convert Object sent as JSON into local object
-                    ObjectMapper mapper = new ObjectMapper();
-                                
-                    Object objectFromJSON = mapper.readValue(json, StdPDP.class);
+                ObjectMapper mapper = new ObjectMapper();
 
-                                if (pdpId == null ||
-                                                objectFromJSON == null ||
-                                                ! (objectFromJSON instanceof StdPDP) ||
-                                                ((StdPDP)objectFromJSON).getId() == null ||
-                                                ! ((StdPDP)objectFromJSON).getId().equals(pdpId)) {
-                                        logger.error("PDP new/update had bad input. pdpId=" + pdpId + " objectFromJSON="+objectFromJSON);
-                                        response.sendError(500, "Bad input, pdpid="+pdpId+" object="+objectFromJSON);
-                                }
-                                StdPDP pdp = (StdPDP) objectFromJSON;
-                                
-                                if (papEngine.getPDP(pdpId) == null) {
-                                        // this is a request to create a new PDP object
-                                        papEngine.newPDP(pdp.getId(), group, pdp.getName(), pdp.getDescription());
-                                } else {
-                                        // this is a request to update the pdp
-                                        papEngine.updatePDP(pdp);
-                                }
+                Object objectFromJSON = mapper.readValue(json, StdPDP.class);
 
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("PDP '" + pdpId + "' created/updated");
-                                }
-                                
-                                // adjust the group's state including the new PDP
-                                ((StdPDPGroup)group).resetStatus();
-                                
-                                // tell the Admin Consoles there is a change
-                                notifyAC();
-                                // this might affect the PDP, so notify it of the change
-                                pdpChanged(pdp);
-                                return;
-                        } else if (request.getParameter("pipId") != null) {
-        //                group=<groupId> pipId=<pipEngineId> contents=pip properties              <= add a PIP to pip config, or replace it if it already exists (lenient operation) 
-        //TODO
-                                logger.error("UNIMPLEMENTED ");
-                                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
-                                return;
-                        } else {
-                                // Assume that this is an update of an existing PDP Group
-                                // ARGS:        group=<groupId>         <= Update an Existing Group
-                                                                
+                if (pdpId == null ||
+                        objectFromJSON == null ||
+                        ! (objectFromJSON instanceof StdPDP) ||
+                        ((StdPDP)objectFromJSON).getId() == null ||
+                        ! ((StdPDP)objectFromJSON).getId().equals(pdpId)) {
+                    logger.error("PDP new/update had bad input. pdpId=" + pdpId + " objectFromJSON="+objectFromJSON);
+                    response.sendError(500, "Bad input, pdpid="+pdpId+" object="+objectFromJSON);
+                }
+                StdPDP pdp = (StdPDP) objectFromJSON;
+
+                if (papEngine.getPDP(pdpId) == null) {
+                    // this is a request to create a new PDP object
+                    papEngine.newPDP(pdp.getId(), group, pdp.getName(), pdp.getDescription());
+                } else {
+                    // this is a request to update the pdp
+                    papEngine.updatePDP(pdp);
+                }
+
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                if (logger.isDebugEnabled()) {
+                    logger.debug("PDP '" + pdpId + "' created/updated");
+                }
+
+                // adjust the group's state including the new PDP
+                ((StdPDPGroup)group).resetStatus();
+
+                // tell the Admin Consoles there is a change
+                notifyAC();
+                // this might affect the PDP, so notify it of the change
+                pdpChanged(pdp);
+                return;
+            } else if (request.getParameter("pipId") != null) {
+                //                group=<groupId> pipId=<pipEngineId> contents=pip properties              <= add a PIP to pip config, or replace it if it already exists (lenient operation)
+                //TODO
+                logger.error("UNIMPLEMENTED ");
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
+                return;
+            } else {
+                // Assume that this is an update of an existing PDP Group
+                // ARGS:        group=<groupId>         <= Update an Existing Group
+
                 // get the request content into a String
                 String json = null;
-                        // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file)
-                    java.util.Scanner scanner = new java.util.Scanner(request.getInputStream());
-                    scanner.useDelimiter("\\A");
-                    json =  scanner.hasNext() ? scanner.next() : "";
-                    scanner.close();
-                    logger.info("JSON request from AC: " + json);
-                
+                // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file)
+                java.util.Scanner scanner = new java.util.Scanner(request.getInputStream());
+                scanner.useDelimiter("\\A");
+                json =  scanner.hasNext() ? scanner.next() : "";
+                scanner.close();
+                logger.info("JSON request from AC: " + json);
+
                 // convert Object sent as JSON into local object
-                    ObjectMapper mapper = new ObjectMapper();
-                    
-                    Object objectFromJSON  = mapper.readValue(json, StdPDPGroup.class);
+                ObjectMapper mapper = new ObjectMapper();
 
-                                if (objectFromJSON == null ||
-                                                ! (objectFromJSON instanceof StdPDPGroup) ||
-                                                ! ((StdPDPGroup)objectFromJSON).getId().equals(group.getId())) {
-                                        logger.error("Group update had bad input. id=" + group.getId() + " objectFromJSON="+objectFromJSON);
-                                        response.sendError(500, "Bad input, id="+group.getId() +" object="+objectFromJSON);
-                                }
-                                
-                                // The Path on the PAP side is not carried on the RESTful interface with the AC
-                                // (because it is local to the PAP)
-                                // so we need to fill that in before submitting the group for update
-                                ((StdPDPGroup)objectFromJSON).setDirectory(((StdPDPGroup)group).getDirectory());
+                Object objectFromJSON  = mapper.readValue(json, StdPDPGroup.class);
 
-                                papEngine.updateGroup((StdPDPGroup)objectFromJSON);
-
-
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("Group '" + group.getId() + "' updated");
-                                }
-                                // tell the Admin Consoles there is a change
-                                notifyAC();
-                                // Group changed, which might include changing the policies
-                                groupChanged(group);
-                                return;
-                        }
-                } catch (PAPException e) {
-                        logger.error("AC PUT exception: " + e, e);
-                        response.sendError(500, e.getMessage());
-                        return;
+                if (objectFromJSON == null ||
+                        ! (objectFromJSON instanceof StdPDPGroup) ||
+                        ! ((StdPDPGroup)objectFromJSON).getId().equals(group.getId())) {
+                    logger.error("Group update had bad input. id=" + group.getId() + " objectFromJSON="+objectFromJSON);
+                    response.sendError(500, "Bad input, id="+group.getId() +" object="+objectFromJSON);
                 }
+
+                // The Path on the PAP side is not carried on the RESTful interface with the AC
+                // (because it is local to the PAP)
+                // so we need to fill that in before submitting the group for update
+                ((StdPDPGroup)objectFromJSON).setDirectory(((StdPDPGroup)group).getDirectory());
+
+                papEngine.updateGroup((StdPDPGroup)objectFromJSON);
+
+
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Group '" + group.getId() + "' updated");
+                }
+                // tell the Admin Consoles there is a change
+                notifyAC();
+                // Group changed, which might include changing the policies
+                groupChanged(group);
+                return;
+            }
+        } catch (PAPException e) {
+            logger.error("AC PUT exception: " + e, e);
+            response.sendError(500, e.getMessage());
+            return;
         }
-        
-        /**
-         * Requests from the Admin Console to delete/remove items
-         * 
-         * @param request
-         * @param response
-         * @param groupId
-         * @throws ServletException
-         * @throws java.io.IOException
-         */
-        private void doACDelete(HttpServletRequest request, HttpServletResponse response, String groupId) throws ServletException, IOException {
-                try {
-                        // for all DELETE operations the group must exist before the operation can be done
-                        PDPGroup group = papEngine.getGroup(groupId);
-                        if (group == null) {
-                                logger.error("Unknown groupId '" + groupId + "'");
-                                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId +"'");
-                                return;
-                        }
-                        // determine the operation needed based on the parameters in the request
-                        if (request.getParameter("policy") != null) {
-        //        group=<groupId> policy=<policyId>  [delete=<true|false>]       <= delete policy file from group
-        //TODO
-                                logger.error("UNIMPLEMENTED ");
-                                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
-                                return;
-                        } else if (request.getParameter("pdpId") != null) {
-                                // ARGS:        group=<groupId> pdpId=<pdpId>                  <= delete PDP 
-                                String pdpId = request.getParameter("pdpId");
-                                PDP pdp = papEngine.getPDP(pdpId);
-                                
-                                papEngine.removePDP(pdp);
-                                
-                                // adjust the status of the group, which may have changed when we removed this PDP
-                                ((StdPDPGroup)group).resetStatus();
-                                
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                notifyAC();
+    }
 
-                                // update the PDP and tell it that it has NO Policies (which prevents it from serving PEP Requests)
-                                pdpChanged(pdp);
-                                return;
-                        } else if (request.getParameter("pipId") != null) {
-        //        group=<groupId> pipId=<pipEngineId> <= delete PIP config for given engine
-        //TODO
-                                logger.error("UNIMPLEMENTED ");
-                                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
-                                return;
-                        } else {
-                                // ARGS:      group=<groupId> movePDPsToGroupId=<movePDPsToGroupId>            <= delete a group and move all its PDPs to the given group
-                                String moveToGroupId = request.getParameter("movePDPsToGroupId");
-                                PDPGroup moveToGroup = null;
-                                if (moveToGroupId != null) {
-                                        moveToGroup = papEngine.getGroup(moveToGroupId);
-                                }
-                                
-                                // get list of PDPs in the group being deleted so we can notify them that they got changed
-                                Set<PDP> movedPDPs = new HashSet<PDP>();
-                                movedPDPs.addAll(group.getPdps());
-                                
-                                // do the move/remove
-                                papEngine.removeGroup(group, moveToGroup);
-                                
-                                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                                notifyAC();
-                                // notify any PDPs in the removed set that their config may have changed
-                                for (PDP pdp : movedPDPs) {
-                                        pdpChanged(pdp);
-                                }
-                                return;
-                        }
+    /**
+     * Requests from the Admin Console to delete/remove items
+     *
+     * @param request
+     * @param response
+     * @param groupId
+     * @throws ServletException
+     * @throws java.io.IOException
+     */
+    private void doACDelete(HttpServletRequest request, HttpServletResponse response, String groupId) throws ServletException, IOException {
+        try {
+            // for all DELETE operations the group must exist before the operation can be done
+            PDPGroup group = papEngine.getGroup(groupId);
+            if (group == null) {
+                logger.error("Unknown groupId '" + groupId + "'");
+                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unknown groupId '" + groupId +"'");
+                return;
+            }
+            // determine the operation needed based on the parameters in the request
+            if (request.getParameter("policy") != null) {
+                //        group=<groupId> policy=<policyId>  [delete=<true|false>]       <= delete policy file from group
+                //TODO
+                logger.error("UNIMPLEMENTED ");
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
+                return;
+            } else if (request.getParameter("pdpId") != null) {
+                // ARGS:        group=<groupId> pdpId=<pdpId>                  <= delete PDP
+                String pdpId = request.getParameter("pdpId");
+                PDP pdp = papEngine.getPDP(pdpId);
 
-                } catch (PAPException e) {
-                        logger.error("AC DELETE exception: " + e, e);
-                        response.sendError(500, e.getMessage());
-                        return;
+                papEngine.removePDP(pdp);
+
+                // adjust the status of the group, which may have changed when we removed this PDP
+                ((StdPDPGroup)group).resetStatus();
+
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                notifyAC();
+
+                // update the PDP and tell it that it has NO Policies (which prevents it from serving PEP Requests)
+                pdpChanged(pdp);
+                return;
+            } else if (request.getParameter("pipId") != null) {
+                //        group=<groupId> pipId=<pipEngineId> <= delete PIP config for given engine
+                //TODO
+                logger.error("UNIMPLEMENTED ");
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "UNIMPLEMENTED");
+                return;
+            } else {
+                // ARGS:      group=<groupId> movePDPsToGroupId=<movePDPsToGroupId>            <= delete a group and move all its PDPs to the given group
+                String moveToGroupId = request.getParameter("movePDPsToGroupId");
+                PDPGroup moveToGroup = null;
+                if (moveToGroupId != null) {
+                    moveToGroup = papEngine.getGroup(moveToGroupId);
                 }
+
+                // get list of PDPs in the group being deleted so we can notify them that they got changed
+                Set<PDP> movedPDPs = new HashSet<PDP>();
+                movedPDPs.addAll(group.getPdps());
+
+                // do the move/remove
+                papEngine.removeGroup(group, moveToGroup);
+
+                response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                notifyAC();
+                // notify any PDPs in the removed set that their config may have changed
+                for (PDP pdp : movedPDPs) {
+                    pdpChanged(pdp);
+                }
+                return;
+            }
+
+        } catch (PAPException e) {
+            logger.error("AC DELETE exception: " + e, e);
+            response.sendError(500, e.getMessage());
+            return;
+        }
+    }
+
+    //
+    // Heartbeat thread - periodically check on PDPs' status
+    //
+
+    /**
+     * Heartbeat with all known PDPs.
+     *
+     * Implementation note:
+     *
+     * The PDPs are contacted Sequentially, not in Parallel.
+     *
+     * If we did this in parallel using multiple threads we would simultaneously use
+     * 		- 1 thread and
+     * 		- 1 connection
+     * for EACH PDP.
+     * This could become a resource problem since we already use multiple threads and connections for updating the PDPs
+     * when user changes occur.
+     * Using separate threads can also make it tricky dealing with timeouts on PDPs that are non-responsive.
+     *
+     * The Sequential operation does a heartbeat request to each PDP one at a time.
+     * This has the flaw that any PDPs that do not respond will hold up the entire heartbeat sequence until they timeout.
+     * If there are a lot of non-responsive PDPs and the timeout is large-ish (the default is 20 seconds)
+     * it could take a long time to cycle through all of the PDPs.
+     * That means that this may not notice a PDP being down in a predictable time.
+     *
+     * @author glenngriffin
+     *
+     */
+    private class Heartbeat implements Runnable {
+        private PAPEngine papEngine;
+        private Set<PDP> pdps = new HashSet<PDP>();
+        private int heartbeatInterval;
+        private int heartbeatTimeout;
+
+        public volatile boolean isRunning = false;
+
+        public synchronized boolean isRunning() {
+            return this.isRunning;
         }
 
-        //
-        // Heartbeat thread - periodically check on PDPs' status
-        //
-        
-        /**
-         * Heartbeat with all known PDPs.
-         * 
-         * Implementation note:
-         * 
-         * The PDPs are contacted Sequentially, not in Parallel.
-         * 
-         * If we did this in parallel using multiple threads we would simultaneously use
-         * 		- 1 thread and
-         * 		- 1 connection
-         * for EACH PDP.
-         * This could become a resource problem since we already use multiple threads and connections for updating the PDPs
-         * when user changes occur.
-         * Using separate threads can also make it tricky dealing with timeouts on PDPs that are non-responsive.
-         * 
-         * The Sequential operation does a heartbeat request to each PDP one at a time.
-         * This has the flaw that any PDPs that do not respond will hold up the entire heartbeat sequence until they timeout.
-         * If there are a lot of non-responsive PDPs and the timeout is large-ish (the default is 20 seconds)
-         * it could take a long time to cycle through all of the PDPs.
-         * That means that this may not notice a PDP being down in a predictable time.
-         * 
-         * @author glenngriffin
-         *
-         */
-        private class Heartbeat implements Runnable {
-                private PAPEngine papEngine;
-                private Set<PDP> pdps = new HashSet<PDP>();
-                private int heartbeatInterval;
-                private int heartbeatTimeout;
-                
-                public volatile boolean isRunning = false;
-                
-                public synchronized boolean isRunning() {
-                        return this.isRunning;
-                }
-                
-                public synchronized void terminate() {
-                        this.isRunning = false;
-                }
-                
-                public Heartbeat(PAPEngine engine) {
-                        this.papEngine = engine;
-                        this.heartbeatInterval = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_HEARTBEAT_INTERVAL, "10000"));
-                        this.heartbeatTimeout = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_HEARTBEAT_TIMEOUT, "10000"));
-                }
+        public synchronized void terminate() {
+            this.isRunning = false;
+        }
 
-                @Override
-                public void run() {
-                        //
-                        // Set ourselves as running
-                        //
-                        synchronized(this) {
-                                this.isRunning = true;
-                        }
-                        HashMap<String, URL> idToURLMap = new HashMap<String, URL>();
+        public Heartbeat(PAPEngine engine) {
+            this.papEngine = engine;
+            this.heartbeatInterval = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_HEARTBEAT_INTERVAL, "10000"));
+            this.heartbeatTimeout = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_HEARTBEAT_TIMEOUT, "10000"));
+        }
+
+        @Override
+        public void run() {
+            //
+            // Set ourselves as running
+            //
+            synchronized(this) {
+                this.isRunning = true;
+            }
+            HashMap<String, URL> idToURLMap = new HashMap<String, URL>();
+            try {
+                while (this.isRunning()) {
+                    // Wait the given time
+                    Thread.sleep(heartbeatInterval);
+
+                    // get the list of PDPs (may have changed since last time)
+                    pdps.clear();
+                    synchronized(papEngine) {
                         try {
-                                while (this.isRunning()) {
-                                        // Wait the given time
-                                        Thread.sleep(heartbeatInterval);
-                                        
-                                        // get the list of PDPs (may have changed since last time)
-                                        pdps.clear();
-                                        synchronized(papEngine) {
-                                                try {
-                                                        for (PDPGroup g : papEngine.getPDPGroups()) {
-                                                                for (PDP p : g.getPdps()) {
-                                                                        pdps.add(p);
-                                                                }
-                                                        }
-                                                } catch (PAPException e) {
-                                                        logger.error("Heartbeat unable to read PDPs from PAPEngine: " + e.getMessage(), e);
-                                                }
-                                        }
-                                        //
-                                        // Check for shutdown
-                                        //
-                                        if (this.isRunning() == false) {
-                                                logger.info("isRunning is false, getting out of loop.");
-                                                break;
-                                        }
-                                        
-                                        // try to get the summary status from each PDP
-                                        boolean changeSeen = false;
-                                        for (PDP pdp : pdps) {
-                                                //
-                                                // Check for shutdown
-                                                //
-                                                if (this.isRunning() == false) {
-                                                        logger.info("isRunning is false, getting out of loop.");
-                                                        break;
-                                                }
-                                                // the id of the PDP is its url (though we add a query parameter)
-                                                URL pdpURL = idToURLMap.get(pdp.getId());
-                                                if (pdpURL == null) {
-                                                        // haven't seen this PDP before
-                                                        String fullURLString = null;
-                                                        try {
-                                                                fullURLString = pdp.getId() + "?type=hb";
-                                                                pdpURL = new URL(fullURLString);
-                                                                idToURLMap.put(pdp.getId(), pdpURL);
-                                                        } catch (MalformedURLException e) {
-                                                                logger.error("PDP id '" + fullURLString + "' is not a valid URL: " + e, e);
-                                                                continue;
-                                                        }
-                                                }
-                                                
-                                                // Do a GET with type HeartBeat
-                                                String newStatus = "";
-                                                
-                                                HttpURLConnection connection = null;
-                                                try {
-
-                                                        //
-                                                        // Open up the connection
-                                                        //
-                                                        connection = (HttpURLConnection)pdpURL.openConnection();
-                                                        //
-                                                        // Setup our method and headers
-                                                        //
-                                            connection.setRequestMethod("GET");
-                                            connection.setConnectTimeout(heartbeatTimeout);
-                                            //
-                                            // Do the connect
-                                            //
-                                            connection.connect();
-                                            if (connection.getResponseCode() == 204) {
-                                                newStatus = connection.getHeaderField(XACMLRestProperties.PROP_PDP_HTTP_HEADER_HB);
-                                                                if (logger.isDebugEnabled()) {
-                                                                        logger.debug("Heartbeat '" + pdp.getId() + "' status='" + newStatus + "'");
-                                                                }
-                                            } else {
-                                                // anything else is an unexpected result
-                                                newStatus = PDPStatus.Status.UNKNOWN.toString();
-                                                logger.error("Heartbeat connect response code " + connection.getResponseCode() + ": " + pdp.getId());
-                                            }
-                                    } catch (UnknownHostException e) {
-                                        newStatus = PDPStatus.Status.NO_SUCH_HOST.toString();
-                                        logger.error("Heartbeat '" + pdp.getId() + "' NO_SUCH_HOST");
-                                                } catch (SocketTimeoutException e) {
-                                        newStatus = PDPStatus.Status.CANNOT_CONNECT.toString();
-                                        logger.error("Heartbeat '" + pdp.getId() + "' connection timeout: " + e );
-                                                } catch (ConnectException e) {
-                                        newStatus = PDPStatus.Status.CANNOT_CONNECT.toString();
-                                        logger.error("Heartbeat '" + pdp.getId() + "' cannot connect: " + e );
-                                                } catch (Exception e) {
-                                        newStatus = PDPStatus.Status.UNKNOWN.toString();
-                                        logger.error("Heartbeat '" + pdp.getId() + "' connect exception: " + e, e);
-                                                } finally {
-                                                        // cleanup the connection
-                                                        connection.disconnect();
-                                                }
-
-                                                if ( ! pdp.getStatus().getStatus().toString().equals(newStatus)) {
-                                                        if (logger.isDebugEnabled()) {
-                                                                logger.debug("previous status='" + pdp.getStatus().getStatus()+"'  new Status='" + newStatus + "'");
-                                                        }
-                                        try {
-                                                                setPDPSummaryStatus(pdp, newStatus);
-                                                        } catch (PAPException e) {
-                                                                logger.error("Unable to set state for PDP '" + pdp.getId() + "': " + e, e);
-                                                        }
-                                                        changeSeen = true;
-                                                }
-                                                
-                                        }
-                                        //
-                                        // Check for shutdown
-                                        //
-                                        if (this.isRunning() == false) {
-                                                logger.info("isRunning is false, getting out of loop.");
-                                                break;
-                                        }
-
-                                        // if any of the PDPs changed state, tell the ACs to update
-                                        if (changeSeen) {
-                                                notifyAC();
-                                        }
-                                        
+                            for (PDPGroup g : papEngine.getPDPGroups()) {
+                                for (PDP p : g.getPdps()) {
+                                    pdps.add(p);
                                 }
-                        } catch (InterruptedException e) {
-                                logger.error("Heartbeat interrupted.  Shutting down");
-                                this.terminate();
+                            }
+                        } catch (PAPException e) {
+                            logger.error("Heartbeat unable to read PDPs from PAPEngine: " + e.getMessage(), e);
                         }
-                }
-        }
-        
-        
-        //
-        // HELPER to change Group status when PDP status is changed
-        //
-        // (Must NOT be called from a method that is synchronized on the papEngine or it may deadlock)
-        //
-        
-        private void setPDPSummaryStatus(PDP pdp, PDPStatus.Status newStatus) throws PAPException {
-                setPDPSummaryStatus(pdp, newStatus.toString());
-        }
+                    }
+                    //
+                    // Check for shutdown
+                    //
+                    if (this.isRunning() == false) {
+                        logger.info("isRunning is false, getting out of loop.");
+                        break;
+                    }
 
-        private void setPDPSummaryStatus(PDP pdp, String newStatus) throws PAPException {
-        synchronized(papEngine) {
-                StdPDPStatus status = (StdPDPStatus)pdp.getStatus();
-                status.setStatus(PDPStatus.Status.valueOf(newStatus));
-                ((StdPDP)pdp).setStatus(status);
-                
-                // now adjust the group
-                StdPDPGroup group = (StdPDPGroup)papEngine.getPDPGroup(pdp);
-                // if the PDP was just deleted it may transiently exist but not be in a group
-                if (group != null) {
-                        group.resetStatus();
-                }
-        }
-        }
-        
-        
-        //
-        // Callback methods telling this servlet to notify PDPs of changes made by the PAP StdEngine
-        //	in the PDP group directories
-        //
-        
-        @Override
-        public void changed() {
-                // all PDPs in all groups need to be updated/sync'd
-                Set<PDPGroup> groups;
-                try {
-                        groups = papEngine.getPDPGroups();
-                } catch (PAPException e) {
-                        logger.error("getPDPGroups failed: " + e.getLocalizedMessage());
-                        throw new RuntimeException("Unable to get Groups: " + e);
-                }
-                for (PDPGroup group : groups) {
-                        groupChanged(group);
-                }
-        }
+                    // try to get the summary status from each PDP
+                    boolean changeSeen = false;
+                    for (PDP pdp : pdps) {
+                        //
+                        // Check for shutdown
+                        //
+                        if (this.isRunning() == false) {
+                            logger.info("isRunning is false, getting out of loop.");
+                            break;
+                        }
+                        // the id of the PDP is its url (though we add a query parameter)
+                        URL pdpURL = idToURLMap.get(pdp.getId());
+                        if (pdpURL == null) {
+                            // haven't seen this PDP before
+                            String fullURLString = null;
+                            try {
+                                fullURLString = pdp.getId() + "?type=hb";
+                                pdpURL = new URL(fullURLString);
+                                idToURLMap.put(pdp.getId(), pdpURL);
+                            } catch (MalformedURLException e) {
+                                logger.error("PDP id '" + fullURLString + "' is not a valid URL: " + e, e);
+                                continue;
+                            }
+                        }
 
-        @Override
-        public void groupChanged(PDPGroup group) {
-                // all PDPs within one group need to be updated/sync'd
-                for (PDP pdp : group.getPdps()) {
-                        pdpChanged(pdp);
-                }
-        }
+                        // Do a GET with type HeartBeat
+                        String newStatus = "";
 
-        @Override
-        public void pdpChanged(PDP pdp) {
-                // kick off a thread to do an event notification for each PDP.
-                // This needs to be on a separate thread so that PDPs that do not respond (down, non-existent, etc)
-                // do not block the PSP response to the AC, which would freeze the GUI until all PDPs sequentially respond or time-out.
-                Thread t = new Thread(new UpdatePDPThread(pdp));
-                t.start();
-        }
-        
-        private class UpdatePDPThread implements Runnable {
-                private PDP pdp;
-
-                // remember which PDP to notify
-                public UpdatePDPThread(PDP pdp) {
-                        this.pdp = pdp;
-                }
-
-                public void run() {
-                        // send the current configuration to one PDP
                         HttpURLConnection connection = null;
                         try {
-                                
-                                //
-                                // the Id of the PDP is its URL
-                                //
+
+                            //
+                            // Open up the connection
+                            //
+                            connection = (HttpURLConnection)pdpURL.openConnection();
+                            //
+                            // Setup our method and headers
+                            //
+                            connection.setRequestMethod("GET");
+                            connection.setConnectTimeout(heartbeatTimeout);
+                            //
+                            // Do the connect
+                            //
+                            connection.connect();
+                            if (connection.getResponseCode() == 204) {
+                                newStatus = connection.getHeaderField(XACMLRestProperties.PROP_PDP_HTTP_HEADER_HB);
                                 if (logger.isDebugEnabled()) {
-                                        logger.debug("creating url for id '" + pdp.getId() + "'");
+                                    logger.debug("Heartbeat '" + pdp.getId() + "' status='" + newStatus + "'");
                                 }
-        //TODO - currently always send both policies and pips.  Do we care enough to add code to allow sending just one or the other?
-        //TODO		(need to change "cache=", implying getting some input saying which to change)
-                                URL url = new URL(pdp.getId() + "?cache=all");
-                                
-                                //
-                                // Open up the connection
-                                //
-                                connection = (HttpURLConnection)url.openConnection();
-                                //
-                                // Setup our method and headers
-                                //
+                            } else {
+                                // anything else is an unexpected result
+                                newStatus = PDPStatus.Status.UNKNOWN.toString();
+                                logger.error("Heartbeat connect response code " + connection.getResponseCode() + ": " + pdp.getId());
+                            }
+                        } catch (UnknownHostException e) {
+                            newStatus = PDPStatus.Status.NO_SUCH_HOST.toString();
+                            logger.error("Heartbeat '" + pdp.getId() + "' NO_SUCH_HOST");
+                        } catch (SocketTimeoutException e) {
+                            newStatus = PDPStatus.Status.CANNOT_CONNECT.toString();
+                            logger.error("Heartbeat '" + pdp.getId() + "' connection timeout: " + e );
+                        } catch (ConnectException e) {
+                            newStatus = PDPStatus.Status.CANNOT_CONNECT.toString();
+                            logger.error("Heartbeat '" + pdp.getId() + "' cannot connect: " + e );
+                        } catch (Exception e) {
+                            newStatus = PDPStatus.Status.UNKNOWN.toString();
+                            logger.error("Heartbeat '" + pdp.getId() + "' connect exception: " + e, e);
+                        } finally {
+                            // cleanup the connection
+                            connection.disconnect();
+                        }
+
+                        if ( ! pdp.getStatus().getStatus().toString().equals(newStatus)) {
+                            if (logger.isDebugEnabled()) {
+                                logger.debug("previous status='" + pdp.getStatus().getStatus()+"'  new Status='" + newStatus + "'");
+                            }
+                            try {
+                                setPDPSummaryStatus(pdp, newStatus);
+                            } catch (PAPException e) {
+                                logger.error("Unable to set state for PDP '" + pdp.getId() + "': " + e, e);
+                            }
+                            changeSeen = true;
+                        }
+
+                    }
+                    //
+                    // Check for shutdown
+                    //
+                    if (this.isRunning() == false) {
+                        logger.info("isRunning is false, getting out of loop.");
+                        break;
+                    }
+
+                    // if any of the PDPs changed state, tell the ACs to update
+                    if (changeSeen) {
+                        notifyAC();
+                    }
+
+                }
+            } catch (InterruptedException e) {
+                logger.error("Heartbeat interrupted.  Shutting down");
+                this.terminate();
+            }
+        }
+    }
+
+
+    //
+    // HELPER to change Group status when PDP status is changed
+    //
+    // (Must NOT be called from a method that is synchronized on the papEngine or it may deadlock)
+    //
+
+    private void setPDPSummaryStatus(PDP pdp, PDPStatus.Status newStatus) throws PAPException {
+        setPDPSummaryStatus(pdp, newStatus.toString());
+    }
+
+    private void setPDPSummaryStatus(PDP pdp, String newStatus) throws PAPException {
+        synchronized(papEngine) {
+            StdPDPStatus status = (StdPDPStatus)pdp.getStatus();
+            status.setStatus(PDPStatus.Status.valueOf(newStatus));
+            ((StdPDP)pdp).setStatus(status);
+
+            // now adjust the group
+            StdPDPGroup group = (StdPDPGroup)papEngine.getPDPGroup(pdp);
+            // if the PDP was just deleted it may transiently exist but not be in a group
+            if (group != null) {
+                group.resetStatus();
+            }
+        }
+    }
+
+
+    //
+    // Callback methods telling this servlet to notify PDPs of changes made by the PAP StdEngine
+    //	in the PDP group directories
+    //
+
+    @Override
+    public void changed() {
+        // all PDPs in all groups need to be updated/sync'd
+        Set<PDPGroup> groups;
+        try {
+            groups = papEngine.getPDPGroups();
+        } catch (PAPException e) {
+            logger.error("getPDPGroups failed: " + e.getLocalizedMessage());
+            throw new RuntimeException("Unable to get Groups: " + e);
+        }
+        for (PDPGroup group : groups) {
+            groupChanged(group);
+        }
+    }
+
+    @Override
+    public void groupChanged(PDPGroup group) {
+        // all PDPs within one group need to be updated/sync'd
+        for (PDP pdp : group.getPdps()) {
+            pdpChanged(pdp);
+        }
+    }
+
+    @Override
+    public void pdpChanged(PDP pdp) {
+        // kick off a thread to do an event notification for each PDP.
+        // This needs to be on a separate thread so that PDPs that do not respond (down, non-existent, etc)
+        // do not block the PSP response to the AC, which would freeze the GUI until all PDPs sequentially respond or time-out.
+        Thread t = new Thread(new UpdatePDPThread(pdp));
+        t.start();
+    }
+
+    private class UpdatePDPThread implements Runnable {
+        private PDP pdp;
+
+        // remember which PDP to notify
+        public UpdatePDPThread(PDP pdp) {
+            this.pdp = pdp;
+        }
+
+        public void run() {
+            // send the current configuration to one PDP
+            HttpURLConnection connection = null;
+            try {
+
+                //
+                // the Id of the PDP is its URL
+                //
+                if (logger.isDebugEnabled()) {
+                    logger.debug("creating url for id '" + pdp.getId() + "'");
+                }
+                //TODO - currently always send both policies and pips.  Do we care enough to add code to allow sending just one or the other?
+                //TODO		(need to change "cache=", implying getting some input saying which to change)
+                URL url = new URL(pdp.getId() + "?cache=all");
+
+                //
+                // Open up the connection
+                //
+                connection = (HttpURLConnection)url.openConnection();
+                //
+                // Setup our method and headers
+                //
+                connection.setRequestMethod("PUT");
+                //			connection.setRequestProperty("Accept", "text/x-java-properties");
+                connection.setRequestProperty("Content-Type", "text/x-java-properties");
+                //            connection.setUseCaches(false);
+                //
+                // Adding this in. It seems the HttpUrlConnection class does NOT
+                // properly forward our headers for POST re-direction. It does so
+                // for a GET re-direction.
+                //
+                // So we need to handle this ourselves.
+                //
+                //TODO - is this needed for a PUT?  seems better to leave in for now?
+//	            connection.setInstanceFollowRedirects(false);
+                //
+                // PLD - MUST be able to handle re-directs.
+                //
+                connection.setInstanceFollowRedirects(true);
+                connection.setDoOutput(true);
+                //			connection.setDoInput(true);
+                try (OutputStream os = connection.getOutputStream()) {
+
+                    PDPGroup group = papEngine.getPDPGroup(pdp);
+                    // if the PDP was just deleted, there is no group, but we want to send an update anyway
+                    if (group == null) {
+                        // create blank properties files
+                        Properties policyProperties = new Properties();
+                        policyProperties.put(XACMLProperties.PROP_ROOTPOLICIES, "");
+                        policyProperties.put(XACMLProperties.PROP_REFERENCEDPOLICIES, "");
+                        policyProperties.store(os, "");
+
+                        Properties pipProps = new Properties();
+                        pipProps.setProperty(XACMLProperties.PROP_PIP_ENGINES, "");
+                        pipProps.store(os, "");
+
+                    } else {
+                        // send properties from the current group
+                        group.getPolicyProperties().store(os, "");
+                        Properties policyLocations = new Properties();
+                        for (PDPPolicy policy : group.getPolicies()) {
+                            policyLocations.put(policy.getId() + ".url", XACMLPapServlet.papURL + "?id=" + policy.getId());
+                        }
+                        policyLocations.store(os, "");
+                        group.getPipConfigProperties().store(os, "");
+                    }
+
+                } catch (Exception e) {
+                    logger.error("Failed to send property file to " + pdp.getId(), e);
+                    // Since this is a server-side error, it probably does not reflect a problem on the client,
+                    // so do not change the PDP status.
+                    return;
+                }
+                //
+                // Do the connect
+                //
+                connection.connect();
+                if (connection.getResponseCode() == 204) {
+                    logger.info("Success. We are configured correctly.");
+                    setPDPSummaryStatus(pdp, PDPStatus.Status.UP_TO_DATE);
+                } else if (connection.getResponseCode() == 200) {
+                    logger.info("Success. PDP needs to update its configuration.");
+                    setPDPSummaryStatus(pdp, PDPStatus.Status.OUT_OF_SYNCH);
+                } else {
+                    logger.warn("Failed: " + connection.getResponseCode() + "  message: " + connection.getResponseMessage());
+                    setPDPSummaryStatus(pdp, PDPStatus.Status.UNKNOWN);
+                }
+            } catch (Exception e) {
+                logger.error("Unable to sync config with PDP '" + pdp.getId() + "': " + e, e);
+                try {
+                    setPDPSummaryStatus(pdp, PDPStatus.Status.UNKNOWN);
+                } catch (PAPException e1) {
+                    logger.error("Unable to set status of PDP '" + pdp.getId() + "' to UNKNOWN: " + e, e);
+                }
+            } finally {
+                // cleanup the connection
+                connection.disconnect();
+
+                // tell the AC to update it's status info
+                notifyAC();
+            }
+
+        }
+    }
+
+    //
+    // RESTful Interface from PAP to ACs notifying them of changes
+    //
+
+    private void notifyAC() {
+        // kick off a thread to do one event notification for all registered ACs
+        // This needs to be on a separate thread so that ACs can make calls back to PAP to get the updated Group data
+        // as part of processing this message on their end.
+        Thread t = new Thread(new NotifyACThread());
+        t.start();
+    }
+
+    private class NotifyACThread implements Runnable {
+
+        public void run() {
+            List<String> disconnectedACs = new ArrayList<String>();
+// logger.debug("LIST SIZE="+adminConsoleURLStringList.size());
+
+            // There should be no Concurrent exception here because the list is a CopyOnWriteArrayList.
+            // The "for each" loop uses the collection's iterator under the covers, so it should be correct.
+            for (String acURL : adminConsoleURLStringList) {
+                HttpURLConnection connection = null;
+                try {
+
+                    acURL += "?PAPNotification=true";
+
+//TODO - Currently we just tell AC that "Something changed" without being specific.  Do we want to tell it which group/pdp changed?
+//TODO - If so, put correct parameters into the Query string here
+                    acURL += "&objectType=all" + "&action=update";
+
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("creating url for id '" + acURL + "'");
+                    }
+//TODO - currently always send both policies and pips.  Do we care enough to add code to allow sending just one or the other?
+//TODO		(need to change "cache=", implying getting some input saying which to change)
+
+                    URL url = new URL(acURL );
+
+                    //
+                    // Open up the connection
+                    //
+                    connection = (HttpURLConnection)url.openConnection();
+                    //
+                    // Setup our method and headers
+                    //
                     connection.setRequestMethod("PUT");
-        //			connection.setRequestProperty("Accept", "text/x-java-properties");
                     connection.setRequestProperty("Content-Type", "text/x-java-properties");
-        //            connection.setUseCaches(false);
                     //
                     // Adding this in. It seems the HttpUrlConnection class does NOT
                     // properly forward our headers for POST re-direction. It does so
@@ -1384,166 +1511,40 @@
                     //
                     // So we need to handle this ourselves.
                     //
-        //TODO - is this needed for a PUT?  seems better to leave in for now?
-//	            connection.setInstanceFollowRedirects(false);
+                    //TODO - is this needed for a PUT?  seems better to leave in for now?
+                    connection.setInstanceFollowRedirects(false);
                     //
-                    // PLD - MUST be able to handle re-directs.
+                    // Do not include any data in the PUT because this is just a
+                    // notification to the AC.
+                    // The AC will use GETs back to the PAP to get what it needs
+                    // to fill in the screens.
                     //
-                    connection.setInstanceFollowRedirects(true);
-                                connection.setDoOutput(true);
-        //			connection.setDoInput(true);
-                        try (OutputStream os = connection.getOutputStream()) {
-        
-                                PDPGroup group = papEngine.getPDPGroup(pdp);
-                                // if the PDP was just deleted, there is no group, but we want to send an update anyway
-                                if (group == null) {
-                                        // create blank properties files
-                                        Properties policyProperties = new Properties();
-                                        policyProperties.put(XACMLProperties.PROP_ROOTPOLICIES, "");
-                                        policyProperties.put(XACMLProperties.PROP_REFERENCEDPOLICIES, "");
-                                        policyProperties.store(os, "");
-                                        
-                                        Properties pipProps = new Properties();
-                                                pipProps.setProperty(XACMLProperties.PROP_PIP_ENGINES, "");
-                                                pipProps.store(os, "");
-                                        
-                                } else {
-                                        // send properties from the current group
-                                        group.getPolicyProperties().store(os, "");
-                                        Properties policyLocations = new Properties();
-                                        for (PDPPolicy policy : group.getPolicies()) {
-                                                   policyLocations.put(policy.getId() + ".url", XACMLPapServlet.papURL + "?id=" + policy.getId());
-                                        }
-                                        policyLocations.store(os, "");
-                                        group.getPipConfigProperties().store(os, "");
-                                }
-                
-                        } catch (Exception e) {
-                                logger.error("Failed to send property file to " + pdp.getId(), e);
-                                // Since this is a server-side error, it probably does not reflect a problem on the client,
-                                // so do not change the PDP status.
-                                return;
-                        }
+
                     //
                     // Do the connect
                     //
                     connection.connect();
                     if (connection.getResponseCode() == 204) {
-                        logger.info("Success. We are configured correctly.");
-                                        setPDPSummaryStatus(pdp, PDPStatus.Status.UP_TO_DATE);
-                    } else if (connection.getResponseCode() == 200) {
-                        logger.info("Success. PDP needs to update its configuration.");
-                                        setPDPSummaryStatus(pdp, PDPStatus.Status.OUT_OF_SYNCH);
+                        logger.info("Success. We updated correctly.");
                     } else {
                         logger.warn("Failed: " + connection.getResponseCode() + "  message: " + connection.getResponseMessage());
-                                        setPDPSummaryStatus(pdp, PDPStatus.Status.UNKNOWN);
                     }
-                        } catch (Exception e) {
-                                logger.error("Unable to sync config with PDP '" + pdp.getId() + "': " + e, e);
-                                try {
-                                        setPDPSummaryStatus(pdp, PDPStatus.Status.UNKNOWN);
-                                } catch (PAPException e1) {
-                                        logger.error("Unable to set status of PDP '" + pdp.getId() + "' to UNKNOWN: " + e, e);
-                                }
-                        } finally {
-                                // cleanup the connection
-                                connection.disconnect();
-                                
-                    // tell the AC to update it's status info
-                    notifyAC();
-                        }
-                        
-                }
-        }
 
-        //
-        // RESTful Interface from PAP to ACs notifying them of changes
-        //
-        
-        private void notifyAC() {
-                // kick off a thread to do one event notification for all registered ACs
-                // This needs to be on a separate thread so that ACs can make calls back to PAP to get the updated Group data
-                // as part of processing this message on their end.
-                Thread t = new Thread(new NotifyACThread());
-                t.start();
-        }
-        
-        private class NotifyACThread implements Runnable {
-        
-                public void run() {
-                        List<String> disconnectedACs = new ArrayList<String>();
-// logger.debug("LIST SIZE="+adminConsoleURLStringList.size());
-                        
-                        // There should be no Concurrent exception here because the list is a CopyOnWriteArrayList.
-                        // The "for each" loop uses the collection's iterator under the covers, so it should be correct.
-                        for (String acURL : adminConsoleURLStringList) {
-                                HttpURLConnection connection = null;
-                                try {
-                                        
-                                        acURL += "?PAPNotification=true";
-                                        
-//TODO - Currently we just tell AC that "Something changed" without being specific.  Do we want to tell it which group/pdp changed?
-//TODO - If so, put correct parameters into the Query string here
-                                        acURL += "&objectType=all" + "&action=update";
-        
-                                        if (logger.isDebugEnabled()) {
-                                                logger.debug("creating url for id '" + acURL + "'");
-                                        }
-//TODO - currently always send both policies and pips.  Do we care enough to add code to allow sending just one or the other?
-//TODO		(need to change "cache=", implying getting some input saying which to change)
-                                        
-                                        URL url = new URL(acURL );
-                                        
-                                        //
-                                        // Open up the connection
-                                        //
-                                        connection = (HttpURLConnection)url.openConnection();
-                                        //
-                                        // Setup our method and headers
-                                        //
-                            connection.setRequestMethod("PUT");
-                            connection.setRequestProperty("Content-Type", "text/x-java-properties");
-                            //
-                            // Adding this in. It seems the HttpUrlConnection class does NOT
-                            // properly forward our headers for POST re-direction. It does so
-                            // for a GET re-direction.
-                            //
-                            // So we need to handle this ourselves.
-                            //
-                //TODO - is this needed for a PUT?  seems better to leave in for now?
-                            connection.setInstanceFollowRedirects(false);
-                                        //
-                                        // Do not include any data in the PUT because this is just a
-                                        // notification to the AC.
-                                        // The AC will use GETs back to the PAP to get what it needs
-                                        // to fill in the screens.
-                                        //
-                                        
-                            //
-                            // Do the connect
-                            //
-                            connection.connect();
-                            if (connection.getResponseCode() == 204) {
-                                logger.info("Success. We updated correctly.");
-                            } else {
-                                logger.warn("Failed: " + connection.getResponseCode() + "  message: " + connection.getResponseMessage());
-                            }
-                                        
-                                } catch (Exception e) {
-                                        logger.error("Unable to sync config AC '" + acURL + "': " + e, e);
-                                        disconnectedACs.add(acURL);
-                                } finally {
-                                        // cleanup the connection
-                                        connection.disconnect();
-                                }
-                        }
-                        
-                        // remove any ACs that are no longer connected
-                        if (disconnectedACs.size() > 0) {
-                                adminConsoleURLStringList.removeAll(disconnectedACs);
-                        }
-
+                } catch (Exception e) {
+                    logger.error("Unable to sync config AC '" + acURL + "': " + e, e);
+                    disconnectedACs.add(acURL);
+                } finally {
+                    // cleanup the connection
+                    connection.disconnect();
                 }
+            }
+
+            // remove any ACs that are no longer connected
+            if (disconnectedACs.size() > 0) {
+                adminConsoleURLStringList.removeAll(disconnectedACs);
+            }
+
         }
+    }
 
 }
diff --git a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpLoader.java b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpLoader.java
index 299f609..cb63725 100644
--- a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpLoader.java
+++ b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpLoader.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -69,422 +69,422 @@
 
 /**
  * Does the work for loading policy and PIP configurations sent from the PAP servlet.
- * 
- * 
+ *
+ *
  * @author pameladragosh
  *
  */
 public class XACMLPdpLoader {
-        private static final Log logger	= LogFactory.getLog(XACMLPdpLoader.class);
-        
-        public static synchronized PDPEngine loadEngine(StdPDPStatus status, Properties policyProperties, Properties pipProperties) {
-                logger.info("loadEngine: " + policyProperties + " "+ pipProperties);
+    private static final Log logger	= LogFactory.getLog(XACMLPdpLoader.class);
+
+    public static synchronized PDPEngine loadEngine(StdPDPStatus status, Properties policyProperties, Properties pipProperties) {
+        logger.info("loadEngine: " + policyProperties + " "+ pipProperties);
+        //
+        // First load our policies
+        //
+        try {
+            //
+            // Were we given some properties?
+            //
+            if (policyProperties == null) {
                 //
-                // First load our policies
+                // On init we have no incoming configuration, so just
+                // Load our current saved configuration
                 //
-                try {
-                        //
-                        // Were we given some properties?
-                        //
-                        if (policyProperties == null) {
-                                //
-                                // On init we have no incoming configuration, so just
-                                // Load our current saved configuration
-                                //
-                                policyProperties = new Properties();
-                                try (InputStream is = Files.newInputStream(getPDPPolicyCache())) {
-                                        policyProperties.load(is);
-                                }
-                        }
-                        
-                        //
-                        // Get our policy cache up-to-date
-                        //
-                        // Side effects of this include:
-                        //	- downloading of policies from remote locations, and
-                        //	- creating new "<PolicyId>.file" properties for files existing local
-                        //
-                        XACMLPdpLoader.cachePolicies(policyProperties);
-                        //
-                        // Validate the policies
-                        //
-                        XACMLPdpLoader.validatePolicies(policyProperties, status);
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Status: " + status);
-                        }
-                } catch (Exception e) {
-                        String error = "Failed to load Policy Cache properties file: " + e.getMessage();
-                        logger.error(error, e);
-                        status.addLoadError(error);
-                        status.setStatus(PDPStatus.Status.LOAD_ERRORS);
+                policyProperties = new Properties();
+                try (InputStream is = Files.newInputStream(getPDPPolicyCache())) {
+                    policyProperties.load(is);
                 }
-                //
-                // Load our PIP configuration
-                //
-                try {
-                        //
-                        // Were we given some properties to use?
-                        //
-                        if (pipProperties == null) {
-                                //
-                                // Load our current saved configuration
-                                //
-                                pipProperties = new Properties();
-                                try (InputStream is = Files.newInputStream(getPIPConfig())) {
-                                        pipProperties.load(is);				
-                                }
-                        }
-                        //
-                        // Validate our PIP configurations
-                        //
-                        XACMLPdpLoader.validatePipConfiguration(pipProperties, status);
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Status: " + status);
-                        }
-                } catch (Exception e) {
-                        String error = "Failed to load/validate Pip Config properties file: " + e.getMessage();
-                        logger.error(error, e);
-                        status.addLoadError(error);
-                        status.setStatus(PDPStatus.Status.LOAD_ERRORS);
-                }
-                //
-                // Were they validated?
-                //
-                if (status.getStatus() == Status.LOAD_ERRORS) {
-                        logger.error("there were load errors");
-                        return null;
-                }
-                //
-                // Reset our official properties the PDP factory
-                // uses to configure the PDP engine.
-                //
-                XACMLRest.loadXacmlProperties(policyProperties, pipProperties);
-                //
-                // Dump ALL our properties that we are trying to load
-                //
-                try {
-                        logger.info(XACMLProperties.getProperties().toString());
-                } catch (IOException e) {
-                        logger.error("Failed to get XACML Properties", e);
-                }
-                //
-                // Now load the PDP engine
-                //
-                PDPEngineFactory factory	= null;
-                PDPEngine engine	= null;
-                try {
-                        factory	= PDPEngineFactory.newInstance();
-                        engine	= factory.newEngine();
-                        logger.info("Loaded new PDP engine.");
-                        status.setStatus(Status.UP_TO_DATE);
-                } catch (FactoryException e) {
-                        String error = "Failed to create new PDP Engine";
-                        logger.error(error, e);
-                        status.addLoadError(error);
-                }
-                return engine;
+            }
+
+            //
+            // Get our policy cache up-to-date
+            //
+            // Side effects of this include:
+            //	- downloading of policies from remote locations, and
+            //	- creating new "<PolicyId>.file" properties for files existing local
+            //
+            XACMLPdpLoader.cachePolicies(policyProperties);
+            //
+            // Validate the policies
+            //
+            XACMLPdpLoader.validatePolicies(policyProperties, status);
+            if (logger.isDebugEnabled()) {
+                logger.debug("Status: " + status);
+            }
+        } catch (Exception e) {
+            String error = "Failed to load Policy Cache properties file: " + e.getMessage();
+            logger.error(error, e);
+            status.addLoadError(error);
+            status.setStatus(PDPStatus.Status.LOAD_ERRORS);
         }
-        
-        public static synchronized void validatePolicies(Properties properties, StdPDPStatus status) throws PAPException {
-                Set<String> rootPolicies = XACMLProperties.getRootPolicyIDs(properties);
-                Set<String> refPolicies = XACMLProperties.getReferencedPolicyIDs(properties);
-                
-                for (String id : rootPolicies) {
-                        loadPolicy(properties, status, id, true);
+        //
+        // Load our PIP configuration
+        //
+        try {
+            //
+            // Were we given some properties to use?
+            //
+            if (pipProperties == null) {
+                //
+                // Load our current saved configuration
+                //
+                pipProperties = new Properties();
+                try (InputStream is = Files.newInputStream(getPIPConfig())) {
+                    pipProperties.load(is);
                 }
-                // remember which policies were root policies
-                status.addAllLoadedRootPolicies(status.getLoadedPolicies());
-                
-                for (String id : refPolicies) {
-                        loadPolicy(properties, status, id, false);
-                }
-                
-                logger.info("Loaded " + status.getLoadedPolicies().size() + " policies, failed to load " + status.getFailedPolicies().size() + " policies, " +
-                                status.getLoadedRootPolicies().size() + " root policies");
-                if (status.getLoadedRootPolicies().size() == 0) {
-                        logger.warn("NO ROOT POLICIES LOADED!!!  Cannot serve PEP Requests.");
-                        status.addLoadWarning("NO ROOT POLICIES LOADED!!!  Cannot serve PEP Requests.");
-                }
+            }
+            //
+            // Validate our PIP configurations
+            //
+            XACMLPdpLoader.validatePipConfiguration(pipProperties, status);
+            if (logger.isDebugEnabled()) {
+                logger.debug("Status: " + status);
+            }
+        } catch (Exception e) {
+            String error = "Failed to load/validate Pip Config properties file: " + e.getMessage();
+            logger.error(error, e);
+            status.addLoadError(error);
+            status.setStatus(PDPStatus.Status.LOAD_ERRORS);
         }
-        
-        public static synchronized void loadPolicy(Properties properties, StdPDPStatus status, String id, boolean isRoot) throws PAPException {
-                PolicyDef policy = null;
-                String location = null;
-                URI locationURI = null;
-                boolean isFile = false;
-                try {
-                        location = properties.getProperty(id + ".file");
-                        if (location == null) {
-                                location = properties.getProperty(id + ".url");
-                                if (location != null) {
-                                        //
-                                        // Construct the URL
-                                        //
-                                        locationURI = URI.create(location);
-                                        URL url = locationURI.toURL();
-                                        URLConnection urlConnection = url.openConnection();
-                                        urlConnection.setRequestProperty(XACMLRestProperties.PROP_PDP_HTTP_HEADER_ID, XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_ID));
-                                        //
-                                        // Now construct the output file name
-                                        //
-                                        Path outFile = Paths.get(getPDPConfig().toAbsolutePath().toString(), id);
-                                        //
-                                        // Copy it to disk
-                                        //
-                                        try (FileOutputStream fos = new FileOutputStream(outFile.toFile())) {
-                                                IOUtils.copy(urlConnection.getInputStream(), fos);
-                                        }
-                                        //
-                                        // Now try to load
-                                        //
-                                        isFile = true;
-                                        try (InputStream fis = Files.newInputStream(outFile)) {
-                                                policy = DOMPolicyDef.load(fis);
-                                        }
-                                        //
-                                        // Save it
-                                        //
-                                        properties.setProperty(id + ".file", outFile.toAbsolutePath().toString());
-                                }
-                        } else {
-                                isFile = true;
-                                locationURI = Paths.get(location).toUri();
-                                try (InputStream is = Files.newInputStream(Paths.get(location))) {
-                                        policy = DOMPolicyDef.load(is);
-                                }
-                        }
-                        if (policy != null) {
-                                status.addLoadedPolicy(new StdPDPPolicy(id, isRoot, locationURI, properties));
-                                logger.info("Loaded policy: " + policy.getIdentifier() + " version: " + policy.getVersion().stringValue());
-                        } else {
-                                String error = "Failed to load policy " + location;
-                                logger.error(error);
-                                status.setStatus(PDPStatus.Status.LOAD_ERRORS);
-                                status.addLoadError(error);
-                                status.addFailedPolicy(new StdPDPPolicy(id, isRoot));
-                        }
-                } catch (Exception e) {
-                        logger.error("Failed to load policy '" + id + "' from location '" + location + "'", e);
-                        status.setStatus(PDPStatus.Status.LOAD_ERRORS);
-                        status.addFailedPolicy(new StdPDPPolicy(id, isRoot));
-                        //
-                        // Is it a file?
-                        //
-                        if (isFile) {
-                                //
-                                // Let's remove it
-                                //
-                                try {
-                                        logger.error("Corrupted policy file, deleting: " + location);
-                                        Files.delete(Paths.get(location));
-                                } catch (IOException e1) {
-                                        logger.error(e1);
-                                }
-                        }
-                        throw new PAPException("Failed to load policy '" + id + "' from location '" + location + "'");
-                }
+        //
+        // Were they validated?
+        //
+        if (status.getStatus() == Status.LOAD_ERRORS) {
+            logger.error("there were load errors");
+            return null;
         }
-        
-        public static synchronized void validatePipConfiguration(Properties properties, StdPDPStatus status) throws PAPException {
-                try {
-                        PIPFinderFactory factory = PIPFinderFactory.newInstance(properties);
-                        if (factory == null) {
-                                throw new FactoryException("Could not create PIP Finder Factory: " + properties.getProperty(XACMLProperties.PROP_PIPFINDERFACTORY));
-                        }
-                        PIPFinder finder = factory.getFinder(properties);
-                        //
-                        // Check for this, although it should always return something
-                        //
-                        if (finder == null) {
-                                logger.error("pip finder factory returned a null engine.");
-                                throw new PIPException("Could not create PIP Finder");
-                        } else {
-                                logger.info("Loaded PIP finder");
-                        }
-                        for (PIPEngine engine : finder.getPIPEngines()) {
-                                logger.info("Configured PIP Engine: " + engine.getName());
-                                StdPDPPIPConfig config = new StdPDPPIPConfig();
-                                config.setName(engine.getName());
-                                status.addLoadedPipConfig(config);
-                        }
-                } catch (FactoryException | PIPException e) {
-                        logger.error("validate PIP configuration failed: " + e.getLocalizedMessage());
-                        status.addLoadError(e.getLocalizedMessage());
-                        status.setStatus(Status.LOAD_ERRORS);
-                        throw new PAPException(e);
-                }
+        //
+        // Reset our official properties the PDP factory
+        // uses to configure the PDP engine.
+        //
+        XACMLRest.loadXacmlProperties(policyProperties, pipProperties);
+        //
+        // Dump ALL our properties that we are trying to load
+        //
+        try {
+            logger.info(XACMLProperties.getProperties().toString());
+        } catch (IOException e) {
+            logger.error("Failed to get XACML Properties", e);
         }
-        
-        /**
-         * Iterates the policies defined in the props object to ensure they are loaded locally.
-         * Policies are searched for in the following order:
-         * 	- see if the current properties has a "&lt;PolicyID&gt;.file" entry and that file exists in the local directory
-         * 	- if not, see if the file exists in the local directory; if so create a ".file" property for it.
-         * 	- if not, get the "&lt;PolicyID&gt;.url" property and try to GET the policy from that location (and set the ".file" property)
-         * 
-         *  If the ".file" property is created, then true is returned to tell the caller that the props object changed.
-         * 
-         * @param props
-         * @return true/false if anything was changed in the props object
-         * @throws PAPException 
-         */
-        public static synchronized boolean cachePolicies(Properties props) throws PAPException {
-                boolean changed = false;
-                String[] lists = new String[2];
-                lists[0] = props.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
-                lists[1] = props.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
-                for (String list : lists) {
-                        //
-                        // Check for a null or empty parameter
-                        //
-                        if (list == null || list.length() == 0) {
-                                continue;
-                        }
-                        Iterable<String> policies = Splitter.on(',').trimResults().omitEmptyStrings().split(list);
-                        for (String policy : policies) {
-                                boolean policyExists = false;
-                                
-                                // First look for ".file" property and verify the file exists
-                                String propLocation	= props.getProperty(policy + StdPolicyFinderFactory.PROP_FILE);
-                                if (propLocation != null) {
-                                        //
-                                        // Does it exist?
-                                        //
-                                        policyExists = Files.exists(Paths.get(propLocation));
-                                        if (policyExists == false) {
-                                                logger.warn("Policy file " + policy + " expected at " + propLocation + " does NOT exist.");
-                                        }
-                                }
-                                
-                                // If ".file" property does not exist, try looking for the local file anyway 
-                                //	(it might exist without having a ".file" property set for it)
-                                if (policyExists == false) {
-                                        //
-                                        // Now construct the output file name
-                                        //
-                                        Path outFile = Paths.get(getPDPConfig().toAbsolutePath().toString(), policy);
-                                        //
-                                        // Double check to see if we pulled it at some point
-                                        //
-                                        policyExists = Files.exists(outFile);
-                                        if (policyExists) {
-                                                //
-                                                // Set the property so the PDP engine doesn't have
-                                                // to pull it from the URL but rather the FILE.
-                                                //
-                                                logger.info("Policy does exist: " + outFile.toAbsolutePath().toString());
-                                                props.setProperty(policy + StdPolicyFinderFactory.PROP_FILE, outFile.toAbsolutePath().toString());
-                                                //
-                                                // Indicate that there were changes made to the properties
-                                                //
-                                                changed = true;
-                                        } else {
-                                                
-                                                // File does not exist locally, so we need to get it from the location given in the ".url" property (which MUST exist)
-                                                
-                                                //
-                                                // There better be a URL to retrieve it
-                                                //
-                                                propLocation	= props.getProperty(policy + StdPolicyFinderFactory.PROP_URL);
-                                                if (propLocation != null) {
-                                                        //
-                                                        // Get it
-                                                        //
-                                                        URL url = null;
-                                                        try {
-                                                                //
-                                                                // Create the URL
-                                                                //
-                                                                url						= new URL(propLocation);
-                                                                logger.info("Pulling " + url.toString());
-                                                                //
-                                                                // Open the connection
-                                                                //
-                                                                URLConnection urlConnection	= url.openConnection();
-                                                                urlConnection.setRequestProperty(XACMLRestProperties.PROP_PDP_HTTP_HEADER_ID, XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_ID));
-                                                                //
-                                                                // Copy it to disk
-                                                                //
-                                                                try (InputStream is = urlConnection.getInputStream(); OutputStream os = new FileOutputStream(outFile.toFile())) {
-                                                                        IOUtils.copy(is, os);
-                                                                }
-                                                                //
-                                                                // Now save it in the properties as a .file
-                                                                //
-                                                                logger.info("Pulled policy: " + outFile.toAbsolutePath().toString());
-                                                                props.setProperty(policy + StdPolicyFinderFactory.PROP_FILE, outFile.toAbsolutePath().toString());
-                                                                //
-                                                                // Indicate that there were changes made to the properties
-                                                                //
-                                                                changed = true;
-                                                        } catch (Exception e) {
-                                                                if (e instanceof MalformedURLException) {
-                                                                        logger.error("Policy '" + policy + "' had bad URL in new configuration, URL='" + propLocation + "'");
-                                                                } else {
-                                                                        logger.error("Error while retrieving policy " + policy + " from URL " + url.toString() + ", e="+e);
-                                                                }
-                                                        }
-                                                } else {
-                                                        logger.error("Policy " + policy + " does NOT exist and does NOT have a URL");
-                                                }
-                                        }
-                                }
-                        }
-                }
-                return changed;
+        //
+        // Now load the PDP engine
+        //
+        PDPEngineFactory factory	= null;
+        PDPEngine engine	= null;
+        try {
+            factory	= PDPEngineFactory.newInstance();
+            engine	= factory.newEngine();
+            logger.info("Loaded new PDP engine.");
+            status.setStatus(Status.UP_TO_DATE);
+        } catch (FactoryException e) {
+            String error = "Failed to create new PDP Engine";
+            logger.error(error, e);
+            status.addLoadError(error);
+        }
+        return engine;
+    }
+
+    public static synchronized void validatePolicies(Properties properties, StdPDPStatus status) throws PAPException {
+        Set<String> rootPolicies = XACMLProperties.getRootPolicyIDs(properties);
+        Set<String> refPolicies = XACMLProperties.getReferencedPolicyIDs(properties);
+
+        for (String id : rootPolicies) {
+            loadPolicy(properties, status, id, true);
+        }
+        // remember which policies were root policies
+        status.addAllLoadedRootPolicies(status.getLoadedPolicies());
+
+        for (String id : refPolicies) {
+            loadPolicy(properties, status, id, false);
         }
 
-        public static synchronized Path	getPDPPolicyCache() throws PAPException {
-                Path config = getPDPConfig();
-                Path policyProperties = Paths.get(config.toAbsolutePath().toString(), "xacml.policy.properties");
-                if (Files.notExists(policyProperties)) {
-                        logger.warn(policyProperties.toAbsolutePath().toString() + " does NOT exist.");
-                        //
-                        // Try to create the file
-                        //
-                        try {
-                                Files.createFile(policyProperties);
-                        } catch (IOException e) {
-                                logger.error("Failed to create policy properties file: " + policyProperties.toAbsolutePath().toString());
-                                throw new PAPException("Failed to create policy properties file: " + policyProperties.toAbsolutePath().toString());
-                        }
-                }
-                return policyProperties;
+        logger.info("Loaded " + status.getLoadedPolicies().size() + " policies, failed to load " + status.getFailedPolicies().size() + " policies, " +
+                    status.getLoadedRootPolicies().size() + " root policies");
+        if (status.getLoadedRootPolicies().size() == 0) {
+            logger.warn("NO ROOT POLICIES LOADED!!!  Cannot serve PEP Requests.");
+            status.addLoadWarning("NO ROOT POLICIES LOADED!!!  Cannot serve PEP Requests.");
         }
-        
-        public static synchronized Path	getPIPConfig() throws PAPException {
-                Path config = getPDPConfig();
-                Path pipConfigProperties = Paths.get(config.toAbsolutePath().toString(), "xacml.pip.properties");
-                if (Files.notExists(pipConfigProperties)) {
-                        logger.warn(pipConfigProperties.toAbsolutePath().toString() + " does NOT exist.");
-                        //
-                        // Try to create the file
-                        //
-                        try {
-                                Files.createFile(pipConfigProperties);
-                        } catch (IOException e) {
-                                logger.error("Failed to create pip properties file: " + pipConfigProperties.toAbsolutePath().toString());
-                                throw new PAPException("Failed to create pip properties file: " + pipConfigProperties.toAbsolutePath().toString());
-                        }
+    }
+
+    public static synchronized void loadPolicy(Properties properties, StdPDPStatus status, String id, boolean isRoot) throws PAPException {
+        PolicyDef policy = null;
+        String location = null;
+        URI locationURI = null;
+        boolean isFile = false;
+        try {
+            location = properties.getProperty(id + ".file");
+            if (location == null) {
+                location = properties.getProperty(id + ".url");
+                if (location != null) {
+                    //
+                    // Construct the URL
+                    //
+                    locationURI = URI.create(location);
+                    URL url = locationURI.toURL();
+                    URLConnection urlConnection = url.openConnection();
+                    urlConnection.setRequestProperty(XACMLRestProperties.PROP_PDP_HTTP_HEADER_ID, XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_ID));
+                    //
+                    // Now construct the output file name
+                    //
+                    Path outFile = Paths.get(getPDPConfig().toAbsolutePath().toString(), id);
+                    //
+                    // Copy it to disk
+                    //
+                    try (FileOutputStream fos = new FileOutputStream(outFile.toFile())) {
+                        IOUtils.copy(urlConnection.getInputStream(), fos);
+                    }
+                    //
+                    // Now try to load
+                    //
+                    isFile = true;
+                    try (InputStream fis = Files.newInputStream(outFile)) {
+                        policy = DOMPolicyDef.load(fis);
+                    }
+                    //
+                    // Save it
+                    //
+                    properties.setProperty(id + ".file", outFile.toAbsolutePath().toString());
                 }
-                return pipConfigProperties;
-        }
-        
-        public static synchronized Path getPDPConfig() throws PAPException {
-                Path config = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_CONFIG));
-                if (Files.notExists(config)) {
-                        logger.warn(config.toAbsolutePath().toString() + " does NOT exist.");
-                        //
-                        // Try to create the directory
-                        //
-                        try {
-                                Files.createDirectories(config);
-                        } catch (IOException e) {
-                                logger.error("Failed to create config directory: " + config.toAbsolutePath().toString(), e);
-                                throw new PAPException("Failed to create config directory: " + config.toAbsolutePath().toString());
-                        }
+            } else {
+                isFile = true;
+                locationURI = Paths.get(location).toUri();
+                try (InputStream is = Files.newInputStream(Paths.get(location))) {
+                    policy = DOMPolicyDef.load(is);
                 }
-                return config;
+            }
+            if (policy != null) {
+                status.addLoadedPolicy(new StdPDPPolicy(id, isRoot, locationURI, properties));
+                logger.info("Loaded policy: " + policy.getIdentifier() + " version: " + policy.getVersion().stringValue());
+            } else {
+                String error = "Failed to load policy " + location;
+                logger.error(error);
+                status.setStatus(PDPStatus.Status.LOAD_ERRORS);
+                status.addLoadError(error);
+                status.addFailedPolicy(new StdPDPPolicy(id, isRoot));
+            }
+        } catch (Exception e) {
+            logger.error("Failed to load policy '" + id + "' from location '" + location + "'", e);
+            status.setStatus(PDPStatus.Status.LOAD_ERRORS);
+            status.addFailedPolicy(new StdPDPPolicy(id, isRoot));
+            //
+            // Is it a file?
+            //
+            if (isFile) {
+                //
+                // Let's remove it
+                //
+                try {
+                    logger.error("Corrupted policy file, deleting: " + location);
+                    Files.delete(Paths.get(location));
+                } catch (IOException e1) {
+                    logger.error(e1);
+                }
+            }
+            throw new PAPException("Failed to load policy '" + id + "' from location '" + location + "'");
         }
+    }
+
+    public static synchronized void validatePipConfiguration(Properties properties, StdPDPStatus status) throws PAPException {
+        try {
+            PIPFinderFactory factory = PIPFinderFactory.newInstance(properties);
+            if (factory == null) {
+                throw new FactoryException("Could not create PIP Finder Factory: " + properties.getProperty(XACMLProperties.PROP_PIPFINDERFACTORY));
+            }
+            PIPFinder finder = factory.getFinder(properties);
+            //
+            // Check for this, although it should always return something
+            //
+            if (finder == null) {
+                logger.error("pip finder factory returned a null engine.");
+                throw new PIPException("Could not create PIP Finder");
+            } else {
+                logger.info("Loaded PIP finder");
+            }
+            for (PIPEngine engine : finder.getPIPEngines()) {
+                logger.info("Configured PIP Engine: " + engine.getName());
+                StdPDPPIPConfig config = new StdPDPPIPConfig();
+                config.setName(engine.getName());
+                status.addLoadedPipConfig(config);
+            }
+        } catch (FactoryException | PIPException e) {
+            logger.error("validate PIP configuration failed: " + e.getLocalizedMessage());
+            status.addLoadError(e.getLocalizedMessage());
+            status.setStatus(Status.LOAD_ERRORS);
+            throw new PAPException(e);
+        }
+    }
+
+    /**
+     * Iterates the policies defined in the props object to ensure they are loaded locally.
+     * Policies are searched for in the following order:
+     * 	- see if the current properties has a "&lt;PolicyID&gt;.file" entry and that file exists in the local directory
+     * 	- if not, see if the file exists in the local directory; if so create a ".file" property for it.
+     * 	- if not, get the "&lt;PolicyID&gt;.url" property and try to GET the policy from that location (and set the ".file" property)
+     *
+     *  If the ".file" property is created, then true is returned to tell the caller that the props object changed.
+     *
+     * @param props
+     * @return true/false if anything was changed in the props object
+     * @throws PAPException
+     */
+    public static synchronized boolean cachePolicies(Properties props) throws PAPException {
+        boolean changed = false;
+        String[] lists = new String[2];
+        lists[0] = props.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
+        lists[1] = props.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
+        for (String list : lists) {
+            //
+            // Check for a null or empty parameter
+            //
+            if (list == null || list.length() == 0) {
+                continue;
+            }
+            Iterable<String> policies = Splitter.on(',').trimResults().omitEmptyStrings().split(list);
+            for (String policy : policies) {
+                boolean policyExists = false;
+
+                // First look for ".file" property and verify the file exists
+                String propLocation	= props.getProperty(policy + StdPolicyFinderFactory.PROP_FILE);
+                if (propLocation != null) {
+                    //
+                    // Does it exist?
+                    //
+                    policyExists = Files.exists(Paths.get(propLocation));
+                    if (policyExists == false) {
+                        logger.warn("Policy file " + policy + " expected at " + propLocation + " does NOT exist.");
+                    }
+                }
+
+                // If ".file" property does not exist, try looking for the local file anyway
+                //	(it might exist without having a ".file" property set for it)
+                if (policyExists == false) {
+                    //
+                    // Now construct the output file name
+                    //
+                    Path outFile = Paths.get(getPDPConfig().toAbsolutePath().toString(), policy);
+                    //
+                    // Double check to see if we pulled it at some point
+                    //
+                    policyExists = Files.exists(outFile);
+                    if (policyExists) {
+                        //
+                        // Set the property so the PDP engine doesn't have
+                        // to pull it from the URL but rather the FILE.
+                        //
+                        logger.info("Policy does exist: " + outFile.toAbsolutePath().toString());
+                        props.setProperty(policy + StdPolicyFinderFactory.PROP_FILE, outFile.toAbsolutePath().toString());
+                        //
+                        // Indicate that there were changes made to the properties
+                        //
+                        changed = true;
+                    } else {
+
+                        // File does not exist locally, so we need to get it from the location given in the ".url" property (which MUST exist)
+
+                        //
+                        // There better be a URL to retrieve it
+                        //
+                        propLocation	= props.getProperty(policy + StdPolicyFinderFactory.PROP_URL);
+                        if (propLocation != null) {
+                            //
+                            // Get it
+                            //
+                            URL url = null;
+                            try {
+                                //
+                                // Create the URL
+                                //
+                                url						= new URL(propLocation);
+                                logger.info("Pulling " + url.toString());
+                                //
+                                // Open the connection
+                                //
+                                URLConnection urlConnection	= url.openConnection();
+                                urlConnection.setRequestProperty(XACMLRestProperties.PROP_PDP_HTTP_HEADER_ID, XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_ID));
+                                //
+                                // Copy it to disk
+                                //
+                                try (InputStream is = urlConnection.getInputStream(); OutputStream os = new FileOutputStream(outFile.toFile())) {
+                                    IOUtils.copy(is, os);
+                                }
+                                //
+                                // Now save it in the properties as a .file
+                                //
+                                logger.info("Pulled policy: " + outFile.toAbsolutePath().toString());
+                                props.setProperty(policy + StdPolicyFinderFactory.PROP_FILE, outFile.toAbsolutePath().toString());
+                                //
+                                // Indicate that there were changes made to the properties
+                                //
+                                changed = true;
+                            } catch (Exception e) {
+                                if (e instanceof MalformedURLException) {
+                                    logger.error("Policy '" + policy + "' had bad URL in new configuration, URL='" + propLocation + "'");
+                                } else {
+                                    logger.error("Error while retrieving policy " + policy + " from URL " + url.toString() + ", e="+e);
+                                }
+                            }
+                        } else {
+                            logger.error("Policy " + policy + " does NOT exist and does NOT have a URL");
+                        }
+                    }
+                }
+            }
+        }
+        return changed;
+    }
+
+    public static synchronized Path	getPDPPolicyCache() throws PAPException {
+        Path config = getPDPConfig();
+        Path policyProperties = Paths.get(config.toAbsolutePath().toString(), "xacml.policy.properties");
+        if (Files.notExists(policyProperties)) {
+            logger.warn(policyProperties.toAbsolutePath().toString() + " does NOT exist.");
+            //
+            // Try to create the file
+            //
+            try {
+                Files.createFile(policyProperties);
+            } catch (IOException e) {
+                logger.error("Failed to create policy properties file: " + policyProperties.toAbsolutePath().toString());
+                throw new PAPException("Failed to create policy properties file: " + policyProperties.toAbsolutePath().toString());
+            }
+        }
+        return policyProperties;
+    }
+
+    public static synchronized Path	getPIPConfig() throws PAPException {
+        Path config = getPDPConfig();
+        Path pipConfigProperties = Paths.get(config.toAbsolutePath().toString(), "xacml.pip.properties");
+        if (Files.notExists(pipConfigProperties)) {
+            logger.warn(pipConfigProperties.toAbsolutePath().toString() + " does NOT exist.");
+            //
+            // Try to create the file
+            //
+            try {
+                Files.createFile(pipConfigProperties);
+            } catch (IOException e) {
+                logger.error("Failed to create pip properties file: " + pipConfigProperties.toAbsolutePath().toString());
+                throw new PAPException("Failed to create pip properties file: " + pipConfigProperties.toAbsolutePath().toString());
+            }
+        }
+        return pipConfigProperties;
+    }
+
+    public static synchronized Path getPDPConfig() throws PAPException {
+        Path config = Paths.get(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_CONFIG));
+        if (Files.notExists(config)) {
+            logger.warn(config.toAbsolutePath().toString() + " does NOT exist.");
+            //
+            // Try to create the directory
+            //
+            try {
+                Files.createDirectories(config);
+            } catch (IOException e) {
+                logger.error("Failed to create config directory: " + config.toAbsolutePath().toString(), e);
+                throw new PAPException("Failed to create config directory: " + config.toAbsolutePath().toString());
+            }
+        }
+        return config;
+    }
 
 }
diff --git a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpRegisterThread.java b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpRegisterThread.java
index ddbce6d..ba6a065 100644
--- a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpRegisterThread.java
+++ b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpRegisterThread.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,184 +47,184 @@
 import com.att.research.xacml.util.XACMLProperties;
 
 public class XACMLPdpRegisterThread implements Runnable {
-        private static final Log logger	= LogFactory.getLog(XACMLPdpRegisterThread.class);
-        
-        public volatile boolean isRunning = false;
-        
-        public synchronized boolean isRunning() {
-                return this.isRunning;
-        }
-        
-        public synchronized void terminate() {
-                this.isRunning = false;
-        }
-        
-        /**
-         * 
-         * This is our thread that runs on startup to tell the PAP server we are up-and-running.
-         * 
-         */
-        @Override
-        public void run() {
-                synchronized(this) {
-                        this.isRunning = true;
-                }
-                boolean registered = false;
-                boolean interrupted = false;
-                int seconds;
-                try {
-                        seconds = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_REGISTER_SLEEP));
-                } catch (NumberFormatException e) {
-                        logger.error("REGISTER_SLEEP: ", e);
-                        seconds = 5;
-                }
-                if (seconds < 5) {
-                        seconds = 5;
-                }
-                int retries;
-                try {
-                        retries = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_REGISTER_RETRIES));
-                } catch (NumberFormatException e) {
-                        logger.error("REGISTER_SLEEP: ", e);
-                        retries = -1;
-                }
-                while (! registered && ! interrupted && this.isRunning()) {
-                        HttpURLConnection connection = null;
-                        try {
-                                //
-                                // Get the PAP Servlet URL
-                                //
-                                URL url = new URL(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL));
-                                logger.info("Registering with " + url.toString());
-                                boolean finished = false;
-                                while (! finished) {
-                                        //
-                                        // Open up the connection
-                                        //
-                                        connection = (HttpURLConnection)url.openConnection();
-                                        //
-                                        // Setup our method and headers
-                                        //
-                            connection.setRequestMethod("POST");
-                                        connection.setRequestProperty("Accept", "text/x-java-properties");
-                            connection.setRequestProperty("Content-Type", "text/x-java-properties");
-                            connection.setRequestProperty(XACMLRestProperties.PROP_PDP_HTTP_HEADER_ID, XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_ID));
-                            connection.setUseCaches(false);
-                            //
-                            // Adding this in. It seems the HttpUrlConnection class does NOT
-                            // properly forward our headers for POST re-direction. It does so
-                            // for a GET re-direction.
-                            //
-                            // So we need to handle this ourselves.
-                            //
-                            connection.setInstanceFollowRedirects(false);
-                                connection.setDoOutput(true);
-                                connection.setDoInput(true);
-                                try {
-                                        //
-                                        // Send our current policy configuration
-                                        //
-                                        String lists = XACMLProperties.PROP_ROOTPOLICIES + "=" + XACMLProperties.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
-                                        lists = lists + "\n" + XACMLProperties.PROP_REFERENCEDPOLICIES + "=" + XACMLProperties.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES) + "\n";
-                                        try (InputStream listsInputStream = new ByteArrayInputStream(lists.getBytes());
-                                                        InputStream pipInputStream = Files.newInputStream(XACMLPdpLoader.getPIPConfig());
-                                                        OutputStream os = connection.getOutputStream()) {
-                                                IOUtils.copy(listsInputStream, os);
+    private static final Log logger	= LogFactory.getLog(XACMLPdpRegisterThread.class);
 
-                                                //
-                                                // Send our current PIP configuration
-                                                //
-                                                IOUtils.copy(pipInputStream, os);
-                                        }
-                                } catch (Exception e) {
-                                        logger.error("Failed to send property file", e);
-                                }
-                            //
-                            // Do the connect
-                            //
-                            connection.connect();
-                            if (connection.getResponseCode() == 204) {
-                                logger.info("Success. We are configured correctly.");
-                                finished = true;
-                                registered = true;
-                            } else if (connection.getResponseCode() == 200) {
-                                logger.info("Success. We have a new configuration.");
-                                Properties properties = new Properties();
-                                properties.load(connection.getInputStream());
-                                logger.info("New properties: " + properties.toString());
-                                //
-                                // Queue it
-                                //
-                                // The incoming properties does NOT include urls
-                                PutRequest req = new PutRequest(XACMLProperties.getPolicyProperties(properties, false), XACMLProperties.getPipProperties(properties));
-                                XACMLPdpServlet.queue.offer(req);
-                                //
-                                // We are now registered
-                                //
-                                finished = true;
-                                registered=true;
-                            } else if (connection.getResponseCode() >= 300 && connection.getResponseCode()  <= 399) {
-                                //
-                                // Re-direction
-                                //
-                                String newLocation = connection.getHeaderField("Location");
-                                if (newLocation == null || newLocation.isEmpty()) {
-                                        logger.warn("Did not receive a valid re-direction location");
-                                        finished = true;
-                                } else {
-                                        logger.info("New Location: " + newLocation);
-                                        url = new URL(newLocation);
-                                }
-                            } else {
-                                logger.warn("Failed: " + connection.getResponseCode() + "  message: " + connection.getResponseMessage());
-                                finished = true;
-                            }
-                                }
-                        } catch (Exception e) {
-                                logger.error(e);
-                        } finally {
-                                // cleanup the connection
-                                if (connection != null) {
-                                        try {
-                                                // For some reason trying to get the inputStream from the connection
-                                                // throws an exception rather than returning null when the InputStream does not exist.
-                                                InputStream is = null;
-                                                try {
-                                                        is = connection.getInputStream();
-                                                } catch (Exception e1) {
-                                                        // ignore this
-                                                }
-                                                if (is != null) {
-                                                        is.close();
-                                                }
+    public volatile boolean isRunning = false;
 
-                                        } catch (IOException ex) {
-                                                logger.error("Failed to close connection: " + ex, ex);
-                                        }
-                                        connection.disconnect();
-                                }
-                        }
-                        //
-                        // Wait a little while to try again
-                        //
-                        try {
-                                if (registered == false) {
-                                        if (retries > 0) {
-                                                retries--;
-                                        } else if (retries == 0) {
-                                                break;
-                                        }
-                                        Thread.sleep(seconds * 1000);
-                                }
-                        } catch (InterruptedException e) {
-                                interrupted = true;
-                                this.terminate();
-                        }
-                }
-                synchronized(this) {
-                        this.isRunning = false;
-                }
-                logger.info("Thread exiting...(registered=" + registered + ", interrupted=" + interrupted + ", isRunning=" + this.isRunning() + ", retries=" + retries + ")");
+    public synchronized boolean isRunning() {
+        return this.isRunning;
+    }
+
+    public synchronized void terminate() {
+        this.isRunning = false;
+    }
+
+    /**
+     *
+     * This is our thread that runs on startup to tell the PAP server we are up-and-running.
+     *
+     */
+    @Override
+    public void run() {
+        synchronized(this) {
+            this.isRunning = true;
         }
+        boolean registered = false;
+        boolean interrupted = false;
+        int seconds;
+        try {
+            seconds = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_REGISTER_SLEEP));
+        } catch (NumberFormatException e) {
+            logger.error("REGISTER_SLEEP: ", e);
+            seconds = 5;
+        }
+        if (seconds < 5) {
+            seconds = 5;
+        }
+        int retries;
+        try {
+            retries = Integer.parseInt(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_REGISTER_RETRIES));
+        } catch (NumberFormatException e) {
+            logger.error("REGISTER_SLEEP: ", e);
+            retries = -1;
+        }
+        while (! registered && ! interrupted && this.isRunning()) {
+            HttpURLConnection connection = null;
+            try {
+                //
+                // Get the PAP Servlet URL
+                //
+                URL url = new URL(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL));
+                logger.info("Registering with " + url.toString());
+                boolean finished = false;
+                while (! finished) {
+                    //
+                    // Open up the connection
+                    //
+                    connection = (HttpURLConnection)url.openConnection();
+                    //
+                    // Setup our method and headers
+                    //
+                    connection.setRequestMethod("POST");
+                    connection.setRequestProperty("Accept", "text/x-java-properties");
+                    connection.setRequestProperty("Content-Type", "text/x-java-properties");
+                    connection.setRequestProperty(XACMLRestProperties.PROP_PDP_HTTP_HEADER_ID, XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_ID));
+                    connection.setUseCaches(false);
+                    //
+                    // Adding this in. It seems the HttpUrlConnection class does NOT
+                    // properly forward our headers for POST re-direction. It does so
+                    // for a GET re-direction.
+                    //
+                    // So we need to handle this ourselves.
+                    //
+                    connection.setInstanceFollowRedirects(false);
+                    connection.setDoOutput(true);
+                    connection.setDoInput(true);
+                    try {
+                        //
+                        // Send our current policy configuration
+                        //
+                        String lists = XACMLProperties.PROP_ROOTPOLICIES + "=" + XACMLProperties.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
+                        lists = lists + "\n" + XACMLProperties.PROP_REFERENCEDPOLICIES + "=" + XACMLProperties.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES) + "\n";
+                        try (InputStream listsInputStream = new ByteArrayInputStream(lists.getBytes());
+                                    InputStream pipInputStream = Files.newInputStream(XACMLPdpLoader.getPIPConfig());
+                                    OutputStream os = connection.getOutputStream()) {
+                            IOUtils.copy(listsInputStream, os);
+
+                            //
+                            // Send our current PIP configuration
+                            //
+                            IOUtils.copy(pipInputStream, os);
+                        }
+                    } catch (Exception e) {
+                        logger.error("Failed to send property file", e);
+                    }
+                    //
+                    // Do the connect
+                    //
+                    connection.connect();
+                    if (connection.getResponseCode() == 204) {
+                        logger.info("Success. We are configured correctly.");
+                        finished = true;
+                        registered = true;
+                    } else if (connection.getResponseCode() == 200) {
+                        logger.info("Success. We have a new configuration.");
+                        Properties properties = new Properties();
+                        properties.load(connection.getInputStream());
+                        logger.info("New properties: " + properties.toString());
+                        //
+                        // Queue it
+                        //
+                        // The incoming properties does NOT include urls
+                        PutRequest req = new PutRequest(XACMLProperties.getPolicyProperties(properties, false), XACMLProperties.getPipProperties(properties));
+                        XACMLPdpServlet.queue.offer(req);
+                        //
+                        // We are now registered
+                        //
+                        finished = true;
+                        registered=true;
+                    } else if (connection.getResponseCode() >= 300 && connection.getResponseCode()  <= 399) {
+                        //
+                        // Re-direction
+                        //
+                        String newLocation = connection.getHeaderField("Location");
+                        if (newLocation == null || newLocation.isEmpty()) {
+                            logger.warn("Did not receive a valid re-direction location");
+                            finished = true;
+                        } else {
+                            logger.info("New Location: " + newLocation);
+                            url = new URL(newLocation);
+                        }
+                    } else {
+                        logger.warn("Failed: " + connection.getResponseCode() + "  message: " + connection.getResponseMessage());
+                        finished = true;
+                    }
+                }
+            } catch (Exception e) {
+                logger.error(e);
+            } finally {
+                // cleanup the connection
+                if (connection != null) {
+                    try {
+                        // For some reason trying to get the inputStream from the connection
+                        // throws an exception rather than returning null when the InputStream does not exist.
+                        InputStream is = null;
+                        try {
+                            is = connection.getInputStream();
+                        } catch (Exception e1) {
+                            // ignore this
+                        }
+                        if (is != null) {
+                            is.close();
+                        }
+
+                    } catch (IOException ex) {
+                        logger.error("Failed to close connection: " + ex, ex);
+                    }
+                    connection.disconnect();
+                }
+            }
+            //
+            // Wait a little while to try again
+            //
+            try {
+                if (registered == false) {
+                    if (retries > 0) {
+                        retries--;
+                    } else if (retries == 0) {
+                        break;
+                    }
+                    Thread.sleep(seconds * 1000);
+                }
+            } catch (InterruptedException e) {
+                interrupted = true;
+                this.terminate();
+            }
+        }
+        synchronized(this) {
+            this.isRunning = false;
+        }
+        logger.info("Thread exiting...(registered=" + registered + ", interrupted=" + interrupted + ", isRunning=" + this.isRunning() + ", retries=" + retries + ")");
+    }
 
 }
diff --git a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpServlet.java b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpServlet.java
index d835ca1..ba18cf4 100644
--- a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpServlet.java
+++ b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/XACMLPdpServlet.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -70,497 +70,495 @@
 
 /**
  * Servlet implementation class XacmlPdpServlet
- * 
+ *
  * This is an implementation of the XACML 3.0 RESTful Interface with added features to support
  * simple PAP RESTful API for policy publishing and PIP configuration changes.
- * 
+ *
  * If you are running this the first time, then we recommend you look at the xacml.pdp.properties file.
  * This properties file has all the default parameter settings. If you are running the servlet as is,
  * then we recommend setting up you're container to run it on port 8080 with context "/pdp". Wherever
  * the default working directory is set to, a "config" directory will be created that holds the policy
  * and pip cache. This setting is located in the xacml.pdp.properties file.
- * 
+ *
  * When you are ready to customize, you can create a separate xacml.pdp.properties on you're local file
  * system and setup the parameters as you wish. Just set the Java VM System variable to point to that file:
- * 
+ *
  * -Dxacml.properties=/opt/app/xacml/etc/xacml.pdp.properties
- * 
+ *
  * Or if you only want to change one or two properties, simply set the Java VM System variable for that property.
- * 
+ *
  * -Dxacml.rest.pdp.register=false
  *
  * @author pameladragosh
  *
  */
 @WebServlet(
-                description = "Implements the XACML PDP RESTful API and client PAP API.", 
-                urlPatterns = { "/" }, 
-                loadOnStartup=1,
-                initParams = { 
-                                @WebInitParam(name = "XACML_PROPERTIES_NAME", value = "xacml.pdp.properties", description = "The location of the PDP xacml.pdp.properties file holding configuration information.")
-                })
+    description = "Implements the XACML PDP RESTful API and client PAP API.",
+    urlPatterns = { "/" },
+    loadOnStartup=1,
+initParams = {
+    @WebInitParam(name = "XACML_PROPERTIES_NAME", value = "xacml.pdp.properties", description = "The location of the PDP xacml.pdp.properties file holding configuration information.")
+})
 public class XACMLPdpServlet extends HttpServlet implements Runnable {
-        private static final long serialVersionUID = 1L;
-        //
-        // Our application debug log
-        //
-        private static final Log logger	= LogFactory.getLog(XACMLPdpServlet.class);
-        //
-        // This logger is specifically only for Xacml requests and their corresponding response.
-        // It's output ideally should be sent to a separate file from the application logger.
-        //
-        private static final Log requestLogger = LogFactory.getLog("xacml.request");
-        //
-        // This thread may getting invoked on startup, to let the PAP know
-        // that we are up and running.
-        //
-        private Thread registerThread = null;
-        private XACMLPdpRegisterThread registerRunnable = null;
-        //
-        // This is our PDP engine pointer. There is a synchronized lock used
-        // for access to the pointer. In case we are servicing PEP requests while
-        // an update is occurring from the PAP.
-        //
-        private PDPEngine pdpEngine	= null;
-        private static final Object pdpEngineLock = new Object();
-        //
-        // This is our PDP's status. What policies are loaded (or not) and
-        // what PIP configurations are loaded (or not).
-        // There is a synchronized lock used for access to the object.
-        //
-        private static volatile StdPDPStatus status = new StdPDPStatus();
-        private static final Object pdpStatusLock = new Object();
-        //
-        // Queue of PUT requests
-        //
-        public static class PutRequest {
-                public Properties policyProperties = null;
-                public Properties pipConfigProperties = null;
-                
-                PutRequest(Properties policies, Properties pips) {
-                        this.policyProperties = policies;
-                        this.pipConfigProperties = pips;
-                }
+    private static final long serialVersionUID = 1L;
+    //
+    // Our application debug log
+    //
+    private static final Log logger	= LogFactory.getLog(XACMLPdpServlet.class);
+    //
+    // This logger is specifically only for Xacml requests and their corresponding response.
+    // It's output ideally should be sent to a separate file from the application logger.
+    //
+    private static final Log requestLogger = LogFactory.getLog("xacml.request");
+    //
+    // This thread may getting invoked on startup, to let the PAP know
+    // that we are up and running.
+    //
+    private Thread registerThread = null;
+    private XACMLPdpRegisterThread registerRunnable = null;
+    //
+    // This is our PDP engine pointer. There is a synchronized lock used
+    // for access to the pointer. In case we are servicing PEP requests while
+    // an update is occurring from the PAP.
+    //
+    private PDPEngine pdpEngine	= null;
+    private static final Object pdpEngineLock = new Object();
+    //
+    // This is our PDP's status. What policies are loaded (or not) and
+    // what PIP configurations are loaded (or not).
+    // There is a synchronized lock used for access to the object.
+    //
+    private static volatile StdPDPStatus status = new StdPDPStatus();
+    private static final Object pdpStatusLock = new Object();
+    //
+    // Queue of PUT requests
+    //
+    public static class PutRequest {
+        public Properties policyProperties = null;
+        public Properties pipConfigProperties = null;
+
+        PutRequest(Properties policies, Properties pips) {
+            this.policyProperties = policies;
+            this.pipConfigProperties = pips;
         }
-        public static volatile BlockingQueue<PutRequest> queue = new LinkedBlockingQueue<PutRequest>(2);
-        //
-        // This is our configuration thread that attempts to load
-        // a new configuration request.
-        //
-        private Thread configThread = null;
-        private volatile boolean configThreadTerminate = false;
+    }
+    public static volatile BlockingQueue<PutRequest> queue = new LinkedBlockingQueue<PutRequest>(2);
+    //
+    // This is our configuration thread that attempts to load
+    // a new configuration request.
+    //
+    private Thread configThread = null;
+    private volatile boolean configThreadTerminate = false;
 
     /**
-     * Default constructor. 
+     * Default constructor.
      */
     public XACMLPdpServlet() {
     }
 
-        /**
-         * @see Servlet#init(ServletConfig)
-         */
-        public void init(ServletConfig config) throws ServletException {
-                //
-                // Initialize
-                //
-                XACMLRest.xacmlInit(config);
-                //
-                // Load our engine - this will use the latest configuration
-                // that was saved to disk and set our initial status object.
-                //
-                PDPEngine engine = XACMLPdpLoader.loadEngine(XACMLPdpServlet.status, null, null);
-                if (engine != null) {
-                        synchronized(pdpEngineLock) {
-                                pdpEngine = engine;
-                        }
-                }
-                //
-                // Kick off our thread to register with the PAP servlet.
-                //
-                if (Boolean.parseBoolean(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_REGISTER))) {
-                        this.registerRunnable = new XACMLPdpRegisterThread();
-                        this.registerThread = new Thread(this.registerRunnable);
-                        this.registerThread.start();
-                }
-                //
-                // This is our thread that manages incoming configuration
-                // changes.
-                //
-                this.configThread = new Thread(this);
-                this.configThread.start();
+    /**
+     * @see Servlet#init(ServletConfig)
+     */
+    public void init(ServletConfig config) throws ServletException {
+        //
+        // Initialize
+        //
+        XACMLRest.xacmlInit(config);
+        //
+        // Load our engine - this will use the latest configuration
+        // that was saved to disk and set our initial status object.
+        //
+        PDPEngine engine = XACMLPdpLoader.loadEngine(XACMLPdpServlet.status, null, null);
+        if (engine != null) {
+            synchronized(pdpEngineLock) {
+                pdpEngine = engine;
+            }
         }
+        //
+        // Kick off our thread to register with the PAP servlet.
+        //
+        if (Boolean.parseBoolean(XACMLProperties.getProperty(XACMLRestProperties.PROP_PDP_REGISTER))) {
+            this.registerRunnable = new XACMLPdpRegisterThread();
+            this.registerThread = new Thread(this.registerRunnable);
+            this.registerThread.start();
+        }
+        //
+        // This is our thread that manages incoming configuration
+        // changes.
+        //
+        this.configThread = new Thread(this);
+        this.configThread.start();
+    }
 
-        /**
-         * @see Servlet#destroy()
-         */
-        public void destroy() {
-                super.destroy();
-                logger.info("Destroying....");
-                //
-                // Make sure the register thread is not running
-                //
-                if (this.registerRunnable != null) {
-                        try {
-                                this.registerRunnable.terminate();
-                                if (this.registerThread != null) {
-                                        this.registerThread.interrupt();
-                                        this.registerThread.join();
-                                }
-                        } catch (InterruptedException e) {
-                                logger.error(e);
-                        }
+    /**
+     * @see Servlet#destroy()
+     */
+    public void destroy() {
+        super.destroy();
+        logger.info("Destroying....");
+        //
+        // Make sure the register thread is not running
+        //
+        if (this.registerRunnable != null) {
+            try {
+                this.registerRunnable.terminate();
+                if (this.registerThread != null) {
+                    this.registerThread.interrupt();
+                    this.registerThread.join();
                 }
-                //
-                // Make sure the configure thread is not running
-                //
-                this.configThreadTerminate = true;
-                try {
-                        this.configThread.interrupt();
-                        this.configThread.join();
-                } catch (InterruptedException e) {
-                        logger.error(e);
-                }
-                logger.info("Destroyed.");
+            } catch (InterruptedException e) {
+                logger.error(e);
+            }
         }
+        //
+        // Make sure the configure thread is not running
+        //
+        this.configThreadTerminate = true;
+        try {
+            this.configThread.interrupt();
+            this.configThread.join();
+        } catch (InterruptedException e) {
+            logger.error(e);
+        }
+        logger.info("Destroyed.");
+    }
 
-        /**
-         * PUT - The PAP engine sends configuration information using HTTP PUT request.
-         * 
-         * One parameter is expected:
-         * 
-         * config=[policy|pip|all]
-         * 
-         * 	policy - Expect a properties file that contains updated lists of the root and referenced policies that the PDP should
-         * 			 be using for PEP requests.
-         * 
-         * 		Specifically should AT LEAST contain the following properties:
-         * 		xacml.rootPolicies
-         * 		xacml.referencedPolicies
-         * 
-         * 		In addition, any relevant information needed by the PDP to load or retrieve the policies to store in its cache.
-         *
-         * 		EXAMPLE:
-         *	 		xacml.rootPolicies=PolicyA.1, PolicyB.1
-         *
-         *			PolicyA.1.url=http://localhost:9090/PAP?id=b2d7b86d-d8f1-4adf-ba9d-b68b2a90bee1&version=1
-         *			PolicyB.1.url=http://localhost:9090/PAP/id=be962404-27f6-41d8-9521-5acb7f0238be&version=1
-         *	
-         *			xacml.referencedPolicies=RefPolicyC.1, RefPolicyD.1
-         *
-         *			RefPolicyC.1.url=http://localhost:9090/PAP?id=foobar&version=1
-         *			RefPolicyD.1.url=http://localhost:9090/PAP/id=example&version=1
-         *	
-         * pip - Expect a properties file that contain PIP engine configuration properties.
-         * 
-         *  		Specifically should AT LEAST the following property:
-         * 			xacml.pip.engines
-         * 
-         * 		In addition, any relevant information needed by the PDP to load and configure the PIPs.
-         * 
-         * 		EXAMPLE:
-         * 			xacml.pip.engines=foo,bar
-         * 
-         * 			foo.classname=com.foo
-         * 			foo.sample=abc
-         * 			foo.example=xyz
-         * 			......
-         * 
-         * 			bar.classname=com.bar
-         * 			......
-         * 
-         * all - Expect ALL new configuration properties for the PDP
-         * 
-         * @see HttpServlet#doPut(HttpServletRequest request, HttpServletResponse response)
-         */
-        protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-                //
-                // Dump our request out
-                //
-                if (logger.isDebugEnabled()) {
-                        XACMLRest.dumpRequest(request);
-                }
-                //
-                // What is being PUT?
-                //
-                String cache = request.getParameter("cache");
-                //
-                // Should be a list of policy and pip configurations in Java properties format
-                //
-                if (cache != null && request.getContentType().equals("text/x-java-properties")) {
-                        if (request.getContentLength() > Integer.parseInt(XACMLProperties.getProperty("MAX_CONTENT_LENGTH", "32767"))) {
-                                String message = "Content-Length larger than server will accept.";
-                                logger.info(message);
-                                response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
-                                return;
-                        }
-                        this.doPutConfig(cache, request, response);
-                } else {
-                        String message = "Invalid cache: '" + cache + "' or content-type: '" + request.getContentType() + "'";
-                        logger.error(message);
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
-                        return;
-                }
+    /**
+     * PUT - The PAP engine sends configuration information using HTTP PUT request.
+     *
+     * One parameter is expected:
+     *
+     * config=[policy|pip|all]
+     *
+     * 	policy - Expect a properties file that contains updated lists of the root and referenced policies that the PDP should
+     * 			 be using for PEP requests.
+     *
+     * 		Specifically should AT LEAST contain the following properties:
+     * 		xacml.rootPolicies
+     * 		xacml.referencedPolicies
+     *
+     * 		In addition, any relevant information needed by the PDP to load or retrieve the policies to store in its cache.
+     *
+     * 		EXAMPLE:
+     *	 		xacml.rootPolicies=PolicyA.1, PolicyB.1
+     *
+     *			PolicyA.1.url=http://localhost:9090/PAP?id=b2d7b86d-d8f1-4adf-ba9d-b68b2a90bee1&version=1
+     *			PolicyB.1.url=http://localhost:9090/PAP/id=be962404-27f6-41d8-9521-5acb7f0238be&version=1
+     *
+     *			xacml.referencedPolicies=RefPolicyC.1, RefPolicyD.1
+     *
+     *			RefPolicyC.1.url=http://localhost:9090/PAP?id=foobar&version=1
+     *			RefPolicyD.1.url=http://localhost:9090/PAP/id=example&version=1
+     *
+     * pip - Expect a properties file that contain PIP engine configuration properties.
+     *
+     *  		Specifically should AT LEAST the following property:
+     * 			xacml.pip.engines
+     *
+     * 		In addition, any relevant information needed by the PDP to load and configure the PIPs.
+     *
+     * 		EXAMPLE:
+     * 			xacml.pip.engines=foo,bar
+     *
+     * 			foo.classname=com.foo
+     * 			foo.sample=abc
+     * 			foo.example=xyz
+     * 			......
+     *
+     * 			bar.classname=com.bar
+     * 			......
+     *
+     * all - Expect ALL new configuration properties for the PDP
+     *
+     * @see HttpServlet#doPut(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        //
+        // Dump our request out
+        //
+        if (logger.isDebugEnabled()) {
+            XACMLRest.dumpRequest(request);
         }
-        
-        protected void doPutConfig(String config, HttpServletRequest request, HttpServletResponse response)  throws ServletException, IOException {
-                try {
-                        // prevent multiple configuration changes from stacking up
-                        if (XACMLPdpServlet.queue.remainingCapacity() <= 0) {
-                                logger.error("Queue capacity reached");
-                                response.sendError(HttpServletResponse.SC_CONFLICT, "Multiple configuration changes waiting processing.");
-                                return;
-                        }
-                        //
-                        // Read the properties data into an object.
-                        //
-                        Properties newProperties = new Properties();
-                        newProperties.load(request.getInputStream());
-                        // should have something in the request
-                        if (newProperties.size() == 0) {
-                                logger.error("No properties in PUT");
-                                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT must contain at least one property");
-                                return;
-                        }
-                        //
-                        // Which set of properties are they sending us? Whatever they send gets
-                        // put on the queue (if there is room).
-                        //
-                        if (config.equals("policies")) {
-                                newProperties = XACMLProperties.getPolicyProperties(newProperties, true);
-                                if (newProperties.size() == 0) {
-                                        logger.error("No policy properties in PUT");
-                                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT with cache=policies must contain at least one policy property");
-                                        return;
-                                }
-                                XACMLPdpServlet.queue.offer(new PutRequest(newProperties, null));
-                        } else if (config.equals("pips")) {
-                                newProperties = XACMLProperties.getPipProperties(newProperties);
-                                if (newProperties.size() == 0) {
-                                        logger.error("No pips properties in PUT");
-                                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT with cache=pips must contain at least one pip property");
-                                        return;
-                                }
-                                XACMLPdpServlet.queue.offer(new PutRequest(null, newProperties));
-                        } else if (config.equals("all")) {
-                                Properties newPolicyProperties = XACMLProperties.getPolicyProperties(newProperties, true);
-                                if (newPolicyProperties.size() == 0) {
-                                        logger.error("No policy properties in PUT");
-                                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT with cache=all must contain at least one policy property");
-                                        return;
-                                }
-                                Properties newPipProperties = XACMLProperties.getPipProperties(newProperties);
-                                if (newPipProperties.size() == 0) {
-                                        logger.error("No pips properties in PUT");
-                                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT with cache=all must contain at least one pip property");
-                                        return;
-                                }
-                                XACMLPdpServlet.queue.offer(new PutRequest(newPolicyProperties, newPipProperties));
-                        } else {
-                                //
-                                // Invalid value
-                                //
-                                logger.error("Invalid config value: " + config);
-                                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Config must be one of 'policies', 'pips', 'all'");
-                                return;
-                        }
-                } catch (Exception e) {
-                        logger.error("Failed to process new configuration.", e);
-                        response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
-                        return;
-                }
+        //
+        // What is being PUT?
+        //
+        String cache = request.getParameter("cache");
+        //
+        // Should be a list of policy and pip configurations in Java properties format
+        //
+        if (cache != null && request.getContentType().equals("text/x-java-properties")) {
+            if (request.getContentLength() > Integer.parseInt(XACMLProperties.getProperty("MAX_CONTENT_LENGTH", "32767"))) {
+                String message = "Content-Length larger than server will accept.";
+                logger.info(message);
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
+                return;
+            }
+            this.doPutConfig(cache, request, response);
+        } else {
+            String message = "Invalid cache: '" + cache + "' or content-type: '" + request.getContentType() + "'";
+            logger.error(message);
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
+            return;
         }
-        
-        /**
-         * Parameters: type=hb|config|Status
-         * 
-         * 1. HeartBeat Status 
-         * HeartBeat
-         * 		OK - All Policies are Loaded, All PIPs are Loaded
-         *  	LOADING_IN_PROGRESS - Currently loading a new policy set/pip configuration
-         *  	LAST_UPDATE_FAILED - Need to track the items that failed during last update
-         *  	LOAD_FAILURE - ??? Need to determine what information is sent and how 
-         * 2. Configuration
-         * 3. Status
-         * 		return the StdPDPStatus object in the Response content
-         * 
-         * 
-         * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
-         */
-        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-                XACMLRest.dumpRequest(request);
+    }
+
+    protected void doPutConfig(String config, HttpServletRequest request, HttpServletResponse response)  throws ServletException, IOException {
+        try {
+            // prevent multiple configuration changes from stacking up
+            if (XACMLPdpServlet.queue.remainingCapacity() <= 0) {
+                logger.error("Queue capacity reached");
+                response.sendError(HttpServletResponse.SC_CONFLICT, "Multiple configuration changes waiting processing.");
+                return;
+            }
+            //
+            // Read the properties data into an object.
+            //
+            Properties newProperties = new Properties();
+            newProperties.load(request.getInputStream());
+            // should have something in the request
+            if (newProperties.size() == 0) {
+                logger.error("No properties in PUT");
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT must contain at least one property");
+                return;
+            }
+            //
+            // Which set of properties are they sending us? Whatever they send gets
+            // put on the queue (if there is room).
+            //
+            if (config.equals("policies")) {
+                newProperties = XACMLProperties.getPolicyProperties(newProperties, true);
+                if (newProperties.size() == 0) {
+                    logger.error("No policy properties in PUT");
+                    response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT with cache=policies must contain at least one policy property");
+                    return;
+                }
+                XACMLPdpServlet.queue.offer(new PutRequest(newProperties, null));
+            } else if (config.equals("pips")) {
+                newProperties = XACMLProperties.getPipProperties(newProperties);
+                if (newProperties.size() == 0) {
+                    logger.error("No pips properties in PUT");
+                    response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT with cache=pips must contain at least one pip property");
+                    return;
+                }
+                XACMLPdpServlet.queue.offer(new PutRequest(null, newProperties));
+            } else if (config.equals("all")) {
+                Properties newPolicyProperties = XACMLProperties.getPolicyProperties(newProperties, true);
+                if (newPolicyProperties.size() == 0) {
+                    logger.error("No policy properties in PUT");
+                    response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT with cache=all must contain at least one policy property");
+                    return;
+                }
+                Properties newPipProperties = XACMLProperties.getPipProperties(newProperties);
+                if (newPipProperties.size() == 0) {
+                    logger.error("No pips properties in PUT");
+                    response.sendError(HttpServletResponse.SC_BAD_REQUEST, "PUT with cache=all must contain at least one pip property");
+                    return;
+                }
+                XACMLPdpServlet.queue.offer(new PutRequest(newPolicyProperties, newPipProperties));
+            } else {
                 //
-                // What are they requesting?
+                // Invalid value
                 //
-                boolean returnHB = false;
-                response.setHeader("Cache-Control", "no-cache");
-                String type = request.getParameter("type");
-                // type might be null, so use equals on string constants
-                if ("config".equals(type)) {
-                        response.setContentType("text/x-java-properties");
-                        try {
-                        String lists = XACMLProperties.PROP_ROOTPOLICIES + "=" + XACMLProperties.getProperty(XACMLProperties.PROP_ROOTPOLICIES, "");
-                        lists = lists + "\n" + XACMLProperties.PROP_REFERENCEDPOLICIES + "=" + XACMLProperties.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "") + "\n";
-                        try (InputStream listInputStream = new ByteArrayInputStream(lists.getBytes());
-                                        InputStream pipInputStream = Files.newInputStream(XACMLPdpLoader.getPIPConfig());
-                                        OutputStream os = response.getOutputStream()) {
-                                IOUtils.copy(listInputStream, os);
-                                IOUtils.copy(pipInputStream, os);
-                                }
+                logger.error("Invalid config value: " + config);
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Config must be one of 'policies', 'pips', 'all'");
+                return;
+            }
+        } catch (Exception e) {
+            logger.error("Failed to process new configuration.", e);
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
+            return;
+        }
+    }
+
+    /**
+     * Parameters: type=hb|config|Status
+     *
+     * 1. HeartBeat Status
+     * HeartBeat
+     * 		OK - All Policies are Loaded, All PIPs are Loaded
+     *  	LOADING_IN_PROGRESS - Currently loading a new policy set/pip configuration
+     *  	LAST_UPDATE_FAILED - Need to track the items that failed during last update
+     *  	LOAD_FAILURE - ??? Need to determine what information is sent and how
+     * 2. Configuration
+     * 3. Status
+     * 		return the StdPDPStatus object in the Response content
+     *
+     *
+     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        XACMLRest.dumpRequest(request);
+        //
+        // What are they requesting?
+        //
+        boolean returnHB = false;
+        response.setHeader("Cache-Control", "no-cache");
+        String type = request.getParameter("type");
+        // type might be null, so use equals on string constants
+        if ("config".equals(type)) {
+            response.setContentType("text/x-java-properties");
+            try {
+                String lists = XACMLProperties.PROP_ROOTPOLICIES + "=" + XACMLProperties.getProperty(XACMLProperties.PROP_ROOTPOLICIES, "");
+                lists = lists + "\n" + XACMLProperties.PROP_REFERENCEDPOLICIES + "=" + XACMLProperties.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "") + "\n";
+                try (InputStream listInputStream = new ByteArrayInputStream(lists.getBytes());
+                            InputStream pipInputStream = Files.newInputStream(XACMLPdpLoader.getPIPConfig());
+                            OutputStream os = response.getOutputStream()) {
+                    IOUtils.copy(listInputStream, os);
+                    IOUtils.copy(pipInputStream, os);
+                }
                 response.setStatus(HttpServletResponse.SC_OK);
-                        } catch (Exception e) {
-                                logger.error("Failed to copy property file", e);
-                                response.sendError(400, "Failed to copy Property file");
-                        }
-                        
-                } else if ("hb".equals(type)) {
-                        returnHB = true;
-                        response.setStatus(HttpServletResponse.SC_NO_CONTENT);
-                        
-                } else if ("Status".equals(type)) {
-                        // convert response object to JSON and include in the response
-                        synchronized(pdpStatusLock) {
-                                ObjectMapper mapper = new ObjectMapper();
-                    mapper.writeValue(response.getOutputStream(),  status);
-                        }
+            } catch (Exception e) {
+                logger.error("Failed to copy property file", e);
+                response.sendError(400, "Failed to copy Property file");
+            }
+
+        } else if ("hb".equals(type)) {
+            returnHB = true;
+            response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+
+        } else if ("Status".equals(type)) {
+            // convert response object to JSON and include in the response
+            synchronized(pdpStatusLock) {
+                ObjectMapper mapper = new ObjectMapper();
+                mapper.writeValue(response.getOutputStream(),  status);
+            }
             response.setStatus(HttpServletResponse.SC_OK);
-            
-                } else {
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "type not 'config' or 'hb'");
-                }
-                if (returnHB) {
-                        synchronized(pdpStatusLock) {
-                                response.addHeader(XACMLRestProperties.PROP_PDP_HTTP_HEADER_HB, status.getStatus().toString());
-                        }
-                }
+
+        } else {
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "type not 'config' or 'hb'");
+        }
+        if (returnHB) {
+            synchronized(pdpStatusLock) {
+                response.addHeader(XACMLRestProperties.PROP_PDP_HTTP_HEADER_HB, status.getStatus().toString());
+            }
+        }
+    }
+
+    /**
+     * POST - We expect XACML requests to be posted by PEP applications. They can be in the form of XML or JSON according
+     * to the XACML 3.0 Specifications for both.
+     *
+     *
+     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
+     */
+    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        //
+        // no point in doing any work if we know from the get-go that we cannot do anything with the request
+        //
+        if (status.getLoadedRootPolicies().size() == 0) {
+            logger.warn("Request from PEP at " + request.getRequestURI() + " for service when PDP has No Root Policies loaded");
+            response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
+            return;
         }
 
-        /**
-         * POST - We expect XACML requests to be posted by PEP applications. They can be in the form of XML or JSON according
-         * to the XACML 3.0 Specifications for both.
-         * 
-         * 
-         * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
-         */
-        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-                //
-                // no point in doing any work if we know from the get-go that we cannot do anything with the request
-                //
-                if (status.getLoadedRootPolicies().size() == 0) {
-                        logger.warn("Request from PEP at " + request.getRequestURI() + " for service when PDP has No Root Policies loaded");
-                        response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
-                        return;
+        XACMLRest.dumpRequest(request);
+        //
+        // Set our no-cache header
+        //
+        response.setHeader("Cache-Control", "no-cache");
+        //
+        // They must send a Content-Type
+        //
+        if (request.getContentType() == null) {
+            logger.warn("Must specify a Content-Type");
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "no content-type given");
+            return;
+        }
+        //
+        // Limit the Content-Length to something reasonable
+        //
+        if (request.getContentLength() > Integer.parseInt(XACMLProperties.getProperty("MAX_CONTENT_LENGTH", "32767"))) {
+            String message = "Content-Length larger than server will accept.";
+            logger.info(message);
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
+            return;
+        }
+        if (request.getContentLength() <= 0) {
+            String message = "Content-Length is negative";
+            logger.info(message);
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
+            return;
+        }
+        ContentType contentType = null;
+        try {
+            contentType = ContentType.parse(request.getContentType());
+        } catch (Exception e) {
+            String message = "Parsing Content-Type: " + request.getContentType() + ", error=" + e.getMessage();
+            logger.error(message, e);
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
+            return;
+        }
+        //
+        // What exactly did they send us?
+        //
+        String incomingRequestString = null;
+        Request pdpRequest = null;
+        if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_JSON.getMimeType()) ||
+                contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_XML.getMimeType()) ||
+                contentType.getMimeType().equalsIgnoreCase("application/xacml+xml") ) {
+            //
+            // Read in the string
+            //
+            StringBuilder buffer = new StringBuilder();
+            BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream()));
+            String line;
+            while((line = reader.readLine()) != null) {
+                buffer.append(line);
+            }
+            incomingRequestString = buffer.toString();
+            logger.info(incomingRequestString);
+            //
+            // Parse into a request
+            //
+            try {
+                if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_JSON.getMimeType())) {
+                    pdpRequest = JSONRequest.load(incomingRequestString);
+                } else if (	contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_XML.getMimeType()) ||
+                            contentType.getMimeType().equalsIgnoreCase("application/xacml+xml")) {
+                    pdpRequest = DOMRequest.load(incomingRequestString);
                 }
-                
-                XACMLRest.dumpRequest(request);
-                //
-                // Set our no-cache header
-                //
-                response.setHeader("Cache-Control", "no-cache");
-                //
-                // They must send a Content-Type
-                //
-                if (request.getContentType() == null) {
-                        logger.warn("Must specify a Content-Type");
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "no content-type given");
-                        return;
-                }
-                //
-                // Limit the Content-Length to something reasonable
-                //
-                if (request.getContentLength() > Integer.parseInt(XACMLProperties.getProperty("MAX_CONTENT_LENGTH", "32767"))) {
-                        String message = "Content-Length larger than server will accept.";
-                        logger.info(message);
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
-                        return;
-                }
-                if (request.getContentLength() <= 0) {
-                        String message = "Content-Length is negative";
-                        logger.info(message);
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
-                        return;
-                }
-                ContentType contentType = null;
-                try {
-                        contentType = ContentType.parse(request.getContentType());
-                }
-                catch (Exception e) {
-                        String message = "Parsing Content-Type: " + request.getContentType() + ", error=" + e.getMessage();
-                        logger.error(message, e);
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
-                        return;
-                }
-                //
-                // What exactly did they send us?
-                //
-                String incomingRequestString = null;
-                Request pdpRequest = null;
-                if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_JSON.getMimeType()) ||
-                                contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_XML.getMimeType()) ||
-                                contentType.getMimeType().equalsIgnoreCase("application/xacml+xml") ) {
-                        //
-                        // Read in the string
-                        //
-                        StringBuilder buffer = new StringBuilder();
-                        BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream()));
-                        String line;
-                        while((line = reader.readLine()) != null){
-                                buffer.append(line);
-                        }
-                        incomingRequestString = buffer.toString();
-                        logger.info(incomingRequestString);
-                    //
-                        // Parse into a request
-                        //
-                        try {
-                                if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_JSON.getMimeType())) {
-                                        pdpRequest = JSONRequest.load(incomingRequestString);
-                                } else if (	contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_XML.getMimeType()) ||
-                                                        contentType.getMimeType().equalsIgnoreCase("application/xacml+xml")) {
-                                        pdpRequest = DOMRequest.load(incomingRequestString);
-                                }
-                        }
-                        catch(Exception e) {
-                                logger.error("Could not parse request", e);
-                                response.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
-                                return;
-                        }
-                } else {
-                        String message = "unsupported content type" + request.getContentType();
-                        logger.error(message);
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
-                        return;
-                }
-                //
-                // Did we successfully get and parse a request?
-                //
-                if (pdpRequest == null || pdpRequest.getRequestAttributes() == null || pdpRequest.getRequestAttributes().size() <= 0) {
-                        String message = "Zero Attributes found in the request";
-                        logger.error(message);
-                        response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
-                        return;
-                }
-                //
-                // Run it
-                //
-                try {
-                        //
-                // Get the pointer to the PDP Engine
-                //
-                        PDPEngine myEngine = null;
-                        synchronized(pdpEngineLock) {
-                                myEngine = this.pdpEngine;
-                        }
-                        if (myEngine == null) {
-                                String message = "No engine loaded.";
-                                logger.error(message);
-                                response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
-                                return;
-                        }
-                        //
-                        // Send the request and save the response
-                        //
-                        long lTimeStart, lTimeEnd;
-                        Response pdpResponse	= null;
+            } catch(Exception e) {
+                logger.error("Could not parse request", e);
+                response.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage());
+                return;
+            }
+        } else {
+            String message = "unsupported content type" + request.getContentType();
+            logger.error(message);
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
+            return;
+        }
+        //
+        // Did we successfully get and parse a request?
+        //
+        if (pdpRequest == null || pdpRequest.getRequestAttributes() == null || pdpRequest.getRequestAttributes().size() <= 0) {
+            String message = "Zero Attributes found in the request";
+            logger.error(message);
+            response.sendError(HttpServletResponse.SC_BAD_REQUEST, message);
+            return;
+        }
+        //
+        // Run it
+        //
+        try {
+            //
+            // Get the pointer to the PDP Engine
+            //
+            PDPEngine myEngine = null;
+            synchronized(pdpEngineLock) {
+                myEngine = this.pdpEngine;
+            }
+            if (myEngine == null) {
+                String message = "No engine loaded.";
+                logger.error(message);
+                response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
+                return;
+            }
+            //
+            // Send the request and save the response
+            //
+            long lTimeStart, lTimeEnd;
+            Response pdpResponse	= null;
 
 //TODO - Make this unnecessary
 //TODO	It seems that the PDP Engine is not thread-safe, so when a configuration change occurs in the middle of processing
@@ -576,135 +574,134 @@
 //TODO	With that configuration this code (without the synchronized) throws a NullPointerException
 //TODO	within a few seconds.
 //
-synchronized(pdpEngineLock) {
-        myEngine = this.pdpEngine;
-                        try {
-                                lTimeStart = System.currentTimeMillis();
-                                pdpResponse	= myEngine.decide(pdpRequest);
-                                lTimeEnd = System.currentTimeMillis();
-                        } catch (PDPException e) {
-                                String message = "Exception during decide: " + e.getMessage();
-                                logger.error(message);
-                                response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
-                                return;
-                        }
-}
-                        requestLogger.info(lTimeStart + "=" + incomingRequestString);
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Request time: " + (lTimeEnd - lTimeStart) + "ms");
-                        }
-                        //
-                        // Convert Response to appropriate Content-Type
-                        //
-                        if (pdpResponse == null) {
-                                requestLogger.info(lTimeStart + "=" + "{}");
-                                throw new Exception("Failed to get response from PDP engine.");
-                        }
-                        //
-                        // Set our content-type
-                        //
-                        response.setContentType(contentType.getMimeType());
-                        //
-                        // Convert the PDP response object to a String to
-                        // return to our caller as well as dump to our loggers.
-                        //
-                        String outgoingResponseString = "";
-                        if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_JSON.getMimeType())) {
-                                //
-                                // Get it as a String. This is not very efficient but we need to log our
-                                // results for auditing.
-                                //
-                                outgoingResponseString = JSONResponse.toString(pdpResponse, logger.isDebugEnabled());
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug(outgoingResponseString);
-                                        //
-                                        // Get rid of whitespace
-                                        //
-                                        outgoingResponseString = JSONResponse.toString(pdpResponse, false);
-                                }
-                        } else if (	contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_XML.getMimeType()) ||
-                                                contentType.getMimeType().equalsIgnoreCase("application/xacml+xml")) {
-                                //
-                                // Get it as a String. This is not very efficient but we need to log our
-                                // results for auditing.
-                                //
-                                outgoingResponseString = DOMResponse.toString(pdpResponse, logger.isDebugEnabled());
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug(outgoingResponseString);
-                                        //
-                                        // Get rid of whitespace
-                                        //
-                                        outgoingResponseString = DOMResponse.toString(pdpResponse, false);
-                                }
-                        }
-                        //
-                        // lTimeStart is used as an ID within the requestLogger to match up
-                        // request's with responses.
-                        //
-                        requestLogger.info(lTimeStart + "=" + outgoingResponseString);
-                        response.getWriter().print(outgoingResponseString);
-                }
-                catch (Exception e) {
-                        String message = "Exception executing request: " + e;
-                        logger.error(message, e);
-                        response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
-                        return;
-                }
-                response.setStatus(HttpServletResponse.SC_OK);
-        }
-
-        @Override
-        public void run() {
-                //
-                // Keep running until we are told to terminate
-                //
+            synchronized(pdpEngineLock) {
+                myEngine = this.pdpEngine;
                 try {
-                        while (! this.configThreadTerminate) {
-                                PutRequest request = XACMLPdpServlet.queue.take();
-                                StdPDPStatus newStatus = new StdPDPStatus();
+                    lTimeStart = System.currentTimeMillis();
+                    pdpResponse	= myEngine.decide(pdpRequest);
+                    lTimeEnd = System.currentTimeMillis();
+                } catch (PDPException e) {
+                    String message = "Exception during decide: " + e.getMessage();
+                    logger.error(message);
+                    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
+                    return;
+                }
+            }
+            requestLogger.info(lTimeStart + "=" + incomingRequestString);
+            if (logger.isDebugEnabled()) {
+                logger.debug("Request time: " + (lTimeEnd - lTimeStart) + "ms");
+            }
+            //
+            // Convert Response to appropriate Content-Type
+            //
+            if (pdpResponse == null) {
+                requestLogger.info(lTimeStart + "=" + "{}");
+                throw new Exception("Failed to get response from PDP engine.");
+            }
+            //
+            // Set our content-type
+            //
+            response.setContentType(contentType.getMimeType());
+            //
+            // Convert the PDP response object to a String to
+            // return to our caller as well as dump to our loggers.
+            //
+            String outgoingResponseString = "";
+            if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_JSON.getMimeType())) {
+                //
+                // Get it as a String. This is not very efficient but we need to log our
+                // results for auditing.
+                //
+                outgoingResponseString = JSONResponse.toString(pdpResponse, logger.isDebugEnabled());
+                if (logger.isDebugEnabled()) {
+                    logger.debug(outgoingResponseString);
+                    //
+                    // Get rid of whitespace
+                    //
+                    outgoingResponseString = JSONResponse.toString(pdpResponse, false);
+                }
+            } else if (	contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_XML.getMimeType()) ||
+                        contentType.getMimeType().equalsIgnoreCase("application/xacml+xml")) {
+                //
+                // Get it as a String. This is not very efficient but we need to log our
+                // results for auditing.
+                //
+                outgoingResponseString = DOMResponse.toString(pdpResponse, logger.isDebugEnabled());
+                if (logger.isDebugEnabled()) {
+                    logger.debug(outgoingResponseString);
+                    //
+                    // Get rid of whitespace
+                    //
+                    outgoingResponseString = DOMResponse.toString(pdpResponse, false);
+                }
+            }
+            //
+            // lTimeStart is used as an ID within the requestLogger to match up
+            // request's with responses.
+            //
+            requestLogger.info(lTimeStart + "=" + outgoingResponseString);
+            response.getWriter().print(outgoingResponseString);
+        } catch (Exception e) {
+            String message = "Exception executing request: " + e;
+            logger.error(message, e);
+            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, message);
+            return;
+        }
+        response.setStatus(HttpServletResponse.SC_OK);
+    }
+
+    @Override
+    public void run() {
+        //
+        // Keep running until we are told to terminate
+        //
+        try {
+            while (! this.configThreadTerminate) {
+                PutRequest request = XACMLPdpServlet.queue.take();
+                StdPDPStatus newStatus = new StdPDPStatus();
 
 //TODO - This is related to the problem discussed in the doPost() method about the PDPEngine not being thread-safe.
 //TODO	See that discussion, and when the PDPEngine is made thread-safe it should be ok to move the loadEngine out of
 //TODO	the synchronized block.
 //TODO	However, since configuration changes should be rare we may not care about changing this.
-PDPEngine newEngine = null;
-                                synchronized(pdpStatusLock) {
-                                        XACMLPdpServlet.status.setStatus(Status.UPDATING_CONFIGURATION);
-newEngine = XACMLPdpLoader.loadEngine(newStatus, request.policyProperties, request.pipConfigProperties);
-                                }
-//				PDPEngine newEngine = XACMLPdpLoader.loadEngine(newStatus, request.policyProperties, request.pipConfigProperties);
-                                if (newEngine != null) {
-                                        synchronized(XACMLPdpServlet.pdpEngineLock) {
-                                                this.pdpEngine = newEngine;
-                                                try {
-                                                        logger.info("Saving configuration.");
-                                                        if (request.policyProperties != null) {
-                                                                try (OutputStream os = Files.newOutputStream(XACMLPdpLoader.getPDPPolicyCache())) {
-                                                                        request.policyProperties.store(os, "");
-                                                                }
-                                                        }
-                                                        if (request.pipConfigProperties != null) {
-                                                                try (OutputStream os = Files.newOutputStream(XACMLPdpLoader.getPIPConfig())) {
-                                                                        request.pipConfigProperties.store(os, "");
-                                                                }
-                                                        }
-                                                        newStatus.setStatus(Status.UP_TO_DATE);
-                                                        
-                                                } catch (Exception e) {
-                                                        logger.error("Failed to store new properties.");
-                                                        newStatus.setStatus(Status.LOAD_ERRORS);
-                                                        newStatus.addLoadWarning("Unable to save configuration: " + e.getMessage());
-                                                }
-                                        }					
-                                } else {
-                                        newStatus.setStatus(Status.LAST_UPDATE_FAILED);
-                                }
-                                synchronized(pdpStatusLock) {
-                                        XACMLPdpServlet.status.set(newStatus);
-                                }
-                        }
-                } catch (InterruptedException e) {
-                        logger.error("interrupted");
+                PDPEngine newEngine = null;
+                synchronized(pdpStatusLock) {
+                    XACMLPdpServlet.status.setStatus(Status.UPDATING_CONFIGURATION);
+                    newEngine = XACMLPdpLoader.loadEngine(newStatus, request.policyProperties, request.pipConfigProperties);
                 }
-        }	
+//				PDPEngine newEngine = XACMLPdpLoader.loadEngine(newStatus, request.policyProperties, request.pipConfigProperties);
+                if (newEngine != null) {
+                    synchronized(XACMLPdpServlet.pdpEngineLock) {
+                        this.pdpEngine = newEngine;
+                        try {
+                            logger.info("Saving configuration.");
+                            if (request.policyProperties != null) {
+                                try (OutputStream os = Files.newOutputStream(XACMLPdpLoader.getPDPPolicyCache())) {
+                                    request.policyProperties.store(os, "");
+                                }
+                            }
+                            if (request.pipConfigProperties != null) {
+                                try (OutputStream os = Files.newOutputStream(XACMLPdpLoader.getPIPConfig())) {
+                                    request.pipConfigProperties.store(os, "");
+                                }
+                            }
+                            newStatus.setStatus(Status.UP_TO_DATE);
+
+                        } catch (Exception e) {
+                            logger.error("Failed to store new properties.");
+                            newStatus.setStatus(Status.LOAD_ERRORS);
+                            newStatus.addLoadWarning("Unable to save configuration: " + e.getMessage());
+                        }
+                    }
+                } else {
+                    newStatus.setStatus(Status.LAST_UPDATE_FAILED);
+                }
+                synchronized(pdpStatusLock) {
+                    XACMLPdpServlet.status.set(newStatus);
+                }
+            }
+        } catch (InterruptedException e) {
+            logger.error("interrupted");
+        }
+    }
 }
diff --git a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/impl/XACMLPdpPIPFinderFactory.java b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/impl/XACMLPdpPIPFinderFactory.java
index 961eb36..c0b24e9 100644
--- a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/impl/XACMLPdpPIPFinderFactory.java
+++ b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/impl/XACMLPdpPIPFinderFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,54 +42,54 @@
 import com.att.research.xacml.util.XACMLProperties;
 
 public class XACMLPdpPIPFinderFactory extends PIPFinderFactory {
-        private ConfigurableEngineFinder pipFinder;
-        
-        private static Log logger	= LogFactory.getLog(XACMLPdpPIPFinderFactory.class);
-        
-        public XACMLPdpPIPFinderFactory() {
-        }
+    private ConfigurableEngineFinder pipFinder;
 
-        public XACMLPdpPIPFinderFactory(Properties properties) {
-        }
+    private static Log logger	= LogFactory.getLog(XACMLPdpPIPFinderFactory.class);
 
-        @Override
-        public PIPFinder getFinder() throws PIPException {
+    public XACMLPdpPIPFinderFactory() {
+    }
+
+    public XACMLPdpPIPFinderFactory(Properties properties) {
+    }
+
+    @Override
+    public PIPFinder getFinder() throws PIPException {
+        if (pipFinder == null) {
+            synchronized(this) {
                 if (pipFinder == null) {
-                        synchronized(this) {
-                                if (pipFinder == null) {
-                                        if (logger.isDebugEnabled()) {
-                                                logger.debug("Creating default configurable engine finder");
-                                        }
-                                        pipFinder					= new ConfigurableEngineFinder();
-                                        Properties xacmlProperties	= null;
-                                        try {
-                                                xacmlProperties	= XACMLProperties.getProperties();
-                                        } catch (Exception ex) {
-                                                logger.error("Exception getting XACML properties: " + ex.getMessage(), ex);
-                                                return null;
-                                        }
-                                        if (xacmlProperties != null) {
-                                                ((ConfigurableEngineFinder)pipFinder).configure(xacmlProperties);
-                                        }
-                                }
-                        }
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("Creating default configurable engine finder");
+                    }
+                    pipFinder					= new ConfigurableEngineFinder();
+                    Properties xacmlProperties	= null;
+                    try {
+                        xacmlProperties	= XACMLProperties.getProperties();
+                    } catch (Exception ex) {
+                        logger.error("Exception getting XACML properties: " + ex.getMessage(), ex);
+                        return null;
+                    }
+                    if (xacmlProperties != null) {
+                        ((ConfigurableEngineFinder)pipFinder).configure(xacmlProperties);
+                    }
                 }
-                return pipFinder;
+            }
         }
+        return pipFinder;
+    }
 
-        @Override
-        public PIPFinder getFinder(Properties properties) throws PIPException {
+    @Override
+    public PIPFinder getFinder(Properties properties) throws PIPException {
+        if (pipFinder == null) {
+            synchronized(this) {
                 if (pipFinder == null) {
-                        synchronized(this) {
-                                if (pipFinder == null) {
-                                        if (logger.isDebugEnabled()) {
-                                                logger.debug("Creating configurable engine finder using: " + properties);
-                                        }
-                                        pipFinder					= new ConfigurableEngineFinder();
-                                        ((ConfigurableEngineFinder)pipFinder).configure(properties);
-                                }
-                        }
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("Creating configurable engine finder using: " + properties);
+                    }
+                    pipFinder					= new ConfigurableEngineFinder();
+                    ((ConfigurableEngineFinder)pipFinder).configure(properties);
                 }
-                return this.pipFinder;
+            }
         }
+        return this.pipFinder;
+    }
 }
diff --git a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/impl/XACMLPdpPolicyFinderFactory.java b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/impl/XACMLPdpPolicyFinderFactory.java
index 6a2c2be..fc2d0d0 100644
--- a/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/impl/XACMLPdpPolicyFinderFactory.java
+++ b/openaz-xacml-pdp-rest/src/main/java/com/att/research/xacml/rest/impl/XACMLPdpPolicyFinderFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -56,162 +56,162 @@
 import com.google.common.base.Splitter;
 
 public class XACMLPdpPolicyFinderFactory extends PolicyFinderFactory {
-        public static final String	PROP_FILE		= ".file";
-        public static final String	PROP_URL		= ".url";
-        
-        private static Log logger							= LogFactory.getLog(XACMLPdpPolicyFinderFactory.class);
-        private List<PolicyDef> rootPolicies;
-        private List<PolicyDef> referencedPolicies;
-        private boolean needsInit					= true;
-        
-        private Properties properties = null;
-        
-        public XACMLPdpPolicyFinderFactory() {
-                //
-                // Here we differ from the StdPolicyFinderFactory in that we initialize right away.
-                // We do not wait for a policy request to happen to look for and load policies.
-                //
-                this.init();
+    public static final String	PROP_FILE		= ".file";
+    public static final String	PROP_URL		= ".url";
+
+    private static Log logger							= LogFactory.getLog(XACMLPdpPolicyFinderFactory.class);
+    private List<PolicyDef> rootPolicies;
+    private List<PolicyDef> referencedPolicies;
+    private boolean needsInit					= true;
+
+    private Properties properties = null;
+
+    public XACMLPdpPolicyFinderFactory() {
+        //
+        // Here we differ from the StdPolicyFinderFactory in that we initialize right away.
+        // We do not wait for a policy request to happen to look for and load policies.
+        //
+        this.init();
+    }
+
+    public XACMLPdpPolicyFinderFactory(Properties properties) {
+        //
+        // Save our properties
+        //
+        this.properties = properties;
+        //
+        // Here we differ from the StdPolicyFinderFactory in that we initialize right away.
+        // We do not wait for a policy request to happen to look for and load policies.
+        //
+        this.init();
+    }
+
+    /**
+     * Loads the <code>PolicyDef</code> for the given <code>String</code> identifier by looking first
+     * for a ".file" property associated with the ID and using that to load from a <code>File</code> and
+     * looking for a ".url" property associated with the ID and using that to load from a <code>URL</code>.
+     *
+     * @param policyId the <code>String</code> identifier for the policy
+     * @return a <code>PolicyDef</code> loaded from the given identifier
+     */
+    protected PolicyDef loadPolicyDef(String policyId) {
+        String propLocation = null;
+        if (this.properties == null) {
+            propLocation	= XACMLProperties.getProperty(policyId + PROP_FILE);
+        } else {
+            propLocation	= this.properties.getProperty(policyId + PROP_FILE);
+        }
+        if (propLocation != null) {
+            File fileLocation	= new File(propLocation);
+            if (!fileLocation.exists()) {
+                XACMLPdpPolicyFinderFactory.logger.error("Policy file " + fileLocation.getAbsolutePath() + " does not exist.");
+            } else if (!fileLocation.canRead()) {
+                XACMLPdpPolicyFinderFactory.logger.error("Policy file " + fileLocation.getAbsolutePath() + " cannot be read.");
+            } else {
+                try {
+                    XACMLPdpPolicyFinderFactory.logger.info("Loading policy file " + fileLocation);
+                    PolicyDef policyDef	= DOMPolicyDef.load(fileLocation);
+                    if (policyDef != null) {
+                        return policyDef;
+                    }
+                } catch (DOMStructureException ex) {
+                    XACMLPdpPolicyFinderFactory.logger.error("Error loading policy file " + fileLocation.getAbsolutePath() + ": " + ex.getMessage(), ex);
+                    return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+                }
+            }
+        }
+        if (this.properties == null) {
+            propLocation = XACMLProperties.getProperty(policyId + PROP_URL);
+        } else {
+            propLocation = this.properties.getProperty(policyId + PROP_URL);
+        }
+        if (propLocation != null) {
+            InputStream is = null;
+            try {
+                URL url						= new URL(propLocation);
+                URLConnection urlConnection	= url.openConnection();
+                XACMLPdpPolicyFinderFactory.logger.info("Loading policy file " + url.toString());
+                is = urlConnection.getInputStream();
+                PolicyDef policyDef			= DOMPolicyDef.load(is);
+                if (policyDef != null) {
+                    return policyDef;
+                }
+            } catch (MalformedURLException ex) {
+                XACMLPdpPolicyFinderFactory.logger.error("Invalid URL " + propLocation + ": " + ex.getMessage(), ex);
+            } catch (IOException ex) {
+                XACMLPdpPolicyFinderFactory.logger.error("IOException opening URL " + propLocation + ": " + ex.getMessage(), ex);
+            } catch (DOMStructureException ex) {
+                XACMLPdpPolicyFinderFactory.logger.error("Invalid Policy " + propLocation + ": " + ex.getMessage(), ex);
+                return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            } finally {
+                if (is != null) {
+                    try {
+                        is.close();
+                    } catch (IOException e) {
+                        XACMLPdpPolicyFinderFactory.logger.error("Exception closing InputStream for GET of url " + propLocation + " : " + e.getMessage() + "  (May be memory leak)", e);
+                    }
+                }
+            }
         }
 
-        public XACMLPdpPolicyFinderFactory(Properties properties) {
-                //
-                // Save our properties
-                //
-                this.properties = properties;
-                //
-                // Here we differ from the StdPolicyFinderFactory in that we initialize right away.
-                // We do not wait for a policy request to happen to look for and load policies.
-                //
-                this.init();
+        XACMLPdpPolicyFinderFactory.logger.error("No known location for Policy " + policyId);
+        return null;
+    }
+
+    /**
+     * Finds the identifiers for all of the policies referenced by the given property name in the
+     * <code>XACMLProperties</code> and loads them using the requested loading method.
+     *
+     * @param propertyName the <code>String</code> name of the property containing the list of policy identifiers
+     * @return a <code>List</code> of <code>PolicyDef</code>s loaded from the given property name
+     */
+    protected List<PolicyDef> getPolicyDefs(String propertyName) {
+        String policyIds	= XACMLProperties.getProperty(propertyName);
+        if (policyIds == null || policyIds.length() == 0) {
+            return null;
         }
 
-        /**
-         * Loads the <code>PolicyDef</code> for the given <code>String</code> identifier by looking first
-         * for a ".file" property associated with the ID and using that to load from a <code>File</code> and
-         * looking for a ".url" property associated with the ID and using that to load from a <code>URL</code>.
-         * 
-         * @param policyId the <code>String</code> identifier for the policy
-         * @return a <code>PolicyDef</code> loaded from the given identifier
-         */
-        protected PolicyDef loadPolicyDef(String policyId) {
-                String propLocation = null;
-                if (this.properties == null) {
-                        propLocation	= XACMLProperties.getProperty(policyId + PROP_FILE);
-                } else {
-                        propLocation	= this.properties.getProperty(policyId + PROP_FILE);
-                }
-                if (propLocation != null) {
-                        File fileLocation	= new File(propLocation);
-                        if (!fileLocation.exists()) {
-                                XACMLPdpPolicyFinderFactory.logger.error("Policy file " + fileLocation.getAbsolutePath() + " does not exist.");
-                        } else if (!fileLocation.canRead()) {
-                                XACMLPdpPolicyFinderFactory.logger.error("Policy file " + fileLocation.getAbsolutePath() + " cannot be read.");
-                        } else {
-                                try {
-                                        XACMLPdpPolicyFinderFactory.logger.info("Loading policy file " + fileLocation);
-                                        PolicyDef policyDef	= DOMPolicyDef.load(fileLocation);
-                                        if (policyDef != null) {
-                                                return policyDef;
-                                        }
-                                } catch (DOMStructureException ex) {
-                                        XACMLPdpPolicyFinderFactory.logger.error("Error loading policy file " + fileLocation.getAbsolutePath() + ": " + ex.getMessage(), ex);
-                                        return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                                }
-                        }
-                }
-                if (this.properties == null) {
-                        propLocation = XACMLProperties.getProperty(policyId + PROP_URL);
-                } else {
-                        propLocation = this.properties.getProperty(policyId + PROP_URL);
-                }
-                if (propLocation != null) {
-                         InputStream is = null;
-                        try {
-                                URL url						= new URL(propLocation);
-                                URLConnection urlConnection	= url.openConnection();
-                                XACMLPdpPolicyFinderFactory.logger.info("Loading policy file " + url.toString());
-                                is = urlConnection.getInputStream();
-                                PolicyDef policyDef			= DOMPolicyDef.load(is);
-                                if (policyDef != null) {
-                                        return policyDef;
-                                }
-                        } catch (MalformedURLException ex) {
-                                XACMLPdpPolicyFinderFactory.logger.error("Invalid URL " + propLocation + ": " + ex.getMessage(), ex);
-                        } catch (IOException ex) {
-                                XACMLPdpPolicyFinderFactory.logger.error("IOException opening URL " + propLocation + ": " + ex.getMessage(), ex);
-                        } catch (DOMStructureException ex) {
-                                XACMLPdpPolicyFinderFactory.logger.error("Invalid Policy " + propLocation + ": " + ex.getMessage(), ex);
-                                return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        } finally {
-                                if (is != null) {
-                                        try {
-                                                is.close();
-                                        } catch (IOException e) {
-                                                XACMLPdpPolicyFinderFactory.logger.error("Exception closing InputStream for GET of url " + propLocation + " : " + e.getMessage() + "  (May be memory leak)", e);
-                                        }
-                                }
-                        }
-                }
-                
-                XACMLPdpPolicyFinderFactory.logger.error("No known location for Policy " + policyId);
-                return null;
-        }
-        
-        /**
-         * Finds the identifiers for all of the policies referenced by the given property name in the
-         * <code>XACMLProperties</code> and loads them using the requested loading method.
-         * 
-         * @param propertyName the <code>String</code> name of the property containing the list of policy identifiers
-         * @return a <code>List</code> of <code>PolicyDef</code>s loaded from the given property name
-         */
-        protected List<PolicyDef> getPolicyDefs(String propertyName) {
-                String policyIds	= XACMLProperties.getProperty(propertyName);
-                if (policyIds == null || policyIds.length() == 0) {
-                        return null;
-                }
-                
-                Iterable<String> policyIdArray	= Splitter.on(',').trimResults().omitEmptyStrings().split(policyIds);
-                if (policyIdArray == null) {
-                        return null;
-                }
-                
-                List<PolicyDef> listPolicyDefs	= new ArrayList<PolicyDef>();
-                for (String policyId : policyIdArray) {
-                        PolicyDef policyDef	= this.loadPolicyDef(policyId);	
-                        if (policyDef != null) {
-                                listPolicyDefs.add(policyDef);
-                        }
-                }
-                return listPolicyDefs;
-        }
-        
-        protected synchronized void init() {
-                if (this.needsInit) {
-                        if (XACMLPdpPolicyFinderFactory.logger.isDebugEnabled()) {
-                                XACMLPdpPolicyFinderFactory.logger.debug("Initializing");
-                        }
-                        this.rootPolicies		= this.getPolicyDefs(XACMLProperties.PROP_ROOTPOLICIES);
-                        this.referencedPolicies	= this.getPolicyDefs(XACMLProperties.PROP_REFERENCEDPOLICIES);
-                        if (XACMLPdpPolicyFinderFactory.logger.isDebugEnabled()) {
-                                XACMLPdpPolicyFinderFactory.logger.debug("Root Policies: " + this.rootPolicies);
-                                XACMLPdpPolicyFinderFactory.logger.debug("Referenced Policies: " + this.referencedPolicies);
-                        }
-                        this.needsInit	= false;
-                }
-        }
-        
-        @Override
-        public PolicyFinder getPolicyFinder() throws FactoryException {
-                //
-                // Force using any properties that were passed upon construction
-                //
-                return new StdPolicyFinder(this.rootPolicies, this.referencedPolicies, this.properties);
+        Iterable<String> policyIdArray	= Splitter.on(',').trimResults().omitEmptyStrings().split(policyIds);
+        if (policyIdArray == null) {
+            return null;
         }
 
-        @Override
-        public PolicyFinder getPolicyFinder(Properties properties) throws FactoryException {
-                return new StdPolicyFinder(this.rootPolicies, this.referencedPolicies, properties);
+        List<PolicyDef> listPolicyDefs	= new ArrayList<PolicyDef>();
+        for (String policyId : policyIdArray) {
+            PolicyDef policyDef	= this.loadPolicyDef(policyId);
+            if (policyDef != null) {
+                listPolicyDefs.add(policyDef);
+            }
         }
+        return listPolicyDefs;
+    }
+
+    protected synchronized void init() {
+        if (this.needsInit) {
+            if (XACMLPdpPolicyFinderFactory.logger.isDebugEnabled()) {
+                XACMLPdpPolicyFinderFactory.logger.debug("Initializing");
+            }
+            this.rootPolicies		= this.getPolicyDefs(XACMLProperties.PROP_ROOTPOLICIES);
+            this.referencedPolicies	= this.getPolicyDefs(XACMLProperties.PROP_REFERENCEDPOLICIES);
+            if (XACMLPdpPolicyFinderFactory.logger.isDebugEnabled()) {
+                XACMLPdpPolicyFinderFactory.logger.debug("Root Policies: " + this.rootPolicies);
+                XACMLPdpPolicyFinderFactory.logger.debug("Referenced Policies: " + this.referencedPolicies);
+            }
+            this.needsInit	= false;
+        }
+    }
+
+    @Override
+    public PolicyFinder getPolicyFinder() throws FactoryException {
+        //
+        // Force using any properties that were passed upon construction
+        //
+        return new StdPolicyFinder(this.rootPolicies, this.referencedPolicies, this.properties);
+    }
+
+    @Override
+    public PolicyFinder getPolicyFinder(Properties properties) throws FactoryException {
+        return new StdPolicyFinder(this.rootPolicies, this.referencedPolicies, properties);
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/ATTPDPEngine.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/ATTPDPEngine.java
index 74e2a2c..57bc2d4 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/ATTPDPEngine.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/ATTPDPEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -70,206 +70,206 @@
 
 /**
  * ATTPDPEngine implements the {@link com.att.research.xacml.api.pdp.PDPEngine} interface using the XACML 3.0 specification.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class ATTPDPEngine implements PDPEngine, Traceable {
-        private static final Status		STATUS_ADVICE_NA		= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Advice not allowed in combined decision");
-        private static final Status		STATUS_OBLIGATIONS_NA	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Obligations not allowed in combined decision");
-        private static final Status		STATUS_COMBINE_FAILED	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Individual decisions do not match");
-        private static final Result		RESULT_ECTX_NULL		= new StdMutableResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null EvaluationContext"));
+    private static final Status		STATUS_ADVICE_NA		= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Advice not allowed in combined decision");
+    private static final Status		STATUS_OBLIGATIONS_NA	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Obligations not allowed in combined decision");
+    private static final Status		STATUS_COMBINE_FAILED	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Individual decisions do not match");
+    private static final Result		RESULT_ECTX_NULL		= new StdMutableResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null EvaluationContext"));
+
+    /*
+     * These are the profiles that this reference implementation of the PDP engine supports
+     */
+    private static final Set<URI> PROFILES			= new HashSet<URI>();
+    static {
+        PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_COMBINED_DECISION.getUri());
+        PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_REFERENCE.getUri());
+        PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_REPEATED_ATTRIBUTE_CATEGORIES.getUri());
+        PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_SCOPE.getUri());
+        PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_XPATH_EXPRESSION.getUri());
+    }
+
+    private EvaluationContextFactory evaluationContextFactory;
+    private Decision defaultDecision				= Decision.INDETERMINATE;
+    private ScopeResolver scopeResolver;
+    private TraceEngine traceEngine;
+    private Log logger								= LogFactory.getLog(this.getClass());
+
+    protected TraceEngine getTraceEngine() {
+        if (this.traceEngine == null) {
+            synchronized(this) {
+                if (this.traceEngine == null) {
+                    try {
+                        this.traceEngine	= TraceEngineFactory.newInstance().getTraceEngine();
+                    } catch (FactoryException ex) {
+                        this.logger.error("FactoryException creating TraceEngine instance: " + ex.toString(), ex);
+                        throw new IllegalStateException("FactoryException creating TraceEngine instance", ex);
+                    }
+                }
+            }
+        }
+        return this.traceEngine;
+    }
+
+    public ATTPDPEngine(EvaluationContextFactory evaluationContextFactoryIn, ScopeResolver scopeResolverIn) {
+        this.evaluationContextFactory	= evaluationContextFactoryIn;
+        this.scopeResolver				= scopeResolverIn;
+    }
+
+    public ATTPDPEngine(EvaluationContextFactory evaluationContextFactoryIn, Decision defaultDecisionIn, ScopeResolver scopeResolverIn) {
+        this(evaluationContextFactoryIn, scopeResolverIn);
+        this.defaultDecision	= defaultDecisionIn;
+    }
+
+    public ATTPDPEngine(EvaluationContextFactory evaluationContextFactoryIn, Decision defaultDecisionIn, ScopeResolver scopeResolverIn, Properties properties) {
+        this(evaluationContextFactoryIn, defaultDecisionIn, scopeResolverIn);
+    }
+
+    protected Result processRequest(EvaluationContext evaluationContext) {
+        try {
+            PolicyFinderResult<PolicyDef> policyFinderResult	= evaluationContext.getRootPolicyDef();
+            if (policyFinderResult.getStatus() != null && !policyFinderResult.getStatus().isOk()) {
+                return new StdMutableResult(policyFinderResult.getStatus());
+            }
+            PolicyDef policyDefRoot					= policyFinderResult.getPolicyDef();
+            if (policyDefRoot == null) {
+                switch(this.defaultDecision) {
+                case DENY:
+                case NOTAPPLICABLE:
+                case PERMIT:
+                    return new StdMutableResult(this.defaultDecision, new StdStatus(StdStatusCode.STATUS_CODE_OK, "No applicable policy"));
+                case INDETERMINATE:
+                case INDETERMINATE_DENY:
+                case INDETERMINATE_DENYPERMIT:
+                case INDETERMINATE_PERMIT:
+                    return new StdMutableResult(this.defaultDecision, new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No applicable policy"));
+                }
+            }
+            Result result	= policyDefRoot.evaluate(evaluationContext);
+            if (result.getStatus().isOk()) {
+                Collection<AttributeCategory> listRequestAttributesIncludeInResult	= evaluationContext.getRequest().getRequestAttributesIncludedInResult();
+                if (listRequestAttributesIncludeInResult != null && listRequestAttributesIncludeInResult.size() > 0) {
+                    StdMutableResult stdMutableResult	= new StdMutableResult(result);
+                    stdMutableResult.addAttributeCategories(listRequestAttributesIncludeInResult);
+                    result	= new StdResult(stdMutableResult);
+                }
+            }
+            return result;
+        } catch (EvaluationException ex) {
+            return new StdMutableResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
+        }
+    }
+
+    @Override
+    public Response decide(Request pepRequest) throws PDPException {
+        /*
+         * Validate the request
+         */
+        TraceEngine traceEngineThis	= this.getTraceEngine();
+        if (traceEngineThis.isTracing()) {
+            traceEngineThis.trace(new StdTraceEvent<Request>("Input Request", this, pepRequest));
+        }
+        Status statusRequest	= pepRequest.getStatus();
+        if (statusRequest != null && !statusRequest.isOk()) {
+            return new StdMutableResponse(statusRequest);
+        }
 
         /*
-         * These are the profiles that this reference implementation of the PDP engine supports
+         * Split the original request up into individual decision requests
          */
-        private static final Set<URI> PROFILES			= new HashSet<URI>();
-        static {
-                PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_COMBINED_DECISION.getUri());
-                PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_REFERENCE.getUri());
-                PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_REPEATED_ATTRIBUTE_CATEGORIES.getUri());
-                PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_SCOPE.getUri());
-                PROFILES.add(XACML3.ID_PROFILE_MULTIPLE_XPATH_EXPRESSION.getUri());
+        StdIndividualDecisionRequestGenerator stdIndividualDecisionRequestGenerator	= new StdIndividualDecisionRequestGenerator(this.scopeResolver, pepRequest);
+        /*
+         * Determine if we are combining multiple results into a single result
+         */
+        boolean bCombineResults	= pepRequest.getCombinedDecision();
+        StdMutableResult stdResultCombined	= null;
+
+        /*
+         * Iterate over all of the individual decision requests and process them, combining them into the final response
+         */
+        StdMutableResponse stdResponse	= new StdMutableResponse();
+        Iterator<Request> iterRequestsIndividualDecision	= stdIndividualDecisionRequestGenerator.getIndividualDecisionRequests();
+        if (iterRequestsIndividualDecision == null || !iterRequestsIndividualDecision.hasNext()) {
+            return new StdMutableResponse(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No individual decision requests"));
         }
-        
-        private EvaluationContextFactory evaluationContextFactory;
-        private Decision defaultDecision				= Decision.INDETERMINATE;
-        private ScopeResolver scopeResolver;
-        private TraceEngine traceEngine;
-        private Log logger								= LogFactory.getLog(this.getClass());
-        
-        protected TraceEngine getTraceEngine() {
-                if (this.traceEngine == null) {
-                        synchronized(this) {
-                                if (this.traceEngine == null) {
-                                        try {
-                                                this.traceEngine	= TraceEngineFactory.newInstance().getTraceEngine();
-                                        } catch (FactoryException ex) {
-                                                this.logger.error("FactoryException creating TraceEngine instance: " + ex.toString(), ex);
-                                                throw new IllegalStateException("FactoryException creating TraceEngine instance", ex);
-                                        }
-                                }
-                        }
+
+        while (iterRequestsIndividualDecision.hasNext()) {
+            Request requestIndividualDecision	= iterRequestsIndividualDecision.next();
+            if (traceEngineThis.isTracing()) {
+                traceEngineThis.trace(new StdTraceEvent<Request>("Individual Request", this, requestIndividualDecision));
+            }
+            Result resultIndividualDecision		= null;
+            if (requestIndividualDecision.getStatus() != null && !requestIndividualDecision.getStatus().isOk()) {
+                resultIndividualDecision	= new StdMutableResult(requestIndividualDecision.getStatus());
+            } else {
+                EvaluationContext evaluationContext	= this.evaluationContextFactory.getEvaluationContext(requestIndividualDecision);
+                if (evaluationContext == null) {
+                    resultIndividualDecision	= RESULT_ECTX_NULL;
+                } else {
+                    resultIndividualDecision	= this.processRequest(evaluationContext);
                 }
-                return this.traceEngine;
-        }
-        
-        public ATTPDPEngine(EvaluationContextFactory evaluationContextFactoryIn, ScopeResolver scopeResolverIn) {
-                this.evaluationContextFactory	= evaluationContextFactoryIn;
-                this.scopeResolver				= scopeResolverIn;
-        }
-        
-        public ATTPDPEngine(EvaluationContextFactory evaluationContextFactoryIn, Decision defaultDecisionIn, ScopeResolver scopeResolverIn) {
-                this(evaluationContextFactoryIn, scopeResolverIn);
-                this.defaultDecision	= defaultDecisionIn;
-        }
-        
-        public ATTPDPEngine(EvaluationContextFactory evaluationContextFactoryIn, Decision defaultDecisionIn, ScopeResolver scopeResolverIn, Properties properties) {
-                this(evaluationContextFactoryIn, defaultDecisionIn, scopeResolverIn);
-        }
-        
-        protected Result processRequest(EvaluationContext evaluationContext) {
-                try {
-                        PolicyFinderResult<PolicyDef> policyFinderResult	= evaluationContext.getRootPolicyDef();
-                        if (policyFinderResult.getStatus() != null && !policyFinderResult.getStatus().isOk()) {
-                                return new StdMutableResult(policyFinderResult.getStatus());
-                        }
-                        PolicyDef policyDefRoot					= policyFinderResult.getPolicyDef();
-                        if (policyDefRoot == null) {
-                                switch(this.defaultDecision) {
-                                case DENY:
-                                case NOTAPPLICABLE:
-                                case PERMIT:
-                                        return new StdMutableResult(this.defaultDecision, new StdStatus(StdStatusCode.STATUS_CODE_OK, "No applicable policy"));
-                                case INDETERMINATE:
-                                case INDETERMINATE_DENY:
-                                case INDETERMINATE_DENYPERMIT:
-                                case INDETERMINATE_PERMIT:
-                                        return new StdMutableResult(this.defaultDecision, new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No applicable policy"));
-                                }
-                        }
-                        Result result	= policyDefRoot.evaluate(evaluationContext);
-                        if (result.getStatus().isOk()) {
-                                Collection<AttributeCategory> listRequestAttributesIncludeInResult	= evaluationContext.getRequest().getRequestAttributesIncludedInResult();
-                                if (listRequestAttributesIncludeInResult != null && listRequestAttributesIncludeInResult.size() > 0) {
-                                        StdMutableResult stdMutableResult	= new StdMutableResult(result);
-                                        stdMutableResult.addAttributeCategories(listRequestAttributesIncludeInResult);
-                                        result	= new StdResult(stdMutableResult);
-                                }
-                        }
-                        return result;
-                } catch (EvaluationException ex) {
-                        return new StdMutableResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
+            }
+
+            assert(resultIndividualDecision != null);
+            if (traceEngineThis.isTracing()) {
+                traceEngineThis.trace(new StdTraceEvent<Result>("Individual Result", this, resultIndividualDecision));
+            }
+            if (bCombineResults) {
+                Decision decision	= resultIndividualDecision.getDecision();
+                Status status		= resultIndividualDecision.getStatus();
+                if (resultIndividualDecision.getAssociatedAdvice().size() > 0) {
+                    decision	= Decision.INDETERMINATE;
+                    status		= STATUS_ADVICE_NA;
+                } else if (resultIndividualDecision.getObligations().size() > 0) {
+                    decision	= Decision.INDETERMINATE;
+                    status		= STATUS_OBLIGATIONS_NA;
                 }
-        }
-        
-        @Override
-        public Response decide(Request pepRequest) throws PDPException {
-                /*
-                 * Validate the request
-                 */
-                TraceEngine traceEngineThis	= this.getTraceEngine();
+
+                if (stdResultCombined == null) {
+                    stdResultCombined	= new StdMutableResult(decision, status);
+                } else {
+                    if (stdResultCombined.getDecision() != resultIndividualDecision.getDecision()) {
+                        stdResultCombined.setDecision(Decision.INDETERMINATE);
+                        stdResultCombined.setStatus(STATUS_COMBINE_FAILED);
+                    }
+                }
+                stdResultCombined.addPolicyIdentifiers(resultIndividualDecision.getPolicyIdentifiers());
+                stdResultCombined.addPolicySetIdentifiers(resultIndividualDecision.getPolicySetIdentifiers());
+                stdResultCombined.addAttributeCategories(resultIndividualDecision.getAttributes());
                 if (traceEngineThis.isTracing()) {
-                        traceEngineThis.trace(new StdTraceEvent<Request>("Input Request", this, pepRequest));
+                    traceEngineThis.trace(new StdTraceEvent<Result>("Combined result", this, stdResultCombined));
                 }
-                Status statusRequest	= pepRequest.getStatus();
-                if (statusRequest != null && !statusRequest.isOk()) {
-                        return new StdMutableResponse(statusRequest);
-                }
-                
-                /*
-                 * Split the original request up into individual decision requests
-                 */
-                StdIndividualDecisionRequestGenerator stdIndividualDecisionRequestGenerator	= new StdIndividualDecisionRequestGenerator(this.scopeResolver, pepRequest);
-                /*
-                 * Determine if we are combining multiple results into a single result
-                 */
-                boolean bCombineResults	= pepRequest.getCombinedDecision();
-                StdMutableResult stdResultCombined	= null;
-                
-                /*
-                 * Iterate over all of the individual decision requests and process them, combining them into the final response
-                 */
-                StdMutableResponse stdResponse	= new StdMutableResponse();
-                Iterator<Request> iterRequestsIndividualDecision	= stdIndividualDecisionRequestGenerator.getIndividualDecisionRequests();
-                if (iterRequestsIndividualDecision == null || !iterRequestsIndividualDecision.hasNext()) {
-                        return new StdMutableResponse(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No individual decision requests"));
-                }
-                
-                while (iterRequestsIndividualDecision.hasNext()) {
-                        Request requestIndividualDecision	= iterRequestsIndividualDecision.next();
-                        if (traceEngineThis.isTracing()) {
-                                traceEngineThis.trace(new StdTraceEvent<Request>("Individual Request", this, requestIndividualDecision));
-                        }
-                        Result resultIndividualDecision		= null;
-                        if (requestIndividualDecision.getStatus() != null && !requestIndividualDecision.getStatus().isOk()) {
-                                resultIndividualDecision	= new StdMutableResult(requestIndividualDecision.getStatus());
-                        } else {
-                                EvaluationContext evaluationContext	= this.evaluationContextFactory.getEvaluationContext(requestIndividualDecision);
-                                if (evaluationContext == null) {
-                                        resultIndividualDecision	= RESULT_ECTX_NULL;
-                                } else {
-                                        resultIndividualDecision	= this.processRequest(evaluationContext);
-                                }
-                        }
-                        
-                        assert(resultIndividualDecision != null);
-                        if (traceEngineThis.isTracing()) {
-                                traceEngineThis.trace(new StdTraceEvent<Result>("Individual Result", this, resultIndividualDecision));
-                        }
-                        if (bCombineResults) {
-                                Decision decision	= resultIndividualDecision.getDecision();
-                                Status status		= resultIndividualDecision.getStatus();
-                                if (resultIndividualDecision.getAssociatedAdvice().size() > 0) {
-                                        decision	= Decision.INDETERMINATE;
-                                        status		= STATUS_ADVICE_NA;
-                                } else if (resultIndividualDecision.getObligations().size() > 0) {
-                                        decision	= Decision.INDETERMINATE;
-                                        status		= STATUS_OBLIGATIONS_NA;
-                                }
-                                
-                                if (stdResultCombined == null) {
-                                        stdResultCombined	= new StdMutableResult(decision, status);
-                                } else {
-                                        if (stdResultCombined.getDecision() != resultIndividualDecision.getDecision()) {
-                                                stdResultCombined.setDecision(Decision.INDETERMINATE);
-                                                stdResultCombined.setStatus(STATUS_COMBINE_FAILED);
-                                        }
-                                }
-                                stdResultCombined.addPolicyIdentifiers(resultIndividualDecision.getPolicyIdentifiers());
-                                stdResultCombined.addPolicySetIdentifiers(resultIndividualDecision.getPolicySetIdentifiers());
-                                stdResultCombined.addAttributeCategories(resultIndividualDecision.getAttributes());
-                                if (traceEngineThis.isTracing()) {
-                                        traceEngineThis.trace(new StdTraceEvent<Result>("Combined result", this, stdResultCombined));
-                                }
-                        } else {
-                                stdResponse.add(resultIndividualDecision);
-                        }
-                }
-                
-                if (bCombineResults) {
-                        stdResponse.add(stdResultCombined);
-                }
-                return stdResponse;
+            } else {
+                stdResponse.add(resultIndividualDecision);
+            }
         }
 
-        @Override
-        public Collection<URI> getProfiles() {
-                return Collections.unmodifiableCollection(PROFILES);
+        if (bCombineResults) {
+            stdResponse.add(stdResultCombined);
         }
+        return stdResponse;
+    }
 
-        @Override
-        public boolean hasProfile(URI uriProfile) {
-                return PROFILES.contains(uriProfile);
-        }
+    @Override
+    public Collection<URI> getProfiles() {
+        return Collections.unmodifiableCollection(PROFILES);
+    }
 
-        @Override
-        public String getTraceId() {
-                return this.getClass().getCanonicalName();
-        }
+    @Override
+    public boolean hasProfile(URI uriProfile) {
+        return PROFILES.contains(uriProfile);
+    }
 
-        @Override
-        public Traceable getCause() {
-                return null;
-        }
+    @Override
+    public String getTraceId() {
+        return this.getClass().getCanonicalName();
+    }
+
+    @Override
+    public Traceable getCause() {
+        return null;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/ATTPDPEngineFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/ATTPDPEngineFactory.java
index fe0c95c..e30b180 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/ATTPDPEngineFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/ATTPDPEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,33 +44,33 @@
  * ATTPDPEngineFactory extends {@link com.att.research.xacml.api.pdp.PDPEngineFactory} by implementing the abstract
  * <code>newEngine</code> method to create a {@link ATTPDPEngine} instance and initialize it
  * with policies and PIP instances based on configuration information provided to the factory.
- * 
+ *
  * @author car
  * @version $Revision: 1.4 $
  */
 public class ATTPDPEngineFactory extends PDPEngineFactory {
-        private Log logger	= LogFactory.getLog(this.getClass());
-        
-        public ATTPDPEngineFactory() {
-        }
+    private Log logger	= LogFactory.getLog(this.getClass());
 
-        @Override
-        public PDPEngine newEngine() throws FactoryException {
-                EvaluationContextFactory evaluationContextFactory	= EvaluationContextFactory.newInstance();
-                if (evaluationContextFactory == null) {
-                        this.logger.error("Null EvaluationContextFactory");
-                        throw new FactoryException("Null EvaluationContextFactory");
-                }
-                return new ATTPDPEngine(evaluationContextFactory, this.getDefaultBehavior(), this.getScopeResolver());
-        }
+    public ATTPDPEngineFactory() {
+    }
 
-        @Override
-        public PDPEngine newEngine(Properties properties) throws FactoryException {
-                EvaluationContextFactory evaluationContextFactory	= EvaluationContextFactory.newInstance(properties);
-                if (evaluationContextFactory == null) {
-                        this.logger.error("Null EvaluationContextFactory");
-                        throw new FactoryException("Null EvaluationContextFactory");
-                }
-                return new ATTPDPEngine(evaluationContextFactory, this.getDefaultBehavior(), this.getScopeResolver(), properties);
-        }	
+    @Override
+    public PDPEngine newEngine() throws FactoryException {
+        EvaluationContextFactory evaluationContextFactory	= EvaluationContextFactory.newInstance();
+        if (evaluationContextFactory == null) {
+            this.logger.error("Null EvaluationContextFactory");
+            throw new FactoryException("Null EvaluationContextFactory");
+        }
+        return new ATTPDPEngine(evaluationContextFactory, this.getDefaultBehavior(), this.getScopeResolver());
+    }
+
+    @Override
+    public PDPEngine newEngine(Properties properties) throws FactoryException {
+        EvaluationContextFactory evaluationContextFactory	= EvaluationContextFactory.newInstance(properties);
+        if (evaluationContextFactory == null) {
+            this.logger.error("Null EvaluationContextFactory");
+            throw new FactoryException("Null EvaluationContextFactory");
+        }
+        return new ATTPDPEngine(evaluationContextFactory, this.getDefaultBehavior(), this.getScopeResolver(), properties);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/Evaluatable.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/Evaluatable.java
index 32039b4..f34dfd3 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/Evaluatable.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/Evaluatable.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,10 +34,10 @@
 /**
  * Evaluatable is the interface objects implement to indicate they can be evaluated with an {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}
  * and return an {@link com.att.research.xacmlatt.pdp.eval.EvaluationResult}.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface Evaluatable {
-        public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException;
+    public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException;
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContext.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContext.java
index 453a3ec..36c71a6 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContext.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContext.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,49 +45,49 @@
 /**
  * EvaluationContext provides the interface that the PDP uses to evaluate its set of Policies and PolicySets against
  * a {@link com.att.research.xacml.api.Request}.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public interface EvaluationContext extends PIPFinder, TraceEngine {
-        /**
-         * Gets the original <code>Request</code> provided to the <code>ATTPDPEngine</code>'s <code>decide</code> method.
-         * 
-         * @return the <code>Request</code> provided to the <code>ATTPDPEngine</code>'s <code>decide</code> method.
-         */
-        public Request getRequest();
-        
-        /**
-         * Gets the root {@link com.att.research.xacmlatt.pdp.policy.PolicyDef} from the policy store
-         * configured by the particular implementation of the <code>PolicyFinderFactory</code> class.
-         * 
-         * @return a <code>PolicyFinderResult</code> with the root <code>PolicyDef</code>
-         */
-        public abstract PolicyFinderResult<PolicyDef> getRootPolicyDef();
-        
-        /**
-         * Gets the {@link com.att.research.xacmlatt.pdp.policy.Policy} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
-         * 
-         * @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
-         * @return a <code>PolicyFinderResult</code> with the <code>Policy</code> matching the given <code>IdReferenceMatch</code>
-         */
-        public abstract PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch);
-        
-        /**
-         * Gets the {@link com.att.research.xacmlatt.pdp.policy.PolicySet} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
-         * 
-         * @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
-         * @return a <code>PolicyFinderResult</code> with the <code>PolicySet</code> matching the given <code>IdReferenceMatch</code>.
-         */
-        public abstract PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch);
-        
-        /**
-         * Gets the {@link com.att.research.xacml.api.pip.PIPResponse} containing {@link com.att.research.xacml.api.Attribute}s that
-         * match the given {@link com.att.research.xacml.api.pip.PIPRequest} from this <code>EvaluationContext</code>.
-         * 
-         * @param pipRequest the <code>PIPRequest</code> specifying which <code>Attribute</code>s to retrieve
-         * @return the <code>PIPResponse</code> containing the {@link com.att.research.xacml.api.Status} and <code>Attribute</code>s
-         * @throws EvaluationException if there is an error retrieving the <code>Attribute</code>s
-         */
-        public PIPResponse getAttributes(PIPRequest pipRequest) throws PIPException;
+    /**
+     * Gets the original <code>Request</code> provided to the <code>ATTPDPEngine</code>'s <code>decide</code> method.
+     *
+     * @return the <code>Request</code> provided to the <code>ATTPDPEngine</code>'s <code>decide</code> method.
+     */
+    public Request getRequest();
+
+    /**
+     * Gets the root {@link com.att.research.xacmlatt.pdp.policy.PolicyDef} from the policy store
+     * configured by the particular implementation of the <code>PolicyFinderFactory</code> class.
+     *
+     * @return a <code>PolicyFinderResult</code> with the root <code>PolicyDef</code>
+     */
+    public abstract PolicyFinderResult<PolicyDef> getRootPolicyDef();
+
+    /**
+     * Gets the {@link com.att.research.xacmlatt.pdp.policy.Policy} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
+     *
+     * @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
+     * @return a <code>PolicyFinderResult</code> with the <code>Policy</code> matching the given <code>IdReferenceMatch</code>
+     */
+    public abstract PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch);
+
+    /**
+     * Gets the {@link com.att.research.xacmlatt.pdp.policy.PolicySet} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
+     *
+     * @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
+     * @return a <code>PolicyFinderResult</code> with the <code>PolicySet</code> matching the given <code>IdReferenceMatch</code>.
+     */
+    public abstract PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch);
+
+    /**
+     * Gets the {@link com.att.research.xacml.api.pip.PIPResponse} containing {@link com.att.research.xacml.api.Attribute}s that
+     * match the given {@link com.att.research.xacml.api.pip.PIPRequest} from this <code>EvaluationContext</code>.
+     *
+     * @param pipRequest the <code>PIPRequest</code> specifying which <code>Attribute</code>s to retrieve
+     * @return the <code>PIPResponse</code> containing the {@link com.att.research.xacml.api.Status} and <code>Attribute</code>s
+     * @throws EvaluationException if there is an error retrieving the <code>Attribute</code>s
+     */
+    public PIPResponse getAttributes(PIPRequest pipRequest) throws PIPException;
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContextException.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContextException.java
index de7d76c..b9a41da 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContextException.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContextException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,30 +33,30 @@
 /**
  * EvaluationContextException extends <code>Exception</code> to represent errors thrown by
  * methods in the {@link EvaluationContext} and {@link EvaluationContextFactory}.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class EvaluationContextException extends Exception {
-        private static final long serialVersionUID = -8270506903118536839L;
+    private static final long serialVersionUID = -8270506903118536839L;
 
-        public EvaluationContextException() {
-        }
+    public EvaluationContextException() {
+    }
 
-        public EvaluationContextException(String message) {
-                super(message);
-        }
+    public EvaluationContextException(String message) {
+        super(message);
+    }
 
-        public EvaluationContextException(Throwable cause) {
-                super(cause);
-        }
+    public EvaluationContextException(Throwable cause) {
+        super(cause);
+    }
 
-        public EvaluationContextException(String message, Throwable cause) {
-                super(message, cause);
-        }
+    public EvaluationContextException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-        public EvaluationContextException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-                super(message, cause, enableSuppression, writableStackTrace);
-        }
+    public EvaluationContextException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContextFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContextFactory.java
index d8d1258..93532a8 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContextFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationContextFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,58 +42,58 @@
 /**
  * EvaluationContextFactory provides methods for creating {@link EvaluationContext} objects
  * based on configuration information found in standard places.  (TODO: Detail what these are)
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public abstract class EvaluationContextFactory {
-        private static final String	FACTORYID					= ATTPDPProperties.PROP_EVALUATIONCONTEXTFACTORY;
-        private static final String DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.std.StdEvaluationContextFactory";
-        
-        protected EvaluationContextFactory() {
-        }
-        
-        protected EvaluationContextFactory(Properties properties) {
-        }
-        
-        public static EvaluationContextFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, EvaluationContextFactory.class);
-        }
-        
-        public static EvaluationContextFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, EvaluationContextFactory.class, properties);
-        }
-        
-        public static EvaluationContextFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(className, EvaluationContextFactory.class, classLoader, false);
-        }
+    private static final String	FACTORYID					= ATTPDPProperties.PROP_EVALUATIONCONTEXTFACTORY;
+    private static final String DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.std.StdEvaluationContextFactory";
 
-        public static EvaluationContextFactory newInstance(String className) throws FactoryException {
-                return FactoryFinder.newInstance(className, EvaluationContextFactory.class, null, true);
-        }
-        
-        /**
-         * Gets a new {@link com.att.research.xacml.pdp.eval.EvaluationContext} for the given {@link com.att.research.xacml.api.Request}.
-         * 
-         * @param request the <code>Request</code> for the new <code>EvaluationContext</code>
-         * @return a new <code>EvaluationContext</code> for the given <code>Request</code>
-         */
-        public abstract EvaluationContext getEvaluationContext(Request request);
+    protected EvaluationContextFactory() {
+    }
 
-        /**
-         * Sets the {@link com.att.research.xacmlatt.pdp.policy.PolicyFinder} for this <code>EvaluationContextFactory</code> to an
-         * explicit instance instead of the default or configured value.
-         * 
-         * @param policyFinder the <code>PolicyFinder</code> to use in creating new <code>EvaluationContext</code>s.
-         */
-        public abstract void setPolicyFinder(PolicyFinder policyFinder);
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.pip.PIPFinder} for this <code>EvaluationContextFactory</code> to an
-         * explicit instance instaed of the default or configured value.
-         * 
-         * @param pipFinder the <code>PIPFinder</code> to use in creating new <code>EvaluationContext</code>s.
-         */
-        public abstract void setPIPFinder(PIPFinder pipFinder);
+    protected EvaluationContextFactory(Properties properties) {
+    }
+
+    public static EvaluationContextFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, EvaluationContextFactory.class);
+    }
+
+    public static EvaluationContextFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, EvaluationContextFactory.class, properties);
+    }
+
+    public static EvaluationContextFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(className, EvaluationContextFactory.class, classLoader, false);
+    }
+
+    public static EvaluationContextFactory newInstance(String className) throws FactoryException {
+        return FactoryFinder.newInstance(className, EvaluationContextFactory.class, null, true);
+    }
+
+    /**
+     * Gets a new {@link com.att.research.xacml.pdp.eval.EvaluationContext} for the given {@link com.att.research.xacml.api.Request}.
+     *
+     * @param request the <code>Request</code> for the new <code>EvaluationContext</code>
+     * @return a new <code>EvaluationContext</code> for the given <code>Request</code>
+     */
+    public abstract EvaluationContext getEvaluationContext(Request request);
+
+    /**
+     * Sets the {@link com.att.research.xacmlatt.pdp.policy.PolicyFinder} for this <code>EvaluationContextFactory</code> to an
+     * explicit instance instead of the default or configured value.
+     *
+     * @param policyFinder the <code>PolicyFinder</code> to use in creating new <code>EvaluationContext</code>s.
+     */
+    public abstract void setPolicyFinder(PolicyFinder policyFinder);
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.pip.PIPFinder} for this <code>EvaluationContextFactory</code> to an
+     * explicit instance instaed of the default or configured value.
+     *
+     * @param pipFinder the <code>PIPFinder</code> to use in creating new <code>EvaluationContext</code>s.
+     */
+    public abstract void setPIPFinder(PIPFinder pipFinder);
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationException.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationException.java
index 1eceb5c..cf28f82 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationException.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,30 +34,30 @@
 /**
  * EvaluationException extends <code>Exception</code> to represent errors returned by methods of the
  * {@link Evaluatable} interface and the {@link Matchable} interface.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class EvaluationException extends Exception {
-        private static final long serialVersionUID = 302250127793947492L;
+    private static final long serialVersionUID = 302250127793947492L;
 
-        public EvaluationException() {
-        }
+    public EvaluationException() {
+    }
 
-        public EvaluationException(String message) {
-                super(message);
-        }
+    public EvaluationException(String message) {
+        super(message);
+    }
 
-        public EvaluationException(Throwable cause) {
-                super(cause);
-        }
+    public EvaluationException(Throwable cause) {
+        super(cause);
+    }
 
-        public EvaluationException(String message, Throwable cause) {
-                super(message, cause);
-        }
+    public EvaluationException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-        public EvaluationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-                super(message, cause, enableSuppression, writableStackTrace);
-        }
+    public EvaluationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationResult.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationResult.java
index 00f4f91..cef7a9d 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationResult.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/EvaluationResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,58 +43,58 @@
 
 /**
  * EvaluationResult extends {@link com.att.research.xacml.std.StdMutableResult} with methods useful within a PDP implementation
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class EvaluationResult extends StdMutableResult {
-        public EvaluationResult() {
-                super();
+    public EvaluationResult() {
+        super();
+    }
+
+    public EvaluationResult(Decision decisionIn, Status statusIn) {
+        super(decisionIn, statusIn);
+    }
+
+    public EvaluationResult(Status statusIn) {
+        super(statusIn);
+    }
+
+    public EvaluationResult(Decision decisionIn) {
+        super(decisionIn);
+    }
+
+    public EvaluationResult(Decision decisionIn,
+                            Collection<Obligation> obligationsIn,
+                            Collection<Advice> adviceIn,
+                            Collection<AttributeCategory> attributesIn,
+                            Collection<IdReference> policyIdentifiersIn,
+                            Collection<IdReference> policySetIdentifiersIn) {
+        super(decisionIn, obligationsIn, adviceIn, attributesIn, policyIdentifiersIn, policySetIdentifiersIn);
+    }
+
+    /**
+     * Creates an <code>EvaluationResult</code> generally from a {@link com.att.research.xacmlatt.pdp.policy.Rule} <code>evaluation</code>
+     * call.
+     *
+     * @param decisionIn the <code>Decision</code>
+     * @param obligationsIn the <code>Collection</code> of <code>Obligation</code>s
+     * @param adviceIn the <code>Collection</code> of <code>Advice</code> objects
+     */
+    public EvaluationResult(Decision decisionIn, Collection<Obligation> obligationsIn, Collection<Advice> adviceIn) {
+        super(decisionIn, obligationsIn, adviceIn, null, null, null);
+    }
+
+    public void merge(EvaluationResult evaluationResult) {
+        if (this.getStatus() == null) {
+            this.setStatus(evaluationResult.getStatus());
+        } else {
+            this.getStatus().merge(evaluationResult.getStatus());
         }
-        
-        public EvaluationResult(Decision decisionIn, Status statusIn) {
-                super(decisionIn, statusIn);
-        }
-        
-        public EvaluationResult(Status statusIn) {
-                super(statusIn);
-        }
-        
-        public EvaluationResult(Decision decisionIn) {
-                super(decisionIn);
-        }
-        
-        public EvaluationResult(Decision decisionIn, 
-                        Collection<Obligation> obligationsIn, 
-                        Collection<Advice> adviceIn, 
-                        Collection<AttributeCategory> attributesIn, 
-                        Collection<IdReference> policyIdentifiersIn, 
-                        Collection<IdReference> policySetIdentifiersIn) {
-                super(decisionIn, obligationsIn, adviceIn, attributesIn, policyIdentifiersIn, policySetIdentifiersIn);
-        }
-        
-        /**
-         * Creates an <code>EvaluationResult</code> generally from a {@link com.att.research.xacmlatt.pdp.policy.Rule} <code>evaluation</code>
-         * call.
-         * 
-         * @param decisionIn the <code>Decision</code>
-         * @param obligationsIn the <code>Collection</code> of <code>Obligation</code>s
-         * @param adviceIn the <code>Collection</code> of <code>Advice</code> objects
-         */
-        public EvaluationResult(Decision decisionIn, Collection<Obligation> obligationsIn, Collection<Advice> adviceIn) {
-                super(decisionIn, obligationsIn, adviceIn, null, null, null);
-        }
-        
-        public void merge(EvaluationResult evaluationResult) {
-                if (this.getStatus() == null) {
-                        this.setStatus(evaluationResult.getStatus());
-                } else {
-                        this.getStatus().merge(evaluationResult.getStatus());
-                }
-                this.addObligations(evaluationResult.getObligations());
-                this.addAdvice(evaluationResult.getAssociatedAdvice());
-                this.addAttributeCategories(evaluationResult.getAttributes());
-                this.addPolicyIdentifiers(evaluationResult.getPolicyIdentifiers());
-                this.addPolicySetIdentifiers(evaluationResult.getPolicySetIdentifiers());
-        }
+        this.addObligations(evaluationResult.getObligations());
+        this.addAdvice(evaluationResult.getAssociatedAdvice());
+        this.addAttributeCategories(evaluationResult.getAttributes());
+        this.addPolicyIdentifiers(evaluationResult.getPolicyIdentifiers());
+        this.addPolicySetIdentifiers(evaluationResult.getPolicySetIdentifiers());
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/MatchResult.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/MatchResult.java
index 4487cc5..da7212e 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/MatchResult.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/MatchResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,56 +36,56 @@
 
 /**
  * MatchResult is the value returned by the {@link Matchable} interface.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class MatchResult {
-        public static enum MatchCode {
-                INDETERMINATE,
-                MATCH,
-                NOMATCH
+    public static enum MatchCode {
+        INDETERMINATE,
+        MATCH,
+        NOMATCH
+    }
+
+    public static MatchResult	MM_MATCH	= new MatchResult(MatchCode.MATCH);
+    public static MatchResult	MM_NOMATCH	= new MatchResult(MatchCode.NOMATCH);
+
+    private MatchCode	matchCode;
+    private Status		status;
+
+    public MatchResult(MatchCode matchCodeIn, Status statusIn) {
+        this.matchCode	= matchCodeIn;
+        this.status		= statusIn;
+    }
+
+    public MatchResult(MatchCode matchCodeIn) {
+        this(matchCodeIn, StdStatus.STATUS_OK);
+    }
+
+    public MatchResult(Status statusIn) {
+        this(MatchCode.INDETERMINATE, statusIn);
+    }
+
+    public MatchCode getMatchCode() {
+        return this.matchCode;
+    }
+
+    public Status getStatus() {
+        return this.status;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        stringBuilder.append("matchCode=");
+        stringBuilder.append(this.getMatchCode());
+        Status thisStatus	= this.getStatus();
+        if (thisStatus != null) {
+            stringBuilder.append(", status=");
+            stringBuilder.append(thisStatus.toString());
         }
-        
-        public static MatchResult	MM_MATCH	= new MatchResult(MatchCode.MATCH);
-        public static MatchResult	MM_NOMATCH	= new MatchResult(MatchCode.NOMATCH);
-        
-        private MatchCode	matchCode;
-        private Status		status;
-        
-        public MatchResult(MatchCode matchCodeIn, Status statusIn) {
-                this.matchCode	= matchCodeIn;
-                this.status		= statusIn;
-        }
-        
-        public MatchResult(MatchCode matchCodeIn) {
-                this(matchCodeIn, StdStatus.STATUS_OK);
-        }
-        
-        public MatchResult(Status statusIn) {
-                this(MatchCode.INDETERMINATE, statusIn);
-        }
-        
-        public MatchCode getMatchCode() {
-                return this.matchCode;
-        }
-        
-        public Status getStatus() {
-                return this.status;
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("matchCode=");
-                stringBuilder.append(this.getMatchCode());
-                Status thisStatus	= this.getStatus();
-                if (thisStatus != null) {
-                        stringBuilder.append(", status=");
-                        stringBuilder.append(thisStatus.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/Matchable.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/Matchable.java
index 6dc9bc4..9920e60 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/Matchable.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/Matchable.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,18 +33,18 @@
 
 /**
  * Matchable is the interface objects implement to indicate they are part of a XACML Target matching tree.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface Matchable {
-        /**
-         * Matches this <code>Matchable</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} and
-         * returns a {@link com.att.research.xacmlatt.pdp.eval.MatchResult}.
-         * 
-         * @param evaluationContext the <code>EvaluationContext</code> to use in matching
-         * @return a <code>MatchResult</code> indicating whether this <code>Matchable</code> matches against the given <code>EvaluationContext</code>.
-         * @throws EvaluationException if there is an error testing the match.
-         */
-        public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException;
+    /**
+     * Matches this <code>Matchable</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} and
+     * returns a {@link com.att.research.xacmlatt.pdp.eval.MatchResult}.
+     *
+     * @param evaluationContext the <code>EvaluationContext</code> to use in matching
+     * @return a <code>MatchResult</code> indicating whether this <code>Matchable</code> matches against the given <code>EvaluationContext</code>.
+     * @throws EvaluationException if there is an error testing the match.
+     */
+    public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException;
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/package-info.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/package-info.java
index 4ce7aa0..1fa2006 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/package-info.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/eval/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 
 /**
  * com.att.research.xacmlatt.pdp.eval contains interfaces and classes used in evaluating and matching XACML policy components.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/package-info.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/package-info.java
index 0b510a2..141ce7c 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/package-info.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacmlatt.pdp contains a reference implementation of the {@link com.att.research.xacml.pdp.PDPEngine} interface
  * developed at AT&T Laboratories.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AdviceExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AdviceExpression.java
index 807cadb..84848ec 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AdviceExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AdviceExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,174 +48,174 @@
 
 /**
  * AdviceExpression extends {@link PolicyComponent} to implement the XACML AdviceExpression element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class AdviceExpression extends PolicyComponent {
-        private List<AttributeAssignmentExpression>	listAttributeAssignmentExpressions	= new ArrayList<AttributeAssignmentExpression>();
-        private Identifier adviceId;
-        private RuleEffect appliesTo;
-        
-        protected List<AttributeAssignmentExpression> getAttributeAssignmentExpressionList() {
-                return this.listAttributeAssignmentExpressions;
+    private List<AttributeAssignmentExpression>	listAttributeAssignmentExpressions	= new ArrayList<AttributeAssignmentExpression>();
+    private Identifier adviceId;
+    private RuleEffect appliesTo;
+
+    protected List<AttributeAssignmentExpression> getAttributeAssignmentExpressionList() {
+        return this.listAttributeAssignmentExpressions;
+    }
+
+    protected void clearAttributeAssignmentExpressionList() {
+        this.getAttributeAssignmentExpressionList().clear();
+    }
+
+    public AdviceExpression(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public AdviceExpression(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public AdviceExpression() {
+    }
+
+    public AdviceExpression(Identifier adviceIdIn, RuleEffect ruleEffectIn, Collection<AttributeAssignmentExpression> attributeAssignmentExpressions) {
+        this.adviceId	= adviceIdIn;
+        this.appliesTo	= ruleEffectIn;
+        if (attributeAssignmentExpressions != null) {
+            this.listAttributeAssignmentExpressions.addAll(attributeAssignmentExpressions);
         }
-        
-        protected void clearAttributeAssignmentExpressionList() {
-                this.getAttributeAssignmentExpressionList().clear();
+    }
+
+    public Identifier getAdviceId() {
+        return this.adviceId;
+    }
+
+    public void setAdviceId(Identifier identifier) {
+        this.adviceId	= identifier;
+    }
+
+    public RuleEffect getAppliesTo() {
+        return this.appliesTo;
+    }
+
+    public void setAppliesTo(RuleEffect ruleEffect) {
+        this.appliesTo	= ruleEffect;
+    }
+
+    public Iterator<AttributeAssignmentExpression> getAttributeAssignmentExpressions() {
+        return this.getAttributeAssignmentExpressionList().iterator();
+    }
+
+    public void setAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressions) {
+        this.clearAttributeAssignmentExpressionList();
+        if (attributeAssignmentExpressions != null) {
+
         }
-        
-        public AdviceExpression(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
+    }
+
+    public void addAttributeAssignmentExpression(AttributeAssignmentExpression attributeAssignmentExpression) {
+        this.getAttributeAssignmentExpressionList().add(attributeAssignmentExpression);
+    }
+
+    public void addAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressions) {
+        this.getAttributeAssignmentExpressionList().addAll(attributeAssignmentExpressions);
+    }
+
+    /**
+     * Evaluates the <code>AttributeAssignmentExpression</code>s in this <code>AdviceExpression</code> to generate an
+     * {@link com.att.research.xacml.api.Advice} object.
+     *
+     * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} in which to evaluate the <code>AttributeAssignmentExpression</code>s
+     * @param policyDefaults the {@link PolicyDefaults} for the evaluation
+     * @return a new <code>Advice</code> evaluated from this <code>AdviceExpression</code>
+     * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error in the evaluation
+     */
+    public Advice evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return null;
         }
 
-        public AdviceExpression(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+        List<AttributeAssignment> attributeAssignments	= new ArrayList<AttributeAssignment>();
+        Iterator<AttributeAssignmentExpression> iterAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressions();
+        if (iterAttributeAssignmentExpressions != null) {
+            while (iterAttributeAssignmentExpressions.hasNext()) {
+                AttributeAssignmentResult attributeAssignmentResult	= iterAttributeAssignmentExpressions.next().evaluate(evaluationContext, policyDefaults);
+                if (attributeAssignmentResult.isOk() && attributeAssignmentResult.getNumAttributeAssignments() > 0) {
+                    Iterator<AttributeAssignment> iterAttributeAssignments	= attributeAssignmentResult.getAttributeAssignments();
+                    while (iterAttributeAssignments.hasNext()) {
+                        attributeAssignments.add(iterAttributeAssignments.next());
+                    }
+                }
+            }
         }
 
-        public AdviceExpression() {
-        }
-        
-        public AdviceExpression(Identifier adviceIdIn, RuleEffect ruleEffectIn, Collection<AttributeAssignmentExpression> attributeAssignmentExpressions) {
-                this.adviceId	= adviceIdIn;
-                this.appliesTo	= ruleEffectIn;
-                if (attributeAssignmentExpressions != null) {
-                        this.listAttributeAssignmentExpressions.addAll(attributeAssignmentExpressions);
+        return new StdMutableAdvice(this.getAdviceId(), attributeAssignments);
+    }
+
+    /**
+     * Evaluates a <code>Collection</code> of <code>AdviceExpression</code>s in the given <code>EvaluationContext</code> and returns
+     * a <code>List</code> of <code>Advice</code>s.
+     *
+     * @param evaluationContext
+     * @param policyDefaults
+     * @param listAdviceExpressions
+     * @return
+     * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException
+     */
+    public static List<Advice> evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults, Decision decision, Collection<AdviceExpression> listAdviceExpressions) throws EvaluationException {
+        List<Advice> listAdvices	= new ArrayList<Advice>();
+        Iterator<AdviceExpression> iterAdviceExpressions	= listAdviceExpressions.iterator();
+        while (iterAdviceExpressions.hasNext()) {
+            AdviceExpression adviceExpression	= iterAdviceExpressions.next();
+            adviceExpression.validateComponent();
+            if ( ! adviceExpression.isOk()) {
+                throw new EvaluationException(adviceExpression.getStatusMessage());
+            }
+            if (decision == null || adviceExpression.getAppliesTo().getDecision().equals(decision)) {
+                Advice advice	= adviceExpression.evaluate(evaluationContext, policyDefaults);
+                if (advice != null) {
+                    listAdvices.add(advice);
                 }
+            }
         }
-        
-        public Identifier getAdviceId() {
-                return this.adviceId;
+        return listAdvices;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getAdviceId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AdviceId");
+            return false;
+        } else if (this.getAppliesTo() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AppliesTo");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
-        
-        public void setAdviceId(Identifier identifier) {
-                this.adviceId	= identifier;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getAdviceId()) != null) {
+            stringBuilder.append(",adviceId=");
+            stringBuilder.append(objectToDump.toString());
         }
-        
-        public RuleEffect getAppliesTo() {
-                return this.appliesTo;
+        if ((objectToDump = this.getAppliesTo()) != null) {
+            stringBuilder.append(",appliesTo=");
+            stringBuilder.append(objectToDump.toString());
         }
-        
-        public void setAppliesTo(RuleEffect ruleEffect) {
-                this.appliesTo	= ruleEffect;
-        }
-        
-        public Iterator<AttributeAssignmentExpression> getAttributeAssignmentExpressions() {
-                return this.getAttributeAssignmentExpressionList().iterator();
-        }
-        
-        public void setAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressions) {
-                this.clearAttributeAssignmentExpressionList();
-                if (attributeAssignmentExpressions != null) {
-                        
-                }
-        }
-        
-        public void addAttributeAssignmentExpression(AttributeAssignmentExpression attributeAssignmentExpression) {
-                this.getAttributeAssignmentExpressionList().add(attributeAssignmentExpression);
-        }
-        
-        public void addAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressions) {
-                this.getAttributeAssignmentExpressionList().addAll(attributeAssignmentExpressions);
-        }
-        
-        /**
-         * Evaluates the <code>AttributeAssignmentExpression</code>s in this <code>AdviceExpression</code> to generate an
-         * {@link com.att.research.xacml.api.Advice} object.
-         * 
-         * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} in which to evaluate the <code>AttributeAssignmentExpression</code>s
-         * @param policyDefaults the {@link PolicyDefaults} for the evaluation
-         * @return a new <code>Advice</code> evaluated from this <code>AdviceExpression</code>
-         * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error in the evaluation
-         */
-        public Advice evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return null;
-                }
-                
-                List<AttributeAssignment> attributeAssignments	= new ArrayList<AttributeAssignment>();
-                Iterator<AttributeAssignmentExpression> iterAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressions();
-                if (iterAttributeAssignmentExpressions != null) {
-                        while (iterAttributeAssignmentExpressions.hasNext()) {
-                                AttributeAssignmentResult attributeAssignmentResult	= iterAttributeAssignmentExpressions.next().evaluate(evaluationContext, policyDefaults);
-                                if (attributeAssignmentResult.isOk() && attributeAssignmentResult.getNumAttributeAssignments() > 0) {
-                                        Iterator<AttributeAssignment> iterAttributeAssignments	= attributeAssignmentResult.getAttributeAssignments();
-                                        while (iterAttributeAssignments.hasNext()) {
-                                                attributeAssignments.add(iterAttributeAssignments.next());
-                                        }
-                                }
-                        }
-                }
-                
-                return new StdMutableAdvice(this.getAdviceId(), attributeAssignments);
-        }
-        
-        /**
-         * Evaluates a <code>Collection</code> of <code>AdviceExpression</code>s in the given <code>EvaluationContext</code> and returns
-         * a <code>List</code> of <code>Advice</code>s.
-         * 
-         * @param evaluationContext
-         * @param policyDefaults
-         * @param listAdviceExpressions
-         * @return
-         * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException
-         */
-        public static List<Advice> evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults, Decision decision, Collection<AdviceExpression> listAdviceExpressions) throws EvaluationException {
-                List<Advice> listAdvices	= new ArrayList<Advice>();
-                Iterator<AdviceExpression> iterAdviceExpressions	= listAdviceExpressions.iterator();
-                while (iterAdviceExpressions.hasNext()) {
-                        AdviceExpression adviceExpression	= iterAdviceExpressions.next();
-                        adviceExpression.validateComponent();
-                        if ( ! adviceExpression.isOk()) {
-                                throw new EvaluationException(adviceExpression.getStatusMessage());
-                        }
-                        if (decision == null || adviceExpression.getAppliesTo().getDecision().equals(decision)) {
-                                Advice advice	= adviceExpression.evaluate(evaluationContext, policyDefaults);
-                                if (advice != null) {
-                                        listAdvices.add(advice);
-                                }
-                        }
-                }
-                return listAdvices;
+        if ((objectToDump = StringUtils.toString(this.getAttributeAssignmentExpressions())) != null) {
+            stringBuilder.append(",attributeAssignmentExpressions=");
+            stringBuilder.append((String)objectToDump);
         }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getAdviceId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AdviceId");
-                        return false;
-                } else if (this.getAppliesTo() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AppliesTo");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getAdviceId()) != null) {
-                        stringBuilder.append(",adviceId=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getAppliesTo()) != null) {
-                        stringBuilder.append(",appliesTo=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = StringUtils.toString(this.getAttributeAssignmentExpressions())) != null) {
-                        stringBuilder.append(",attributeAssignmentExpressions=");
-                        stringBuilder.append((String)objectToDump);
-                }
-                
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AllOf.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AllOf.java
index 24d9a2b..f9b1076 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AllOf.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AllOf.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,110 +47,110 @@
 /**
  * AnyOf extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} and implements the {@link com.att.research.xacmlatt.pdp.policy.Matchable}
  * interface to represent XACML AllOf elements in a XACML Target.
- * 
+ *
  * @author car
  * @version $Revision
  */
 public class AllOf extends PolicyComponent implements Matchable {
-        private List<Match>	matches;
-        
-        protected List<Match> getMatchList(boolean bNoNulls) {
-                if (this.matches == null && bNoNulls) {
-                        this.matches	= new ArrayList<Match>();
-                }
-                return this.matches;
-        }
-        
-        protected void clearMatchList() {
-                if (this.matches != null) {
-                        this.matches.clear();
-                }
-        }
-        
-        public AllOf(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private List<Match>	matches;
 
-        public AllOf(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+    protected List<Match> getMatchList(boolean bNoNulls) {
+        if (this.matches == null && bNoNulls) {
+            this.matches	= new ArrayList<Match>();
         }
+        return this.matches;
+    }
 
-        public AllOf() {
+    protected void clearMatchList() {
+        if (this.matches != null) {
+            this.matches.clear();
         }
-        
-        public Iterator<Match> getMatches() {
-                return (this.matches == null ? null : this.matches.iterator());
-        }
-        
-        public void setMatches(Collection<Match> matchesIn) {
-                this.clearMatchList();
-                if (matchesIn != null) {
-                        this.addMatches(matchesIn);
-                }
-        }
-        
-        public void addMatch(Match match) {
-                List<Match> matchList	= this.getMatchList(true);
-                matchList.add(match);
-        }
-        
-        public void addMatches(Collection<Match> matchesIn) {
-                List<Match> matchList	= this.getMatchList(true);
-                matchList.addAll(matchesIn);
-        }
+    }
 
-        @Override
-        public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
-                if (!this.validate()) {
-                        return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                Iterator<Match> iterMatches	= this.getMatches();
-                assert(iterMatches != null && iterMatches.hasNext());
-                
-                MatchResult matchResultFallThrough	= MatchResult.MM_MATCH;
-                while (iterMatches.hasNext()) {
-                        MatchResult matchResultMatch	= iterMatches.next().match(evaluationContext);
-                        assert(matchResultMatch != null);
-                        switch(matchResultMatch.getMatchCode()) {
-                        case INDETERMINATE:
-                                if (matchResultFallThrough.getMatchCode() != MatchResult.MatchCode.INDETERMINATE) {
-                                        matchResultFallThrough	= matchResultMatch;
-                                }
-                                break;
-                        case MATCH:
-                                break;
-                        case NOMATCH:
-                                return matchResultMatch;
-                        }
-                }
-                return matchResultFallThrough;
-        }
+    public AllOf(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                Iterator<Match>	iterMatches	= this.getMatches();
-                if (iterMatches == null || !iterMatches.hasNext()) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing matches");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
+    public AllOf(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-                String stringMatches	= StringUtils.toString(this.getMatches());
-                if (stringMatches != null) {
-                        stringBuilder.append(",matches=");
-                        stringBuilder.append(stringMatches);
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    public AllOf() {
+    }
+
+    public Iterator<Match> getMatches() {
+        return (this.matches == null ? null : this.matches.iterator());
+    }
+
+    public void setMatches(Collection<Match> matchesIn) {
+        this.clearMatchList();
+        if (matchesIn != null) {
+            this.addMatches(matchesIn);
         }
+    }
+
+    public void addMatch(Match match) {
+        List<Match> matchList	= this.getMatchList(true);
+        matchList.add(match);
+    }
+
+    public void addMatches(Collection<Match> matchesIn) {
+        List<Match> matchList	= this.getMatchList(true);
+        matchList.addAll(matchesIn);
+    }
+
+    @Override
+    public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
+        if (!this.validate()) {
+            return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        }
+        Iterator<Match> iterMatches	= this.getMatches();
+        assert(iterMatches != null && iterMatches.hasNext());
+
+        MatchResult matchResultFallThrough	= MatchResult.MM_MATCH;
+        while (iterMatches.hasNext()) {
+            MatchResult matchResultMatch	= iterMatches.next().match(evaluationContext);
+            assert(matchResultMatch != null);
+            switch(matchResultMatch.getMatchCode()) {
+            case INDETERMINATE:
+                if (matchResultFallThrough.getMatchCode() != MatchResult.MatchCode.INDETERMINATE) {
+                    matchResultFallThrough	= matchResultMatch;
+                }
+                break;
+            case MATCH:
+                break;
+            case NOMATCH:
+                return matchResultMatch;
+            }
+        }
+        return matchResultFallThrough;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        Iterator<Match>	iterMatches	= this.getMatches();
+        if (iterMatches == null || !iterMatches.hasNext()) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing matches");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        String stringMatches	= StringUtils.toString(this.getMatches());
+        if (stringMatches != null) {
+            stringBuilder.append(",matches=");
+            stringBuilder.append(stringMatches);
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AnyOf.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AnyOf.java
index 37281a0..8807100 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AnyOf.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AnyOf.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,124 +47,124 @@
 /**
  * AnyOf extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} and implements the {@link com.att.research.xacmlatt.pdp.policy.Matchable}
  * interface to represent XACML AnyOf elements in a XACML Target.
- * 
+ *
  * @author car
  * @version $Revision
  */
 public class AnyOf extends PolicyComponent implements Matchable {
-        private List<AllOf>	allOfs;
-        
-        protected List<AllOf> getAllOfList(boolean bNoNull) {
-                if (this.allOfs == null && bNoNull) {
-                        this.allOfs	= new ArrayList<AllOf>();
-                }
-                return this.allOfs;
+    private List<AllOf>	allOfs;
+
+    protected List<AllOf> getAllOfList(boolean bNoNull) {
+        if (this.allOfs == null && bNoNull) {
+            this.allOfs	= new ArrayList<AllOf>();
         }
-        
-        protected void clearAllOfList() {
-                if (this.allOfs != null) {
-                        this.allOfs.clear();
-                }
+        return this.allOfs;
+    }
+
+    protected void clearAllOfList() {
+        if (this.allOfs != null) {
+            this.allOfs.clear();
         }
-        
-        public AnyOf(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
+    }
+
+    public AnyOf(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public AnyOf(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public AnyOf() {
+    }
+
+    public AnyOf(Collection<AllOf> allOfsIn) {
+        if (allOfsIn != null) {
+            this.addAllOfs(allOfsIn);
+        }
+    }
+
+    public Iterator<AllOf> getAllOfs() {
+        return (this.allOfs == null ? null : this.allOfs.iterator());
+    }
+
+    public void setAllOfs(Collection<AllOf> allOfsIn) {
+        this.clearAllOfList();
+        if (allOfsIn != null) {
+            this.addAllOfs(allOfsIn);
+        }
+    }
+
+    public void addAllOf(AllOf allOf) {
+        List<AllOf> listAllOfs	= this.getAllOfList(true);
+        listAllOfs.add(allOf);
+    }
+
+    public void addAllOfs(Collection<AllOf> allOfs) {
+        List<AllOf> listAllOfs	= this.getAllOfList(true);
+        listAllOfs.addAll(allOfs);
+    }
+
+    @Override
+    public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
+        if (!this.validate()) {
+            return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        }
+        Iterator<AllOf> iterAllOfs	= this.getAllOfs();
+        if (iterAllOfs == null || !iterAllOfs.hasNext()) {
+            return MatchResult.MM_NOMATCH;
         }
 
-        public AnyOf(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-
-        public AnyOf() {
-        }
-        
-        public AnyOf(Collection<AllOf> allOfsIn) {
-                if (allOfsIn != null) {
-                        this.addAllOfs(allOfsIn);
-                }
-        }
-        
-        public Iterator<AllOf> getAllOfs() {
-                return (this.allOfs == null ? null : this.allOfs.iterator());
-        }
-        
-        public void setAllOfs(Collection<AllOf> allOfsIn) {
-                this.clearAllOfList();
-                if (allOfsIn != null) {
-                        this.addAllOfs(allOfsIn);
-                }
-        }
-        
-        public void addAllOf(AllOf allOf) {
-                List<AllOf> listAllOfs	= this.getAllOfList(true);
-                listAllOfs.add(allOf);
-        }
-        
-        public void addAllOfs(Collection<AllOf> allOfs) {
-                List<AllOf> listAllOfs	= this.getAllOfList(true);
-                listAllOfs.addAll(allOfs);
-        }
-
-        @Override
-        public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
-                if (!this.validate()) {
-                        return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                Iterator<AllOf> iterAllOfs	= this.getAllOfs();
-                if (iterAllOfs == null || !iterAllOfs.hasNext()) {
-                        return MatchResult.MM_NOMATCH;
-                }
-                
+        /*
+         * Assume "No Match" until we find a match or an indeterminate result
+         */
+        MatchResult matchResultFallThrough	= MatchResult.MM_NOMATCH;
+        while (iterAllOfs.hasNext()) {
+            MatchResult matchResultAllOf	= iterAllOfs.next().match(evaluationContext);
+            assert(matchResultAllOf != null);
+            switch(matchResultAllOf.getMatchCode()) {
+            case INDETERMINATE:
                 /*
-                 * Assume "No Match" until we find a match or an indeterminate result
+                 * Keep the first indeterminate value to return if no other match is found
                  */
-                MatchResult matchResultFallThrough	= MatchResult.MM_NOMATCH;
-                while (iterAllOfs.hasNext()) {
-                        MatchResult matchResultAllOf	= iterAllOfs.next().match(evaluationContext);
-                        assert(matchResultAllOf != null);
-                        switch(matchResultAllOf.getMatchCode()) {
-                        case INDETERMINATE:
-                                /*
-                                 * Keep the first indeterminate value to return if no other match is found
-                                 */
-                                if (matchResultFallThrough.getMatchCode() != MatchResult.MatchCode.INDETERMINATE) {
-                                        matchResultFallThrough	= matchResultAllOf;
-                                }
-                                break;
-                        case MATCH:
-                                return matchResultAllOf;
-                        case NOMATCH:
-                                break;
-                        }
+                if (matchResultFallThrough.getMatchCode() != MatchResult.MatchCode.INDETERMINATE) {
+                    matchResultFallThrough	= matchResultAllOf;
                 }
-                return matchResultFallThrough;
+                break;
+            case MATCH:
+                return matchResultAllOf;
+            case NOMATCH:
+                break;
+            }
         }
+        return matchResultFallThrough;
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                Iterator<AllOf>	iterAllOfs	= this.getAllOfs();
-                if (iterAllOfs == null || !iterAllOfs.hasNext()) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AllOf elements in AnyOf");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
+    @Override
+    protected boolean validateComponent() {
+        Iterator<AllOf>	iterAllOfs	= this.getAllOfs();
+        if (iterAllOfs == null || !iterAllOfs.hasNext()) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AllOf elements in AnyOf");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                String iterToDump	= StringUtils.toString(this.getAllOfs());
-                if (iterToDump != null) {
-                        stringBuilder.append(",allOfs=");
-                        stringBuilder.append(iterToDump);
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        String iterToDump	= StringUtils.toString(this.getAllOfs());
+        if (iterToDump != null) {
+            stringBuilder.append(",allOfs=");
+            stringBuilder.append(iterToDump);
         }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AttributeAssignmentExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AttributeAssignmentExpression.java
index 18e7aad..4c6664f 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AttributeAssignmentExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AttributeAssignmentExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,140 +47,140 @@
 /**
  * AttributeAssignmentExpression extends {@link PolicyComponent} to represent a
  * XACML AttributeAssignmentExpression element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class AttributeAssignmentExpression extends PolicyComponent {
-        private static final AttributeAssignmentResult AAR_NULL_EXPRESSION			= new AttributeAssignmentResult(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Null expression"));
-        private static final AttributeAssignmentResult AAR_NULL_EXPRESSION_RESULT	= new AttributeAssignmentResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null expression result"));
-        
-        private Expression expression;
-        private Identifier attributeId;
-        private Identifier category;
-        private String issuer;
-        
-        public AttributeAssignmentExpression(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
+    private static final AttributeAssignmentResult AAR_NULL_EXPRESSION			= new AttributeAssignmentResult(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Null expression"));
+    private static final AttributeAssignmentResult AAR_NULL_EXPRESSION_RESULT	= new AttributeAssignmentResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null expression result"));
+
+    private Expression expression;
+    private Identifier attributeId;
+    private Identifier category;
+    private String issuer;
+
+    public AttributeAssignmentExpression(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public AttributeAssignmentExpression(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public AttributeAssignmentExpression() {
+    }
+
+    public AttributeAssignmentExpression(Identifier categoryIn, Identifier attributeIdIn, String issuerIn, Expression expressionIn) {
+        this.category		= categoryIn;
+        this.attributeId	= attributeIdIn;
+        this.issuer			= issuerIn;
+        this.expression		= expressionIn;
+    }
+
+    public Identifier getCategory() {
+        return this.category;
+    }
+
+    public void setCategory(Identifier identifier) {
+        this.category	= identifier;
+    }
+
+    public Identifier getAttributeId() {
+        return this.attributeId;
+    }
+
+    public void setAttributeId(Identifier identifier) {
+        this.attributeId	= identifier;
+    }
+
+    public String getIssuer() {
+        return this.issuer;
+    }
+
+    public void setIssuer(String string) {
+        this.issuer	= string;
+    }
+
+    public Expression getExpression() {
+        return this.expression;
+    }
+
+    public void setExpression(Expression expressionIn) {
+        this.expression	= expressionIn;
+    }
+
+    public AttributeAssignmentResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return new AttributeAssignmentResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
 
-        public AttributeAssignmentExpression(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+        Expression thisExpression	= this.getExpression();
+        if (thisExpression == null) {
+            return AAR_NULL_EXPRESSION;
         }
 
-        public AttributeAssignmentExpression() {
-        }
-        
-        public AttributeAssignmentExpression(Identifier categoryIn, Identifier attributeIdIn, String issuerIn, Expression expressionIn) {
-                this.category		= categoryIn;
-                this.attributeId	= attributeIdIn;
-                this.issuer			= issuerIn;
-                this.expression		= expressionIn;
-        }
-        
-        public Identifier getCategory() {
-                return this.category;
-        }
-        
-        public void setCategory(Identifier identifier) {
-                this.category	= identifier;
-        }
-        
-        public Identifier getAttributeId() {
-                return this.attributeId;
-        }
-        
-        public void setAttributeId(Identifier identifier) {
-                this.attributeId	= identifier;
-        }
-        
-        public String getIssuer() {
-                return this.issuer;
-        }
-        
-        public void setIssuer(String string) {
-                this.issuer	= string;
-        }
-        
-        public Expression getExpression() {
-                return this.expression;
-        }
-        
-        public void setExpression(Expression expressionIn) {
-                this.expression	= expressionIn;
-        }
-        
-        public AttributeAssignmentResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return new AttributeAssignmentResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                Expression thisExpression	= this.getExpression();
-                if (thisExpression == null) {
-                        return AAR_NULL_EXPRESSION;
-                }
-                
-                ExpressionResult thisExpressionResult	= thisExpression.evaluate(evaluationContext, policyDefaults);
-                if (thisExpressionResult == null) {
-                        return AAR_NULL_EXPRESSION_RESULT;
-                } else if (!thisExpressionResult.isOk()) {
-                        return new AttributeAssignmentResult(thisExpressionResult.getStatus());
+        ExpressionResult thisExpressionResult	= thisExpression.evaluate(evaluationContext, policyDefaults);
+        if (thisExpressionResult == null) {
+            return AAR_NULL_EXPRESSION_RESULT;
+        } else if (!thisExpressionResult.isOk()) {
+            return new AttributeAssignmentResult(thisExpressionResult.getStatus());
+        } else {
+            List<AttributeAssignment> listAttributeAssignments	= new ArrayList<AttributeAssignment>();
+            if (thisExpressionResult.isBag()) {
+                Bag bagValues	= thisExpressionResult.getBag();
+                if (bagValues == null || bagValues.size() == 0) {
+                    listAttributeAssignments.add(new StdMutableAttributeAssignment(this.getCategory(), this.getAttributeId(), this.getIssuer(), null));
                 } else {
-                        List<AttributeAssignment> listAttributeAssignments	= new ArrayList<AttributeAssignment>();
-                        if (thisExpressionResult.isBag()) {
-                                Bag bagValues	= thisExpressionResult.getBag();
-                                if (bagValues == null || bagValues.size() == 0) {
-                                        listAttributeAssignments.add(new StdMutableAttributeAssignment(this.getCategory(), this.getAttributeId(), this.getIssuer(), null));
-                                } else {
-                                        Iterator<AttributeValue<?>> iterBagValues	= bagValues.getAttributeValues();
-                                        while (iterBagValues.hasNext()) {
-                                                AttributeValue<?> attributeValue	= iterBagValues.next();
-                                                listAttributeAssignments.add(new StdMutableAttributeAssignment(this.getCategory(), this.getAttributeId(), this.getIssuer(), attributeValue));
-                                        }
-                                }
-                        } else {
-                                listAttributeAssignments.add(new StdMutableAttributeAssignment(this.getCategory(), this.getAttributeId(), this.getIssuer(), thisExpressionResult.getValue()));
-                        }
-                        return new AttributeAssignmentResult(listAttributeAssignments);
+                    Iterator<AttributeValue<?>> iterBagValues	= bagValues.getAttributeValues();
+                    while (iterBagValues.hasNext()) {
+                        AttributeValue<?> attributeValue	= iterBagValues.next();
+                        listAttributeAssignments.add(new StdMutableAttributeAssignment(this.getCategory(), this.getAttributeId(), this.getIssuer(), attributeValue));
+                    }
                 }
+            } else {
+                listAttributeAssignments.add(new StdMutableAttributeAssignment(this.getCategory(), this.getAttributeId(), this.getIssuer(), thisExpressionResult.getValue()));
+            }
+            return new AttributeAssignmentResult(listAttributeAssignments);
         }
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getAttributeId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeId");
-                        return false;
-                } else if (this.getExpression() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Expression");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
+    @Override
+    protected boolean validateComponent() {
+        if (this.getAttributeId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeId");
+            return false;
+        } else if (this.getExpression() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Expression");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getCategory()) != null) {
-                        stringBuilder.append(",category=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getAttributeId()) != null) {
-                        stringBuilder.append(",attributeId=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getExpression()) != null) {
-                        stringBuilder.append(",expression=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getCategory()) != null) {
+            stringBuilder.append(",category=");
+            stringBuilder.append(objectToDump.toString());
         }
+        if ((objectToDump = this.getAttributeId()) != null) {
+            stringBuilder.append(",attributeId=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getExpression()) != null) {
+            stringBuilder.append(",expression=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AttributeAssignmentResult.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AttributeAssignmentResult.java
index a5ead37..198bb7d 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AttributeAssignmentResult.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/AttributeAssignmentResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,72 +44,72 @@
  * AttributeAssignmentResult is the object returned by the <code>evaluate</code> method of an {@link com.att.research.xacmlatt.pdp.policy.AttributeAssignmentExpression}.
  * It contains a {@link com.att.research.xacml.api.Status} and an optional collection of {@link com.att.research.xacml.api.AttributeAssignment}
  * elements.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class AttributeAssignmentResult {
-        private Status status;
-        private List<AttributeAssignment> listAttributeAssignments;
-        
-        protected List<AttributeAssignment> getListAttributeAssignments() {
-                return this.listAttributeAssignments;
+    private Status status;
+    private List<AttributeAssignment> listAttributeAssignments;
+
+    protected List<AttributeAssignment> getListAttributeAssignments() {
+        return this.listAttributeAssignments;
+    }
+
+    public AttributeAssignmentResult(Status statusIn, Collection<AttributeAssignment> listAttributeAssignmentsIn) {
+        this.status	= statusIn;
+        if (listAttributeAssignmentsIn != null && listAttributeAssignmentsIn.size() > 0) {
+            this.listAttributeAssignments	= new ArrayList<AttributeAssignment>();
+            this.listAttributeAssignments.addAll(listAttributeAssignmentsIn);
         }
-        
-        public AttributeAssignmentResult(Status statusIn, Collection<AttributeAssignment> listAttributeAssignmentsIn) {
-                this.status	= statusIn;
-                if (listAttributeAssignmentsIn != null && listAttributeAssignmentsIn.size() > 0) {
-                        this.listAttributeAssignments	= new ArrayList<AttributeAssignment>();
-                        this.listAttributeAssignments.addAll(listAttributeAssignmentsIn);
-                }
-        }
-        
-        public AttributeAssignmentResult(Status statusIn) {
-                this(statusIn, null);
-        }
-        
-        public AttributeAssignmentResult(Collection<AttributeAssignment> listAttributeAssignmentsIn) {
-                this(StdStatus.STATUS_OK, listAttributeAssignmentsIn);
+    }
+
+    public AttributeAssignmentResult(Status statusIn) {
+        this(statusIn, null);
+    }
+
+    public AttributeAssignmentResult(Collection<AttributeAssignment> listAttributeAssignmentsIn) {
+        this(StdStatus.STATUS_OK, listAttributeAssignmentsIn);
+    }
+
+    public Status getStatus() {
+        return this.status;
+    }
+
+    public boolean isOk() {
+        return (this.getStatus() == null || this.getStatus().isOk());
+    }
+
+    public Iterator<AttributeAssignment> getAttributeAssignments() {
+        List<AttributeAssignment> thisListAttributeAssignments	= this.getListAttributeAssignments();
+        return (thisListAttributeAssignments == null ? null : thisListAttributeAssignments.iterator());
+    }
+
+    public int getNumAttributeAssignments() {
+        List<AttributeAssignment> thisListAttributeAssignments	= this.getListAttributeAssignments();
+        return (thisListAttributeAssignments == null ? 0 : thisListAttributeAssignments.size());
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        boolean needsComma	= false;
+
+        Object objectToDump;
+        if ((objectToDump = this.getStatus()) != null) {
+            stringBuilder.append("status=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
 
-        public Status getStatus() {
-                return this.status;
+        Iterator<?> iterToDump;
+        if ((iterToDump = this.getAttributeAssignments()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append(StringUtils.toString(iterToDump));
         }
-        
-        public boolean isOk() {
-                return (this.getStatus() == null || this.getStatus().isOk());
-        }
-        
-        public Iterator<AttributeAssignment> getAttributeAssignments() {
-                List<AttributeAssignment> thisListAttributeAssignments	= this.getListAttributeAssignments();
-                return (thisListAttributeAssignments == null ? null : thisListAttributeAssignments.iterator());
-        }
-        
-        public int getNumAttributeAssignments() {
-                List<AttributeAssignment> thisListAttributeAssignments	= this.getListAttributeAssignments();
-                return (thisListAttributeAssignments == null ? 0 : thisListAttributeAssignments.size());
-        }
-
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                boolean needsComma	= false;
-                
-                Object objectToDump;
-                if ((objectToDump = this.getStatus()) != null) {
-                        stringBuilder.append("status=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                
-                Iterator<?> iterToDump;
-                if ((iterToDump = this.getAttributeAssignments()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append(StringUtils.toString(iterToDump));
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Bag.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Bag.java
index e2440f7..9b97fb9 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Bag.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Bag.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,76 +38,76 @@
 
 /**
  * Bag represents a collection of XACML attribute values for the same attribute.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class Bag {
-        public static final Bag	EMPTY	= new Bag();
-        
-        private List<AttributeValue<?>> attributeValues	= new ArrayList<AttributeValue<?>>();
+    public static final Bag	EMPTY	= new Bag();
 
-        /**
-         * Gets the <code>List</code> of <code>AttributeValue</code>s for this <code>Bag</code>.
-         * 
-         * @return the <code>List</code> of <code>AttributeValue</code>s for this <code>Bag</code>
-         */
-        public List<AttributeValue<?>> getAttributeValueList() {
-                return this.attributeValues;
-        }
-        
-        /**
-         * Creates a new, empty <code>Bag</code>.
-         */
-        public Bag() {
-        }
-        
-        /**
-         * Creates a new <code>Bag</code> by copying the {@link com.att.research.xacml.api.AttributeValue}s from the
-         * given <code>Collection</code>.
-         * 
-         * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s for this <code>Bag</code>.
-         *
-        public Bag(Collection<AttributeValue<?>> attributeValuesIn) {
-                if (attributeValuesIn != null) {
-                        this.attributeValues.addAll(attributeValuesIn);
-                }
-        }
-        
-        public Bag(Iterator<AttributeValue<?>> iterAttributeValuesIn) {
-                if (iterAttributeValuesIn != null) {
-                        while (iterAttributeValuesIn.hasNext()) {
-                                this.attributeValues.add(iterAttributeValuesIn.next());
-                        }
-                }
-        }
-        */
-        
-        /**
-         * Adds an <code>AttributeValue</code> to this <code>Bag</code>>
-         * 
-         * @param attributeValue the <code>AttributeValue</code> to add
-         */
-        public void add(AttributeValue<?> attributeValue) {
-                this.attributeValues.add(attributeValue);
-        }
-        
-        /**
-         * Gets the number of <code>AttributeValue</code>s in this <code>Bag</code>.
-         * 
-         * @return the number of <code>AttributeValue</code>s in this <code>Bag</code>.
-         */
-        public int size() {
-                return this.getAttributeValueList().size();
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over all of the <code>AttributeValue</code>s in this <code>Bag</code>.
-         * 
-         * @return an <code>Iterator</code> over all of the <code>AttributeValue</code>s in this <code>Bag</code>.
-         */
-        public Iterator<AttributeValue<?>> getAttributeValues() {
-                return this.getAttributeValueList().iterator();
-        }
+    private List<AttributeValue<?>> attributeValues	= new ArrayList<AttributeValue<?>>();
+
+    /**
+     * Gets the <code>List</code> of <code>AttributeValue</code>s for this <code>Bag</code>.
+     *
+     * @return the <code>List</code> of <code>AttributeValue</code>s for this <code>Bag</code>
+     */
+    public List<AttributeValue<?>> getAttributeValueList() {
+        return this.attributeValues;
+    }
+
+    /**
+     * Creates a new, empty <code>Bag</code>.
+     */
+    public Bag() {
+    }
+
+    /**
+     * Creates a new <code>Bag</code> by copying the {@link com.att.research.xacml.api.AttributeValue}s from the
+     * given <code>Collection</code>.
+     *
+     * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s for this <code>Bag</code>.
+     *
+    public Bag(Collection<AttributeValue<?>> attributeValuesIn) {
+            if (attributeValuesIn != null) {
+                    this.attributeValues.addAll(attributeValuesIn);
+            }
+    }
+
+    public Bag(Iterator<AttributeValue<?>> iterAttributeValuesIn) {
+            if (iterAttributeValuesIn != null) {
+                    while (iterAttributeValuesIn.hasNext()) {
+                            this.attributeValues.add(iterAttributeValuesIn.next());
+                    }
+            }
+    }
+    */
+
+    /**
+     * Adds an <code>AttributeValue</code> to this <code>Bag</code>>
+     *
+     * @param attributeValue the <code>AttributeValue</code> to add
+     */
+    public void add(AttributeValue<?> attributeValue) {
+        this.attributeValues.add(attributeValue);
+    }
+
+    /**
+     * Gets the number of <code>AttributeValue</code>s in this <code>Bag</code>.
+     *
+     * @return the number of <code>AttributeValue</code>s in this <code>Bag</code>.
+     */
+    public int size() {
+        return this.getAttributeValueList().size();
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over all of the <code>AttributeValue</code>s in this <code>Bag</code>.
+     *
+     * @return an <code>Iterator</code> over all of the <code>AttributeValue</code>s in this <code>Bag</code>.
+     */
+    public Iterator<AttributeValue<?>> getAttributeValues() {
+        return this.getAttributeValueList().iterator();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombinerParameter.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombinerParameter.java
index bbb5633..db25c6c 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombinerParameter.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombinerParameter.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,134 +36,134 @@
 
 /**
  * CombinerParameter extends {@link PolicyComponent} to represent a XACML CombinerParameter element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class CombinerParameter extends PolicyComponent {
-        private String 				name;
-        private AttributeValue<?>	attributeValue;
-        
-        @Override
-        protected boolean validateComponent() {
-                if (this.getName() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing parameter name");
-                        return false;
-                } else if (this.getAttributeValue() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing attribute value");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
-        }
-        
-        /**
-         * Creates a new <code>CombinerParameter</code> with the given <code>String</code> name, <code>AttributeValue</code>,
-         * {@link com.att.research.xacml.api.StatusCode} and <code>String</code> status message.
-         * 
-         * @param nameIn the <code>String</code> name of the <code>CombinerParameter</code>
-         * @param attributeValueIn the <code>AttributeValue</code> of the <code>CombinerParameter</code>
-         * @param statusCodeIn the <code>StatusCode</code> of the <code>CombinerParameter</code>
-         * @param statusMessageIn the <code>String</code> status message of the <code>CombinerParameter</code>
-         */
-        public CombinerParameter(String nameIn, AttributeValue<?> attributeValueIn, StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-                this.name			= nameIn;
-                this.attributeValue	= attributeValueIn;
-        }
-        
-        /**
-         * Creates a new <code>CombinerParameter</code> for an error condition with the given <code>StatusCode</code> and
-         * <code>String</code> status message.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> of the <code>CombinerParameter</code>
-         * @param statusMessageIn the <code>String</code> status message of the <code>CombinerParameter</code>
-         */
-        public CombinerParameter(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private String 				name;
+    private AttributeValue<?>	attributeValue;
 
-        /**
-         * Creates a new <code>CombinerParameter</code> for an error condition with the given <code>StatusCode</code> and
-         * null status message.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> of the <code>CombinerParameter</code>
-         */
-        public CombinerParameter(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+    @Override
+    protected boolean validateComponent() {
+        if (this.getName() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing parameter name");
+            return false;
+        } else if (this.getAttributeValue() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing attribute value");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
+    }
 
-        /**
-         * Creates a new <code>CombinerParameter</code> with a default <code>StatusCode</code>, null status message, and the given
-         * <code>String</code> name and <code>AttributeValue</code>>
-         * 
-         * @param nameIn the <code>String</code> name of the <code>CombinerParameter</code>
-         * @param attributeValueIn the <code>AttributeValue</code> of the <code>CombinerParameter</code>
-         */
-        public CombinerParameter(String nameIn, AttributeValue<?> attributeValueIn) {
-                super();
-                this.name			= nameIn;
-                this.attributeValue	= attributeValueIn;
-        }
-        
-        public CombinerParameter() {
-                
-        }
-        
-        /**
-         * Gets the <code>String</code> name of this <code>CombinerParameter</code>.
-         * 
-         * @return the <code>String</code> name of this <code>CombinerParameter</code>
-         */
-        public String getName() {
-                return this.name;
-        }
-        
-        /**
-         * Sets the name of this <code>CombinerParameter</code> to the given <code>String</code>.
-         * 
-         * @param nameIn the <code>String</code> name for this <code>CombinerParameter</code>.
-         */
-        public void setName(String nameIn) {
-                this.name	= nameIn;
-        }
-        
-        /**
-         * Gets the <code>AttributeValue</code> of this <code>CombinerParameter</code>.
-         * 
-         * @return the <code>AttributeValue</code> of this <code>CombinerParameter</code>
-         */
-        public AttributeValue<?> getAttributeValue() {
-                return this.attributeValue;
-        }
-        
-        /**
-         * Sets the <code>AttributeValue</code> for this <code>CombinerParameter</code>>
-         * 
-         * @param attributeValueIn the <code>AttributeValue</code> for this <code>CombinerParameter</code>>
-         */
-        public void setAttributeValue(AttributeValue<?> attributeValueIn) {
-                this.attributeValue	= attributeValueIn;
-        }
+    /**
+     * Creates a new <code>CombinerParameter</code> with the given <code>String</code> name, <code>AttributeValue</code>,
+     * {@link com.att.research.xacml.api.StatusCode} and <code>String</code> status message.
+     *
+     * @param nameIn the <code>String</code> name of the <code>CombinerParameter</code>
+     * @param attributeValueIn the <code>AttributeValue</code> of the <code>CombinerParameter</code>
+     * @param statusCodeIn the <code>StatusCode</code> of the <code>CombinerParameter</code>
+     * @param statusMessageIn the <code>String</code> status message of the <code>CombinerParameter</code>
+     */
+    public CombinerParameter(String nameIn, AttributeValue<?> attributeValueIn, StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+        this.name			= nameIn;
+        this.attributeValue	= attributeValueIn;
+    }
 
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getName()) != null) {
-                        stringBuilder.append(",name=");
-                        stringBuilder.append((String)objectToDump);
-                }
-                if ((objectToDump = this.getAttributeValue()) != null) {
-                        stringBuilder.append(",attributeValue=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    /**
+     * Creates a new <code>CombinerParameter</code> for an error condition with the given <code>StatusCode</code> and
+     * <code>String</code> status message.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> of the <code>CombinerParameter</code>
+     * @param statusMessageIn the <code>String</code> status message of the <code>CombinerParameter</code>
+     */
+    public CombinerParameter(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    /**
+     * Creates a new <code>CombinerParameter</code> for an error condition with the given <code>StatusCode</code> and
+     * null status message.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> of the <code>CombinerParameter</code>
+     */
+    public CombinerParameter(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    /**
+     * Creates a new <code>CombinerParameter</code> with a default <code>StatusCode</code>, null status message, and the given
+     * <code>String</code> name and <code>AttributeValue</code>>
+     *
+     * @param nameIn the <code>String</code> name of the <code>CombinerParameter</code>
+     * @param attributeValueIn the <code>AttributeValue</code> of the <code>CombinerParameter</code>
+     */
+    public CombinerParameter(String nameIn, AttributeValue<?> attributeValueIn) {
+        super();
+        this.name			= nameIn;
+        this.attributeValue	= attributeValueIn;
+    }
+
+    public CombinerParameter() {
+
+    }
+
+    /**
+     * Gets the <code>String</code> name of this <code>CombinerParameter</code>.
+     *
+     * @return the <code>String</code> name of this <code>CombinerParameter</code>
+     */
+    public String getName() {
+        return this.name;
+    }
+
+    /**
+     * Sets the name of this <code>CombinerParameter</code> to the given <code>String</code>.
+     *
+     * @param nameIn the <code>String</code> name for this <code>CombinerParameter</code>.
+     */
+    public void setName(String nameIn) {
+        this.name	= nameIn;
+    }
+
+    /**
+     * Gets the <code>AttributeValue</code> of this <code>CombinerParameter</code>.
+     *
+     * @return the <code>AttributeValue</code> of this <code>CombinerParameter</code>
+     */
+    public AttributeValue<?> getAttributeValue() {
+        return this.attributeValue;
+    }
+
+    /**
+     * Sets the <code>AttributeValue</code> for this <code>CombinerParameter</code>>
+     *
+     * @param attributeValueIn the <code>AttributeValue</code> for this <code>CombinerParameter</code>>
+     */
+    public void setAttributeValue(AttributeValue<?> attributeValueIn) {
+        this.attributeValue	= attributeValueIn;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getName()) != null) {
+            stringBuilder.append(",name=");
+            stringBuilder.append((String)objectToDump);
         }
+        if ((objectToDump = this.getAttributeValue()) != null) {
+            stringBuilder.append(",attributeValue=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningAlgorithm.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningAlgorithm.java
index 11de58c..2d41c0e 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningAlgorithm.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningAlgorithm.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,7 +40,7 @@
 
 /**
  * CombiningAlgorithm is the interface for objects that implement XACML combining algorithms for rules, policies, and policy sets.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  *
@@ -48,22 +48,22 @@
  * @param <U> the type of the identifier for <code>T</code>
  */
 public interface CombiningAlgorithm<T extends Evaluatable> {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Identifier} for this <code>CombiningAlgorithm</code>.
-         * 
-         * @return the <code>Identifier</code> for this <code>CombiningAlgorithm</code>
-         */
-        public Identifier getId();
-        
-        /**
-         * Evaluates as many of the <code>CombiningElement</code>s supplied with the given <code>CombinerParameter</code>s based on
-         * the particular combining algorithm and combines their <code>EvaluationResult</code>s into a single <code>EvaluationResult</code>.
-         * 
-         * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate each of the <code>CombiningElement</code>s
-         * @param elements the <code>List</code> of <code>CombiningElement</code>s to evaluate
-         * @param combinerParameters the <code>List</code> of <code>CombinerParameter</code>s to apply to the combining algorithm
-         * @return the combined <code>EvaluationResult</code>
-         * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error in the <code>evaluate</code> method of any of the <code>CombiningElement</code>s
-         */
-        public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<T>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException;
+    /**
+     * Gets the {@link com.att.research.xacml.api.Identifier} for this <code>CombiningAlgorithm</code>.
+     *
+     * @return the <code>Identifier</code> for this <code>CombiningAlgorithm</code>
+     */
+    public Identifier getId();
+
+    /**
+     * Evaluates as many of the <code>CombiningElement</code>s supplied with the given <code>CombinerParameter</code>s based on
+     * the particular combining algorithm and combines their <code>EvaluationResult</code>s into a single <code>EvaluationResult</code>.
+     *
+     * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate each of the <code>CombiningElement</code>s
+     * @param elements the <code>List</code> of <code>CombiningElement</code>s to evaluate
+     * @param combinerParameters the <code>List</code> of <code>CombinerParameter</code>s to apply to the combining algorithm
+     * @return the combined <code>EvaluationResult</code>
+     * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error in the <code>evaluate</code> method of any of the <code>CombiningElement</code>s
+     */
+    public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<T>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException;
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningAlgorithmFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningAlgorithmFactory.java
index afeebbc..768c5d4 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningAlgorithmFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningAlgorithmFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,72 +40,72 @@
 /**
  * CombiningAlgorithmFactory is an abstract class for mapping function {@link com.att.research.xacml.api.Identifier} ids to
  * {@link CombiningAlgorithm} objects.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public abstract class CombiningAlgorithmFactory {
-        private static final String	FACTORYID					= ATTPDPProperties.PROP_COMBININGALGORITHMFACTORY;
-        private static final String DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.std.StdCombiningAlgorithmFactory";
-        
-        protected CombiningAlgorithmFactory() {
-        }
-        
-        protected CombiningAlgorithmFactory(Properties properties) {
-        }
-        
-        /**
-         * Maps the given <code>Identifier</code> representing a XACML rule combining algorithm to a <code>CombiningAlgorithm</code> object.
-         * 
-         * @param combiningAlgorithmId the <code>Identifier</code> of the <code>CombiningAlgorithm</code> to retrieve
-         * @return the <code>CombiningAlgorithm</code> for the given <code>Identifier</code> or null if not found
-         */
-        public abstract CombiningAlgorithm<Rule> getRuleCombiningAlgorithm(Identifier combiningAlgorithmId);
-        
-        /**
-         * Maps the given <code>Identifier</code> representing a XACML policy combinign algorithm to a <code>CombiningAlgorithm</code> object.
-         * 
-         * @param combiningAlgorithmId the <code.Identifier</code> of the <code>CombiningAlgorithm</code> to retrieve
-         * @return the <code>CombiningAlgorithm</code> for the given <code>Identifier</code> or null if not found
-         */
-        public abstract CombiningAlgorithm<PolicySetChild> getPolicyCombiningAlgorithm(Identifier combiningAlgorithmId);
-        
-        /**
-         * Creates an instance of the <code>CombiningAlgorithmFactory</code> using default configuration information.
-         * 
-         * @return the default <code>CombiningAlgorithmFactory</code>
-         */
-        public static CombiningAlgorithmFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, CombiningAlgorithmFactory.class);
-        }
-        
-        /**
-         * Creates an instance of the <code>CombiningAlgorithmFactory</code> using default configuration information.
-         * 
-         * @return the default <code>CombiningAlgorithmFactory</code>
-         */
-        public static CombiningAlgorithmFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, CombiningAlgorithmFactory.class, properties);
-        }
-        
-        /**
-         * Creates an instance of the <code>CombiningAlgorithmFactory</code> using the given class name.
-         * 
-         * @param className the <code>String</code> class name of the <code>CombiningAlgorithmFactory</code> to create
-         * @return the <code>CombiningAlgorithmFactory</code> for the given class name.
-         */
-        public static CombiningAlgorithmFactory newInstance(String className) throws FactoryException {
-                return FactoryFinder.newInstance(className, CombiningAlgorithmFactory.class, null, true);
-        }
-        
-        /**
-         * Creates an instance of the <code>CombiningAlgorithmFactory</code> using the given class name using the given <code>ClassLoader</code>.
-         * 
-         * @param className the <code>String</code> class name of the <code>CombiningAlgorithmFactory</code> to create
-         * @param classLoader the <code>ClassLoader</code> to use to load the class with the given class name
-         * @return the <code>CombiningAlgorithmFactory</code> for the given class name
-         */
-        public static CombiningAlgorithmFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(className, CombiningAlgorithmFactory.class, classLoader, false);
-        }
+    private static final String	FACTORYID					= ATTPDPProperties.PROP_COMBININGALGORITHMFACTORY;
+    private static final String DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.std.StdCombiningAlgorithmFactory";
+
+    protected CombiningAlgorithmFactory() {
+    }
+
+    protected CombiningAlgorithmFactory(Properties properties) {
+    }
+
+    /**
+     * Maps the given <code>Identifier</code> representing a XACML rule combining algorithm to a <code>CombiningAlgorithm</code> object.
+     *
+     * @param combiningAlgorithmId the <code>Identifier</code> of the <code>CombiningAlgorithm</code> to retrieve
+     * @return the <code>CombiningAlgorithm</code> for the given <code>Identifier</code> or null if not found
+     */
+    public abstract CombiningAlgorithm<Rule> getRuleCombiningAlgorithm(Identifier combiningAlgorithmId);
+
+    /**
+     * Maps the given <code>Identifier</code> representing a XACML policy combinign algorithm to a <code>CombiningAlgorithm</code> object.
+     *
+     * @param combiningAlgorithmId the <code.Identifier</code> of the <code>CombiningAlgorithm</code> to retrieve
+     * @return the <code>CombiningAlgorithm</code> for the given <code>Identifier</code> or null if not found
+     */
+    public abstract CombiningAlgorithm<PolicySetChild> getPolicyCombiningAlgorithm(Identifier combiningAlgorithmId);
+
+    /**
+     * Creates an instance of the <code>CombiningAlgorithmFactory</code> using default configuration information.
+     *
+     * @return the default <code>CombiningAlgorithmFactory</code>
+     */
+    public static CombiningAlgorithmFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, CombiningAlgorithmFactory.class);
+    }
+
+    /**
+     * Creates an instance of the <code>CombiningAlgorithmFactory</code> using default configuration information.
+     *
+     * @return the default <code>CombiningAlgorithmFactory</code>
+     */
+    public static CombiningAlgorithmFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, CombiningAlgorithmFactory.class, properties);
+    }
+
+    /**
+     * Creates an instance of the <code>CombiningAlgorithmFactory</code> using the given class name.
+     *
+     * @param className the <code>String</code> class name of the <code>CombiningAlgorithmFactory</code> to create
+     * @return the <code>CombiningAlgorithmFactory</code> for the given class name.
+     */
+    public static CombiningAlgorithmFactory newInstance(String className) throws FactoryException {
+        return FactoryFinder.newInstance(className, CombiningAlgorithmFactory.class, null, true);
+    }
+
+    /**
+     * Creates an instance of the <code>CombiningAlgorithmFactory</code> using the given class name using the given <code>ClassLoader</code>.
+     *
+     * @param className the <code>String</code> class name of the <code>CombiningAlgorithmFactory</code> to create
+     * @param classLoader the <code>ClassLoader</code> to use to load the class with the given class name
+     * @return the <code>CombiningAlgorithmFactory</code> for the given class name
+     */
+    public static CombiningAlgorithmFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(className, CombiningAlgorithmFactory.class, classLoader, false);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningElement.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningElement.java
index 80e04f9..d3c805c 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningElement.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/CombiningElement.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,61 +42,61 @@
 
 /**
  * CombiningElement wraps an {@link com.att.research.xacmlatt.pdp.evl.Evaluatable} with a set of
- * {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter}s for use with a 
+ * {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter}s for use with a
  * {@link com.att.research.xacmlatt.pdp.policy.CombiningAlgorithm} to get a combined {@link com.att.research.xacmlatt.pdp.eval.EvaluationResult}
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
- * 
+ *
  * @param <T> the java class extending <code>Evaluatable</code> of the objects to be combined
  */
 public class CombiningElement<T extends Evaluatable> {
-        private T										evaluatable;
-        private List<CombinerParameter>	targetedCombinerParameters;
-        
-        /**
-         * Creates a new <code>CombiningElement</code> with the given <code>Evaluatable</code> and <code>List</code> of
-         * <code>TargetedCombinerParameter</code>.
-         * 
-         * @param evaluatableIn the <code>Evaluatable</code>
-         * @param targetedCombinerParametersIn the <code>List</code> of <code>TargetedCombinerParameter</code>s.
-         */
-        public CombiningElement(T evaluatableIn, Collection<CombinerParameter> targetedCombinerParametersIn) {
-                this.evaluatable	= evaluatableIn;
-                if (targetedCombinerParametersIn != null) {
-                        this.targetedCombinerParameters	= new ArrayList<CombinerParameter>();
-                        this.targetedCombinerParameters.addAll(targetedCombinerParametersIn);
-                }
+    private T										evaluatable;
+    private List<CombinerParameter>	targetedCombinerParameters;
+
+    /**
+     * Creates a new <code>CombiningElement</code> with the given <code>Evaluatable</code> and <code>List</code> of
+     * <code>TargetedCombinerParameter</code>.
+     *
+     * @param evaluatableIn the <code>Evaluatable</code>
+     * @param targetedCombinerParametersIn the <code>List</code> of <code>TargetedCombinerParameter</code>s.
+     */
+    public CombiningElement(T evaluatableIn, Collection<CombinerParameter> targetedCombinerParametersIn) {
+        this.evaluatable	= evaluatableIn;
+        if (targetedCombinerParametersIn != null) {
+            this.targetedCombinerParameters	= new ArrayList<CombinerParameter>();
+            this.targetedCombinerParameters.addAll(targetedCombinerParametersIn);
         }
-        
-        /**
-         * Gets the <code>Evaluatable</code> for this <code>CombiningElement</code>.
-         * 
-         * @return the <code>Evaluatable</code> for this <code>CombiningElement</code>
-         */
-        public T getEvaluatable() {
-                return this.evaluatable;
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the <code>TargetedCombinerParameters</code> for this
-         * <code>CombiningElement</code>.
-         * 
-         * @return an <code>Iterator</code> over the <code>TargetedCombinerParameters</code> for this <code>CombiningElement</code>
-         */
-        public Iterator<CombinerParameter> getTargetedCombinerParameters() {
-                return (this.targetedCombinerParameters == null ? null : this.targetedCombinerParameters.iterator());
-        }
-        
-        /**
-         * Evaluates this <code>CombiningElement</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
-         * 
-         * @param evaluationContext the <code>EvaluationContext</code>
-         * @return the {@link com.att.research.xacmlatt.pdp.eval.EvaluationResult} from the <code>Evaluatable</code>
-         * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error in the <code>evaluate</code> method of the <code>Evaluatable</code>
-         */
-        public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
-                return this.getEvaluatable().evaluate(evaluationContext);
-        }
+    }
+
+    /**
+     * Gets the <code>Evaluatable</code> for this <code>CombiningElement</code>.
+     *
+     * @return the <code>Evaluatable</code> for this <code>CombiningElement</code>
+     */
+    public T getEvaluatable() {
+        return this.evaluatable;
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the <code>TargetedCombinerParameters</code> for this
+     * <code>CombiningElement</code>.
+     *
+     * @return an <code>Iterator</code> over the <code>TargetedCombinerParameters</code> for this <code>CombiningElement</code>
+     */
+    public Iterator<CombinerParameter> getTargetedCombinerParameters() {
+        return (this.targetedCombinerParameters == null ? null : this.targetedCombinerParameters.iterator());
+    }
+
+    /**
+     * Evaluates this <code>CombiningElement</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
+     *
+     * @param evaluationContext the <code>EvaluationContext</code>
+     * @return the {@link com.att.research.xacmlatt.pdp.eval.EvaluationResult} from the <code>Evaluatable</code>
+     * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error in the <code>evaluate</code> method of the <code>Evaluatable</code>
+     */
+    public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
+        return this.getEvaluatable().evaluate(evaluationContext);
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Condition.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Condition.java
index 206107c..5580908 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Condition.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Condition.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,127 +43,127 @@
 /**
  * Condition extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} to represent the XACML Condition element
  * in a XACML Rule.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class Condition extends PolicyComponent {
-        private static final Status						STATUS_PE_RETURNED_BAG			= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Condition Expression returned a bag");
-        private static final ExpressionResultBoolean	ERB_RETURNED_BAG				= new ExpressionResultBoolean(STATUS_PE_RETURNED_BAG);
-        private static final Status 					STATUS_PE_RETURNED_NULL			= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null value from Condition Expression");
-        private static final ExpressionResultBoolean	ERB_RETURNED_NULL				= new ExpressionResultBoolean(STATUS_PE_RETURNED_NULL);
-        private static final Status 					STATUS_PE_RETURNED_NON_BOOLEAN	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Non-boolean value from Condition Expression");
-        private static final ExpressionResultBoolean	ERB_RETURNED_NON_BOOLEAN		= new ExpressionResultBoolean(STATUS_PE_RETURNED_NON_BOOLEAN);
-        private static final Status						STATUS_PE_INVALID_BOOLEAN		= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Invalid Boolean value");
-        private static final ExpressionResultBoolean	ERB_INVALID_BOOLEAN				= new ExpressionResultBoolean(STATUS_PE_INVALID_BOOLEAN);
-        
-        private Expression expression;
-        
-        /**
-         * Creates a <code>Condition</code> with the given {@link com.att.research.xacml.api.StatusCode} and <code>String</code>
-         * status message.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> for the <code>Condition</code>
-         * @param statusMessageIn the <code>String</code> status message for the <code>Condition</code>
-         */
-        public Condition(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
+    private static final Status						STATUS_PE_RETURNED_BAG			= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Condition Expression returned a bag");
+    private static final ExpressionResultBoolean	ERB_RETURNED_BAG				= new ExpressionResultBoolean(STATUS_PE_RETURNED_BAG);
+    private static final Status 					STATUS_PE_RETURNED_NULL			= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null value from Condition Expression");
+    private static final ExpressionResultBoolean	ERB_RETURNED_NULL				= new ExpressionResultBoolean(STATUS_PE_RETURNED_NULL);
+    private static final Status 					STATUS_PE_RETURNED_NON_BOOLEAN	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Non-boolean value from Condition Expression");
+    private static final ExpressionResultBoolean	ERB_RETURNED_NON_BOOLEAN		= new ExpressionResultBoolean(STATUS_PE_RETURNED_NON_BOOLEAN);
+    private static final Status						STATUS_PE_INVALID_BOOLEAN		= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Invalid Boolean value");
+    private static final ExpressionResultBoolean	ERB_INVALID_BOOLEAN				= new ExpressionResultBoolean(STATUS_PE_INVALID_BOOLEAN);
+
+    private Expression expression;
+
+    /**
+     * Creates a <code>Condition</code> with the given {@link com.att.research.xacml.api.StatusCode} and <code>String</code>
+     * status message.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> for the <code>Condition</code>
+     * @param statusMessageIn the <code>String</code> status message for the <code>Condition</code>
+     */
+    public Condition(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    /**
+     * Creates a <code>Condition</code> with the given <code>StatusCode</code. and a null status message.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> for the <code>Condition</code>
+     */
+    public Condition(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    /**
+     * Creates an empty <code>Condition</code>
+     */
+    public Condition() {
+    }
+
+    /**
+     * Creates a new <code>Condition</code> with the given {@link com.att.research.xacmlatt.pdp.policy.Expression} and a default
+     * OK <code>StatusCode</code>.
+     *
+     * @param expressionIn the <code>Expression</code> for the <code>Condition</code>
+     */
+    public Condition(Expression expressionIn) {
+        this.expression	= expressionIn;
+    }
+
+    public Expression getExpression() {
+        return this.expression;
+    }
+
+    public void setExpression(Expression expressionIn) {
+        this.expression	= expressionIn;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getExpression() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Expression");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
+        }
+    }
+
+    /**
+     * Evaluates the <code>Expression</code> in this <code>Condition</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
+     * and validates that the result is a boolean.
+     *
+     * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate this <code>Expression</code>
+     * @param policyDefaults the {@link com.att.research.xacml.pdp.policy.PolicyDefaults} to use in evaluating this <code>Expression</code>
+     * @return a {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult}
+     */
+    public ExpressionResultBoolean evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return new ExpressionResultBoolean(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
 
-        /**
-         * Creates a <code>Condition</code> with the given <code>StatusCode</code. and a null status message.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> for the <code>Condition</code>
+        /*
+         * Evaluate the expression
          */
-        public Condition(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+        ExpressionResult expressionResult	= this.getExpression().evaluate(evaluationContext, policyDefaults);
+        assert(expressionResult != null);
+
+        if (!expressionResult.isOk()) {
+            return new ExpressionResultBoolean(expressionResult.getStatus());
         }
 
-        /**
-         * Creates an empty <code>Condition</code>
+        /*
+         * Ensure the result is a single element of type boolean
          */
-        public Condition() {
+        if (expressionResult.isBag()) {
+            return ERB_RETURNED_BAG;
         }
-        
-        /**
-         * Creates a new <code>Condition</code> with the given {@link com.att.research.xacmlatt.pdp.policy.Expression} and a default
-         * OK <code>StatusCode</code>.
-         * 
-         * @param expressionIn the <code>Expression</code> for the <code>Condition</code>
-         */
-        public Condition(Expression expressionIn) {
-                this.expression	= expressionIn;
-        }
-        
-        public Expression getExpression() {
-                return this.expression;
-        }
-        
-        public void setExpression(Expression expressionIn) {
-                this.expression	= expressionIn;
+        AttributeValue<?> attributeValueResult	= expressionResult.getValue();
+        if (attributeValueResult == null) {
+            return ERB_RETURNED_NULL;
+        } else if (!DataTypes.DT_BOOLEAN.getId().equals(attributeValueResult.getDataTypeId())) {
+            return ERB_RETURNED_NON_BOOLEAN;
         }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getExpression() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Expression");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
-        }
-
-        /**
-         * Evaluates the <code>Expression</code> in this <code>Condition</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
-         * and validates that the result is a boolean.
-         * 
-         * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate this <code>Expression</code>
-         * @param policyDefaults the {@link com.att.research.xacml.pdp.policy.PolicyDefaults} to use in evaluating this <code>Expression</code>
-         * @return a {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult}
+        /*
+         * Otherwise it is a valid condition evaluation
          */
-        public ExpressionResultBoolean evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return new ExpressionResultBoolean(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                /*
-                 * Evaluate the expression
-                 */
-                ExpressionResult expressionResult	= this.getExpression().evaluate(evaluationContext, policyDefaults);
-                assert(expressionResult != null);
-                
-                if (!expressionResult.isOk()) {
-                        return new ExpressionResultBoolean(expressionResult.getStatus());
-                }
-                
-                /*
-                 * Ensure the result is a single element of type boolean
-                 */
-                if (expressionResult.isBag()) {
-                        return ERB_RETURNED_BAG;
-                }
-                AttributeValue<?> attributeValueResult	= expressionResult.getValue();
-                if (attributeValueResult == null) {
-                        return ERB_RETURNED_NULL;
-                } else if (!DataTypes.DT_BOOLEAN.getId().equals(attributeValueResult.getDataTypeId())) {
-                        return ERB_RETURNED_NON_BOOLEAN;
-                }
-                
-                /*
-                 * Otherwise it is a valid condition evaluation
-                 */
-                Boolean	booleanValue	= null;
-                try {
-                        booleanValue	= DataTypes.DT_BOOLEAN.convert(attributeValueResult.getValue());
-                } catch (DataTypeException ex) {
-                        return new ExpressionResultBoolean(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
-                }
-                if (booleanValue == null) {
-                        return ERB_INVALID_BOOLEAN;
-                } else {
-                        return (booleanValue.booleanValue() ? ExpressionResultBoolean.ERB_TRUE : ExpressionResultBoolean.ERB_FALSE);
-                }
+        Boolean	booleanValue	= null;
+        try {
+            booleanValue	= DataTypes.DT_BOOLEAN.convert(attributeValueResult.getValue());
+        } catch (DataTypeException ex) {
+            return new ExpressionResultBoolean(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
         }
-        
+        if (booleanValue == null) {
+            return ERB_INVALID_BOOLEAN;
+        } else {
+            return (booleanValue.booleanValue() ? ExpressionResultBoolean.ERB_TRUE : ExpressionResultBoolean.ERB_FALSE);
+        }
+    }
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Expression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Expression.java
index d00bdf8..681a475 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Expression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Expression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,29 +36,29 @@
 
 /**
  * Expression extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} to represent a XACML ExpressionType element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public abstract class Expression extends PolicyComponent {
 
-        public Expression(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    public Expression(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        public Expression(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
+    public Expression(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-        public Expression() {
-        }
-        
-        /**
-         * Evaluates this <code>Expression</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
-         * 
-         * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate this <code>Expression</code>
-         * @param policyDefaults the {@link com.att.research.xacml.pdp.policy.PolicyDefaults} to use in evaluating this <code>Expression</code>
-         * @return a {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult}
-         */
-        public abstract ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException;
+    public Expression() {
+    }
+
+    /**
+     * Evaluates this <code>Expression</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
+     *
+     * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate this <code>Expression</code>
+     * @param policyDefaults the {@link com.att.research.xacml.pdp.policy.PolicyDefaults} to use in evaluating this <code>Expression</code>
+     * @return a {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult}
+     */
+    public abstract ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException;
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ExpressionResult.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ExpressionResult.java
index f45ee23..127e8be 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ExpressionResult.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ExpressionResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,236 +39,236 @@
 /**
  * ExpressionResult is the object returned by the <code>evaluate</code> method of {@link Expression}
  * objects.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public abstract class ExpressionResult implements FunctionArgument {
-        private Status	status;
+    private Status	status;
 
-        /**
-         * ExpressionResultError extends <code>ExpressionResult</code> to represent error results.
-         * 
-         * @author car
-         * @version $Revision: 1.1 $
-         */
-        private static class ExpressionResultError extends ExpressionResult {
-                public ExpressionResultError(Status statusIn) {
-                        super(statusIn);
-                }
-
-                @Override
-                public AttributeValue<?> getValue() {
-                        return null;
-                }
-
-                @Override
-                public boolean isBag() {
-                        return false;
-                }
-
-                @Override
-                public Bag getBag() {
-                        return null;
-                }
+    /**
+     * ExpressionResultError extends <code>ExpressionResult</code> to represent error results.
+     *
+     * @author car
+     * @version $Revision: 1.1 $
+     */
+    private static class ExpressionResultError extends ExpressionResult {
+        public ExpressionResultError(Status statusIn) {
+            super(statusIn);
         }
-        
-        /**
-         * ExpressionResultSingle extends <code>ExpressionResult</code> to represent results with a single value.
-         * 
-         * @author car
-         * @version $Revision: 1.1 $
-         */
-        private static class ExpressionResultSingle extends ExpressionResult {
-                AttributeValue<?>	attributeValue;
-                
-                public ExpressionResultSingle(AttributeValue<?> attributeValueIn) {
-                        super(StdStatus.STATUS_OK);
-                        this.attributeValue	= attributeValueIn;
-                }
 
-                @Override
-                public AttributeValue<?> getValue() {
-                        return this.attributeValue;
-                }
-
-                @Override
-                public boolean isBag() {
-                        return false;
-                }
-
-                @Override
-                public Bag getBag() {
-                        return null;
-                }
-        }
-        
-        private static class ExpressionResultBag extends ExpressionResult {
-                private Bag bag;
-                
-                public ExpressionResultBag(Bag bagIn) {
-                        super(StdStatus.STATUS_OK);
-                        this.bag	= bagIn;
-                }
-                
-                @Override
-                public AttributeValue<?> getValue() {
-                        Iterator<AttributeValue<?>> iter	= this.bag.getAttributeValues();
-                        if (iter != null && iter.hasNext()) {
-                                return iter.next();
-                        } else {
-                                return null;
-                        }
-                }
-
-                @Override
-                public boolean isBag() {
-                        return true;
-                }
-
-                @Override
-                public Bag getBag() {
-                        return this.bag;
-                }
-        }
-        
-        private static class ExpressionResultEmptyBag extends ExpressionResult {
-                public ExpressionResultEmptyBag() {
-                        super(StdStatus.STATUS_OK);
-                }
-
-                @Override
-                public AttributeValue<?> getValue() {
-                        return null;
-                }
-
-                @Override
-                public boolean isBag() {
-                        return true;
-                }
-
-                @Override
-                public Bag getBag() {
-                        return Bag.EMPTY;
-                }
-        }
-        
-        /**
-         * Creates a new <code>ExpressionResult</code> with the given {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param statusIn the <code>Status</code> of this <code>ExpressionResult</code>
-         */
-        protected ExpressionResult(Status statusIn) {
-                this.status	= statusIn;
-        }
-        
-        /**
-         * Gets the <code>Status</code> for this <code>ExpressionResult</code>.
-         * 
-         * @return the <code>Status</code> for this <code>ExpressionResult</code>
-         */
-        public Status getStatus() {
-                return this.status;
-        }
-        
-        /**
-         * Shortcut procedure for determining if the <code>Status</code> of this <code>ExpressionResult</code> is OK.
-         * 
-         * @return true if the <code>Status</code> is null or has a <code>StatusCode</code> value of <code>STATUS_CODE_OK</code>.
-         */
-        public boolean isOk() {
-                return (this.getStatus() == null || this.getStatus().isOk());
-        }
-        
-        /**
-         * Gets the single {@link com.att.research.xacml.api.AttributeValue} from this <code>ExpressionResult</code>.  If this
-         * <code>ExpressionResult</code> represents a bag, the first element in the bag is returned.
-         * 
-         * @return a single <code>AttributeValue</code> from this <code>ExpressionResult</code>
-         */
-        public abstract AttributeValue<?> getValue();
-        
-        /**
-         * Determines if this <code>ExpressionResult</code> represents a bag of <code>AttributeValue</code>s or not.
-         * 
-         * @return true if this <code>ExpressionResult</code> represents a bag of <code>AttributeValue</code>s, else false
-         */
-        public abstract boolean isBag();
-        
-        /**
-         * Gets the {@link Bag} of values for this <code>ExpressionResult</code> if
-         * there is one.
-         * 
-         * @return the <code>Bag</code> of <code>AttributeValue</code>s for this <code>ExpressionResult</code>.
-         */
-        public abstract Bag getBag();
-        
         @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("isOk=" + this.isOk());
-                stringBuilder.append(", isBag=" + this.isBag());
-                Status thisStatus	= this.getStatus();
-                if (thisStatus != null) {
-                        stringBuilder.append(", status=");
-                        stringBuilder.append(thisStatus.toString());
-                }
-                AttributeValue<?> value = this.getValue();
-                if (value != null) {
-                        stringBuilder.append(", value=");
-                        stringBuilder.append(value);
-                }
-                /*
-                 * Not sure if I want this dumped
-                if (this.isBag()) {
-                        Bag bag = this.getBag();
-                        if (bag != null) {
-                        }
-                }
-                */
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        public AttributeValue<?> getValue() {
+            return null;
         }
-        /**
-         * Creates a new instance of the <code>ExpressionResult</code> class representing an error.
-         * 
-         * @param statusIn the <code>Status</code> containing the error information
-         * @return a new <code>ExpressionResult</code> representing the error
-         */
-        public static ExpressionResult newError(Status statusIn) {
-                return new ExpressionResultError(statusIn);
+
+        @Override
+        public boolean isBag() {
+            return false;
         }
-        
-        public static ExpressionResult newSingle(AttributeValue<?> attributeValue) {
-                return new ExpressionResultSingle(attributeValue);
+
+        @Override
+        public Bag getBag() {
+            return null;
         }
-        
-        /**
-         * Creates a new instance of the <code>ExpressionResult</code> class representing a bag of values 
-         * from the given <code>Bag</code>.
-         * 
-         * @param bag the <code>Bag</code> for the new <code>ExpressionResult</code>
-         * @return a new <code>ExpressionResult</code> representing the given <code>Bag</code>.
-         */
-        public static ExpressionResult newBag(Bag bag) {
-                return new ExpressionResultBag(bag);
+    }
+
+    /**
+     * ExpressionResultSingle extends <code>ExpressionResult</code> to represent results with a single value.
+     *
+     * @author car
+     * @version $Revision: 1.1 $
+     */
+    private static class ExpressionResultSingle extends ExpressionResult {
+        AttributeValue<?>	attributeValue;
+
+        public ExpressionResultSingle(AttributeValue<?> attributeValueIn) {
+            super(StdStatus.STATUS_OK);
+            this.attributeValue	= attributeValueIn;
         }
-        
-        /**
-         * Creates a new instance of the <code>ExpressionResult</code> class representing an empty bag of values.
-         * 
-         * @return the <code>ExpressionResult</code> representing the empty bag of values of the expression
-         */
-        public static ExpressionResult newEmpty() {
-                return new ExpressionResultEmptyBag();
+
+        @Override
+        public AttributeValue<?> getValue() {
+            return this.attributeValue;
         }
-        
-        public static ExpressionResult newInstance(Status statusIn) {
-                if (statusIn.getStatusCode().equals(StdStatus.STATUS_OK.getStatusCode())) {
-                        return newEmpty();
-                } else {
-                        return newError(statusIn);
+
+        @Override
+        public boolean isBag() {
+            return false;
+        }
+
+        @Override
+        public Bag getBag() {
+            return null;
+        }
+    }
+
+    private static class ExpressionResultBag extends ExpressionResult {
+        private Bag bag;
+
+        public ExpressionResultBag(Bag bagIn) {
+            super(StdStatus.STATUS_OK);
+            this.bag	= bagIn;
+        }
+
+        @Override
+        public AttributeValue<?> getValue() {
+            Iterator<AttributeValue<?>> iter	= this.bag.getAttributeValues();
+            if (iter != null && iter.hasNext()) {
+                return iter.next();
+            } else {
+                return null;
+            }
+        }
+
+        @Override
+        public boolean isBag() {
+            return true;
+        }
+
+        @Override
+        public Bag getBag() {
+            return this.bag;
+        }
+    }
+
+    private static class ExpressionResultEmptyBag extends ExpressionResult {
+        public ExpressionResultEmptyBag() {
+            super(StdStatus.STATUS_OK);
+        }
+
+        @Override
+        public AttributeValue<?> getValue() {
+            return null;
+        }
+
+        @Override
+        public boolean isBag() {
+            return true;
+        }
+
+        @Override
+        public Bag getBag() {
+            return Bag.EMPTY;
+        }
+    }
+
+    /**
+     * Creates a new <code>ExpressionResult</code> with the given {@link com.att.research.xacml.api.Status}.
+     *
+     * @param statusIn the <code>Status</code> of this <code>ExpressionResult</code>
+     */
+    protected ExpressionResult(Status statusIn) {
+        this.status	= statusIn;
+    }
+
+    /**
+     * Gets the <code>Status</code> for this <code>ExpressionResult</code>.
+     *
+     * @return the <code>Status</code> for this <code>ExpressionResult</code>
+     */
+    public Status getStatus() {
+        return this.status;
+    }
+
+    /**
+     * Shortcut procedure for determining if the <code>Status</code> of this <code>ExpressionResult</code> is OK.
+     *
+     * @return true if the <code>Status</code> is null or has a <code>StatusCode</code> value of <code>STATUS_CODE_OK</code>.
+     */
+    public boolean isOk() {
+        return (this.getStatus() == null || this.getStatus().isOk());
+    }
+
+    /**
+     * Gets the single {@link com.att.research.xacml.api.AttributeValue} from this <code>ExpressionResult</code>.  If this
+     * <code>ExpressionResult</code> represents a bag, the first element in the bag is returned.
+     *
+     * @return a single <code>AttributeValue</code> from this <code>ExpressionResult</code>
+     */
+    public abstract AttributeValue<?> getValue();
+
+    /**
+     * Determines if this <code>ExpressionResult</code> represents a bag of <code>AttributeValue</code>s or not.
+     *
+     * @return true if this <code>ExpressionResult</code> represents a bag of <code>AttributeValue</code>s, else false
+     */
+    public abstract boolean isBag();
+
+    /**
+     * Gets the {@link Bag} of values for this <code>ExpressionResult</code> if
+     * there is one.
+     *
+     * @return the <code>Bag</code> of <code>AttributeValue</code>s for this <code>ExpressionResult</code>.
+     */
+    public abstract Bag getBag();
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("isOk=" + this.isOk());
+        stringBuilder.append(", isBag=" + this.isBag());
+        Status thisStatus	= this.getStatus();
+        if (thisStatus != null) {
+            stringBuilder.append(", status=");
+            stringBuilder.append(thisStatus.toString());
+        }
+        AttributeValue<?> value = this.getValue();
+        if (value != null) {
+            stringBuilder.append(", value=");
+            stringBuilder.append(value);
+        }
+        /*
+         * Not sure if I want this dumped
+        if (this.isBag()) {
+                Bag bag = this.getBag();
+                if (bag != null) {
                 }
         }
+        */
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+    /**
+     * Creates a new instance of the <code>ExpressionResult</code> class representing an error.
+     *
+     * @param statusIn the <code>Status</code> containing the error information
+     * @return a new <code>ExpressionResult</code> representing the error
+     */
+    public static ExpressionResult newError(Status statusIn) {
+        return new ExpressionResultError(statusIn);
+    }
+
+    public static ExpressionResult newSingle(AttributeValue<?> attributeValue) {
+        return new ExpressionResultSingle(attributeValue);
+    }
+
+    /**
+     * Creates a new instance of the <code>ExpressionResult</code> class representing a bag of values
+     * from the given <code>Bag</code>.
+     *
+     * @param bag the <code>Bag</code> for the new <code>ExpressionResult</code>
+     * @return a new <code>ExpressionResult</code> representing the given <code>Bag</code>.
+     */
+    public static ExpressionResult newBag(Bag bag) {
+        return new ExpressionResultBag(bag);
+    }
+
+    /**
+     * Creates a new instance of the <code>ExpressionResult</code> class representing an empty bag of values.
+     *
+     * @return the <code>ExpressionResult</code> representing the empty bag of values of the expression
+     */
+    public static ExpressionResult newEmpty() {
+        return new ExpressionResultEmptyBag();
+    }
+
+    public static ExpressionResult newInstance(Status statusIn) {
+        if (statusIn.getStatusCode().equals(StdStatus.STATUS_OK.getStatusCode())) {
+            return newEmpty();
+        } else {
+            return newError(statusIn);
+        }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ExpressionResultBoolean.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ExpressionResultBoolean.java
index e4d16d5..db19704 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ExpressionResultBoolean.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ExpressionResultBoolean.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,49 +37,49 @@
 
 /**
  * ExpressionResultBoolean extends {@link ExpressionResult} to represent predicates.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ExpressionResultBoolean extends ExpressionResult {
-        private AttributeValue<Boolean>	value;
-        public static final ExpressionResultBoolean	ERB_FALSE						= new ExpressionResultBoolean(false);
-        public static final ExpressionResultBoolean	ERB_TRUE						= new ExpressionResultBoolean(true);
-        
-        public ExpressionResultBoolean(Status statusIn) {
-                super(statusIn);
-        }
-        
-        public ExpressionResultBoolean(boolean bvalue) {
-                super(StdStatus.STATUS_OK);
-                this.value	= (bvalue ? DataTypeBoolean.AV_TRUE : DataTypeBoolean.AV_FALSE);
-        }
-        
-        /**
-         * Gets the <code>boolean</code> value of this <code>ExpressionResultBoolean</code>
-         * 
-         * @return the <code>boolean</code> value of this <code>ExpressionResultBoolean</code>
-         */
-        public boolean isTrue() {
-                if (this.value == null) {
-                        return false;
-                } else {
-                        return this.value.getValue().booleanValue();
-                }
-        }
+    private AttributeValue<Boolean>	value;
+    public static final ExpressionResultBoolean	ERB_FALSE						= new ExpressionResultBoolean(false);
+    public static final ExpressionResultBoolean	ERB_TRUE						= new ExpressionResultBoolean(true);
 
-        @Override
-        public AttributeValue<?> getValue() {
-                return this.value;
-        }
+    public ExpressionResultBoolean(Status statusIn) {
+        super(statusIn);
+    }
 
-        @Override
-        public boolean isBag() {
-                return false;
-        }
+    public ExpressionResultBoolean(boolean bvalue) {
+        super(StdStatus.STATUS_OK);
+        this.value	= (bvalue ? DataTypeBoolean.AV_TRUE : DataTypeBoolean.AV_FALSE);
+    }
 
-        @Override
-        public Bag getBag() {
-                return null;
+    /**
+     * Gets the <code>boolean</code> value of this <code>ExpressionResultBoolean</code>
+     *
+     * @return the <code>boolean</code> value of this <code>ExpressionResultBoolean</code>
+     */
+    public boolean isTrue() {
+        if (this.value == null) {
+            return false;
+        } else {
+            return this.value.getValue().booleanValue();
         }
+    }
+
+    @Override
+    public AttributeValue<?> getValue() {
+        return this.value;
+    }
+
+    @Override
+    public boolean isBag() {
+        return false;
+    }
+
+    @Override
+    public Bag getBag() {
+        return null;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgument.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgument.java
index 37a7ecc..4d5f1e0 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgument.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgument.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,47 +36,47 @@
 /**
  * FunctionArgument is the interface implemented by objects that can serve as arguments to a {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition}
  * <code>evaluate</code> call.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public interface FunctionArgument {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Status} from the evaluation of this <code>FunctionArgument</code>.
-         * 
-         * @return the <code>Status</code> from the evaluation of this <code>FunctionArgument</code>>
-         */
-        public Status getStatus();
-        
-        /**
-         * Determines if this <code>FunctionArgument</code> is OK and can have its <code>AttributeValue</code> or
-         * <code>Bag</code> retrieved.
-         * 
-         * @return true if this <code>FunctionArgument</code> is OK, otherwise false.
-         */
-        public boolean isOk();
-        
-        /**
-         * Determines if this <code>FunctionArgument</code> represents a bag of values.
-         * 
-         * @return true if this <code>FunctionArgument</code> represents a bag of values, else false.
-         */
-        public boolean isBag();
-        
-        /**
-         * Gets the single <code>AttributeValue</code> representing the value of this <code>FunctionArgument</code>.  If
-         * this <code>FunctionArgument</code> represents a bag, the value returned is up to the implementation.
-         * 
-         * @return the single <code>AttributeValue</code> representing the value of this <code>FunctionArgument</code>.
-         */
-        public AttributeValue<?> getValue();
-        
-        /**
-         * Gets the {@link Bag} value for this <code>FunctionArgument</code> if the
-         * argument represents a <code>Bag</code>, (i.e. <code>isBag</code> returns true).
-         * 
-         * @return the <code>Bag</code> value for this <code>FunctionArgument</code>.
-         */
-        public Bag getBag();
-        
+    /**
+     * Gets the {@link com.att.research.xacml.api.Status} from the evaluation of this <code>FunctionArgument</code>.
+     *
+     * @return the <code>Status</code> from the evaluation of this <code>FunctionArgument</code>>
+     */
+    public Status getStatus();
+
+    /**
+     * Determines if this <code>FunctionArgument</code> is OK and can have its <code>AttributeValue</code> or
+     * <code>Bag</code> retrieved.
+     *
+     * @return true if this <code>FunctionArgument</code> is OK, otherwise false.
+     */
+    public boolean isOk();
+
+    /**
+     * Determines if this <code>FunctionArgument</code> represents a bag of values.
+     *
+     * @return true if this <code>FunctionArgument</code> represents a bag of values, else false.
+     */
+    public boolean isBag();
+
+    /**
+     * Gets the single <code>AttributeValue</code> representing the value of this <code>FunctionArgument</code>.  If
+     * this <code>FunctionArgument</code> represents a bag, the value returned is up to the implementation.
+     *
+     * @return the single <code>AttributeValue</code> representing the value of this <code>FunctionArgument</code>.
+     */
+    public AttributeValue<?> getValue();
+
+    /**
+     * Gets the {@link Bag} value for this <code>FunctionArgument</code> if the
+     * argument represents a <code>Bag</code>, (i.e. <code>isBag</code> returns true).
+     *
+     * @return the <code>Bag</code> value for this <code>FunctionArgument</code>.
+     */
+    public Bag getBag();
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentAttributeValue.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentAttributeValue.java
index 9c99855..4874167 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentAttributeValue.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentAttributeValue.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,44 +36,44 @@
 
 /**
  * FunctionArgumentAttributeValue implements {@link FunctionArgument} for a single
- * {@link com.att.research.xacml.api.AttributeValue} 
+ * {@link com.att.research.xacml.api.AttributeValue}
  * @author car
  *
  */
 public class FunctionArgumentAttributeValue implements FunctionArgument {
-        private AttributeValue<?> attributeValue;
-        
-        /**
-         * Creates a new <code>FunctionArgumentAttributeValue</code> from the given <code>AttributeValue</code>.
-         * 
-         * @param attributeValueIn the <code>AttributeValue</code> for the new <code>FunctionArgumentAttributeValue</code>.
-         */
-        public FunctionArgumentAttributeValue(AttributeValue<?> attributeValueIn) {
-                this.attributeValue	= attributeValueIn;
-        }
-        
-        @Override
-        public Status getStatus() {
-                return StdStatus.STATUS_OK;
-        }
-        
-        @Override
-        public boolean isOk() {
-                return true;
-        }
+    private AttributeValue<?> attributeValue;
 
-        @Override
-        public boolean isBag() {
-                return false;
-        }
+    /**
+     * Creates a new <code>FunctionArgumentAttributeValue</code> from the given <code>AttributeValue</code>.
+     *
+     * @param attributeValueIn the <code>AttributeValue</code> for the new <code>FunctionArgumentAttributeValue</code>.
+     */
+    public FunctionArgumentAttributeValue(AttributeValue<?> attributeValueIn) {
+        this.attributeValue	= attributeValueIn;
+    }
 
-        @Override
-        public AttributeValue<?> getValue() {
-                return this.attributeValue;
-        }
+    @Override
+    public Status getStatus() {
+        return StdStatus.STATUS_OK;
+    }
 
-        @Override
-        public Bag getBag() {
-                return null;
-        }
+    @Override
+    public boolean isOk() {
+        return true;
+    }
+
+    @Override
+    public boolean isBag() {
+        return false;
+    }
+
+    @Override
+    public AttributeValue<?> getValue() {
+        return this.attributeValue;
+    }
+
+    @Override
+    public Bag getBag() {
+        return null;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentBag.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentBag.java
index b418eac..c200c4d 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentBag.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentBag.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,49 +39,49 @@
 /**
  * FunctionArgumentBag implements the {@link FunctionArgument} interface for
  * a {@link Bag} objects.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class FunctionArgumentBag implements FunctionArgument {
-        private Bag	bag;
-        
-        /**
-         * Creates a new <code>FunctionArgumentBag</code> from the given <code>Bag</code>.
-         * 
-         * @param bagIn the <code>Bag</code> for the new <code>FunctionArgumentBag</code>.
-         */
-        public FunctionArgumentBag(Bag bagIn) {
-                this.bag	= bagIn;
-        }
-        
-        @Override
-        public Status getStatus() {
-                return StdStatus.STATUS_OK;
-        }
-        
-        @Override
-        public boolean isOk() {
-                return true;
-        }
+    private Bag	bag;
 
-        @Override
-        public boolean isBag() {
-                return true;
-        }
+    /**
+     * Creates a new <code>FunctionArgumentBag</code> from the given <code>Bag</code>.
+     *
+     * @param bagIn the <code>Bag</code> for the new <code>FunctionArgumentBag</code>.
+     */
+    public FunctionArgumentBag(Bag bagIn) {
+        this.bag	= bagIn;
+    }
 
-        @Override
-        public AttributeValue<?> getValue() {
-                Iterator<AttributeValue<?>> iterAttributeValues	= this.bag.getAttributeValues();
-                if (iterAttributeValues == null || !iterAttributeValues.hasNext()) {
-                        return null;
-                } else {
-                        return iterAttributeValues.next();
-                }
-        }
+    @Override
+    public Status getStatus() {
+        return StdStatus.STATUS_OK;
+    }
 
-        @Override
-        public Bag getBag() {
-                return this.bag;
+    @Override
+    public boolean isOk() {
+        return true;
+    }
+
+    @Override
+    public boolean isBag() {
+        return true;
+    }
+
+    @Override
+    public AttributeValue<?> getValue() {
+        Iterator<AttributeValue<?>> iterAttributeValues	= this.bag.getAttributeValues();
+        if (iterAttributeValues == null || !iterAttributeValues.hasNext()) {
+            return null;
+        } else {
+            return iterAttributeValues.next();
         }
+    }
+
+    @Override
+    public Bag getBag() {
+        return this.bag;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java
index 52dd9ed..3fc0514 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionArgumentExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,94 +40,94 @@
 /**
  * FunctionArgumentExpression implements the {@link FunctionArgument} interface for
  * unevaluated {@link Expression}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class FunctionArgumentExpression implements FunctionArgument {
-        private static final Status STATUS_NULL_EXPRESSION_RESULT	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null expression result");
-        
-        private Expression expression;
-        private EvaluationContext evaluationContext;
-        private ExpressionResult expressionResult;
-        private PolicyDefaults policyDefaults;
-        
-        protected ExpressionResult evaluateExpression() {
-                if (this.getExpression() != null && this.getEvaluationContext() != null) {
-                        try {
-                                this.expressionResult	= this.getExpression().evaluate(this.getEvaluationContext(), this.getPolicyDefaults());
-                        } catch (EvaluationException ex) {
-                                this.expressionResult	= ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
-                        }
-                }
-                return this.expressionResult;
-        }
-        
-        public FunctionArgumentExpression() {
-        }
-        
-        public FunctionArgumentExpression(Expression expressionIn, EvaluationContext evaluationContextIn, PolicyDefaults policyDefaultsIn) {
-                this.expression			= expressionIn;
-                this.evaluationContext	= evaluationContextIn;
-                this.policyDefaults		= policyDefaultsIn;
-        }
-        
-        protected ExpressionResult getExpressionResult() {
-                return this.expressionResult;
-        }
-        
-        protected Expression getExpression() {
-                return this.expression;
-        }
-        
-        protected EvaluationContext getEvaluationContext() {
-                return this.evaluationContext;
-        }
-        
-        protected PolicyDefaults getPolicyDefaults() {
-                
-                return this.policyDefaults;
-        }
+    private static final Status STATUS_NULL_EXPRESSION_RESULT	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null expression result");
 
-        @Override
-        public Status getStatus() {
-                ExpressionResult thisExpressionResult	= this.getExpressionResult();
-                if (thisExpressionResult == null) {
-                        thisExpressionResult	= this.evaluateExpression();
-                }
-                return (thisExpressionResult == null ? STATUS_NULL_EXPRESSION_RESULT : thisExpressionResult.getStatus());
-        }
-        
-        @Override
-        public boolean isOk() {
-                Status thisStatus	= this.getStatus();
-                return (thisStatus == null ? true : thisStatus.isOk());
-        }
+    private Expression expression;
+    private EvaluationContext evaluationContext;
+    private ExpressionResult expressionResult;
+    private PolicyDefaults policyDefaults;
 
-        @Override
-        public boolean isBag() {
-                ExpressionResult thisExpressionResult	= this.getExpressionResult();
-                if (thisExpressionResult == null) {
-                        thisExpressionResult	= this.evaluateExpression();
-                }
-                return (thisExpressionResult == null ? false : thisExpressionResult.isBag());
+    protected ExpressionResult evaluateExpression() {
+        if (this.getExpression() != null && this.getEvaluationContext() != null) {
+            try {
+                this.expressionResult	= this.getExpression().evaluate(this.getEvaluationContext(), this.getPolicyDefaults());
+            } catch (EvaluationException ex) {
+                this.expressionResult	= ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
+            }
         }
+        return this.expressionResult;
+    }
 
-        @Override
-        public AttributeValue<?> getValue() {
-                ExpressionResult thisExpressionResult	= this.getExpressionResult();
-                if (thisExpressionResult == null) {
-                        thisExpressionResult	= this.evaluateExpression();
-                }
-                return (thisExpressionResult == null ? null : thisExpressionResult.getValue());
-        }
+    public FunctionArgumentExpression() {
+    }
 
-        @Override
-        public Bag getBag() {
-                ExpressionResult thisExpressionResult	= this.getExpressionResult();
-                if (thisExpressionResult == null) {
-                        thisExpressionResult	= this.evaluateExpression();
-                }
-                return (thisExpressionResult == null ? null : thisExpressionResult.getBag());
+    public FunctionArgumentExpression(Expression expressionIn, EvaluationContext evaluationContextIn, PolicyDefaults policyDefaultsIn) {
+        this.expression			= expressionIn;
+        this.evaluationContext	= evaluationContextIn;
+        this.policyDefaults		= policyDefaultsIn;
+    }
+
+    protected ExpressionResult getExpressionResult() {
+        return this.expressionResult;
+    }
+
+    protected Expression getExpression() {
+        return this.expression;
+    }
+
+    protected EvaluationContext getEvaluationContext() {
+        return this.evaluationContext;
+    }
+
+    protected PolicyDefaults getPolicyDefaults() {
+
+        return this.policyDefaults;
+    }
+
+    @Override
+    public Status getStatus() {
+        ExpressionResult thisExpressionResult	= this.getExpressionResult();
+        if (thisExpressionResult == null) {
+            thisExpressionResult	= this.evaluateExpression();
         }
+        return (thisExpressionResult == null ? STATUS_NULL_EXPRESSION_RESULT : thisExpressionResult.getStatus());
+    }
+
+    @Override
+    public boolean isOk() {
+        Status thisStatus	= this.getStatus();
+        return (thisStatus == null ? true : thisStatus.isOk());
+    }
+
+    @Override
+    public boolean isBag() {
+        ExpressionResult thisExpressionResult	= this.getExpressionResult();
+        if (thisExpressionResult == null) {
+            thisExpressionResult	= this.evaluateExpression();
+        }
+        return (thisExpressionResult == null ? false : thisExpressionResult.isBag());
+    }
+
+    @Override
+    public AttributeValue<?> getValue() {
+        ExpressionResult thisExpressionResult	= this.getExpressionResult();
+        if (thisExpressionResult == null) {
+            thisExpressionResult	= this.evaluateExpression();
+        }
+        return (thisExpressionResult == null ? null : thisExpressionResult.getValue());
+    }
+
+    @Override
+    public Bag getBag() {
+        ExpressionResult thisExpressionResult	= this.getExpressionResult();
+        if (thisExpressionResult == null) {
+            thisExpressionResult	= this.evaluateExpression();
+        }
+        return (thisExpressionResult == null ? null : thisExpressionResult.getBag());
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java
index ee139bb..7827c55 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,39 +38,39 @@
 /**
  * FunctionDefinition is the interface that objects representing XACML functions found in Match and Apply elements in Policies, PolicySets
  * and Rules.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface FunctionDefinition {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Identifier} for this <code>FunctionDefinition</code>.
-         * 
-         * @return the <code>Identifier</code> for this <code>FunctionDefinition</code>.
-         */
-        public Identifier getId();
-        
-        /**
-         * Returns the <code>Identifier</code> for the data type returned by this function if <code>returnsBag()</code> is false or
-         * if this <code>FunctionDefinition</code> returns a bag containing a single data type.  Otherwise it returns null.
-         * 
-         * @return the <code>Identifier</code> for the XACML data type this <code>FunctionDefinition</code> returns
-         */
-        public Identifier getDataTypeId();
-        
-        /**
-         * Determines if this <code>FunctionDefinition</code> returns a bag of values or a single value.
-         * 
-         * @return true if this <code>FunctionDefinition</code> returns a bag, else false
-         */
-        public boolean returnsBag();
-        
-        /**
-         * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link FunctionArgument}s.
-         * 
-         * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation
-         * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation
-         * @return an {@link ExpressionResult} with the results of the call
-         */
-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments);
+    /**
+     * Gets the {@link com.att.research.xacml.api.Identifier} for this <code>FunctionDefinition</code>.
+     *
+     * @return the <code>Identifier</code> for this <code>FunctionDefinition</code>.
+     */
+    public Identifier getId();
+
+    /**
+     * Returns the <code>Identifier</code> for the data type returned by this function if <code>returnsBag()</code> is false or
+     * if this <code>FunctionDefinition</code> returns a bag containing a single data type.  Otherwise it returns null.
+     *
+     * @return the <code>Identifier</code> for the XACML data type this <code>FunctionDefinition</code> returns
+     */
+    public Identifier getDataTypeId();
+
+    /**
+     * Determines if this <code>FunctionDefinition</code> returns a bag of values or a single value.
+     *
+     * @return true if this <code>FunctionDefinition</code> returns a bag, else false
+     */
+    public boolean returnsBag();
+
+    /**
+     * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link FunctionArgument}s.
+     *
+     * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation
+     * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation
+     * @return an {@link ExpressionResult} with the results of the call
+     */
+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments);
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java
index 59aab79..4ebd026 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinitionFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,64 +40,64 @@
 /**
  * FunctionDefinitionFactory is an abstract class for mapping function {@link com.att.research.xacml.api.Identifier} ids to
  * {@link FunctionDefinition} objects.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public abstract class FunctionDefinitionFactory {
-        private static final String	FACTORYID					= ATTPDPProperties.PROP_FUNCTIONDEFINITIONFACTORY;
-        private static final String DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.std.StdFunctionDefinitionFactory";
-        
-        protected FunctionDefinitionFactory() {
-        }
-        
-        protected FunctionDefinitionFactory(Properties properties) {
-        }
-        
-        /**
-         * Maps the given <code>Identifier</code> representing a XACML function to a <code>FunctionDefinition</code> object.
-         * 
-         * @param functionId the <code>Identifier</code> of the <code>FunctionDefinition</code> to retrieve
-         * @return the <code>FunctionDefinition</code> for the given <code>Identifier</code> or null if not found
-         */
-        public abstract FunctionDefinition getFunctionDefinition(Identifier functionId);
-        
-        /**
-         * Creates an instance of the <code>FunctionDefinitionFactory</code> using default configuration information.
-         * 
-         * @return the default <code>FunctionDefinitionFactory</code>
-         */
-        public static FunctionDefinitionFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, FunctionDefinitionFactory.class);
-        }
-        
-        /**
-         * Creates an instance of the <code>FunctionDefinitionFactory</code> using default configuration information.
-         * 
-         * @return the default <code>FunctionDefinitionFactory</code>
-         */
-        public static FunctionDefinitionFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, FunctionDefinitionFactory.class, properties);
-        }
-        
-        /**
-         * Creates an instance of the <code>FunctionDefinitionFactory</code> using the given class name.
-         * 
-         * @param className the <code>String</code> class name of the <code>FunctionDefinitionFactory</code> to create
-         * @return the <code>FunctionDefinitionFactory</code> for the given class name.
-         */
-        public static FunctionDefinitionFactory newInstance(String className) throws FactoryException {
-                return FactoryFinder.newInstance(className, FunctionDefinitionFactory.class, null, true);
-        }
-        
-        /**
-         * Creates an instance of the <code>FunctionDefinitionFactory</code> using the given class name using the given <code>ClassLoader</code>.
-         * 
-         * @param className the <code>String</code> class name of the <code>FunctionDefinitionFactory</code> to create
-         * @param classLoader the <code>ClassLoader</code> to use to load the class with the given class name
-         * @return the <code>FunctionDefinitionFactory</code> for the given class name
-         */
-        public static FunctionDefinitionFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(className, FunctionDefinitionFactory.class, classLoader, false);
-        }
+    private static final String	FACTORYID					= ATTPDPProperties.PROP_FUNCTIONDEFINITIONFACTORY;
+    private static final String DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.std.StdFunctionDefinitionFactory";
+
+    protected FunctionDefinitionFactory() {
+    }
+
+    protected FunctionDefinitionFactory(Properties properties) {
+    }
+
+    /**
+     * Maps the given <code>Identifier</code> representing a XACML function to a <code>FunctionDefinition</code> object.
+     *
+     * @param functionId the <code>Identifier</code> of the <code>FunctionDefinition</code> to retrieve
+     * @return the <code>FunctionDefinition</code> for the given <code>Identifier</code> or null if not found
+     */
+    public abstract FunctionDefinition getFunctionDefinition(Identifier functionId);
+
+    /**
+     * Creates an instance of the <code>FunctionDefinitionFactory</code> using default configuration information.
+     *
+     * @return the default <code>FunctionDefinitionFactory</code>
+     */
+    public static FunctionDefinitionFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, FunctionDefinitionFactory.class);
+    }
+
+    /**
+     * Creates an instance of the <code>FunctionDefinitionFactory</code> using default configuration information.
+     *
+     * @return the default <code>FunctionDefinitionFactory</code>
+     */
+    public static FunctionDefinitionFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, FunctionDefinitionFactory.class, properties);
+    }
+
+    /**
+     * Creates an instance of the <code>FunctionDefinitionFactory</code> using the given class name.
+     *
+     * @param className the <code>String</code> class name of the <code>FunctionDefinitionFactory</code> to create
+     * @return the <code>FunctionDefinitionFactory</code> for the given class name.
+     */
+    public static FunctionDefinitionFactory newInstance(String className) throws FactoryException {
+        return FactoryFinder.newInstance(className, FunctionDefinitionFactory.class, null, true);
+    }
+
+    /**
+     * Creates an instance of the <code>FunctionDefinitionFactory</code> using the given class name using the given <code>ClassLoader</code>.
+     *
+     * @param className the <code>String</code> class name of the <code>FunctionDefinitionFactory</code> to create
+     * @param classLoader the <code>ClassLoader</code> to use to load the class with the given class name
+     * @return the <code>FunctionDefinitionFactory</code> for the given class name
+     */
+    public static FunctionDefinitionFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(className, FunctionDefinitionFactory.class, classLoader, false);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java
index 856bca3..55a4181 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Match.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -52,212 +52,212 @@
 /**
  * Match extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} and implements the
  * {@link com.att.research.xacmlatt.pdp.eval.Matchable} interface to represent a XACML Match element.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class Match extends PolicyComponent implements Matchable {
-        private Identifier				matchId;
-        private AttributeValue<?>		attributeValue;
-        private AttributeRetrievalBase	attributeRetrievalBase;
-        private PolicyDefaults			policyDefaults;
-        private FunctionDefinition		functionDefinition;
-        
-        protected FunctionDefinition getFunctionDefinition() {
-                Identifier functionDefinitionId	= this.getMatchId();
-                if (this.functionDefinition == null && functionDefinitionId != null) {
-                        try {
-                                this.functionDefinition	= FunctionDefinitionFactory.newInstance().getFunctionDefinition(functionDefinitionId);
-                        } catch (FactoryException ex) {
-                                this.setStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "FactoryException getting FunctionDefinition");
+    private Identifier				matchId;
+    private AttributeValue<?>		attributeValue;
+    private AttributeRetrievalBase	attributeRetrievalBase;
+    private PolicyDefaults			policyDefaults;
+    private FunctionDefinition		functionDefinition;
+
+    protected FunctionDefinition getFunctionDefinition() {
+        Identifier functionDefinitionId	= this.getMatchId();
+        if (this.functionDefinition == null && functionDefinitionId != null) {
+            try {
+                this.functionDefinition	= FunctionDefinitionFactory.newInstance().getFunctionDefinition(functionDefinitionId);
+            } catch (FactoryException ex) {
+                this.setStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "FactoryException getting FunctionDefinition");
+            }
+        }
+        return this.functionDefinition;
+    }
+
+    public Match(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public Match(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public Match() {
+    }
+
+    public Match(Identifier matchIdIn, AttributeValue<?> attributeValueIn, AttributeRetrievalBase attributeRetrievalBaseIn, PolicyDefaults policyDefaultsIn) {
+        this(StdStatusCode.STATUS_CODE_OK);
+        this.matchId				= matchIdIn;
+        this.attributeValue			= attributeValueIn;
+        this.attributeRetrievalBase	= attributeRetrievalBaseIn;
+        this.policyDefaults			= policyDefaultsIn;
+    }
+
+    public Identifier getMatchId() {
+        return this.matchId;
+    }
+
+    public void setMatchId(Identifier matchIdIn) {
+        this.matchId	= matchIdIn;
+    }
+
+    public AttributeValue<?> getAttributeValue() {
+        return this.attributeValue;
+    }
+
+    public void setAttributeValue(AttributeValue<?> attributeValueIn) {
+        this.attributeValue	= attributeValueIn;
+    }
+
+    public AttributeRetrievalBase getAttributeRetrievalBase() {
+        return this.attributeRetrievalBase;
+    }
+
+    public void setAttributeRetrievalBase(AttributeRetrievalBase attributeRetrievalBaseIn) {
+        this.attributeRetrievalBase	= attributeRetrievalBaseIn;
+    }
+
+    public PolicyDefaults getPolicyDefaults() {
+        return this.policyDefaults;
+    }
+
+    public void setPolicyDefaults(PolicyDefaults policyDefaultsIn) {
+        this.policyDefaults	= policyDefaultsIn;
+    }
+
+    private static MatchResult match(EvaluationContext evaluationContext, FunctionDefinition functionDefinition, FunctionArgument arg1, FunctionArgument arg2) throws EvaluationException {
+        List<FunctionArgument> listArguments	= new ArrayList<FunctionArgument>(2);
+        listArguments.add(arg1);
+        listArguments.add(arg2);
+
+        ExpressionResult expressionResult	= functionDefinition.evaluate(evaluationContext, listArguments);
+        assert(expressionResult != null);
+        if (!expressionResult.isOk()) {
+            return new MatchResult(expressionResult.getStatus());
+        }
+
+        AttributeValue<Boolean> attributeValueResult	= null;
+        try {
+            attributeValueResult	= DataTypes.DT_BOOLEAN.convertAttributeValue(expressionResult.getValue());
+        } catch (DataTypeException ex) {
+            return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
+        }
+        if (attributeValueResult == null) {
+            return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Non-boolean result from Match Function " + functionDefinition.getId() + " on " + expressionResult.getValue().toString()));
+        } else if (attributeValueResult.getValue().booleanValue()) {
+            return MatchResult.MM_MATCH;
+        } else {
+            return MatchResult.MM_NOMATCH;
+        }
+
+    }
+
+    @Override
+    public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
+        if (!this.validate()) {
+            return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        }
+
+        FunctionDefinition functionDefinitionMatch		= this.getFunctionDefinition();
+        assert(functionDefinitionMatch != null);
+
+        AttributeValue<?> attributeValue				= this.getAttributeValue();
+        assert(attributeValue != null);
+        FunctionArgument functionArgument1				= new FunctionArgumentAttributeValue(attributeValue);
+
+        AttributeRetrievalBase attributeRetrievalBase	= this.getAttributeRetrievalBase();
+        assert(attributeRetrievalBase != null);
+
+        ExpressionResult expressionResult	= attributeRetrievalBase.evaluate(evaluationContext, this.getPolicyDefaults());
+        assert(expressionResult != null);
+        if (!expressionResult.isOk()) {
+            return new MatchResult(expressionResult.getStatus());
+        }
+
+        if (expressionResult.isBag()) {
+            MatchResult matchResult	= MatchResult.MM_NOMATCH;
+            Bag bagAttributeValues	= expressionResult.getBag();
+            if (bagAttributeValues != null) {
+                Iterator<AttributeValue<?>> iterAttributeValues	= bagAttributeValues.getAttributeValues();
+                while (matchResult.getMatchCode() != MatchResult.MatchCode.MATCH && iterAttributeValues.hasNext()) {
+                    MatchResult matchResultValue	= match(evaluationContext, functionDefinitionMatch, functionArgument1, new FunctionArgumentAttributeValue(iterAttributeValues.next()));
+                    switch(matchResultValue.getMatchCode()) {
+                    case INDETERMINATE:
+                        if (matchResult.getMatchCode() != MatchResult.MatchCode.INDETERMINATE) {
+                            matchResult	= matchResultValue;
                         }
+                        break;
+                    case MATCH:
+                        matchResult	= matchResultValue;
+                        break;
+                    case NOMATCH:
+                        break;
+                    }
                 }
-                return this.functionDefinition;
-        }
-        
-        public Match(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+            }
+            return matchResult;
+        } else {
+            /*
+             * There is a single value, so add it as the second argument and do the one function evaluation
+             */
+            AttributeValue<?> attributeValueExpressionResult	= expressionResult.getValue();
+            if (attributeValueExpressionResult == null) {
+                return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null AttributeValue"));
+            }
 
-        public Match(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+            return match(evaluationContext, functionDefinitionMatch, functionArgument1, new FunctionArgumentAttributeValue(attributeValueExpressionResult));
         }
+    }
 
-        public Match() {
+    @Override
+    protected boolean validateComponent() {
+        FunctionDefinition functionDefinitionHere;
+        if (this.getAttributeValue() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeValue");
+            return false;
+        } else if (this.getMatchId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing MatchId");
+            return false;
+        } else if ((functionDefinitionHere = this.getFunctionDefinition()) == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Unknown MatchId \"" + this.getMatchId().toString() + "\"");
+            return false;
+        } else if (functionDefinitionHere.returnsBag()) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "FunctionDefinition returns a bag");
+            return false;
+        } else if (functionDefinitionHere.getDataTypeId() == null || !functionDefinitionHere.getDataTypeId().equals(XACML.ID_DATATYPE_BOOLEAN)) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Non-Boolean return type for FunctionDefinition");
+            return false;
+        } else if (this.getAttributeRetrievalBase() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeSelector or AttributeDesignator");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
-        
-        public Match(Identifier matchIdIn, AttributeValue<?> attributeValueIn, AttributeRetrievalBase attributeRetrievalBaseIn, PolicyDefaults policyDefaultsIn) {
-                this(StdStatusCode.STATUS_CODE_OK);
-                this.matchId				= matchIdIn;
-                this.attributeValue			= attributeValueIn;
-                this.attributeRetrievalBase	= attributeRetrievalBaseIn;
-                this.policyDefaults			= policyDefaultsIn;
-        }
-        
-        public Identifier getMatchId() {
-                return this.matchId;
-        }
-        
-        public void setMatchId(Identifier matchIdIn) {
-                this.matchId	= matchIdIn;
-        }
-        
-        public AttributeValue<?> getAttributeValue() {
-                return this.attributeValue;
-        }
-        
-        public void setAttributeValue(AttributeValue<?> attributeValueIn) {
-                this.attributeValue	= attributeValueIn;
-        }
-        
-        public AttributeRetrievalBase getAttributeRetrievalBase() {
-                return this.attributeRetrievalBase;
-        }
-        
-        public void setAttributeRetrievalBase(AttributeRetrievalBase attributeRetrievalBaseIn) {
-                this.attributeRetrievalBase	= attributeRetrievalBaseIn;
-        }
-        
-        public PolicyDefaults getPolicyDefaults() {
-                return this.policyDefaults;
-        }
-        
-        public void setPolicyDefaults(PolicyDefaults policyDefaultsIn) {
-                this.policyDefaults	= policyDefaultsIn;
-        }
+    }
 
-        private static MatchResult match(EvaluationContext evaluationContext, FunctionDefinition functionDefinition, FunctionArgument arg1, FunctionArgument arg2) throws EvaluationException {
-                List<FunctionArgument> listArguments	= new ArrayList<FunctionArgument>(2);
-                listArguments.add(arg1);
-                listArguments.add(arg2);
-                
-                ExpressionResult expressionResult	= functionDefinition.evaluate(evaluationContext, listArguments);
-                assert(expressionResult != null);
-                if (!expressionResult.isOk()) {
-                        return new MatchResult(expressionResult.getStatus());
-                }
-                
-                AttributeValue<Boolean> attributeValueResult	= null;
-                try {
-                        attributeValueResult	= DataTypes.DT_BOOLEAN.convertAttributeValue(expressionResult.getValue());
-                } catch (DataTypeException ex) {
-                        return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
-                }
-                if (attributeValueResult == null) {
-                        return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Non-boolean result from Match Function " + functionDefinition.getId() + " on " + expressionResult.getValue().toString()));
-                } else if (attributeValueResult.getValue().booleanValue()) {
-                        return MatchResult.MM_MATCH;
-                } else {
-                        return MatchResult.MM_NOMATCH;
-                }
-                
-        }
-        
-        @Override
-        public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
-                if (!this.validate()) {
-                        return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                FunctionDefinition functionDefinitionMatch		= this.getFunctionDefinition();
-                assert(functionDefinitionMatch != null);
-                
-                AttributeValue<?> attributeValue				= this.getAttributeValue();
-                assert(attributeValue != null);
-                FunctionArgument functionArgument1				= new FunctionArgumentAttributeValue(attributeValue);
-                
-                AttributeRetrievalBase attributeRetrievalBase	= this.getAttributeRetrievalBase();
-                assert(attributeRetrievalBase != null);
-                
-                ExpressionResult expressionResult	= attributeRetrievalBase.evaluate(evaluationContext, this.getPolicyDefaults());
-                assert(expressionResult != null);
-                if (!expressionResult.isOk()) {
-                        return new MatchResult(expressionResult.getStatus());
-                }
-                
-                if (expressionResult.isBag()) {
-                        MatchResult matchResult	= MatchResult.MM_NOMATCH;
-                        Bag bagAttributeValues	= expressionResult.getBag();
-                        if (bagAttributeValues != null) {
-                                Iterator<AttributeValue<?>> iterAttributeValues	= bagAttributeValues.getAttributeValues();
-                                while (matchResult.getMatchCode() != MatchResult.MatchCode.MATCH && iterAttributeValues.hasNext()) {
-                                        MatchResult matchResultValue	= match(evaluationContext, functionDefinitionMatch, functionArgument1, new FunctionArgumentAttributeValue(iterAttributeValues.next()));
-                                        switch(matchResultValue.getMatchCode()) {
-                                        case INDETERMINATE:
-                                                if (matchResult.getMatchCode() != MatchResult.MatchCode.INDETERMINATE) {
-                                                        matchResult	= matchResultValue;
-                                                }
-                                                break;
-                                        case MATCH:
-                                                matchResult	= matchResultValue;
-                                                break;
-                                        case NOMATCH:
-                                                break;
-                                        }
-                                }
-                        }
-                        return matchResult;
-                } else {
-                        /*
-                         * There is a single value, so add it as the second argument and do the one function evaluation
-                         */
-                        AttributeValue<?> attributeValueExpressionResult	= expressionResult.getValue();
-                        if (attributeValueExpressionResult == null) {
-                                return new MatchResult(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Null AttributeValue"));
-                        }
-                        
-                        return match(evaluationContext, functionDefinitionMatch, functionArgument1, new FunctionArgumentAttributeValue(attributeValueExpressionResult));
-                }
-        }
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
 
-        @Override
-        protected boolean validateComponent() {
-                FunctionDefinition functionDefinitionHere;
-                if (this.getAttributeValue() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeValue");
-                        return false;
-                } else if (this.getMatchId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing MatchId");
-                        return false;
-                } else if ((functionDefinitionHere = this.getFunctionDefinition()) == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Unknown MatchId \"" + this.getMatchId().toString() + "\"");
-                        return false;
-                } else if (functionDefinitionHere.returnsBag()) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "FunctionDefinition returns a bag");
-                        return false;
-                } else if (functionDefinitionHere.getDataTypeId() == null || !functionDefinitionHere.getDataTypeId().equals(XACML.ID_DATATYPE_BOOLEAN)) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Non-Boolean return type for FunctionDefinition");
-                        return false;
-                } else if (this.getAttributeRetrievalBase() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeSelector or AttributeDesignator");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
+        Object objectToDump;
+        if ((objectToDump = this.getMatchId()) != null) {
+            stringBuilder.append(",matchId=");
+            stringBuilder.append(objectToDump.toString());
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getMatchId()) != null) {
-                        stringBuilder.append(",matchId=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getAttributeValue()) != null) {
-                        stringBuilder.append(",attributeValue=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getAttributeRetrievalBase()) != null) {
-                        stringBuilder.append(",attributeRetrieval=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        if ((objectToDump = this.getAttributeValue()) != null) {
+            stringBuilder.append(",attributeValue=");
+            stringBuilder.append(objectToDump.toString());
         }
+        if ((objectToDump = this.getAttributeRetrievalBase()) != null) {
+            stringBuilder.append(",attributeRetrieval=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java
index 4d4e64e..fc33260 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/ObligationExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,147 +48,147 @@
 /**
  * ObligationExpression extends {@link PolicyComponent} to implement the XACML
  * ObligationExpression element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ObligationExpression extends PolicyComponent {
-        private Identifier							obligationId;
-        private RuleEffect							ruleEffect;
-        private List<AttributeAssignmentExpression>	attributeAssignmentExpressions;
-        
-        protected List<AttributeAssignmentExpression> getAttributeAssignmentExpressionList(boolean bNoNull) {
-                if (this.attributeAssignmentExpressions == null && bNoNull) {
-                        this.attributeAssignmentExpressions	= new ArrayList<AttributeAssignmentExpression>();
-                }
-                return this.attributeAssignmentExpressions;
-        }
-        
-        protected void clearAttributeAssignmentExpressions() {
-                if (this.attributeAssignmentExpressions != null) {
-                        this.attributeAssignmentExpressions.clear();
-                }
-        }
-        
-        public ObligationExpression(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private Identifier							obligationId;
+    private RuleEffect							ruleEffect;
+    private List<AttributeAssignmentExpression>	attributeAssignmentExpressions;
 
-        public ObligationExpression(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+    protected List<AttributeAssignmentExpression> getAttributeAssignmentExpressionList(boolean bNoNull) {
+        if (this.attributeAssignmentExpressions == null && bNoNull) {
+            this.attributeAssignmentExpressions	= new ArrayList<AttributeAssignmentExpression>();
         }
+        return this.attributeAssignmentExpressions;
+    }
 
-        public ObligationExpression() {
+    protected void clearAttributeAssignmentExpressions() {
+        if (this.attributeAssignmentExpressions != null) {
+            this.attributeAssignmentExpressions.clear();
         }
-        
-        public Identifier getObligationId() {
-                return this.obligationId;
-        }
-        
-        public void setObligationId(Identifier identifier) {
-                this.obligationId	= identifier;
-        }
-        
-        public RuleEffect getRuleEffect() {
-                return this.ruleEffect;
-        }
-        
-        public void setRuleEffect(RuleEffect ruleEffectIn) {
-                this.ruleEffect	= ruleEffectIn;
-        }
-        
-        public Iterator<AttributeAssignmentExpression> getAttributeAssignmentExpressions() {
-                List<AttributeAssignmentExpression> listAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressionList(false);
-                return (listAttributeAssignmentExpressions == null ? null : listAttributeAssignmentExpressions.iterator());
-        }
-        
-        public void setAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressionsIn) {
-                this.clearAttributeAssignmentExpressions();
-                if (attributeAssignmentExpressionsIn != null) {
-                        this.addAttributeAssignmentExpressions(attributeAssignmentExpressionsIn);
-                }
-        }
-        
-        public void addAttributeAssignmentExpression(AttributeAssignmentExpression attributeAssignmentExpression) {
-                List<AttributeAssignmentExpression> listAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressionList(true);
-                listAttributeAssignmentExpressions.add(attributeAssignmentExpression);
-        }
-        
-        public void addAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressionsIn) {
-                List<AttributeAssignmentExpression> listAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressionList(true);
-                listAttributeAssignmentExpressions.addAll(attributeAssignmentExpressionsIn);
-        }
-        
-        /**
-         * Evaluates this <code>ObligationExpression</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}
-         * to get an {@link com.att.research.xacml.api.Obligation} to include in a PDP result.
-         * 
-         * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate this <code>ObligationExpression</code>
-         * @param policyDefaults the <code>PolicyDefaults</code> to apply to the evaluation
-         * @return a new <code>Obliagion</code> from this <code>ObligationExpression</code>
-         * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error evaluating any of the <code>AttributeAssignmentExpression</code>s
-         */
-        public Obligation evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return null;
-                }
-                List<AttributeAssignment> listAttributeAssignments							= new ArrayList<AttributeAssignment>();
-                Iterator<AttributeAssignmentExpression> iterAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressions();
-                if (iterAttributeAssignmentExpressions != null) {
-                        while (iterAttributeAssignmentExpressions.hasNext()) {
-                                AttributeAssignmentResult attributeAssignmentResult	= iterAttributeAssignmentExpressions.next().evaluate(evaluationContext, policyDefaults);
-                                if (attributeAssignmentResult.isOk() && attributeAssignmentResult.getNumAttributeAssignments() > 0) {
-                                        Iterator<AttributeAssignment> iterAttributeAssignments	= attributeAssignmentResult.getAttributeAssignments();
-                                        while (iterAttributeAssignments.hasNext()) {
-                                                listAttributeAssignments.add(iterAttributeAssignments.next());
-                                        }
-                                }
-                        }
-                }
-                return new StdMutableObligation(this.getObligationId(), listAttributeAssignments);
-        }
-        
-        /**
-         * Evaluates a <code>Collection</code> of <code>ObligationExpression</code>s in the given <code>EvaluationContext</code> and returns
-         * a <code>List</code> of <code>Obligation</code>s.
-         * 
-         * @param evaluationContext
-         * @param policyDefaults
-         * @param listObligationExpressions
-         * @return
-         * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException
-         */
-        public static List<Obligation> evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults, Decision decision, Collection<ObligationExpression> listObligationExpressions) throws EvaluationException {
-                List<Obligation> listObligations	= new ArrayList<Obligation>();
-                Iterator<ObligationExpression> iterObligationExpressions	= listObligationExpressions.iterator();
-                while (iterObligationExpressions.hasNext()) {
-                        ObligationExpression obligationExpression	= iterObligationExpressions.next();
-                        obligationExpression.validateComponent();
-                        if ( ! obligationExpression.isOk()) {
-                                throw new EvaluationException(obligationExpression.getStatusMessage());
-                        }
-                        if (decision == null || obligationExpression.getRuleEffect().getDecision().equals(decision)) {
-                                Obligation obligation	= obligationExpression.evaluate(evaluationContext, policyDefaults);
-                                if (obligation != null) {
-                                        listObligations.add(obligation);
-                                }
-                        }
-                }
-                return listObligations;
-        }
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getObligationId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing ObligationId attribute");
-                        return false;
-                } else if (this.getRuleEffect() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing FulfillOn attribute");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
+    public ObligationExpression(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public ObligationExpression(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public ObligationExpression() {
+    }
+
+    public Identifier getObligationId() {
+        return this.obligationId;
+    }
+
+    public void setObligationId(Identifier identifier) {
+        this.obligationId	= identifier;
+    }
+
+    public RuleEffect getRuleEffect() {
+        return this.ruleEffect;
+    }
+
+    public void setRuleEffect(RuleEffect ruleEffectIn) {
+        this.ruleEffect	= ruleEffectIn;
+    }
+
+    public Iterator<AttributeAssignmentExpression> getAttributeAssignmentExpressions() {
+        List<AttributeAssignmentExpression> listAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressionList(false);
+        return (listAttributeAssignmentExpressions == null ? null : listAttributeAssignmentExpressions.iterator());
+    }
+
+    public void setAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressionsIn) {
+        this.clearAttributeAssignmentExpressions();
+        if (attributeAssignmentExpressionsIn != null) {
+            this.addAttributeAssignmentExpressions(attributeAssignmentExpressionsIn);
         }
+    }
+
+    public void addAttributeAssignmentExpression(AttributeAssignmentExpression attributeAssignmentExpression) {
+        List<AttributeAssignmentExpression> listAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressionList(true);
+        listAttributeAssignmentExpressions.add(attributeAssignmentExpression);
+    }
+
+    public void addAttributeAssignmentExpressions(Collection<AttributeAssignmentExpression> attributeAssignmentExpressionsIn) {
+        List<AttributeAssignmentExpression> listAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressionList(true);
+        listAttributeAssignmentExpressions.addAll(attributeAssignmentExpressionsIn);
+    }
+
+    /**
+     * Evaluates this <code>ObligationExpression</code> in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}
+     * to get an {@link com.att.research.xacml.api.Obligation} to include in a PDP result.
+     *
+     * @param evaluationContext the <code>EvaluationContext</code> in which to evaluate this <code>ObligationExpression</code>
+     * @param policyDefaults the <code>PolicyDefaults</code> to apply to the evaluation
+     * @return a new <code>Obliagion</code> from this <code>ObligationExpression</code>
+     * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error evaluating any of the <code>AttributeAssignmentExpression</code>s
+     */
+    public Obligation evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return null;
+        }
+        List<AttributeAssignment> listAttributeAssignments							= new ArrayList<AttributeAssignment>();
+        Iterator<AttributeAssignmentExpression> iterAttributeAssignmentExpressions	= this.getAttributeAssignmentExpressions();
+        if (iterAttributeAssignmentExpressions != null) {
+            while (iterAttributeAssignmentExpressions.hasNext()) {
+                AttributeAssignmentResult attributeAssignmentResult	= iterAttributeAssignmentExpressions.next().evaluate(evaluationContext, policyDefaults);
+                if (attributeAssignmentResult.isOk() && attributeAssignmentResult.getNumAttributeAssignments() > 0) {
+                    Iterator<AttributeAssignment> iterAttributeAssignments	= attributeAssignmentResult.getAttributeAssignments();
+                    while (iterAttributeAssignments.hasNext()) {
+                        listAttributeAssignments.add(iterAttributeAssignments.next());
+                    }
+                }
+            }
+        }
+        return new StdMutableObligation(this.getObligationId(), listAttributeAssignments);
+    }
+
+    /**
+     * Evaluates a <code>Collection</code> of <code>ObligationExpression</code>s in the given <code>EvaluationContext</code> and returns
+     * a <code>List</code> of <code>Obligation</code>s.
+     *
+     * @param evaluationContext
+     * @param policyDefaults
+     * @param listObligationExpressions
+     * @return
+     * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException
+     */
+    public static List<Obligation> evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults, Decision decision, Collection<ObligationExpression> listObligationExpressions) throws EvaluationException {
+        List<Obligation> listObligations	= new ArrayList<Obligation>();
+        Iterator<ObligationExpression> iterObligationExpressions	= listObligationExpressions.iterator();
+        while (iterObligationExpressions.hasNext()) {
+            ObligationExpression obligationExpression	= iterObligationExpressions.next();
+            obligationExpression.validateComponent();
+            if ( ! obligationExpression.isOk()) {
+                throw new EvaluationException(obligationExpression.getStatusMessage());
+            }
+            if (decision == null || obligationExpression.getRuleEffect().getDecision().equals(decision)) {
+                Obligation obligation	= obligationExpression.evaluate(evaluationContext, policyDefaults);
+                if (obligation != null) {
+                    listObligations.add(obligation);
+                }
+            }
+        }
+        return listObligations;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getObligationId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing ObligationId attribute");
+            return false;
+        } else if (this.getRuleEffect() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing FulfillOn attribute");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
+        }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java
index e249bf5..7eb10e4 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Policy.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -50,294 +50,294 @@
 
 /**
  * Policy extends {@link com.att.research.xacmlatt.pdp.policy.PolicyDef} to represent a XACML 3.0 Policy element.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class Policy extends PolicyDef {
-        private TargetedCombinerParameterMap<String,Rule>		ruleCombinerParameters	= new TargetedCombinerParameterMap<String,Rule>();
-        private VariableMap										variableMap				= new VariableMap();
-        private List<Rule>										rules					= new ArrayList<Rule>();
-        private List<CombiningElement<Rule>>					combiningRules;
-        private CombiningAlgorithm<Rule>						ruleCombiningAlgorithm;
-        
-        @Override
-        protected boolean validateComponent() {
-                if (super.validateComponent()) {
-                        if (this.getRuleCombiningAlgorithm() == null) {
-                                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing rule combining algorithm");
-                                return false;
-                        } else {
-                                return true;
-                        }
-                } else {
-                        return false;
-                }
+    private TargetedCombinerParameterMap<String,Rule>		ruleCombinerParameters	= new TargetedCombinerParameterMap<String,Rule>();
+    private VariableMap										variableMap				= new VariableMap();
+    private List<Rule>										rules					= new ArrayList<Rule>();
+    private List<CombiningElement<Rule>>					combiningRules;
+    private CombiningAlgorithm<Rule>						ruleCombiningAlgorithm;
+
+    @Override
+    protected boolean validateComponent() {
+        if (super.validateComponent()) {
+            if (this.getRuleCombiningAlgorithm() == null) {
+                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing rule combining algorithm");
+                return false;
+            } else {
+                return true;
+            }
+        } else {
+            return false;
         }
-        
-        /**
-         * Performs lazy evaluation of the combining parameters from this <code>Policy</code>.
-         * 
-         * @return the <code>List</code> of <code>CombiningElement</code>s for all of the <code>Rule</code>s
+    }
+
+    /**
+     * Performs lazy evaluation of the combining parameters from this <code>Policy</code>.
+     *
+     * @return the <code>List</code> of <code>CombiningElement</code>s for all of the <code>Rule</code>s
+     */
+    protected List<CombiningElement<Rule>> getCombiningRules() {
+        if (this.combiningRules == null) {
+            this.combiningRules			= new ArrayList<CombiningElement<Rule>>();
+            Iterator<Rule> iterRules	= this.getRules();
+            while (iterRules.hasNext()) {
+                Rule rule	= iterRules.next();
+                this.combiningRules.add(new CombiningElement<Rule>(rule, this.ruleCombinerParameters.getCombinerParameters(rule)));
+            }
+        }
+        return this.combiningRules;
+    }
+
+    public Policy(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
+        super(policySetParent, statusCodeIn, statusMessageIn);
+    }
+
+    public Policy(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public Policy(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public Policy(PolicySet policySetParent) {
+        super(policySetParent);
+    }
+
+    public Policy() {
+        super();
+        ruleCombinerParameters.getTargetedCombinerParameters();
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter}s for
+     * the {@link Rule}s in this <code>Policy</code>.
+     *
+     * @return an <code>Iterator</code> over the <code>TargetedCombinerParameter</code>s for this <code>Policy</code>.
+     */
+    public Iterator<TargetedCombinerParameter<String,Rule>> getRuleCombinerParameters() {
+        return this.ruleCombinerParameters.getTargetedCombinerParameters();
+    }
+
+    /**
+     * Sets the Rule combiner parameters for this <code>Policy</code> to the contents of the given <code>Collection</code> of
+     * <code>TargetedCombinerParameter</code>s.
+     *
+     * @param ruleCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to set
+     */
+    public void setRuleCombinerParameters(Collection<TargetedCombinerParameter<String,Rule>> ruleCombinerParameters) {
+        this.ruleCombinerParameters.setCombinerParameters(ruleCombinerParameters);
+    }
+
+    /**
+     * Adds the given <code>TargetedCombinerParameter</code> to the set of Rule combiner parameters for this <code>Policy</code>.
+     * @param ruleCombinerParameter the <code>TargetedCombinerParameter</code> for <code>Rule</code>s to add.
+     */
+    public void addRuleCombinerParameter(TargetedCombinerParameter<String,Rule> ruleCombinerParameter) {
+        this.ruleCombinerParameters.addCombinerParameter(ruleCombinerParameter);
+    }
+
+    /**
+     * Adds the contents of the given <code>Collection</code> of <code>TargetedCombinerParameter</code>s to the set of Rule combiner parameters
+     * for this <code>Policy</code>.
+     *
+     * @param ruleCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to add
+     */
+    public void addRuleCombinerParameters(Collection<TargetedCombinerParameter<String,Rule>> ruleCombinerParameters) {
+        this.ruleCombinerParameters.addCombinerParameters(ruleCombinerParameters);
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.VariableDefinition}s in this <code>Policy</code>.
+     *
+     * @return an <code>Iterator</code> over the <code>VariableDefinition</code>s in this <code>Policy</code>
+     */
+    public Iterator<VariableDefinition> getVariableDefinitions() {
+        return this.variableMap.getVariableDefinitions();
+    }
+
+    /**
+     * Gets the <code>VariableDefinition</code> for the given <code>String</code> variable identifier.
+     *
+     * @param variableId the <code>String</code> variable identifier
+     * @return the <code>VariableDefinition</code> with the given <code>String</code> identifier or null if not found
+     */
+    public VariableDefinition getVariableDefinition(String variableId) {
+        return this.variableMap.getVariableDefinition(variableId);
+    }
+
+    /**
+     * Sets the <code>VariableDefinition</code>s in this <code>Policy</code> to the contents of the given <code>Collection</code>.
+     *
+     * @param listVariableDefinitions the <code>Collection</code> of <code>VariableDefinition</code>s to set
+     */
+    public void setVariableDefinitions(Collection<VariableDefinition> listVariableDefinitions) {
+        this.variableMap.setVariableDefinitions(listVariableDefinitions);
+    }
+
+    /**
+     * Adds the given <code>VariableDefinition</code> to the set of <code>VariableDefinition</code>s for this <code>Policy</code>.
+     *
+     * @param variableDefinition the <code>VariableDefinition</code> to add
+     */
+    public void addVariableDefinition(VariableDefinition variableDefinition) {
+        this.variableMap.add(variableDefinition);
+    }
+
+    /**
+     * Adds the contents of the given <code>Collection</code> of <code>VariableDefinition</code>s to this <code>Policy</code>.
+     *
+     * @param variableDefinitions the <code>Collection</code> of <code>VariableDefinition</code>s to add.
+     */
+    public void addVariableDefinitions(Collection<VariableDefinition> variableDefinitions) {
+        this.variableMap.addVariableDefinitions(variableDefinitions);
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the <code>Rule</code>s in this <code>Policy</code> or null if there are none.
+     *
+     * @return an <code>Iterator</code> over the <code>Rule</code>s in this <code>Policy</code> or null if there are none.
+     */
+    public Iterator<Rule> getRules() {
+        return this.rules.iterator();
+    }
+
+    /**
+     * Sets the <code>Rule</code>s for this <code>Policy</code> to the contents of the given <code>Collection</code> of
+     * <code>Rule</code>s. If the <code>Collection</code> is null, the set of <code>Rule</code>s for this <code>Policy</code> is set to null.
+     *
+     * @param listRules the <code>Collection</code> of <code>Rule</code>s or null
+     */
+    public void setRules(Collection<Rule> listRules) {
+        this.rules.clear();
+        if (listRules != null) {
+            this.addRules(listRules);
+        }
+    }
+
+    /**
+     * Adds the given <code>Rule</code> to the set of <code>Rule</code>s for this <code>Policy</code>.
+     *
+     * @param rule the <code>Rule</code> to add
+     */
+    public void addRule(Rule rule) {
+        this.rules.add(rule);
+    }
+
+    /**
+     * Adds the contents of the given <code>Collection</code> of <code>Rule</code>s to the set of <code>Rule</code>s for
+     * this <code>Policy</code>.
+     *
+     * @param listRules the <code>Collection</code> of <code>Rule</code>s to add
+     */
+    public void addRules(Collection<Rule> listRules) {
+        this.rules.addAll(listRules);
+    }
+
+    /**
+     * Gets the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>.
+     *
+     * @return the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>.
+     */
+    public CombiningAlgorithm<Rule> getRuleCombiningAlgorithm() {
+        return this.ruleCombiningAlgorithm;
+    }
+
+    /**
+     * Sets the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>>
+     *
+     * @param ruleCombiningAlgorithmIn the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>
+     */
+    public void setRuleCombiningAlgorithm(CombiningAlgorithm<Rule> ruleCombiningAlgorithmIn) {
+        this.ruleCombiningAlgorithm	= ruleCombiningAlgorithmIn;
+    }
+
+    @Override
+    public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
+        /*
+         * First check to see if we are valid.  If not, return an error status immediately
          */
-        protected List<CombiningElement<Rule>> getCombiningRules() {
-                if (this.combiningRules == null) {
-                        this.combiningRules			= new ArrayList<CombiningElement<Rule>>();
-                        Iterator<Rule> iterRules	= this.getRules();
-                        while (iterRules.hasNext()) {
-                                Rule rule	= iterRules.next();
-                                this.combiningRules.add(new CombiningElement<Rule>(rule, this.ruleCombinerParameters.getCombinerParameters(rule)));
-                        }
-                }
-                return this.combiningRules;
-        }
-        
-        public Policy(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
-                super(policySetParent, statusCodeIn, statusMessageIn);
-        }
-        
-        public Policy(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
-        
-        public Policy(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-        
-        public Policy(PolicySet policySetParent) {
-                super(policySetParent);
+        if (!this.validate()) {
+            return new EvaluationResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
 
-        public Policy() {
-                super();
-                ruleCombinerParameters.getTargetedCombinerParameters();
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter}s for
-         * the {@link Rule}s in this <code>Policy</code>.
-         * 
-         * @return an <code>Iterator</code> over the <code>TargetedCombinerParameter</code>s for this <code>Policy</code>.
+        /*
+         * See if we match
          */
-        public Iterator<TargetedCombinerParameter<String,Rule>> getRuleCombinerParameters() {
-                return this.ruleCombinerParameters.getTargetedCombinerParameters();
+        MatchResult thisMatchResult	= this.match(evaluationContext);
+        assert(thisMatchResult != null);
+        if (evaluationContext.isTracing()) {
+            evaluationContext.trace(new StdTraceEvent<MatchResult>("Match", this, thisMatchResult));
         }
-        
-        /**
-         * Sets the Rule combiner parameters for this <code>Policy</code> to the contents of the given <code>Collection</code> of
-         * <code>TargetedCombinerParameter</code>s.
-         * 
-         * @param ruleCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to set
-         */
-        public void setRuleCombinerParameters(Collection<TargetedCombinerParameter<String,Rule>> ruleCombinerParameters) {
-                this.ruleCombinerParameters.setCombinerParameters(ruleCombinerParameters);
-        }
-        
-        /**
-         * Adds the given <code>TargetedCombinerParameter</code> to the set of Rule combiner parameters for this <code>Policy</code>.
-         * @param ruleCombinerParameter the <code>TargetedCombinerParameter</code> for <code>Rule</code>s to add.
-         */
-        public void addRuleCombinerParameter(TargetedCombinerParameter<String,Rule> ruleCombinerParameter) {
-                this.ruleCombinerParameters.addCombinerParameter(ruleCombinerParameter);
-        }
-        
-        /**
-         * Adds the contents of the given <code>Collection</code> of <code>TargetedCombinerParameter</code>s to the set of Rule combiner parameters
-         * for this <code>Policy</code>.
-         * 
-         * @param ruleCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to add
-         */
-        public void addRuleCombinerParameters(Collection<TargetedCombinerParameter<String,Rule>> ruleCombinerParameters) {
-                this.ruleCombinerParameters.addCombinerParameters(ruleCombinerParameters);
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.VariableDefinition}s in this <code>Policy</code>.
-         * 
-         * @return an <code>Iterator</code> over the <code>VariableDefinition</code>s in this <code>Policy</code>
-         */
-        public Iterator<VariableDefinition> getVariableDefinitions() {
-                return this.variableMap.getVariableDefinitions();
-        }
-        
-        /**
-         * Gets the <code>VariableDefinition</code> for the given <code>String</code> variable identifier.
-         * 
-         * @param variableId the <code>String</code> variable identifier
-         * @return the <code>VariableDefinition</code> with the given <code>String</code> identifier or null if not found
-         */
-        public VariableDefinition getVariableDefinition(String variableId) {
-                return this.variableMap.getVariableDefinition(variableId);
-        }
-        
-        /**
-         * Sets the <code>VariableDefinition</code>s in this <code>Policy</code> to the contents of the given <code>Collection</code>.
-         * 
-         * @param listVariableDefinitions the <code>Collection</code> of <code>VariableDefinition</code>s to set
-         */
-        public void setVariableDefinitions(Collection<VariableDefinition> listVariableDefinitions) {
-                this.variableMap.setVariableDefinitions(listVariableDefinitions);
-        }
-        
-        /**
-         * Adds the given <code>VariableDefinition</code> to the set of <code>VariableDefinition</code>s for this <code>Policy</code>.
-         * 
-         * @param variableDefinition the <code>VariableDefinition</code> to add
-         */
-        public void addVariableDefinition(VariableDefinition variableDefinition) {
-                this.variableMap.add(variableDefinition);
-        }
-        
-        /**
-         * Adds the contents of the given <code>Collection</code> of <code>VariableDefinition</code>s to this <code>Policy</code>.
-         * 
-         * @param variableDefinitions the <code>Collection</code> of <code>VariableDefinition</code>s to add.
-         */
-        public void addVariableDefinitions(Collection<VariableDefinition> variableDefinitions) {
-                this.variableMap.addVariableDefinitions(variableDefinitions);
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the <code>Rule</code>s in this <code>Policy</code> or null if there are none.
-         * 
-         * @return an <code>Iterator</code> over the <code>Rule</code>s in this <code>Policy</code> or null if there are none.
-         */
-        public Iterator<Rule> getRules() {
-                return this.rules.iterator();
-        }
-        
-        /**
-         * Sets the <code>Rule</code>s for this <code>Policy</code> to the contents of the given <code>Collection</code> of
-         * <code>Rule</code>s. If the <code>Collection</code> is null, the set of <code>Rule</code>s for this <code>Policy</code> is set to null.
-         * 
-         * @param listRules the <code>Collection</code> of <code>Rule</code>s or null
-         */
-        public void setRules(Collection<Rule> listRules) {
-                this.rules.clear();
-                if (listRules != null) {
-                        this.addRules(listRules);
-                }
-        }
-        
-        /**
-         * Adds the given <code>Rule</code> to the set of <code>Rule</code>s for this <code>Policy</code>.
-         * 
-         * @param rule the <code>Rule</code> to add
-         */
-        public void addRule(Rule rule) {
-                this.rules.add(rule);
-        }
-        
-        /**
-         * Adds the contents of the given <code>Collection</code> of <code>Rule</code>s to the set of <code>Rule</code>s for
-         * this <code>Policy</code>.
-         * 
-         * @param listRules the <code>Collection</code> of <code>Rule</code>s to add
-         */
-        public void addRules(Collection<Rule> listRules) {
-                this.rules.addAll(listRules);
-        }
-        
-        /**
-         * Gets the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>.
-         * 
-         * @return the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>.
-         */
-        public CombiningAlgorithm<Rule> getRuleCombiningAlgorithm() {
-                return this.ruleCombiningAlgorithm;
-        }
-        
-        /**
-         * Sets the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>>
-         * 
-         * @param ruleCombiningAlgorithmIn the <code>CombiningAlgorithm</code> for <code>Rule</code>s for this <code>Policy</code>
-         */
-        public void setRuleCombiningAlgorithm(CombiningAlgorithm<Rule> ruleCombiningAlgorithmIn) {
-                this.ruleCombiningAlgorithm	= ruleCombiningAlgorithmIn;
+        switch(thisMatchResult.getMatchCode()) {
+        case INDETERMINATE:
+            return new EvaluationResult(Decision.INDETERMINATE, thisMatchResult.getStatus());
+        case MATCH:
+            break;
+        case NOMATCH:
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
         }
 
-        @Override
-        public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
-                /*
-                 * First check to see if we are valid.  If not, return an error status immediately
-                 */
-                if (!this.validate()) {
-                        return new EvaluationResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                /*
-                 * See if we match
-                 */
-                MatchResult thisMatchResult	= this.match(evaluationContext);
-                assert(thisMatchResult != null);
-                if (evaluationContext.isTracing()) {
-                        evaluationContext.trace(new StdTraceEvent<MatchResult>("Match", this, thisMatchResult));
-                }
-                switch(thisMatchResult.getMatchCode()) {
-                case INDETERMINATE:
-                        return new EvaluationResult(Decision.INDETERMINATE, thisMatchResult.getStatus());
-                case MATCH:
-                        break;
-                case NOMATCH:
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
-                }
-                
-                /*
-                 * Get the combining elements
-                 */
-                List<CombiningElement<Rule>> ruleCombiningElements	= this.getCombiningRules();
-                assert(ruleCombiningElements != null);
-                
-                /*
-                 * Run the combining algorithm
-                 */
-                assert(this.getRuleCombiningAlgorithm() != null);
-                EvaluationResult evaluationResultCombined	= this.getRuleCombiningAlgorithm().combine(evaluationContext, ruleCombiningElements, this.getCombinerParameterList());
-                assert(evaluationResultCombined != null);
-                
-                if (evaluationResultCombined.getDecision() == Decision.DENY || evaluationResultCombined.getDecision() == Decision.PERMIT) {
-                        this.updateResult(evaluationResultCombined, evaluationContext);
-                        
-                        /*
-                         * Add my id to the policy identifiers
-                         */
-                        if (evaluationContext.getRequest().getReturnPolicyIdList()) {
-                                evaluationResultCombined.addPolicyIdentifier(this.getIdReference());
-                        }
-                }
-                if (evaluationContext.isTracing()) {
-                        evaluationContext.trace(new StdTraceEvent<Result>("Result", this, evaluationResultCombined));
-                }
-                return evaluationResultCombined;
+        /*
+         * Get the combining elements
+         */
+        List<CombiningElement<Rule>> ruleCombiningElements	= this.getCombiningRules();
+        assert(ruleCombiningElements != null);
+
+        /*
+         * Run the combining algorithm
+         */
+        assert(this.getRuleCombiningAlgorithm() != null);
+        EvaluationResult evaluationResultCombined	= this.getRuleCombiningAlgorithm().combine(evaluationContext, ruleCombiningElements, this.getCombinerParameterList());
+        assert(evaluationResultCombined != null);
+
+        if (evaluationResultCombined.getDecision() == Decision.DENY || evaluationResultCombined.getDecision() == Decision.PERMIT) {
+            this.updateResult(evaluationResultCombined, evaluationContext);
+
+            /*
+             * Add my id to the policy identifiers
+             */
+            if (evaluationContext.getRequest().getReturnPolicyIdList()) {
+                evaluationResultCombined.addPolicyIdentifier(this.getIdReference());
+            }
+        }
+        if (evaluationContext.isTracing()) {
+            evaluationContext.trace(new StdTraceEvent<Result>("Result", this, evaluationResultCombined));
+        }
+        return evaluationResultCombined;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        String iteratorToDump;
+        if ((iteratorToDump = StringUtils.toString(this.getRuleCombinerParameters())) != null) {
+            stringBuilder.append(",ruleCombinerParameters=");
+            stringBuilder.append(iteratorToDump);
+        }
+        if ((iteratorToDump = StringUtils.toString(this.getVariableDefinitions())) != null) {
+            stringBuilder.append(",variableDefinitions=");
+            stringBuilder.append(iteratorToDump);
+        }
+        if ((iteratorToDump = StringUtils.toString(this.getRules())) != null) {
+            stringBuilder.append(",rules=");
+            stringBuilder.append(iteratorToDump);
         }
 
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                String iteratorToDump;
-                if ((iteratorToDump = StringUtils.toString(this.getRuleCombinerParameters())) != null) {
-                        stringBuilder.append(",ruleCombinerParameters=");
-                        stringBuilder.append(iteratorToDump);
-                }
-                if ((iteratorToDump = StringUtils.toString(this.getVariableDefinitions())) != null) {
-                        stringBuilder.append(",variableDefinitions=");
-                        stringBuilder.append(iteratorToDump);
-                }
-                if ((iteratorToDump = StringUtils.toString(this.getRules())) != null) {
-                        stringBuilder.append(",rules=");
-                        stringBuilder.append(iteratorToDump);
-                }
-                
-                Object objectToDump;
-                if ((objectToDump = this.getRuleCombiningAlgorithm()) != null) {
-                        stringBuilder.append(",ruleCombiningAlgorithm=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        Object objectToDump;
+        if ((objectToDump = this.getRuleCombiningAlgorithm()) != null) {
+            stringBuilder.append(",ruleCombiningAlgorithm=");
+            stringBuilder.append(objectToDump.toString());
         }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java
index d04acae..ff16116 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyComponent.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,129 +36,129 @@
 /**
  * PolicyComponent is the base class for all pieces of a XACML Policy or PolicySet that could potentially have errors associated
  * with them by the policy loader.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 abstract class PolicyComponent {
-        private StatusCode	statusCode;
-        private String		statusMessage;
-        
-        /**
-         * Creates a new <code>PolicyComponent</code> with the given {@link com.att.research.xacml.api.StatusCode} and
-         * <code>String</code> detailed message.  If the <code>StatusCode</code> is null, a default OK status code is used.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> for the new <code>PolicyComponent</code>
-         * @param statusMessageIn the <code>String</code> detailed status message for the new <code>PolicyComponent</code>
-         */
-        public PolicyComponent(StatusCode statusCodeIn, String statusMessageIn) {
-                this.statusCode		= statusCodeIn;
-                this.statusMessage	= statusMessageIn;
+    private StatusCode	statusCode;
+    private String		statusMessage;
+
+    /**
+     * Creates a new <code>PolicyComponent</code> with the given {@link com.att.research.xacml.api.StatusCode} and
+     * <code>String</code> detailed message.  If the <code>StatusCode</code> is null, a default OK status code is used.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> for the new <code>PolicyComponent</code>
+     * @param statusMessageIn the <code>String</code> detailed status message for the new <code>PolicyComponent</code>
+     */
+    public PolicyComponent(StatusCode statusCodeIn, String statusMessageIn) {
+        this.statusCode		= statusCodeIn;
+        this.statusMessage	= statusMessageIn;
+    }
+
+    /**
+     * Creates a new <code>PolicyComponent</code> with the given <code>StatusCode</code> and no status message.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> for the new <code>PolicyComponent</code>
+     */
+    public PolicyComponent(StatusCode statusCodeIn) {
+        this(statusCodeIn, null);
+    }
+
+    /**
+     * Creates a new <code>PolicyCOmponent</code> with no <code>StatusCode</code> or status message.
+     */
+    public PolicyComponent() {
+        this(null, null);
+    }
+
+    /**
+     * Gets the <code>StatusCode</code> associated with this <code>PolicyComponent</code>.
+     *
+     * @return the <code>StatusCode</code> associated with this <code>PolicyComponent</code>
+     */
+    public StatusCode getStatusCode() {
+        return this.statusCode;
+    }
+
+    /**
+     * Gets the <code>String</code> status message associated with this <code>PolicyComponent</code>.
+     *
+     * @return the <code>String</code> status message associated with this <code>PolicyComponent</code> or null if none
+     */
+    public String getStatusMessage() {
+        return this.statusMessage;
+    }
+
+    /**
+     * Sets the <code>StatusCode</code> and <code>String</code> status message for this <code>PolicyComponent</code>.
+     * This method is mainly provided for objects that may have lazy evaluations performed on them, in which case the
+     * status is not determined until the object is actually used.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> for this <code>PolicyComponent</code>
+     * @param messageIn the <code>String</code> status message for this <code>PolicyComponent</code>
+     */
+    public void setStatus(StatusCode statusCodeIn, String messageIn) {
+        this.statusCode		= statusCodeIn;
+        this.statusMessage	= messageIn;
+    }
+
+    /**
+     * Does a check on the <code>StatusCode</code> for this element to determine if it is equivalent to the
+     * OK status code.
+     *
+     * @return true if the <code>StatusCode</code> is equivalent to OK, otherwise false
+     */
+    public boolean isOk() {
+        return StdStatusCode.STATUS_CODE_OK.equals(this.getStatusCode());
+    }
+
+    /**
+     * Validates that this <code>PolicyComponent</code> has all of the required elements according to the XACML 3.0
+     * specification.  If the component is not valid, this method should set the <code>StatusCode</code> to reflect a
+     * syntax error, and should set the status message to reflect the invalid piece(s).
+     *
+     * <code>PolicyComponent</code>s that implement this method should only validate their immediate elements and not perform
+     * a deep validation of descendents.
+     *
+     * @return true if the resulting status code is OK, otherwise false
+     */
+    abstract protected boolean validateComponent();
+
+    /**
+     * If a <code>StatusCode</code> has not been set, ask this <code>PolicyComponent</code> to validate itself and return
+     * the value from the validation.  Otherwise, check to see if the cached <code>StatusCode</code> indicates this <code>PolicyComponent</code> is valid.
+     *
+     * @return true if this <code>PolicyComponent</code> is valid, else false.
+     */
+    public boolean validate() {
+        if (this.getStatusCode() == null) {
+            return this.validateComponent();
+        } else {
+            return this.isOk();
         }
-        
-        /**
-         * Creates a new <code>PolicyComponent</code> with the given <code>StatusCode</code> and no status message.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> for the new <code>PolicyComponent</code>
-         */
-        public PolicyComponent(StatusCode statusCodeIn) {
-                this(statusCodeIn, null);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        Object objectToDump;
+        boolean needsComma	= false;
+        if ((objectToDump = this.getStatusCode()) != null) {
+            stringBuilder.append("statusCode=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
-        
-        /**
-         * Creates a new <code>PolicyCOmponent</code> with no <code>StatusCode</code> or status message.
-         */
-        public PolicyComponent() {
-                this(null, null);
+        if ((objectToDump = this.getStatusMessage()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("statusMessage=");
+            stringBuilder.append((String)objectToDump);
+            needsComma	= true;
         }
-        
-        /**
-         * Gets the <code>StatusCode</code> associated with this <code>PolicyComponent</code>.
-         * 
-         * @return the <code>StatusCode</code> associated with this <code>PolicyComponent</code>
-         */
-        public StatusCode getStatusCode() {
-                return this.statusCode;
-        }
-        
-        /**
-         * Gets the <code>String</code> status message associated with this <code>PolicyComponent</code>.
-         * 
-         * @return the <code>String</code> status message associated with this <code>PolicyComponent</code> or null if none
-         */
-        public String getStatusMessage() {
-                return this.statusMessage;
-        }
-        
-        /**
-         * Sets the <code>StatusCode</code> and <code>String</code> status message for this <code>PolicyComponent</code>.
-         * This method is mainly provided for objects that may have lazy evaluations performed on them, in which case the
-         * status is not determined until the object is actually used.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> for this <code>PolicyComponent</code>
-         * @param messageIn the <code>String</code> status message for this <code>PolicyComponent</code>
-         */
-        public void setStatus(StatusCode statusCodeIn, String messageIn) {
-                this.statusCode		= statusCodeIn;
-                this.statusMessage	= messageIn;
-        }
-        
-        /**
-         * Does a check on the <code>StatusCode</code> for this element to determine if it is equivalent to the
-         * OK status code.
-         * 
-         * @return true if the <code>StatusCode</code> is equivalent to OK, otherwise false
-         */
-        public boolean isOk() {
-                return StdStatusCode.STATUS_CODE_OK.equals(this.getStatusCode());
-        }
-        
-        /**
-         * Validates that this <code>PolicyComponent</code> has all of the required elements according to the XACML 3.0
-         * specification.  If the component is not valid, this method should set the <code>StatusCode</code> to reflect a
-         * syntax error, and should set the status message to reflect the invalid piece(s).
-         * 
-         * <code>PolicyComponent</code>s that implement this method should only validate their immediate elements and not perform
-         * a deep validation of descendents.
-         * 
-         * @return true if the resulting status code is OK, otherwise false
-         */
-        abstract protected boolean validateComponent();
-        
-        /**
-         * If a <code>StatusCode</code> has not been set, ask this <code>PolicyComponent</code> to validate itself and return
-         * the value from the validation.  Otherwise, check to see if the cached <code>StatusCode</code> indicates this <code>PolicyComponent</code> is valid.
-         * 
-         * @return true if this <code>PolicyComponent</code> is valid, else false.
-         */
-        public boolean validate() {
-                if (this.getStatusCode() == null) {
-                        return this.validateComponent();
-                } else {
-                        return this.isOk();
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                Object objectToDump;
-                boolean needsComma	= false;
-                if ((objectToDump = this.getStatusCode()) != null) {
-                        stringBuilder.append("statusCode=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getStatusMessage()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("statusMessage=");
-                        stringBuilder.append((String)objectToDump);
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java
index 15d41a3..881e436 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDef.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -55,442 +55,442 @@
 /**
  * PolicyDef extends {@link com.att.research.xacmlatt.pdp.policy.PolicySetChild} with members and methods common
  * to XACML 3.0 Policies and PolicySets.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public abstract class PolicyDef extends PolicySetChild {
-        private String 						description;
-        private PolicyIssuer 				policyIssuer;
-        private Target 						target;
-        private List<CombinerParameter> 	combinerParameters;
-        private List<ObligationExpression> 	obligationExpressions;
-        private List<AdviceExpression> 		adviceExpressions;
-        private Version						version;
-        private Integer 					maxDelegationDepth;
-        
-        private IdReference					idReference;
+    private String 						description;
+    private PolicyIssuer 				policyIssuer;
+    private Target 						target;
+    private List<CombinerParameter> 	combinerParameters;
+    private List<ObligationExpression> 	obligationExpressions;
+    private List<AdviceExpression> 		adviceExpressions;
+    private Version						version;
+    private Integer 					maxDelegationDepth;
 
-        private void ensureCombinerParameters() {
-                if (this.combinerParameters == null) {
-                        this.combinerParameters	= new ArrayList<CombinerParameter>();
-                }
+    private IdReference					idReference;
+
+    private void ensureCombinerParameters() {
+        if (this.combinerParameters == null) {
+            this.combinerParameters	= new ArrayList<CombinerParameter>();
         }
-        
-        private void ensureObligationExpressions() {
-                if (this.obligationExpressions == null) {
-                        this.obligationExpressions	= new ArrayList<ObligationExpression>();
-                }
+    }
+
+    private void ensureObligationExpressions() {
+        if (this.obligationExpressions == null) {
+            this.obligationExpressions	= new ArrayList<ObligationExpression>();
         }
-        
-        private void ensureAdviceExpressions() {
-                if (this.adviceExpressions == null) {
-                        this.adviceExpressions	= new ArrayList<AdviceExpression>();
-                }
+    }
+
+    private void ensureAdviceExpressions() {
+        if (this.adviceExpressions == null) {
+            this.adviceExpressions	= new ArrayList<AdviceExpression>();
         }
-        
-        protected List<CombinerParameter> getCombinerParameterList() {
-                return this.combinerParameters;
-        }
-        
-        protected List<ObligationExpression> getObligationExpressionList() {
-                return this.obligationExpressions;
-        }
-        
-        protected List<AdviceExpression> getAdviceExpressionList() {
-                return this.adviceExpressions;
-        }
-        
-        protected void updateResult(EvaluationResult evaluationResult, EvaluationContext evaluationContext) throws EvaluationException {
-                List<ObligationExpression> thisObligationExpressions	= this.getObligationExpressionList();
-                if (thisObligationExpressions != null && thisObligationExpressions.size() > 0) {
-                        List<Obligation> listObligations	= ObligationExpression.evaluate(evaluationContext, this.getPolicyDefaults(), evaluationResult.getDecision(), thisObligationExpressions);
-                        if (listObligations != null && listObligations.size() > 0) {
-                                evaluationResult.addObligations(listObligations);
-                        }
-                }
-                
-                List<AdviceExpression> thisAdviceExpressions			= this.getAdviceExpressionList();
-                if (thisAdviceExpressions != null && thisAdviceExpressions.size() > 0) {
-                        List<Advice> listAdvices			= AdviceExpression.evaluate(evaluationContext, this.getPolicyDefaults(), evaluationResult.getDecision(), thisAdviceExpressions);
-                        if (listAdvices != null && listAdvices.size() > 0) {
-                                evaluationResult.addAdvice(listAdvices);
-                        }
-                }
-        }
-        
-        @Override
-        protected boolean validateComponent() {
-                if (super.validateComponent()) {
-                        if (this.getVersion() == null) {
-                                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing version string");
-                                return false;
-                        } else if (this.getTarget() == null) {
-                                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Target in policy " + this.getIdReference().getId().stringValue());
-                                return false;
-                        } else {
-                                return true;
-                        }
-                } else {
-                        return false;
-                }
-        }
-        
-        public PolicyDef(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
-                super(policySetParent, statusCodeIn, statusMessageIn);
-        }
-        
-        public PolicyDef(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
-        
-        public PolicyDef(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-        
-        public PolicyDef(PolicySet policySetParent) {
-                super(policySetParent);
+    }
+
+    protected List<CombinerParameter> getCombinerParameterList() {
+        return this.combinerParameters;
+    }
+
+    protected List<ObligationExpression> getObligationExpressionList() {
+        return this.obligationExpressions;
+    }
+
+    protected List<AdviceExpression> getAdviceExpressionList() {
+        return this.adviceExpressions;
+    }
+
+    protected void updateResult(EvaluationResult evaluationResult, EvaluationContext evaluationContext) throws EvaluationException {
+        List<ObligationExpression> thisObligationExpressions	= this.getObligationExpressionList();
+        if (thisObligationExpressions != null && thisObligationExpressions.size() > 0) {
+            List<Obligation> listObligations	= ObligationExpression.evaluate(evaluationContext, this.getPolicyDefaults(), evaluationResult.getDecision(), thisObligationExpressions);
+            if (listObligations != null && listObligations.size() > 0) {
+                evaluationResult.addObligations(listObligations);
+            }
         }
 
-        public PolicyDef() {
-                super();
+        List<AdviceExpression> thisAdviceExpressions			= this.getAdviceExpressionList();
+        if (thisAdviceExpressions != null && thisAdviceExpressions.size() > 0) {
+            List<Advice> listAdvices			= AdviceExpression.evaluate(evaluationContext, this.getPolicyDefaults(), evaluationResult.getDecision(), thisAdviceExpressions);
+            if (listAdvices != null && listAdvices.size() > 0) {
+                evaluationResult.addAdvice(listAdvices);
+            }
         }
-        
-        @Override
-        public void setIdentifier(Identifier identifierIn) {
-                super.setIdentifier(identifierIn);
-                this.idReference 	= null;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (super.validateComponent()) {
+            if (this.getVersion() == null) {
+                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing version string");
+                return false;
+            } else if (this.getTarget() == null) {
+                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Target in policy " + this.getIdReference().getId().stringValue());
+                return false;
+            } else {
+                return true;
+            }
+        } else {
+            return false;
         }
-        
-        /**
-         * Gets the <code>String</code> description of this <code>PolicyDef</code>.
-         * 
-         * @return the <code>String</code> description of this <code>PolicyDef</code>.
-         */
-        public String getDescription() {
-                return this.description;
+    }
+
+    public PolicyDef(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
+        super(policySetParent, statusCodeIn, statusMessageIn);
+    }
+
+    public PolicyDef(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public PolicyDef(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public PolicyDef(PolicySet policySetParent) {
+        super(policySetParent);
+    }
+
+    public PolicyDef() {
+        super();
+    }
+
+    @Override
+    public void setIdentifier(Identifier identifierIn) {
+        super.setIdentifier(identifierIn);
+        this.idReference 	= null;
+    }
+
+    /**
+     * Gets the <code>String</code> description of this <code>PolicyDef</code>.
+     *
+     * @return the <code>String</code> description of this <code>PolicyDef</code>.
+     */
+    public String getDescription() {
+        return this.description;
+    }
+
+    /**
+     * Sets the <code>String</code> description of this <code>PolicyDef</code>.
+     *
+     * @param s the <code>String</code> description of this <code>PolicyDef</code>
+     */
+    public void setDescription(String s) {
+        this.description	= s;
+    }
+
+    /**
+     * Gets the {@link com.att.research.xacmlatt.pdp.policy.PolicyIssuer} for this <code>PolicyDef</code>.
+     *
+     * @return the <code>PolicyIssuer</code> for this <code>PolicyDef</code>
+     */
+    public PolicyIssuer getPolicyIssuer() {
+        return this.policyIssuer;
+    }
+
+    /**
+     * Sets the <code>PolicyIssuer</code> for this <code>PolicyDef</code>.
+     *
+     * @param policyIssuerIn the <code>PolicyIssuer</code> for this <code>PolicyDef</code>.
+     */
+    public void setPolicyIssuer(PolicyIssuer policyIssuerIn) {
+        this.policyIssuer	= policyIssuerIn;
+    }
+
+    /**
+     * Gets the <code>Target</code> for this <code>PolicyDef</code>.
+     *
+     * @return the <code>Target</code> for this <code>PolicyDef</code>
+     */
+    public Target getTarget() {
+        return this.target;
+    }
+
+    /**
+     * Sets the <code>Target</code> for this <code>PolicyDef</code>.
+     *
+     * @param targetIn the <code>Target</code> for this <code>PolicyDef</code>
+     */
+    public void setTarget(Target targetIn) {
+        this.target	= targetIn;
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the <code>CombinerParameter</code>s for this <code>Policy</code>.
+     *
+     * @return an <code>Iterator</code> over the <code>CombinerParameter</code>s for this <code>Policy</code> or null if there are none
+     */
+    public Iterator<CombinerParameter> getCombinerParameters() {
+        return (this.combinerParameters == null ? null : this.combinerParameters.iterator());
+    }
+
+    /**
+     * Sets the <code>CombinerParameter</code>s for this<code>Policy</code> to the contents of the
+     * given <code>Collection</code>.  If the <code>Collection</code> is null, the set of <code>CombinerParameter</code>s
+     * for this <code>Policy</code> is set to null.
+     *
+     * @param combinerParametersIn the <code>Collection</code> of <code>CombinerParameter</code>s for this <code>PolicyDef</code>
+     */
+    public void setCombinerParameters(Collection<CombinerParameter> combinerParametersIn) {
+        this.combinerParameters	= null;
+        if (combinerParametersIn != null) {
+            this.addCombinerParameters(combinerParametersIn);
         }
-        
-        /**
-         * Sets the <code>String</code> description of this <code>PolicyDef</code>.
-         * 
-         * @param s the <code>String</code> description of this <code>PolicyDef</code>
-         */
-        public void setDescription(String s) {
-                this.description	= s;
+    }
+
+    /**
+     * Adds the given <code>CombinerParameter</code> to the set of <code>CombinerParameter</code>s for this
+     * <code>PolicyDef</code>>
+     *
+     * @param combinerParameter the <code>CombinerParameter</code> to add
+     */
+    public void add(CombinerParameter combinerParameter) {
+        this.ensureCombinerParameters();
+        this.combinerParameters.add(combinerParameter);
+    }
+
+    /**
+     * Adds the given <code>Collection</code> of <code>CombinerParameter</code>s to this <code>PolicyDef</code>>
+     *
+     * @param combinerParametersIn the <code>Collection</code> of <code>CombinerParameter</code>s to add
+     */
+    public void addCombinerParameters(Collection<CombinerParameter> combinerParametersIn) {
+        this.ensureCombinerParameters();
+        this.combinerParameters.addAll(combinerParametersIn);
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
+     *
+     * @return an <code>Iterator</code> over the <code>ObligationExpression</code>s for this <code>PolicyDef</code> or null if there are none.
+     */
+    public Iterator<ObligationExpression> getObligationExpressions() {
+        return (this.obligationExpressions == null ? null : this.obligationExpressions.iterator());
+    }
+
+    /**
+     * Sets the <code>ObligationExpression</code>s for this <code>PolicyDef</code> to the contents of the given <code>Collection</code>.
+     * If the <code>Collection</code> is null, the <code>ObligationExpression</code>s for this <code>PolicyDef</code> are set to null.
+     *
+     * @param obligationExpressionsIn the <code>Collection</code> of <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
+     */
+    public void setObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
+        this.obligationExpressions	= null;
+        if (obligationExpressionsIn != null) {
+            this.addObligationExpressions(obligationExpressionsIn);
         }
-        
-        /**
-         * Gets the {@link com.att.research.xacmlatt.pdp.policy.PolicyIssuer} for this <code>PolicyDef</code>.
-         * 
-         * @return the <code>PolicyIssuer</code> for this <code>PolicyDef</code>
-         */
-        public PolicyIssuer getPolicyIssuer() {
-                return this.policyIssuer;
+    }
+
+    /**
+     * Adds the given <code>ObligationExpression</code> to the set of <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
+     *
+     * @param obligationExpression the <code>ObligationExpression</code> to add
+     */
+    public void add(ObligationExpression obligationExpression) {
+        this.ensureObligationExpressions();
+        this.obligationExpressions.add(obligationExpression);
+    }
+
+    /**
+     * Adds the contents of the given <code>Collection</code> of <code>ObligationExpression</code>s to the set of <code>ObligationExpression</code>s for
+     * this <code>PolicyDef</code>.
+     *
+     * @param obligationExpressionsIn the <code>Collection</code> of <code>ObligationExpression</code>s to add
+     */
+    public void addObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
+        this.ensureObligationExpressions();
+        this.obligationExpressions.addAll(obligationExpressionsIn);
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code>.
+     *
+     * @return an <code>Iterator</code> over the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code> or null if there are none.
+     */
+    public Iterator<AdviceExpression> getAdviceExpressions() {
+        return (this.adviceExpressions == null ? null : this.adviceExpressions.iterator());
+    }
+
+    /**
+     * Sets the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code> to the contents of the given <code>Collection</code>.
+     *
+     * @param adviceExpressionsIn the <code>Collection</code> of <code>AdviceExpression</code> to add
+     */
+    public void setAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
+        this.adviceExpressions	= null;
+        if (adviceExpressionsIn != null) {
+            this.addAdviceExpressions(adviceExpressionsIn);
         }
-        
-        /**
-         * Sets the <code>PolicyIssuer</code> for this <code>PolicyDef</code>.
-         * 
-         * @param policyIssuerIn the <code>PolicyIssuer</code> for this <code>PolicyDef</code>.
-         */
-        public void setPolicyIssuer(PolicyIssuer policyIssuerIn) {
-                this.policyIssuer	= policyIssuerIn;
+    }
+
+    /**
+     * Adds the given <code>AdviceExpression</code> to the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code>.
+     *
+     * @param adviceExpression the <code>AdviceExpression</code> to add.
+     */
+    public void add(AdviceExpression adviceExpression) {
+        this.ensureAdviceExpressions();
+        this.adviceExpressions.add(adviceExpression);
+    }
+
+    /**
+     * Adds the contents of the given <code>Collection</code> of <code>AdviceExpression</code>s to the set of
+     * <code>AdviceExpression</code>s for this <code>PolicyDef</code>.
+     *
+     * @param adviceExpressionsIn the <code>Collection</code> of <code>AdviceExpression</code>s to add.
+     */
+    public void addAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
+        this.ensureAdviceExpressions();
+        this.adviceExpressions.addAll(adviceExpressionsIn);
+    }
+
+    /**
+     * Gets the <code>String</code> version for this <code>PolicyDef</code>.
+     *
+     * @return the <code>String</code> version for this <code>PolicyDef</code>.
+     */
+    public Version getVersion() {
+        return this.version;
+    }
+
+    /**
+     * Sets the version <code>String</code> for this <code>PolicyDef</code>>
+     *
+     * @param versionIn the <code>String</code> version for this <code>PolicyDef</code>
+     */
+    public void setVersion(Version versionIn) {
+        this.version		= versionIn;
+        this.idReference	= null;
+    }
+
+    /**
+     * Creates the <code>IdReference</code> for this <code>PolicyDef</code> if needed and returns it.
+     *
+     * @return the <code>IdReference</code> for this <code>PolicyDef</code>
+     */
+    public IdReference getIdReference() {
+        if (this.idReference == null) {
+            this.idReference	= new StdIdReference(this.getIdentifier(), this.getVersion());
         }
-        
-        /**
-         * Gets the <code>Target</code> for this <code>PolicyDef</code>.
-         * 
-         * @return the <code>Target</code> for this <code>PolicyDef</code>
-         */
-        public Target getTarget() {
-                return this.target;
-        }
-        
-        /**
-         * Sets the <code>Target</code> for this <code>PolicyDef</code>.
-         * 
-         * @param targetIn the <code>Target</code> for this <code>PolicyDef</code>
-         */
-        public void setTarget(Target targetIn) {
-                this.target	= targetIn;
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the <code>CombinerParameter</code>s for this <code>Policy</code>.
-         * 
-         * @return an <code>Iterator</code> over the <code>CombinerParameter</code>s for this <code>Policy</code> or null if there are none
-         */
-        public Iterator<CombinerParameter> getCombinerParameters() {
-                return (this.combinerParameters == null ? null : this.combinerParameters.iterator());
-        }
-        
-        /**
-         * Sets the <code>CombinerParameter</code>s for this<code>Policy</code> to the contents of the
-         * given <code>Collection</code>.  If the <code>Collection</code> is null, the set of <code>CombinerParameter</code>s
-         * for this <code>Policy</code> is set to null.
-         * 
-         * @param combinerParametersIn the <code>Collection</code> of <code>CombinerParameter</code>s for this <code>PolicyDef</code>
-         */
-        public void setCombinerParameters(Collection<CombinerParameter> combinerParametersIn) {
-                this.combinerParameters	= null;
-                if (combinerParametersIn != null) {
-                        this.addCombinerParameters(combinerParametersIn);
-                }
-        }
-        
-        /**
-         * Adds the given <code>CombinerParameter</code> to the set of <code>CombinerParameter</code>s for this
-         * <code>PolicyDef</code>>
-         * 
-         * @param combinerParameter the <code>CombinerParameter</code> to add
-         */
-        public void add(CombinerParameter combinerParameter) {
-                this.ensureCombinerParameters();
-                this.combinerParameters.add(combinerParameter);
-        }
-        
-        /**
-         * Adds the given <code>Collection</code> of <code>CombinerParameter</code>s to this <code>PolicyDef</code>>
-         * 
-         * @param combinerParametersIn the <code>Collection</code> of <code>CombinerParameter</code>s to add
-         */
-        public void addCombinerParameters(Collection<CombinerParameter> combinerParametersIn) {
-                this.ensureCombinerParameters();
-                this.combinerParameters.addAll(combinerParametersIn);
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
-         * 
-         * @return an <code>Iterator</code> over the <code>ObligationExpression</code>s for this <code>PolicyDef</code> or null if there are none.
-         */
-        public Iterator<ObligationExpression> getObligationExpressions() {
-                return (this.obligationExpressions == null ? null : this.obligationExpressions.iterator());
-        }
-        
-        /**
-         * Sets the <code>ObligationExpression</code>s for this <code>PolicyDef</code> to the contents of the given <code>Collection</code>.
-         * If the <code>Collection</code> is null, the <code>ObligationExpression</code>s for this <code>PolicyDef</code> are set to null.
-         * 
-         * @param obligationExpressionsIn the <code>Collection</code> of <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
-         */
-        public void setObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
-                this.obligationExpressions	= null;
-                if (obligationExpressionsIn != null) {
-                        this.addObligationExpressions(obligationExpressionsIn);
-                }
-        }
-        
-        /**
-         * Adds the given <code>ObligationExpression</code> to the set of <code>ObligationExpression</code>s for this <code>PolicyDef</code>.
-         * 
-         * @param obligationExpression the <code>ObligationExpression</code> to add
-         */
-        public void add(ObligationExpression obligationExpression) {
-                this.ensureObligationExpressions();
-                this.obligationExpressions.add(obligationExpression);
-        }
-        
-        /**
-         * Adds the contents of the given <code>Collection</code> of <code>ObligationExpression</code>s to the set of <code>ObligationExpression</code>s for
-         * this <code>PolicyDef</code>.
-         * 
-         * @param obligationExpressionsIn the <code>Collection</code> of <code>ObligationExpression</code>s to add
-         */
-        public void addObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
-                this.ensureObligationExpressions();
-                this.obligationExpressions.addAll(obligationExpressionsIn);
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code>.
-         * 
-         * @return an <code>Iterator</code> over the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code> or null if there are none.
-         */
-        public Iterator<AdviceExpression> getAdviceExpressions() {
-                return (this.adviceExpressions == null ? null : this.adviceExpressions.iterator());
-        }
-        
-        /**
-         * Sets the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code> to the contents of the given <code>Collection</code>.
-         * 
-         * @param adviceExpressionsIn the <code>Collection</code> of <code>AdviceExpression</code> to add
-         */
-        public void setAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
-                this.adviceExpressions	= null;
-                if (adviceExpressionsIn != null) {
-                        this.addAdviceExpressions(adviceExpressionsIn);
-                }
-        }
-        
-        /**
-         * Adds the given <code>AdviceExpression</code> to the set of <code>AdviceExpression</code>s for this <code>PolicyDef</code>.
-         * 
-         * @param adviceExpression the <code>AdviceExpression</code> to add.
-         */
-        public void add(AdviceExpression adviceExpression) {
-                this.ensureAdviceExpressions();
-                this.adviceExpressions.add(adviceExpression);
-        }
-        
-        /**
-         * Adds the contents of the given <code>Collection</code> of <code>AdviceExpression</code>s to the set of
-         * <code>AdviceExpression</code>s for this <code>PolicyDef</code>.
-         * 
-         * @param adviceExpressionsIn the <code>Collection</code> of <code>AdviceExpression</code>s to add.
-         */
-        public void addAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
-                this.ensureAdviceExpressions();
-                this.adviceExpressions.addAll(adviceExpressionsIn);
-        }
-        
-        /**
-         * Gets the <code>String</code> version for this <code>PolicyDef</code>.
-         * 
-         * @return the <code>String</code> version for this <code>PolicyDef</code>.
-         */
-        public Version getVersion() {
-                return this.version;
-        }
-        
-        /**
-         * Sets the version <code>String</code> for this <code>PolicyDef</code>>
-         * 
-         * @param versionIn the <code>String</code> version for this <code>PolicyDef</code>
-         */
-        public void setVersion(Version versionIn) {
-                this.version		= versionIn;
-                this.idReference	= null;
-        }
-        
-        /**
-         * Creates the <code>IdReference</code> for this <code>PolicyDef</code> if needed and returns it.
-         * 
-         * @return the <code>IdReference</code> for this <code>PolicyDef</code>
-         */
-        public IdReference getIdReference() {
-                if (this.idReference == null) {
-                        this.idReference	= new StdIdReference(this.getIdentifier(), this.getVersion());
-                }
-                return this.idReference;
-        }
-        
-        public boolean matches(IdReferenceMatch idReferenceRequest) {
-                IdReference thisIdReference	= this.getIdReference();
-                if (thisIdReference == null || thisIdReference.getId() == null || idReferenceRequest == null || idReferenceRequest.getId() == null) {
-                        return false;
-                } else if (!thisIdReference.getId().equals(idReferenceRequest.getId())) {
-                        return false;
-                }
-                
-                /*
-                 * Now do version number matching
-                 */
-                VersionMatch idReferenceRequestVersion	= idReferenceRequest.getVersion();
-                if (idReferenceRequestVersion != null) {
-                        /*
-                         * Do exact version matching
-                         */
-                        Version thisVersion	= thisIdReference.getVersion();
-                        if (thisVersion == null) {
-                                return false;
-                        } else {
-                                return idReferenceRequestVersion.match(thisVersion, 0);
-                        }
-                } else {
-                        VersionMatch idReferenceRequestEarliestVersion	= idReferenceRequest.getEarliestVersion();
-                        Version thisVersion								= thisIdReference.getVersion();
-                        
-                        if (idReferenceRequestEarliestVersion != null) {
-                                if (thisVersion == null) {
-                                        return false;
-                                } else if (!idReferenceRequestEarliestVersion.match(thisVersion, 1)) {
-                                        return false;
-                                }
-                        }
-                        
-                        VersionMatch idReferenceRequestLatestVersion	= idReferenceRequest.getLatestVersion();
-                        if (idReferenceRequestLatestVersion != null) {
-                                if (thisVersion == null) {
-                                        return false;
-                                } else if (!idReferenceRequestLatestVersion.match(thisVersion, -1)) {
-                                        return false;
-                                }
-                        }
-                        
-                        return true;
-                }
-        }
-        
-        /**
-         * Gets the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>.
-         * 
-         * @return the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>
-         */
-        public Integer getMaxDelegationDepth() {
-                return this.maxDelegationDepth;
-        }
-        
-        /**
-         * Sets the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>
-         * @param i the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>
-         */
-        public void setMaxDelegationDepth(Integer i) {
-                this.maxDelegationDepth	= i;
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getDescription()) != null) {
-                        stringBuilder.append(",description=");
-                        stringBuilder.append((String)objectToDump);
-                }
-                if ((objectToDump = this.getPolicyIssuer()) != null) {
-                        stringBuilder.append(",policyIssuer=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getTarget()) != null) {
-                        stringBuilder.append(",target=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                String iteratorToString;
-                if ((iteratorToString = StringUtils.toString(this.getCombinerParameters())) != null) {
-                        stringBuilder.append(",combinerParameters=");
-                        stringBuilder.append(iteratorToString);
-                }
-                if ((iteratorToString = StringUtils.toString(this.getObligationExpressions())) != null) {
-                        stringBuilder.append(",obligationExpressions=");
-                        stringBuilder.append(iteratorToString);
-                }
-                if ((iteratorToString = StringUtils.toString(this.getAdviceExpressions())) != null) {
-                        stringBuilder.append(",adviceExpressions=");
-                        stringBuilder.append(iteratorToString);
-                }
-                if ((objectToDump = this.getVersion()) != null) {
-                        stringBuilder.append(",version=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getMaxDelegationDepth()) != null) {
-                        stringBuilder.append(",maxDelegationDepth=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        return this.idReference;
+    }
+
+    public boolean matches(IdReferenceMatch idReferenceRequest) {
+        IdReference thisIdReference	= this.getIdReference();
+        if (thisIdReference == null || thisIdReference.getId() == null || idReferenceRequest == null || idReferenceRequest.getId() == null) {
+            return false;
+        } else if (!thisIdReference.getId().equals(idReferenceRequest.getId())) {
+            return false;
         }
 
-        @Override
-        public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
-                if (!this.validate()) {
-                        return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        /*
+         * Now do version number matching
+         */
+        VersionMatch idReferenceRequestVersion	= idReferenceRequest.getVersion();
+        if (idReferenceRequestVersion != null) {
+            /*
+             * Do exact version matching
+             */
+            Version thisVersion	= thisIdReference.getVersion();
+            if (thisVersion == null) {
+                return false;
+            } else {
+                return idReferenceRequestVersion.match(thisVersion, 0);
+            }
+        } else {
+            VersionMatch idReferenceRequestEarliestVersion	= idReferenceRequest.getEarliestVersion();
+            Version thisVersion								= thisIdReference.getVersion();
+
+            if (idReferenceRequestEarliestVersion != null) {
+                if (thisVersion == null) {
+                    return false;
+                } else if (!idReferenceRequestEarliestVersion.match(thisVersion, 1)) {
+                    return false;
                 }
-                return this.getTarget().match(evaluationContext);
+            }
+
+            VersionMatch idReferenceRequestLatestVersion	= idReferenceRequest.getLatestVersion();
+            if (idReferenceRequestLatestVersion != null) {
+                if (thisVersion == null) {
+                    return false;
+                } else if (!idReferenceRequestLatestVersion.match(thisVersion, -1)) {
+                    return false;
+                }
+            }
+
+            return true;
         }
+    }
+
+    /**
+     * Gets the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>.
+     *
+     * @return the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>
+     */
+    public Integer getMaxDelegationDepth() {
+        return this.maxDelegationDepth;
+    }
+
+    /**
+     * Sets the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>
+     * @param i the <code>Integer</code> maximum delegation depth for this <code>PolicyDef</code>
+     */
+    public void setMaxDelegationDepth(Integer i) {
+        this.maxDelegationDepth	= i;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getDescription()) != null) {
+            stringBuilder.append(",description=");
+            stringBuilder.append((String)objectToDump);
+        }
+        if ((objectToDump = this.getPolicyIssuer()) != null) {
+            stringBuilder.append(",policyIssuer=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getTarget()) != null) {
+            stringBuilder.append(",target=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        String iteratorToString;
+        if ((iteratorToString = StringUtils.toString(this.getCombinerParameters())) != null) {
+            stringBuilder.append(",combinerParameters=");
+            stringBuilder.append(iteratorToString);
+        }
+        if ((iteratorToString = StringUtils.toString(this.getObligationExpressions())) != null) {
+            stringBuilder.append(",obligationExpressions=");
+            stringBuilder.append(iteratorToString);
+        }
+        if ((iteratorToString = StringUtils.toString(this.getAdviceExpressions())) != null) {
+            stringBuilder.append(",adviceExpressions=");
+            stringBuilder.append(iteratorToString);
+        }
+        if ((objectToDump = this.getVersion()) != null) {
+            stringBuilder.append(",version=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getMaxDelegationDepth()) != null) {
+            stringBuilder.append(",maxDelegationDepth=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
+        if (!this.validate()) {
+            return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        }
+        return this.getTarget().match(evaluationContext);
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java
index c6faaba..f4ab32b 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyDefaults.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,95 +37,95 @@
 /**
  * PolicyDefaults represents the default values associated with a XACML 3.0 Policy or PolicySet that may
  * be overridden or inherited by child Policies or PolicySets.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class PolicyDefaults {
-        private static URI		xpathVersionDefault;
-        
-        static {
-                try {
-                        xpathVersionDefault	= new URI(XACML.XPATHVERSION_2_0);
-                } catch (Exception ex) {
-                        
-                }
+    private static URI		xpathVersionDefault;
+
+    static {
+        try {
+            xpathVersionDefault	= new URI(XACML.XPATHVERSION_2_0);
+        } catch (Exception ex) {
+
         }
-        
-        private URI				xpathVersion;
-        private PolicyDefaults 	policyDefaultsParent;
-        
-        /**
-         * Creates a new <code>PolicyDefaults</code> with the given <code>URI</code> for the XPath version and
-         * the given <code>PolicyDefaults</code> pointing to the parent.
-         * 
-         * @param xpathVersionIn the <code>URI</code> representing the XPath version for the new <code>PolicyDefaults</code>
-         * @param policyDefaultsParentIn the <code>PolicyDefaults</code> object that is the parent of the new <code>PolicyDefaults</code>
+    }
+
+    private URI				xpathVersion;
+    private PolicyDefaults 	policyDefaultsParent;
+
+    /**
+     * Creates a new <code>PolicyDefaults</code> with the given <code>URI</code> for the XPath version and
+     * the given <code>PolicyDefaults</code> pointing to the parent.
+     *
+     * @param xpathVersionIn the <code>URI</code> representing the XPath version for the new <code>PolicyDefaults</code>
+     * @param policyDefaultsParentIn the <code>PolicyDefaults</code> object that is the parent of the new <code>PolicyDefaults</code>
+     */
+    public PolicyDefaults(URI xpathVersionIn, PolicyDefaults policyDefaultsParentIn) {
+        this.xpathVersion			= xpathVersionIn;
+        this.policyDefaultsParent	= policyDefaultsParentIn;
+    }
+
+    /**
+     * Gets the parent <code>PolicyDefaults</code> for this <code>PolicyDefaults</code>.
+     *
+     * @return the parent <code>PolicyDefaults</code> for this <code>PolicyDefaults</code> or null if none
+     */
+    public PolicyDefaults getPolicyDefaultsParent() {
+        return this.policyDefaultsParent;
+    }
+
+    /**
+     * Gets the XPath version <code>URI</code> for this <code>PolicyDefaults</code>.  If there is no explicit
+     * version in this <code>PolicyDefaults</code>, walk up the parent <code>PolicyDefaults</code> hierarchy until
+     * one is found, or return the default value.
+     *
+     * @return the <code>URI</code> for the XPath version
+     */
+    public URI getXPathVersion() {
+        /*
+         * See if the XPath version was explicitly set here
          */
-        public PolicyDefaults(URI xpathVersionIn, PolicyDefaults policyDefaultsParentIn) {
-                this.xpathVersion			= xpathVersionIn;
-                this.policyDefaultsParent	= policyDefaultsParentIn;
+        if (this.xpathVersion != null) {
+            return this.xpathVersion;
         }
-        
-        /**
-         * Gets the parent <code>PolicyDefaults</code> for this <code>PolicyDefaults</code>.
-         * 
-         * @return the parent <code>PolicyDefaults</code> for this <code>PolicyDefaults</code> or null if none
+
+        /*
+         * Try the parent hierarchy if there is one
          */
-        public PolicyDefaults getPolicyDefaultsParent() {
-                return this.policyDefaultsParent;
+        PolicyDefaults	policyDefaultsParentThis	= this.getPolicyDefaultsParent();
+        if (policyDefaultsParentThis != null) {
+            return policyDefaultsParentThis.getXPathVersion();
         }
-        
-        /**
-         * Gets the XPath version <code>URI</code> for this <code>PolicyDefaults</code>.  If there is no explicit
-         * version in this <code>PolicyDefaults</code>, walk up the parent <code>PolicyDefaults</code> hierarchy until
-         * one is found, or return the default value.
-         * 
-         * @return the <code>URI</code> for the XPath version
+
+        /*
+         * Use the default
          */
-        public URI getXPathVersion() {
-                /*
-                 * See if the XPath version was explicitly set here
-                 */
-                if (this.xpathVersion != null) {
-                        return this.xpathVersion;
-                }
-                
-                /*
-                 * Try the parent hierarchy if there is one
-                 */
-                PolicyDefaults	policyDefaultsParentThis	= this.getPolicyDefaultsParent();
-                if (policyDefaultsParentThis != null) {
-                        return policyDefaultsParentThis.getXPathVersion();
-                }
-                
-                /*
-                 * Use the default
-                 */
-                return xpathVersionDefault;
+        return xpathVersionDefault;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        boolean	needsComma	= false;
+        Object objectToDump;
+        if ((objectToDump = this.xpathVersion) != null) {
+            stringBuilder.append("xpathVersion=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                boolean	needsComma	= false;
-                Object objectToDump;
-                if ((objectToDump = this.xpathVersion) != null) {
-                        stringBuilder.append("xpathVersion=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getPolicyDefaultsParent()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("policyDefaultsParent=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        if ((objectToDump = this.getPolicyDefaultsParent()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("policyDefaultsParent=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java
index 625f486..9adc29d 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinder.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,34 +37,34 @@
  * PolicyFinder is the interface for objects that can locate XACML Policies and PolicySets by identifier and contains the root
  * Policy or Policy set.  The interface is designed to allow for finders that can retrieve a root policy from a repository based on
  * matching a {@link com.att.research.xacml.api.Request}.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface PolicyFinder {
-        /**
-         * Gets the root {@link PolicyDef} from the policy store
-         * configured by the particular implementation of the <code>PolicyFinderFactory</code> class that
-         * is applicable to the {@link com.att.research.xacml.api.Request} in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
-         * 
-         * @return a <code>PolicyFinderResult</code> with the root <code>PolicyDef</code>
-         */
-        public PolicyFinderResult<PolicyDef> getRootPolicyDef(EvaluationContext evaluationContext);
-        
-        /**
-         * Gets the {@link Policy} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
-         * 
-         * @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
-         * @return a <code>PolicyFinderResult</code> with the <code>Policy</code> matching the given <code>IdReferenceMatch</code>
-         */
-        public PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch);
-        
-        /**
-         * Gets the {@link PolicySet} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
-         * 
-         * @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
-         * @return a <code>PolicyFinderResult</code> with the <code>PolicySet</code> matching the given <code>IdReferenceMatch</code>.
-         */
-        public PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch);
+    /**
+     * Gets the root {@link PolicyDef} from the policy store
+     * configured by the particular implementation of the <code>PolicyFinderFactory</code> class that
+     * is applicable to the {@link com.att.research.xacml.api.Request} in the given {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
+     *
+     * @return a <code>PolicyFinderResult</code> with the root <code>PolicyDef</code>
+     */
+    public PolicyFinderResult<PolicyDef> getRootPolicyDef(EvaluationContext evaluationContext);
+
+    /**
+     * Gets the {@link Policy} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
+     *
+     * @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
+     * @return a <code>PolicyFinderResult</code> with the <code>Policy</code> matching the given <code>IdReferenceMatch</code>
+     */
+    public PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch);
+
+    /**
+     * Gets the {@link PolicySet} that matches the given {@link com.att.research.xacml.api.IdReferenceMatch}.
+     *
+     * @param idReferenceMatch the <code>IdReferenceMatch</code> to search for
+     * @return a <code>PolicyFinderResult</code> with the <code>PolicySet</code> matching the given <code>IdReferenceMatch</code>.
+     */
+    public PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch);
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java
index 58eb9ea..c080161 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,47 +39,47 @@
 /**
  * PolicyFinderFactory provides methods for loading XACML 3.0 policies and policy sets that are used
  * by the {@link com.att.research.xacmlatt.pdp.PDPEngine} to evaluate requests.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public abstract class PolicyFinderFactory {
-        private static final String	FACTORYID					= ATTPDPProperties.PROP_POLICYFINDERFACTORY;
-        private static final String DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.std.StdPolicyFinderFactory";
-        
-        protected PolicyFinderFactory() {
-        }
-        
-        protected PolicyFinderFactory(Properties properties) {
-        }
-        
-        public static PolicyFinderFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PolicyFinderFactory.class);
-        }
-        
-        public static PolicyFinderFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PolicyFinderFactory.class, properties);
-        }
-        
-        public static PolicyFinderFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(className, PolicyFinderFactory.class, classLoader, false);
-        }
-        
-        public static PolicyFinderFactory newInstance(String className) throws FactoryException {
-                return FactoryFinder.newInstance(className, PolicyFinderFactory.class, null, true);
-        }
+    private static final String	FACTORYID					= ATTPDPProperties.PROP_POLICYFINDERFACTORY;
+    private static final String DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.std.StdPolicyFinderFactory";
 
-        /**
-         * Gets the configured {@link PolicyFinder}.
-         * 
-         * @return the configured <code>PolicyFinder</code>
-         */
-        abstract public PolicyFinder getPolicyFinder() throws FactoryException;
+    protected PolicyFinderFactory() {
+    }
 
-        /**
-         * Gets the configured {@link PolicyFinder}.
-         * 
-         * @return the configured <code>PolicyFinder</code>
-         */
-        abstract public PolicyFinder getPolicyFinder(Properties properties) throws FactoryException;
+    protected PolicyFinderFactory(Properties properties) {
+    }
+
+    public static PolicyFinderFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PolicyFinderFactory.class);
+    }
+
+    public static PolicyFinderFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PolicyFinderFactory.class, properties);
+    }
+
+    public static PolicyFinderFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(className, PolicyFinderFactory.class, classLoader, false);
+    }
+
+    public static PolicyFinderFactory newInstance(String className) throws FactoryException {
+        return FactoryFinder.newInstance(className, PolicyFinderFactory.class, null, true);
+    }
+
+    /**
+     * Gets the configured {@link PolicyFinder}.
+     *
+     * @return the configured <code>PolicyFinder</code>
+     */
+    abstract public PolicyFinder getPolicyFinder() throws FactoryException;
+
+    /**
+     * Gets the configured {@link PolicyFinder}.
+     *
+     * @return the configured <code>PolicyFinder</code>
+     */
+    abstract public PolicyFinder getPolicyFinder(Properties properties) throws FactoryException;
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderResult.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderResult.java
index 7ce080a..75601a3 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderResult.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyFinderResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,23 +34,23 @@
 
 /**
  * PolicyFinderResult is the interface for return values of the methods in the {@link com.att.research.xacmlatt.pdp.policy.PolicyFinderFactory} interface.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  * @param <T> the class extending {@link PolicyDef} contained as a result in this <code>PolicyFinderResult</code>
  */
 public interface PolicyFinderResult<T extends PolicyDef> {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Status} of the method call.
-         * 
-         * @return the <code>Status</code> of the method call
-         */
-        public Status getStatus();
-        
-        /**
-         * Gets the {@link PolicyDef} returned by the method if the status is OK.
-         * 
-         * @return the <code>T</code> returned by the method if the status is OK.
-         */
-        public T getPolicyDef();
+    /**
+     * Gets the {@link com.att.research.xacml.api.Status} of the method call.
+     *
+     * @return the <code>Status</code> of the method call
+     */
+    public Status getStatus();
+
+    /**
+     * Gets the {@link PolicyDef} returned by the method if the status is OK.
+     *
+     * @return the <code>T</code> returned by the method if the status is OK.
+     */
+    public T getPolicyDef();
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIdReference.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIdReference.java
index 25ab10c..bcf9990 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIdReference.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIdReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,40 +38,40 @@
  * PolicyIdReference extends {@link com.att.research.xacmlatt.pdp.policy.PolicyIdReferenceBase} for
  * {@link Policy} objects with an implementation of the <code>ensureReferencee</code>
  * method to find a <code>Policy</code>.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class PolicyIdReference extends PolicyIdReferenceBase<Policy> {
 
-        public PolicyIdReference(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
-                super(policySetParent, statusCodeIn, statusMessageIn);
-        }
-        
-        public PolicyIdReference(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    public PolicyIdReference(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
+        super(policySetParent, statusCodeIn, statusMessageIn);
+    }
 
-        public PolicyIdReference(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-        
-        public PolicyIdReference(PolicySet policySetParent) {
-                super(policySetParent);
-        }
+    public PolicyIdReference(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        public PolicyIdReference() {
-        }
+    public PolicyIdReference(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-        @Override
-        protected Policy ensureReferencee(EvaluationContext evaluationContext) throws EvaluationException {
-                if (this.getReferencee() == null) {
-                        PolicyFinderResult<Policy> policyFactoryResult	= evaluationContext.getPolicy(this.getIdReferenceMatch());
-                        if (policyFactoryResult.getStatus() == null || policyFactoryResult.getStatus().isOk()) {
-                                this.setReferencee(policyFactoryResult.getPolicyDef());
-                        }
-                }
-                return this.getReferencee();
+    public PolicyIdReference(PolicySet policySetParent) {
+        super(policySetParent);
+    }
+
+    public PolicyIdReference() {
+    }
+
+    @Override
+    protected Policy ensureReferencee(EvaluationContext evaluationContext) throws EvaluationException {
+        if (this.getReferencee() == null) {
+            PolicyFinderResult<Policy> policyFactoryResult	= evaluationContext.getPolicy(this.getIdReferenceMatch());
+            if (policyFactoryResult.getStatus() == null || policyFactoryResult.getStatus().isOk()) {
+                this.setReferencee(policyFactoryResult.getPolicyDef());
+            }
         }
+        return this.getReferencee();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIdReferenceBase.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIdReferenceBase.java
index 01f5466..dc05981 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIdReferenceBase.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIdReferenceBase.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,101 +42,101 @@
 
 /**
  * PolicyIdReferenceBase extends {@link PolicySetChild} to implement a XACML PolicyIdReference element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public abstract class PolicyIdReferenceBase<T extends PolicyDef> extends PolicySetChild {
-        private IdReferenceMatch	idReferenceMatch;
-        private T					referencee;
-        
-        @Override
-        protected boolean validateComponent() {
-                if (super.validateComponent()) {
-                        if (this.getIdReferenceMatch() == null) {
-                                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing reference id");
-                                return false;
-                        } else {
-                                return true;
-                        }
-                } else {
-                        return false;
-                }
-        }
-        
-        /**
-         * If the <code>T</code> referencee has not been set, this method will try and find it
-         * in the given <code>EvaluationContext</code> and return it.
-         * 
-         * @param evaluationContext the <code>EvaluationContext</code> to search for the referencee
-         * @return the <code>T</code> referencee if found, else null
-         * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error attempting to locate the referenced <code>T</code>.
-         */
-        protected abstract T ensureReferencee(EvaluationContext evaluationContext) throws EvaluationException;
-        
-        public PolicyIdReferenceBase(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
-                super(policySetParent, statusCodeIn, statusMessageIn);
-        }
-        
-        public PolicyIdReferenceBase(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private IdReferenceMatch	idReferenceMatch;
+    private T					referencee;
 
-        public PolicyIdReferenceBase(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+    @Override
+    protected boolean validateComponent() {
+        if (super.validateComponent()) {
+            if (this.getIdReferenceMatch() == null) {
+                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing reference id");
+                return false;
+            } else {
+                return true;
+            }
+        } else {
+            return false;
         }
-        
-        public PolicyIdReferenceBase(PolicySet policySetParent) {
-                super(policySetParent);
-        }
+    }
 
-        public PolicyIdReferenceBase() {
-        }
-        
-        /**
-         * Gets the {@link com.att.research.xacml.api.IdReferenceMatch} for this <code>PolicyIdReferenceBase</code>.
-         * 
-         * @return the <code>IdReferenceMatch</code> for this <code>PolicyIdReference</code>.
-         */
-        public IdReferenceMatch getIdReferenceMatch() {
-                return this.idReferenceMatch;
-        }
-        
-        public void setIdReferenceMatch(IdReferenceMatch idReferenceMatchIn) {
-                this.idReferenceMatch	= idReferenceMatchIn;
-        }
-        
-        /**
-         * Sets the <code>PolicyDef</code> object referred to by this <code>PolicyIdReferenceBase</code>.
-         * 
-         * @return the <code>PolicyDef</code> object referred to by this <code>PolicyIdReferenceBase</code>
-         */
-        public T getReferencee() {
-                return this.referencee;
-        }
-        
-        public void setReferencee(T referenceeIn) {
-                this.referencee	= referenceeIn;
-        }
-        
-        @Override
-        public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
-                T thisReferencee	= this.ensureReferencee(evaluationContext);
-                if (thisReferencee == null) {
-                        return new EvaluationResult(Decision.INDETERMINATE, new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Could not find referencee for " + this.getIdReferenceMatch().toString()));
-                } else {
-                        return thisReferencee.evaluate(evaluationContext);
-                }
-        }
+    /**
+     * If the <code>T</code> referencee has not been set, this method will try and find it
+     * in the given <code>EvaluationContext</code> and return it.
+     *
+     * @param evaluationContext the <code>EvaluationContext</code> to search for the referencee
+     * @return the <code>T</code> referencee if found, else null
+     * @throws com.att.research.xacmlatt.pdp.eval.EvaluationException if there is an error attempting to locate the referenced <code>T</code>.
+     */
+    protected abstract T ensureReferencee(EvaluationContext evaluationContext) throws EvaluationException;
 
-        @Override
-        public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
-                T thisReferencee	= this.ensureReferencee(evaluationContext);
-                if (thisReferencee == null) {
-                        return new MatchResult(MatchResult.MatchCode.INDETERMINATE, new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Could not find referencee for " + this.getIdReferenceMatch().toString()));
-                } else {
-                        return thisReferencee.match(evaluationContext);
-                }
+    public PolicyIdReferenceBase(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
+        super(policySetParent, statusCodeIn, statusMessageIn);
+    }
+
+    public PolicyIdReferenceBase(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public PolicyIdReferenceBase(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public PolicyIdReferenceBase(PolicySet policySetParent) {
+        super(policySetParent);
+    }
+
+    public PolicyIdReferenceBase() {
+    }
+
+    /**
+     * Gets the {@link com.att.research.xacml.api.IdReferenceMatch} for this <code>PolicyIdReferenceBase</code>.
+     *
+     * @return the <code>IdReferenceMatch</code> for this <code>PolicyIdReference</code>.
+     */
+    public IdReferenceMatch getIdReferenceMatch() {
+        return this.idReferenceMatch;
+    }
+
+    public void setIdReferenceMatch(IdReferenceMatch idReferenceMatchIn) {
+        this.idReferenceMatch	= idReferenceMatchIn;
+    }
+
+    /**
+     * Sets the <code>PolicyDef</code> object referred to by this <code>PolicyIdReferenceBase</code>.
+     *
+     * @return the <code>PolicyDef</code> object referred to by this <code>PolicyIdReferenceBase</code>
+     */
+    public T getReferencee() {
+        return this.referencee;
+    }
+
+    public void setReferencee(T referenceeIn) {
+        this.referencee	= referenceeIn;
+    }
+
+    @Override
+    public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
+        T thisReferencee	= this.ensureReferencee(evaluationContext);
+        if (thisReferencee == null) {
+            return new EvaluationResult(Decision.INDETERMINATE, new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Could not find referencee for " + this.getIdReferenceMatch().toString()));
+        } else {
+            return thisReferencee.evaluate(evaluationContext);
         }
+    }
+
+    @Override
+    public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
+        T thisReferencee	= this.ensureReferencee(evaluationContext);
+        if (thisReferencee == null) {
+            return new MatchResult(MatchResult.MatchCode.INDETERMINATE, new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Could not find referencee for " + this.getIdReferenceMatch().toString()));
+        } else {
+            return thisReferencee.match(evaluationContext);
+        }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIssuer.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIssuer.java
index b0aba41..d377b3d 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIssuer.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicyIssuer.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,88 +44,88 @@
 /**
  * PolicyIssuer extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} to represent the XACML 3.0
  * PolicyIssuer element in Policies and PolicySets.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class PolicyIssuer extends PolicyComponent {
-        private Node			content;
-        private List<Attribute>	attributes;
-        
-        public PolicyIssuer(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private Node			content;
+    private List<Attribute>	attributes;
 
-        public PolicyIssuer(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
+    public PolicyIssuer(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        public PolicyIssuer() {
-        }
-        
-        public Node getContent() {
-                return this.content;
-        }
-        
-        public void setContent(Node nodeContent) {
-                this.content	= nodeContent;
-        }
-        
-        public Iterator<Attribute> getAttributes() {
-                return (this.attributes == null ? null : this.attributes.iterator());
-        }
-        
-        public void setAttributes(Collection<Attribute> listAttributes) {
-                this.attributes	= null;
-                if (listAttributes != null) {
-                        this.add(listAttributes);
-                }
-        }
-        
-        public void add(Attribute attribute) {
-                if (this.attributes == null) {
-                        this.attributes	= new ArrayList<Attribute>();
-                }
-                this.attributes.add(attribute);
-        }
-        
-        public void add(Collection<Attribute> listAttributes) {
-                if (this.attributes == null) {
-                        this.attributes = new ArrayList<Attribute>();
-                }
-                this.attributes.addAll(listAttributes);
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getContent()) != null) {
-                        stringBuilder.append(",content=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                Iterator<Attribute> iterAttributes	= this.getAttributes();
-                if (iterAttributes != null && iterAttributes.hasNext()) {
-                        stringBuilder.append(",attributes=[");
-                        stringBuilder.append(iterAttributes.next().toString());
-                        while (iterAttributes.hasNext()) {
-                                stringBuilder.append(',');
-                                stringBuilder.append(iterAttributes.next().toString());
-                        }
-                        stringBuilder.append(']');
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    public PolicyIssuer(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                return true;
+    public PolicyIssuer() {
+    }
+
+    public Node getContent() {
+        return this.content;
+    }
+
+    public void setContent(Node nodeContent) {
+        this.content	= nodeContent;
+    }
+
+    public Iterator<Attribute> getAttributes() {
+        return (this.attributes == null ? null : this.attributes.iterator());
+    }
+
+    public void setAttributes(Collection<Attribute> listAttributes) {
+        this.attributes	= null;
+        if (listAttributes != null) {
+            this.add(listAttributes);
         }
+    }
+
+    public void add(Attribute attribute) {
+        if (this.attributes == null) {
+            this.attributes	= new ArrayList<Attribute>();
+        }
+        this.attributes.add(attribute);
+    }
+
+    public void add(Collection<Attribute> listAttributes) {
+        if (this.attributes == null) {
+            this.attributes = new ArrayList<Attribute>();
+        }
+        this.attributes.addAll(listAttributes);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getContent()) != null) {
+            stringBuilder.append(",content=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        Iterator<Attribute> iterAttributes	= this.getAttributes();
+        if (iterAttributes != null && iterAttributes.hasNext()) {
+            stringBuilder.append(",attributes=[");
+            stringBuilder.append(iterAttributes.next().toString());
+            while (iterAttributes.hasNext()) {
+                stringBuilder.append(',');
+                stringBuilder.append(iterAttributes.next().toString());
+            }
+            stringBuilder.append(']');
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+        return true;
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySet.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySet.java
index d20bbcd..9b36835 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySet.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySet.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -51,229 +51,229 @@
 
 /**
  * PolicySet extends {@link PolicyDef} to represent a XACML PolicySet element.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class PolicySet extends PolicyDef {
-        private TargetedCombinerParameterMap<Identifier,PolicySetChild>		policyCombinerParameters	= new TargetedCombinerParameterMap<Identifier,PolicySetChild>();
-        private List<PolicySetChild>										children;
-        private List<CombiningElement<PolicySetChild>>						combiningPolicies;
-        private CombiningAlgorithm<PolicySetChild>							combiningAlgorithm;
-        
-        private void ensureChildren() {
-                if (this.children == null) {
-                        this.children	= new ArrayList<PolicySetChild>();
-                }
+    private TargetedCombinerParameterMap<Identifier,PolicySetChild>		policyCombinerParameters	= new TargetedCombinerParameterMap<Identifier,PolicySetChild>();
+    private List<PolicySetChild>										children;
+    private List<CombiningElement<PolicySetChild>>						combiningPolicies;
+    private CombiningAlgorithm<PolicySetChild>							combiningAlgorithm;
+
+    private void ensureChildren() {
+        if (this.children == null) {
+            this.children	= new ArrayList<PolicySetChild>();
         }
-        
-        /**
-         * Performs lazy evaluation of the combining parameters from this <code>Policy</code>.
-         * 
-         * @return the <code>List</code> of <code>CombiningElement</code>s for all of the <code>Rule</code>s
+    }
+
+    /**
+     * Performs lazy evaluation of the combining parameters from this <code>Policy</code>.
+     *
+     * @return the <code>List</code> of <code>CombiningElement</code>s for all of the <code>Rule</code>s
+     */
+    protected List<CombiningElement<PolicySetChild>> getCombiningPolicies() {
+        if (this.combiningPolicies == null) {
+            this.combiningPolicies			= new ArrayList<CombiningElement<PolicySetChild>>();
+            Iterator<PolicySetChild> iterPolicies	= this.getChildren();
+            if (iterPolicies != null) {
+                while (iterPolicies.hasNext()) {
+                    PolicySetChild policySetChild	= iterPolicies.next();
+                    this.combiningPolicies.add(new CombiningElement<PolicySetChild>(policySetChild, this.policyCombinerParameters.getCombinerParameters(policySetChild)));
+                }
+            }
+        }
+        return this.combiningPolicies;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (super.validateComponent()) {
+            if (this.getPolicyCombiningAlgorithm() == null) {
+                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing policy combining algorithm");
+                return false;
+            } else {
+                return true;
+            }
+        } else {
+            return false;
+        }
+    }
+
+    public PolicySet(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public PolicySet(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public PolicySet(PolicySet policySetParent) {
+        super(policySetParent);
+    }
+
+    public PolicySet() {
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter}s
+     * for {@link Policy} elements in this
+     * <code>PolicySet</code>.
+     *
+     * @return an <code>Iterator</code> over the <code>TargetedCombinerParameter</code>s for <code>Policy</code> elements in this
+     * <code>PolicySet</code>.
+     */
+    public Iterator<TargetedCombinerParameter<Identifier,PolicySetChild>> getPolicyCombinerParameters() {
+        return this.policyCombinerParameters.getTargetedCombinerParameters();
+    }
+
+    /**
+     * Sets the Policy combiner parameters for this <code>PolicySet</code> from the contents of the given <code>Collection</code>
+     * of <code>TargetedCombinerParameter</code>s.
+     *
+     * @param policyCombinerParametersIn the <code>Collection</code> of <code>TargetedCombinerParameter</code>s.
+     */
+    public void setPolicyCombinerParameters(Collection<TargetedCombinerParameter<Identifier,PolicySetChild>> policyCombinerParametersIn) {
+        this.policyCombinerParameters.setCombinerParameters(policyCombinerParametersIn);
+    }
+
+    public void addPolicyCombinerParameter(TargetedCombinerParameter<Identifier,PolicySetChild> policyCombinerParameter) {
+        this.policyCombinerParameters.addCombinerParameter(policyCombinerParameter);
+    }
+
+    public void addPolicyCombinerParameters(Collection<TargetedCombinerParameter<Identifier,PolicySetChild>> policyCombinerParametersIn) {
+        this.policyCombinerParameters.addCombinerParameters(policyCombinerParametersIn);
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the <code>PolicySetChild</code> children of this <code>PolicySet</code>.
+     *
+     * @return an <code>Iterator</code> over the <code>PolicySetChild</code> children of this <code>PolicySet</code> or null if there are none.
+     */
+    public Iterator<PolicySetChild> getChildren() {
+        return (this.children == null ? null : this.children.iterator());
+    }
+
+    public void setChildren(Collection<PolicySetChild> policySetChildren) {
+        this.children	= null;
+        if (policySetChildren != null) {
+            this.addChildren(policySetChildren);
+        }
+    }
+
+    public void addChild(PolicySetChild policySetChild) {
+        this.ensureChildren();
+        this.children.add(policySetChild);
+    }
+
+    public void addChildren(Collection<PolicySetChild> policySetChildren) {
+        this.ensureChildren();
+        this.children.addAll(policySetChildren);
+    }
+
+    /**
+     * Gets the {@link com.att.research.xacmlatt.pdp.policy.CombiningAlgorithm} for <code>PolicySetChild</code> children for this <code>PolicySet</code>.
+     *
+     * @return the <code>CombiningAlgorithm</code> for <code>PolicySetChild</code> children for this <code>PolicySet</code>.
+     */
+    public CombiningAlgorithm<PolicySetChild> getPolicyCombiningAlgorithm() {
+        return this.combiningAlgorithm;
+    }
+
+    public void setPolicyCombiningAlgorithm(CombiningAlgorithm<PolicySetChild> combiningAlgorithmIn) {
+        this.combiningAlgorithm	= combiningAlgorithmIn;
+    }
+
+    @Override
+    public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
+        /*
+         * First check to see if we are valid.  If not, return an error status immediately
          */
-        protected List<CombiningElement<PolicySetChild>> getCombiningPolicies() {
-                if (this.combiningPolicies == null) {
-                        this.combiningPolicies			= new ArrayList<CombiningElement<PolicySetChild>>();
-                        Iterator<PolicySetChild> iterPolicies	= this.getChildren();
-                        if (iterPolicies != null) {
-                                while (iterPolicies.hasNext()) {
-                                        PolicySetChild policySetChild	= iterPolicies.next();
-                                        this.combiningPolicies.add(new CombiningElement<PolicySetChild>(policySetChild, this.policyCombinerParameters.getCombinerParameters(policySetChild)));
-                                }
-                        }
-                }
-                return this.combiningPolicies;
+        if (evaluationContext.isTracing()) {
+            evaluationContext.trace(new StdTraceEvent<Object>("PolicySet", this, null));
         }
-        
-        @Override
-        protected boolean validateComponent() {
-                if (super.validateComponent()) {
-                        if (this.getPolicyCombiningAlgorithm() == null) {
-                                this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing policy combining algorithm");
-                                return false;
-                        } else {
-                                return true;
-                        }
-                } else {
-                        return false;
-                }
+        if (!this.validate()) {
+            return new EvaluationResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
 
-        public PolicySet(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
-
-        public PolicySet(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-        
-        public PolicySet(PolicySet policySetParent) {
-                super(policySetParent);
-        }
-
-        public PolicySet() {
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter}s 
-         * for {@link Policy} elements in this
-         * <code>PolicySet</code>.
-         * 
-         * @return an <code>Iterator</code> over the <code>TargetedCombinerParameter</code>s for <code>Policy</code> elements in this
-         * <code>PolicySet</code>.
+        /*
+         * See if we match
          */
-        public Iterator<TargetedCombinerParameter<Identifier,PolicySetChild>> getPolicyCombinerParameters() {
-                return this.policyCombinerParameters.getTargetedCombinerParameters();
+        MatchResult thisMatchResult	= this.match(evaluationContext);
+        assert(thisMatchResult != null);
+        if (evaluationContext.isTracing()) {
+            evaluationContext.trace(new StdTraceEvent<MatchResult>("Match", this, thisMatchResult));
+        }
+        switch(thisMatchResult.getMatchCode()) {
+        case INDETERMINATE:
+            return new EvaluationResult(Decision.INDETERMINATE, thisMatchResult.getStatus());
+        case MATCH:
+            break;
+        case NOMATCH:
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
         }
 
-        /**
-         * Sets the Policy combiner parameters for this <code>PolicySet</code> from the contents of the given <code>Collection</code>
-         * of <code>TargetedCombinerParameter</code>s.
-         * 
-         * @param policyCombinerParametersIn the <code>Collection</code> of <code>TargetedCombinerParameter</code>s.
+        /*
+         * Get the combining elements
          */
-        public void setPolicyCombinerParameters(Collection<TargetedCombinerParameter<Identifier,PolicySetChild>> policyCombinerParametersIn) {
-                this.policyCombinerParameters.setCombinerParameters(policyCombinerParametersIn);
-        }
-        
-        public void addPolicyCombinerParameter(TargetedCombinerParameter<Identifier,PolicySetChild> policyCombinerParameter) {
-                this.policyCombinerParameters.addCombinerParameter(policyCombinerParameter);
-        }
-        
-        public void addPolicyCombinerParameters(Collection<TargetedCombinerParameter<Identifier,PolicySetChild>> policyCombinerParametersIn) {
-                this.policyCombinerParameters.addCombinerParameters(policyCombinerParametersIn);
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over the <code>PolicySetChild</code> children of this <code>PolicySet</code>.
-         * 
-         * @return an <code>Iterator</code> over the <code>PolicySetChild</code> children of this <code>PolicySet</code> or null if there are none.
+        List<CombiningElement<PolicySetChild>> listCombiningElements	= this.getCombiningPolicies();
+        assert(listCombiningElements != null);
+
+        /*
+         * Run the PolicyCombiningAlgorithm
          */
-        public Iterator<PolicySetChild> getChildren() {
-                return (this.children == null ? null : this.children.iterator());
+        assert(this.getPolicyCombiningAlgorithm() != null);
+        EvaluationResult evaluationResultCombined	= this.getPolicyCombiningAlgorithm().combine(evaluationContext, listCombiningElements, getCombinerParameterList());
+        assert(evaluationResultCombined != null);
+
+        if (evaluationResultCombined.getDecision() == Decision.DENY || evaluationResultCombined.getDecision() == Decision.PERMIT) {
+            this.updateResult(evaluationResultCombined, evaluationContext);
+
+            /*
+             * Add my id to the policy set identifiers
+             */
+            if (evaluationContext.getRequest().getReturnPolicyIdList()) {
+                evaluationResultCombined.addPolicySetIdentifier(this.getIdReference());
+            }
         }
-        
-        public void setChildren(Collection<PolicySetChild> policySetChildren) {
-                this.children	= null;
-                if (policySetChildren != null) {
-                        this.addChildren(policySetChildren);
-                }
+        if (evaluationContext.isTracing()) {
+            evaluationContext.trace(new StdTraceEvent<Result>("Result", this, evaluationResultCombined));
         }
-        
-        public void addChild(PolicySetChild policySetChild) {
-                this.ensureChildren();
-                this.children.add(policySetChild);
+        return evaluationResultCombined;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        String iteratorToDump;
+        if ((iteratorToDump = StringUtils.toString(this.getPolicyCombinerParameters())) != null) {
+            stringBuilder.append(",policyCombinerParameters=");
+            stringBuilder.append(iteratorToDump);
         }
-        
-        public void addChildren(Collection<PolicySetChild> policySetChildren) {
-                this.ensureChildren();
-                this.children.addAll(policySetChildren);
+        if ((iteratorToDump = StringUtils.toString(this.getChildren())) != null) {
+            stringBuilder.append(",children=");
+            stringBuilder.append(iteratorToDump);
         }
-        
-        /**
-         * Gets the {@link com.att.research.xacmlatt.pdp.policy.CombiningAlgorithm} for <code>PolicySetChild</code> children for this <code>PolicySet</code>.
-         * 
-         * @return the <code>CombiningAlgorithm</code> for <code>PolicySetChild</code> children for this <code>PolicySet</code>.
-         */
-        public CombiningAlgorithm<PolicySetChild> getPolicyCombiningAlgorithm() {
-                return this.combiningAlgorithm;
-        }
-        
-        public void setPolicyCombiningAlgorithm(CombiningAlgorithm<PolicySetChild> combiningAlgorithmIn) {
-                this.combiningAlgorithm	= combiningAlgorithmIn;
+        Object objectToDump;
+        if ((objectToDump = this.getPolicyCombiningAlgorithm()) != null) {
+            stringBuilder.append(",policyCombiningAlgorithm=");
+            stringBuilder.append(objectToDump.toString());
         }
 
-        @Override
-        public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
-                /*
-                 * First check to see if we are valid.  If not, return an error status immediately
-                 */
-                if (evaluationContext.isTracing()) {
-                        evaluationContext.trace(new StdTraceEvent<Object>("PolicySet", this, null));
-                }
-                if (!this.validate()) {
-                        return new EvaluationResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                /*
-                 * See if we match
-                 */
-                MatchResult thisMatchResult	= this.match(evaluationContext);
-                assert(thisMatchResult != null);
-                if (evaluationContext.isTracing()) {
-                        evaluationContext.trace(new StdTraceEvent<MatchResult>("Match", this, thisMatchResult));
-                }
-                switch(thisMatchResult.getMatchCode()) {
-                case INDETERMINATE:
-                        return new EvaluationResult(Decision.INDETERMINATE, thisMatchResult.getStatus());
-                case MATCH:
-                        break;
-                case NOMATCH:
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
-                }
-                
-                /*
-                 * Get the combining elements
-                 */
-                List<CombiningElement<PolicySetChild>> listCombiningElements	= this.getCombiningPolicies();
-                assert(listCombiningElements != null);
-                
-                /*
-                 * Run the PolicyCombiningAlgorithm
-                 */
-                assert(this.getPolicyCombiningAlgorithm() != null);
-                EvaluationResult evaluationResultCombined	= this.getPolicyCombiningAlgorithm().combine(evaluationContext, listCombiningElements, getCombinerParameterList());
-                assert(evaluationResultCombined != null);
-                
-                if (evaluationResultCombined.getDecision() == Decision.DENY || evaluationResultCombined.getDecision() == Decision.PERMIT) {
-                        this.updateResult(evaluationResultCombined, evaluationContext);
-                        
-                        /*
-                         * Add my id to the policy set identifiers
-                         */
-                        if (evaluationContext.getRequest().getReturnPolicyIdList()) {
-                                evaluationResultCombined.addPolicySetIdentifier(this.getIdReference());
-                        }
-                }
-                if (evaluationContext.isTracing()) {
-                        evaluationContext.trace(new StdTraceEvent<Result>("Result", this, evaluationResultCombined));
-                }
-                return evaluationResultCombined;
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                String iteratorToDump;
-                if ((iteratorToDump = StringUtils.toString(this.getPolicyCombinerParameters())) != null) {
-                        stringBuilder.append(",policyCombinerParameters=");
-                        stringBuilder.append(iteratorToDump);
-                }
-                if ((iteratorToDump = StringUtils.toString(this.getChildren())) != null) {
-                        stringBuilder.append(",children=");
-                        stringBuilder.append(iteratorToDump);
-                }
-                Object objectToDump;
-                if ((objectToDump = this.getPolicyCombiningAlgorithm()) != null) {
-                        stringBuilder.append(",policyCombiningAlgorithm=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    @Override
+    public String getTraceId() {
+        return this.getIdentifier().stringValue();
+    }
 
-        @Override
-        public String getTraceId() {
-                return this.getIdentifier().stringValue();
-        }
-
-        @Override
-        public Traceable getCause() {
-                return null;
-        }
+    @Override
+    public Traceable getCause() {
+        return null;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySetChild.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySetChild.java
index f71589b..9255a5f 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySetChild.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySetChild.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,130 +40,130 @@
 /**
  * PolicySetChild extends {@link com.att.research.xacmlatt.pdp.PolicyComponent} to represent XACML 3.0 Policies, PolicySets, PolicyReferences,
  * and PolicySetReferences.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public abstract class PolicySetChild extends PolicyComponent implements Evaluatable, Matchable, Traceable {
-        private Identifier		identifier;
-        private PolicyDefaults	policyDefaults;
-        private PolicySet parent;
-        
-        /**
-         * Creates a new <code>PolicySetChild</code> with the given given {@link com.att.research.xacml.api.StatusCode} 
-         * and <code>String</code> status message.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> for the new <code>PolicySetChild</code>
-         * @param statusMessageIn the <code>String</code> status message for the new <code>PolicySetChild</code>
-         */
-        protected PolicySetChild(PolicySet parentIn, StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-                this.parent	= parentIn;
-        }
-        
-        protected PolicySetChild(StatusCode statusCodeIn, String statusMessageIn) {
-                this(null, statusCodeIn, statusMessageIn);
-        }
-        
-        /**
-         * Creates a new <code>PolicySetChild</code> with the default OK <code>StatusCode</code>.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> for this <code>PolicySetChild</code>
-         */
-        protected PolicySetChild(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-        
-        protected PolicySetChild(PolicySet parentIn) {
-                this.parent	= parentIn;
-        }
-        
-        /**
-         * Creates a new <code>PolicySetChild</code> with the default OK status.
-         */
-        protected PolicySetChild() {
-                super();
-        }
-        
-        /**
-         * Gets the <code>Identifier</code> for this <code>PolicySetChild</code>.
-         * 
-         * @return the <code>Identifier</code> for this <code>PolicySetChild</code>
-         */
-        public Identifier getIdentifier() {
-                return this.identifier;
-        }
-        
-        public void setIdentifier(Identifier identifierIn) {
-                this.identifier	= identifierIn;
-        }
-        
-        /**
-         * Gets the <code>PolicyDefaults</code> for this <code>PolicySetChild</code>.
-         * 
-         * @return the <code>PolicyDefaults</code> for this <code>PolicySetChild</code>
-         */
-        public PolicyDefaults getPolicyDefaults() {
-                return this.policyDefaults;
-        }
-        
-        /**
-         * Sets the <code>PolicyDefaults</code> for this <code>PolicySetChild</code>.
-         * 
-         * @param policyDefaultsIn the <code>PolicyDefaults</code> for this <code>PolicySetChild</code>
-         */
-        public void setPolicyDefaults(PolicyDefaults policyDefaultsIn) {
-                this.policyDefaults	= policyDefaultsIn;
-        }
-        
-        /**
-         * Gets the parent {@link PolicySet} containing this <code>PolicySetChild</code>
-         * or null if this is the root.
-         *  
-         * @return the parent <code>PolicySet</code> of this <code>PolicySetChild</code>
-         */
-        public PolicySet getParent() {
-                return this.parent;
-        }
-        
-        @Override
-        protected boolean validateComponent() {
-                if (this.getIdentifier() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing identifier");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
-        }
-        
-        @Override
-        public String getTraceId() {
-                return this.getIdentifier().stringValue();
-        }
-        
-        @Override
-        public Traceable getCause() {
-                return this.parent;
-        }
+    private Identifier		identifier;
+    private PolicyDefaults	policyDefaults;
+    private PolicySet parent;
 
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getIdentifier()) != null) {
-                        stringBuilder.append(",identifier=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getPolicyDefaults()) != null) {
-                        stringBuilder.append(",policyDefaults=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    /**
+     * Creates a new <code>PolicySetChild</code> with the given given {@link com.att.research.xacml.api.StatusCode}
+     * and <code>String</code> status message.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> for the new <code>PolicySetChild</code>
+     * @param statusMessageIn the <code>String</code> status message for the new <code>PolicySetChild</code>
+     */
+    protected PolicySetChild(PolicySet parentIn, StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+        this.parent	= parentIn;
+    }
+
+    protected PolicySetChild(StatusCode statusCodeIn, String statusMessageIn) {
+        this(null, statusCodeIn, statusMessageIn);
+    }
+
+    /**
+     * Creates a new <code>PolicySetChild</code> with the default OK <code>StatusCode</code>.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> for this <code>PolicySetChild</code>
+     */
+    protected PolicySetChild(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    protected PolicySetChild(PolicySet parentIn) {
+        this.parent	= parentIn;
+    }
+
+    /**
+     * Creates a new <code>PolicySetChild</code> with the default OK status.
+     */
+    protected PolicySetChild() {
+        super();
+    }
+
+    /**
+     * Gets the <code>Identifier</code> for this <code>PolicySetChild</code>.
+     *
+     * @return the <code>Identifier</code> for this <code>PolicySetChild</code>
+     */
+    public Identifier getIdentifier() {
+        return this.identifier;
+    }
+
+    public void setIdentifier(Identifier identifierIn) {
+        this.identifier	= identifierIn;
+    }
+
+    /**
+     * Gets the <code>PolicyDefaults</code> for this <code>PolicySetChild</code>.
+     *
+     * @return the <code>PolicyDefaults</code> for this <code>PolicySetChild</code>
+     */
+    public PolicyDefaults getPolicyDefaults() {
+        return this.policyDefaults;
+    }
+
+    /**
+     * Sets the <code>PolicyDefaults</code> for this <code>PolicySetChild</code>.
+     *
+     * @param policyDefaultsIn the <code>PolicyDefaults</code> for this <code>PolicySetChild</code>
+     */
+    public void setPolicyDefaults(PolicyDefaults policyDefaultsIn) {
+        this.policyDefaults	= policyDefaultsIn;
+    }
+
+    /**
+     * Gets the parent {@link PolicySet} containing this <code>PolicySetChild</code>
+     * or null if this is the root.
+     *
+     * @return the parent <code>PolicySet</code> of this <code>PolicySetChild</code>
+     */
+    public PolicySet getParent() {
+        return this.parent;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getIdentifier() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing identifier");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
+    }
+
+    @Override
+    public String getTraceId() {
+        return this.getIdentifier().stringValue();
+    }
+
+    @Override
+    public Traceable getCause() {
+        return this.parent;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getIdentifier()) != null) {
+            stringBuilder.append(",identifier=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getPolicyDefaults()) != null) {
+            stringBuilder.append(",policyDefaults=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySetIdReference.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySetIdReference.java
index 1860ce8..0c4b855 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySetIdReference.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/PolicySetIdReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,40 +38,40 @@
  * PolicySetIdReference extends {@link com.att.research.xacmlatt.pdp.policy.PolicyIdReferenceBase} for
  * {@link com.att.research.xacmlatt.pdp.PolicySet} objects to implement the <code>ensureReferencee</code>
  * method to find <code>PolicySet</code>s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class PolicySetIdReference extends PolicyIdReferenceBase<PolicySet> {
 
-        public PolicySetIdReference(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
-                super(policySetParent, statusCodeIn, statusMessageIn);
-        }
-        
-        public PolicySetIdReference(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    public PolicySetIdReference(PolicySet policySetParent, StatusCode statusCodeIn, String statusMessageIn) {
+        super(policySetParent, statusCodeIn, statusMessageIn);
+    }
 
-        public PolicySetIdReference(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-        
-        public PolicySetIdReference(PolicySet policySetParent) {
-                super(policySetParent);
-        }
+    public PolicySetIdReference(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        public PolicySetIdReference() {
-        }
+    public PolicySetIdReference(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-        @Override
-        protected PolicySet ensureReferencee(EvaluationContext evaluationContext) throws EvaluationException {
-                if (this.getReferencee() == null) {
-                        PolicyFinderResult<PolicySet> policyFactoryResult	= evaluationContext.getPolicySet(this.getIdReferenceMatch());
-                        if (policyFactoryResult.getStatus() == null || policyFactoryResult.getStatus().isOk()) {
-                                this.setReferencee(policyFactoryResult.getPolicyDef());
-                        }
-                }
-                return this.getReferencee();
+    public PolicySetIdReference(PolicySet policySetParent) {
+        super(policySetParent);
+    }
+
+    public PolicySetIdReference() {
+    }
+
+    @Override
+    protected PolicySet ensureReferencee(EvaluationContext evaluationContext) throws EvaluationException {
+        if (this.getReferencee() == null) {
+            PolicyFinderResult<PolicySet> policyFactoryResult	= evaluationContext.getPolicySet(this.getIdReferenceMatch());
+            if (policyFactoryResult.getStatus() == null || policyFactoryResult.getStatus().isOk()) {
+                this.setReferencee(policyFactoryResult.getPolicyDef());
+            }
         }
+        return this.getReferencee();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Rule.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Rule.java
index 8212439..d59dd02 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Rule.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Rule.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -56,264 +56,264 @@
  * Rule extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} to represent a XACML Rule within a Policy.  It implements
  * {@link com.att.research.xacmlatt.pdp.eval.Matchable} and {@link com.att.research.xacmlatt.pdp.eval.Evaluatable} for matching and evaluation
  * a request.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class Rule extends PolicyComponent implements Matchable, Evaluatable, Traceable {
-        private Policy						policy;
-        private String						ruleId;
-        private RuleEffect					ruleEffect;
-        private String 						description;
-        private Target						target;
-        private Condition					condition;
-        private List<ObligationExpression>	obligationExpressions	= new ArrayList<ObligationExpression>();
-        private List<AdviceExpression>		adviceExpressions		= new ArrayList<AdviceExpression>();
-        
-        protected List<ObligationExpression> getObligationExpressionList() {
-                return this.obligationExpressions;
+    private Policy						policy;
+    private String						ruleId;
+    private RuleEffect					ruleEffect;
+    private String 						description;
+    private Target						target;
+    private Condition					condition;
+    private List<ObligationExpression>	obligationExpressions	= new ArrayList<ObligationExpression>();
+    private List<AdviceExpression>		adviceExpressions		= new ArrayList<AdviceExpression>();
+
+    protected List<ObligationExpression> getObligationExpressionList() {
+        return this.obligationExpressions;
+    }
+
+    protected void clearObligationExpressions() {
+        this.getObligationExpressionList().clear();
+    }
+
+    protected List<AdviceExpression> getAdviceExpressionList() {
+        return this.adviceExpressions;
+    }
+
+    protected void clearAdviceExpressions() {
+        this.getAdviceExpressionList().clear();
+    }
+
+    public Rule(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public Rule(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public Rule() {
+    }
+
+    public Policy getPolicy() {
+        return this.policy;
+    }
+
+    public void setPolicy(Policy policyIn) {
+        this.policy	= policyIn;
+    }
+
+    public String getRuleId() {
+        return this.ruleId;
+    }
+
+    public void setRuleId(String ruleIdIn) {
+        this.ruleId	= ruleIdIn;
+    }
+
+    public RuleEffect getRuleEffect() {
+        return this.ruleEffect;
+    }
+
+    public void setRuleEffect(RuleEffect ruleEffectIn) {
+        this.ruleEffect	= ruleEffectIn;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+    public void setDescription(String descriptionIn) {
+        this.description	= descriptionIn;
+    }
+
+    public Target getTarget() {
+        return this.target;
+    }
+
+    public void setTarget(Target targetIn) {
+        this.target	= targetIn;
+    }
+
+    public Condition getCondition() {
+        return this.condition;
+    }
+
+    public void setCondition(Condition conditionIn) {
+        this.condition	= conditionIn;
+    }
+
+    public Iterator<ObligationExpression> getObligationExpressions() {
+        return (this.obligationExpressions == null ? null : this.obligationExpressions.iterator());
+    }
+
+    public void setObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
+        this.clearObligationExpressions();
+        if (obligationExpressionsIn != null) {
+            this.addObligationExpressions(obligationExpressionsIn);
         }
-        
-        protected void clearObligationExpressions() {
-                this.getObligationExpressionList().clear();
+    }
+
+    public void addObligationExpression(ObligationExpression obligationExpression) {
+        this.getObligationExpressionList().add(obligationExpression);
+    }
+
+    public void addObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
+        this.getObligationExpressionList().addAll(obligationExpressionsIn);
+    }
+
+    public Iterator<AdviceExpression> getAdviceExpressions() {
+        return (this.adviceExpressions == null ? null : this.adviceExpressions.iterator());
+    }
+
+    public void setAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
+        this.clearAdviceExpressions();
+        if (adviceExpressionsIn != null) {
+            this.addAdviceExpressions(adviceExpressionsIn);
         }
-        
-        protected List<AdviceExpression> getAdviceExpressionList() {
-                return this.adviceExpressions;
-        }
-        
-        protected void clearAdviceExpressions() {
-                this.getAdviceExpressionList().clear();
-        }
-        
-        public Rule(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
+    }
+
+    public void addAdviceExpression(AdviceExpression adviceExpression) {
+        this.getAdviceExpressionList().add(adviceExpression);
+    }
+
+    public void addAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
+        this.getAdviceExpressionList().addAll(adviceExpressionsIn);
+    }
+
+    @Override
+    public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
+        if (!this.validate()) {
+            return new EvaluationResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
 
-        public Rule(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+        /*
+         * See if our target matches
+         */
+        MatchResult matchResult	= this.match(evaluationContext);
+        if (evaluationContext.isTracing()) {
+            evaluationContext.trace(new StdTraceEvent<MatchResult>("Match", this, matchResult));
+        }
+        switch(matchResult.getMatchCode()) {
+        case INDETERMINATE:
+            return new EvaluationResult(Decision.INDETERMINATE, matchResult.getStatus());
+        case MATCH:
+            break;
+        case NOMATCH:
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
         }
 
-        public Rule() {
-        }
-        
-        public Policy getPolicy() {
-                return this.policy;
-        }
-        
-        public void setPolicy(Policy policyIn) {
-                this.policy	= policyIn;
-        }
-        
-        public String getRuleId() {
-                return this.ruleId;
-        }
-        
-        public void setRuleId(String ruleIdIn) {
-                this.ruleId	= ruleIdIn;
-        }
-        
-        public RuleEffect getRuleEffect() {
-                return this.ruleEffect;
-        }
-        
-        public void setRuleEffect(RuleEffect ruleEffectIn) {
-                this.ruleEffect	= ruleEffectIn;
-        }
-        
-        public String getDescription() {
-                return this.description;
-        }
-        
-        public void setDescription(String descriptionIn) {
-                this.description	= descriptionIn;
-        }
-        
-        public Target getTarget() {
-                return this.target;
-        }
-        
-        public void setTarget(Target targetIn) {
-                this.target	= targetIn;
-        }
-        
-        public Condition getCondition() {
-                return this.condition;
-        }
-        
-        public void setCondition(Condition conditionIn) {
-                this.condition	= conditionIn;
-        }
-        
-        public Iterator<ObligationExpression> getObligationExpressions() {
-                return (this.obligationExpressions == null ? null : this.obligationExpressions.iterator());
-        }
-        
-        public void setObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
-                this.clearObligationExpressions();
-                if (obligationExpressionsIn != null) {
-                        this.addObligationExpressions(obligationExpressionsIn);
-                }
-        }
-        
-        public void addObligationExpression(ObligationExpression obligationExpression) {
-                this.getObligationExpressionList().add(obligationExpression);
-        }
-        
-        public void addObligationExpressions(Collection<ObligationExpression> obligationExpressionsIn) {
-                this.getObligationExpressionList().addAll(obligationExpressionsIn);
+        /*
+         * See if our condition matches
+         */
+        Condition thisCondition	= this.getCondition();
+        if (thisCondition != null) {
+            ExpressionResultBoolean expressionResultCondition	= thisCondition.evaluate(evaluationContext, this.getPolicy().getPolicyDefaults());
+            assert(expressionResultCondition != null);
+
+            if (evaluationContext.isTracing()) {
+                evaluationContext.trace(new StdTraceEvent<ExpressionResultBoolean>("Condition", this, expressionResultCondition));
+            }
+
+            if (!expressionResultCondition.isOk()) {
+                return new EvaluationResult(Decision.INDETERMINATE, expressionResultCondition.getStatus());
+            } else if (!expressionResultCondition.isTrue()) {
+                return new EvaluationResult(Decision.NOTAPPLICABLE);
+            }
         }
 
-        public Iterator<AdviceExpression> getAdviceExpressions() {
-                return (this.adviceExpressions == null ? null : this.adviceExpressions.iterator());
+        /*
+         * The target and condition match, so we can start creating the EvaluationResult
+         */
+        List<Obligation> listObligations	= ObligationExpression.evaluate(evaluationContext, this.getPolicy().getPolicyDefaults(), this.getRuleEffect().getDecision(), this.getObligationExpressionList());
+        List<Advice> listAdvices			= AdviceExpression.evaluate(evaluationContext, this.getPolicy().getPolicyDefaults(), this.getRuleEffect().getDecision(), this.getAdviceExpressionList());
+
+        EvaluationResult evaluationResult	= new EvaluationResult(this.getRuleEffect().getDecision(), listObligations, listAdvices);
+        if (evaluationContext.isTracing()) {
+            evaluationContext.trace(new StdTraceEvent<Result>("Result", this, evaluationResult));
         }
-        
-        public void setAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
-                this.clearAdviceExpressions();
-                if (adviceExpressionsIn != null) {
-                        this.addAdviceExpressions(adviceExpressionsIn);
-                }
+        return evaluationResult;
+    }
+
+    @Override
+    public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
+        if (!this.validate()) {
+            return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
-        
-        public void addAdviceExpression(AdviceExpression adviceExpression) {
-                this.getAdviceExpressionList().add(adviceExpression);
+        Target thisTarget	= this.getTarget();
+        if (thisTarget != null) {
+            return thisTarget.match(evaluationContext);
+        } else {
+            return MatchResult.MM_MATCH;
         }
-        
-        public void addAdviceExpressions(Collection<AdviceExpression> adviceExpressionsIn) {
-                this.getAdviceExpressionList().addAll(adviceExpressionsIn);
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getRuleId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing rule id");
+            return false;
+        } else if (this.getPolicy() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Rule not in a Policy");
+            return false;
+        } else if (this.getRuleEffect() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing effect");
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        StringBuffer stringBuffer	= new StringBuffer("{");
+        stringBuffer.append("super=");
+        stringBuffer.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getRuleId()) != null) {
+            stringBuffer.append(",ruleId=");
+            stringBuffer.append((String)objectToDump);
+        }
+        if ((objectToDump = this.getRuleEffect()) != null) {
+            stringBuffer.append(",ruleEffect=");
+            stringBuffer.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getDescription()) != null) {
+            stringBuffer.append(",description=");
+            stringBuffer.append((String)objectToDump);
+        }
+        if ((objectToDump = this.getTarget()) != null) {
+            stringBuffer.append(",target=");
+            stringBuffer.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getCondition()) != null) {
+            stringBuffer.append(",condition=");
+            stringBuffer.append(objectToDump.toString());
         }
 
-        @Override
-        public EvaluationResult evaluate(EvaluationContext evaluationContext) throws EvaluationException {
-                if (!this.validate()) {
-                        return new EvaluationResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                /*
-                 * See if our target matches
-                 */
-                MatchResult matchResult	= this.match(evaluationContext);
-                if (evaluationContext.isTracing()) {
-                        evaluationContext.trace(new StdTraceEvent<MatchResult>("Match", this, matchResult));
-                }
-                switch(matchResult.getMatchCode()) {
-                case INDETERMINATE:
-                        return new EvaluationResult(Decision.INDETERMINATE, matchResult.getStatus());
-                case MATCH:
-                        break;
-                case NOMATCH:
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
-                }
-                
-                /*
-                 * See if our condition matches
-                 */
-                Condition thisCondition	= this.getCondition();
-                if (thisCondition != null) {
-                        ExpressionResultBoolean expressionResultCondition	= thisCondition.evaluate(evaluationContext, this.getPolicy().getPolicyDefaults());
-                        assert(expressionResultCondition != null);
-                        
-                        if (evaluationContext.isTracing()) {
-                                evaluationContext.trace(new StdTraceEvent<ExpressionResultBoolean>("Condition", this, expressionResultCondition));
-                        }
-                        
-                        if (!expressionResultCondition.isOk()) {
-                                return new EvaluationResult(Decision.INDETERMINATE, expressionResultCondition.getStatus());
-                        } else if (!expressionResultCondition.isTrue()) {
-                                return new EvaluationResult(Decision.NOTAPPLICABLE);
-                        }
-                }
-                
-                /*
-                 * The target and condition match, so we can start creating the EvaluationResult
-                 */
-                List<Obligation> listObligations	= ObligationExpression.evaluate(evaluationContext, this.getPolicy().getPolicyDefaults(), this.getRuleEffect().getDecision(), this.getObligationExpressionList());
-                List<Advice> listAdvices			= AdviceExpression.evaluate(evaluationContext, this.getPolicy().getPolicyDefaults(), this.getRuleEffect().getDecision(), this.getAdviceExpressionList());
-                
-                EvaluationResult evaluationResult	= new EvaluationResult(this.getRuleEffect().getDecision(), listObligations, listAdvices);
-                if (evaluationContext.isTracing()) {
-                        evaluationContext.trace(new StdTraceEvent<Result>("Result", this, evaluationResult));
-                }
-                return evaluationResult;
+        String iterToDump;
+        if ((iterToDump = StringUtils.toString(this.getObligationExpressions())) != null) {
+            stringBuffer.append(",obligationExpressions=");
+            stringBuffer.append(iterToDump);
         }
+        if ((iterToDump = StringUtils.toString(this.getAdviceExpressions())) != null) {
+            stringBuffer.append(",adviceExpressions=");
+            stringBuffer.append(iterToDump);
+        }
+        stringBuffer.append('}');
+        return stringBuffer.toString();
+    }
 
-        @Override
-        public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
-                if (!this.validate()) {
-                        return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                Target thisTarget	= this.getTarget();
-                if (thisTarget != null) {
-                        return thisTarget.match(evaluationContext);
-                } else {
-                        return MatchResult.MM_MATCH;
-                }
-        }
+    @Override
+    public String getTraceId() {
+        return this.getRuleId();
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getRuleId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing rule id");
-                        return false;
-                } else if (this.getPolicy() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Rule not in a Policy");
-                        return false;
-                } else if (this.getRuleEffect() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing effect");
-                        return false;
-                }
-                return true;
-        }
-        
-        @Override
-        public String toString() {
-                StringBuffer stringBuffer	= new StringBuffer("{");
-                stringBuffer.append("super=");
-                stringBuffer.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getRuleId()) != null) {
-                        stringBuffer.append(",ruleId=");
-                        stringBuffer.append((String)objectToDump);
-                }
-                if ((objectToDump = this.getRuleEffect()) != null) {
-                        stringBuffer.append(",ruleEffect=");
-                        stringBuffer.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getDescription()) != null) {
-                        stringBuffer.append(",description=");
-                        stringBuffer.append((String)objectToDump);
-                }
-                if ((objectToDump = this.getTarget()) != null) {
-                        stringBuffer.append(",target=");
-                        stringBuffer.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getCondition()) != null) {
-                        stringBuffer.append(",condition=");
-                        stringBuffer.append(objectToDump.toString());
-                }
-                
-                String iterToDump;
-                if ((iterToDump = StringUtils.toString(this.getObligationExpressions())) != null) {
-                        stringBuffer.append(",obligationExpressions=");
-                        stringBuffer.append(iterToDump);
-                }
-                if ((iterToDump = StringUtils.toString(this.getAdviceExpressions())) != null) {
-                        stringBuffer.append(",adviceExpressions=");
-                        stringBuffer.append(iterToDump);
-                }
-                stringBuffer.append('}');
-                return stringBuffer.toString();
-        }
-
-        @Override
-        public String getTraceId() {
-                return this.getRuleId();
-        }
-
-        @Override
-        public Traceable getCause() {
-                return this.policy;
-        }
+    @Override
+    public Traceable getCause() {
+        return this.policy;
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/RuleEffect.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/RuleEffect.java
index 09b53fb..a879145 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/RuleEffect.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/RuleEffect.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,47 +35,47 @@
 /**
  * RuleEffect is an enumeration of the XACML decision effects that a {@link Rule} may apply
  * to.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public enum RuleEffect {
-        DENY("Deny", Decision.DENY),
-        PERMIT("Permit", Decision.PERMIT)
-        ;
-        
-        private String name;
-        private Decision decision;
-        private RuleEffect(String nameIn, Decision decisionIn) {
-                this.name		= nameIn;
-                this.decision	= decisionIn;
+    DENY("Deny", Decision.DENY),
+    PERMIT("Permit", Decision.PERMIT)
+    ;
+
+    private String name;
+    private Decision decision;
+    private RuleEffect(String nameIn, Decision decisionIn) {
+        this.name		= nameIn;
+        this.decision	= decisionIn;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public Decision getDecision() {
+        return this.decision;
+    }
+
+    @Override
+    public String toString() {
+        return this.getName();
+    }
+
+    /**
+     * Maps a XACML rule effect <code>String</code> name to the matching <code>RuleEffect</code>.
+     *
+     * @param effectName the <code>String</code> effect name to match
+     * @return the matching <code>RuleEffect</code> or null if there is no match
+     */
+    public static RuleEffect getRuleEffect(String effectName) {
+        for (RuleEffect ruleEffect: RuleEffect.values()) {
+            if (ruleEffect.getName().equalsIgnoreCase(effectName)) {
+                return ruleEffect;
+            }
         }
-        
-        public String getName() {
-                return this.name;
-        }
-        
-        public Decision getDecision() {
-                return this.decision;
-        }
-        
-        @Override
-        public String toString() {
-                return this.getName();
-        }
-        
-        /**
-         * Maps a XACML rule effect <code>String</code> name to the matching <code>RuleEffect</code>.
-         * 
-         * @param effectName the <code>String</code> effect name to match
-         * @return the matching <code>RuleEffect</code> or null if there is no match
-         */
-        public static RuleEffect getRuleEffect(String effectName) {
-                for (RuleEffect ruleEffect: RuleEffect.values()) {
-                        if (ruleEffect.getName().equalsIgnoreCase(effectName)) {
-                                return ruleEffect;
-                        }
-                }
-                return null;
-        }
+        return null;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Target.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Target.java
index f97ee21..5a00150 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Target.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/Target.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,113 +46,113 @@
 /**
  * Target extends {@link com.att.research.xacmlatt.pdp.policy.PolicyComponent} to implement XACML 3.0 Target elements for
  * Policies, PolicySets, and Rules.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class Target extends PolicyComponent implements Matchable {
-        private List<AnyOf>	anyOfs;
-        
-        protected List<AnyOf> getAnyOfList(boolean bNoNull) {
-                if (this.anyOfs == null && bNoNull) {
-                        this.anyOfs	= new ArrayList<AnyOf>();
-                }
-                return this.anyOfs;
-        }
-        
-        protected void clearAnyOfList() {
-                if (this.anyOfs != null) {
-                        this.anyOfs.clear();
-                }
-        }
-        
-        public Target(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private List<AnyOf>	anyOfs;
 
-        public Target(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+    protected List<AnyOf> getAnyOfList(boolean bNoNull) {
+        if (this.anyOfs == null && bNoNull) {
+            this.anyOfs	= new ArrayList<AnyOf>();
         }
+        return this.anyOfs;
+    }
 
-        public Target() {
+    protected void clearAnyOfList() {
+        if (this.anyOfs != null) {
+            this.anyOfs.clear();
         }
-        
-        public Target(Collection<AnyOf> anyOfsIn) {
-                if (anyOfsIn != null) {
-                        this.addAnyOfs(anyOfsIn);
-                }
-        }
-        
-        public Target(AnyOf anyOfIn) {
-                if (anyOfIn != null) {
-                        this.addAnyOf(anyOfIn);
-                }
-        }
-        
-        /**
-         * Gets an <code>Iterator</code> over all of the {@link AnyOf}s in this <code>Target</code>.
-         * 
-         * @return an <code>Iterator</code> over all of the <code>AnyOf</code>s in this <code>Target</code> or null if there are none
-         */
-        public Iterator<AnyOf> getAnyOfs() {
-                return (this.anyOfs == null ? null : this.anyOfs.iterator());
-        }
-        
-        public void setAnyOfs(Collection<AnyOf> anyOfsIn) {
-                this.clearAnyOfList();
-                if (anyOfsIn != null) {
-                        this.addAnyOfs(anyOfsIn);
-                }
-        }
-        
-        public void addAnyOf(AnyOf anyOfIn) {
-                List<AnyOf> listAnyOfs	= this.getAnyOfList(true);
-                listAnyOfs.add(anyOfIn);
-        }
-        
-        public void addAnyOfs(Collection<AnyOf> anyOfsIn) {
-                List<AnyOf> listAnyOfs	= this.getAnyOfList(true);
-                listAnyOfs.addAll(anyOfsIn);
-        }
+    }
 
-        @Override
-        public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
-                if (!this.validate()) {
-                        return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                Iterator<AnyOf> iterAnyOfs	= this.getAnyOfs();
-                if (iterAnyOfs == null || !iterAnyOfs.hasNext()) {
-                        return MatchResult.MM_MATCH;
-                } else {
-                        MatchResult matchResult	= MatchResult.MM_MATCH;
-                        while (iterAnyOfs.hasNext()) {
-                                matchResult	= iterAnyOfs.next().match(evaluationContext);
-                                if (matchResult.getMatchCode() != MatchResult.MatchCode.MATCH) {
-                                        return matchResult;
-                                }
-                        }
-                        return matchResult;
-                }
-        }
+    public Target(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                return true;
+    public Target(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public Target() {
+    }
+
+    public Target(Collection<AnyOf> anyOfsIn) {
+        if (anyOfsIn != null) {
+            this.addAnyOfs(anyOfsIn);
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                String iterToDump	= StringUtils.toString(this.getAnyOfs());
-                if (iterToDump != null) {
-                        stringBuilder.append(",anyOfs=");
-                        stringBuilder.append(iterToDump);
+    }
+
+    public Target(AnyOf anyOfIn) {
+        if (anyOfIn != null) {
+            this.addAnyOf(anyOfIn);
+        }
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over all of the {@link AnyOf}s in this <code>Target</code>.
+     *
+     * @return an <code>Iterator</code> over all of the <code>AnyOf</code>s in this <code>Target</code> or null if there are none
+     */
+    public Iterator<AnyOf> getAnyOfs() {
+        return (this.anyOfs == null ? null : this.anyOfs.iterator());
+    }
+
+    public void setAnyOfs(Collection<AnyOf> anyOfsIn) {
+        this.clearAnyOfList();
+        if (anyOfsIn != null) {
+            this.addAnyOfs(anyOfsIn);
+        }
+    }
+
+    public void addAnyOf(AnyOf anyOfIn) {
+        List<AnyOf> listAnyOfs	= this.getAnyOfList(true);
+        listAnyOfs.add(anyOfIn);
+    }
+
+    public void addAnyOfs(Collection<AnyOf> anyOfsIn) {
+        List<AnyOf> listAnyOfs	= this.getAnyOfList(true);
+        listAnyOfs.addAll(anyOfsIn);
+    }
+
+    @Override
+    public MatchResult match(EvaluationContext evaluationContext) throws EvaluationException {
+        if (!this.validate()) {
+            return new MatchResult(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        }
+        Iterator<AnyOf> iterAnyOfs	= this.getAnyOfs();
+        if (iterAnyOfs == null || !iterAnyOfs.hasNext()) {
+            return MatchResult.MM_MATCH;
+        } else {
+            MatchResult matchResult	= MatchResult.MM_MATCH;
+            while (iterAnyOfs.hasNext()) {
+                matchResult	= iterAnyOfs.next().match(evaluationContext);
+                if (matchResult.getMatchCode() != MatchResult.MatchCode.MATCH) {
+                    return matchResult;
                 }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+            }
+            return matchResult;
         }
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        String iterToDump	= StringUtils.toString(this.getAnyOfs());
+        if (iterToDump != null) {
+            stringBuilder.append(",anyOfs=");
+            stringBuilder.append(iterToDump);
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/TargetedCombinerParameter.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/TargetedCombinerParameter.java
index 3d7881d..52afcdb 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/TargetedCombinerParameter.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/TargetedCombinerParameter.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,91 +37,91 @@
  * TargetedCombinerParameter extends {@link CombinerParameter} to include a lazy
  * reference to a particular sub-element within the evaluatable children that should be used when combining evaluation
  * results from that sub-element.
- * 
+ *
  * @author car
  *
  * @param <T> the type of the identifier used to reference the targeted object
  * @param <U> the type of the targeted object
  */
 public class TargetedCombinerParameter<T, U> extends CombinerParameter {
-        private T	targetId;
-        private U	target;
-        
-        public TargetedCombinerParameter(T targetIdIn, String nameIn, AttributeValue<?> attributeValueIn, StatusCode statusCodeIn, String statusMessageIn) {
-                super(nameIn, attributeValueIn, statusCodeIn, statusMessageIn);
-                this.targetId	= targetIdIn;
-        }
+    private T	targetId;
+    private U	target;
 
-        public TargetedCombinerParameter(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    public TargetedCombinerParameter(T targetIdIn, String nameIn, AttributeValue<?> attributeValueIn, StatusCode statusCodeIn, String statusMessageIn) {
+        super(nameIn, attributeValueIn, statusCodeIn, statusMessageIn);
+        this.targetId	= targetIdIn;
+    }
 
-        public TargetedCombinerParameter(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
+    public TargetedCombinerParameter(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        public TargetedCombinerParameter(T targetIdIn, String nameIn, AttributeValue<?> attributeValueIn) {
-                super(nameIn, attributeValueIn);
-                this.targetId	= targetIdIn;
+    public TargetedCombinerParameter(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public TargetedCombinerParameter(T targetIdIn, String nameIn, AttributeValue<?> attributeValueIn) {
+        super(nameIn, attributeValueIn);
+        this.targetId	= targetIdIn;
+    }
+
+    public TargetedCombinerParameter() {
+
+    }
+
+    /**
+     * Gets the target id of this <code>TargetedCombinerParameter</code>.
+     *
+     * @return the <code>T</code> id of this <code>TargetedCombinerParameter</code>
+     */
+    public T getTargetId() {
+        return this.targetId;
+    }
+
+    /**
+     * Sets the target id to the given <code>T</code> value.
+     *
+     * @param targetIdIn the <code>T</code> to set as the target id
+     */
+    public void setTargetId(T targetIdIn) {
+        this.targetId	= targetIdIn;
+    }
+
+    /**
+     * Gets the target for this <code>TargetedCombinerParameter</code>.
+     *
+     * @return the <code>U</code> target for this <code>TargetedCombinerParameter</code>
+     */
+    public U getTarget() {
+        return this.target;
+    }
+
+    /**
+     * Sets the target for this <code>TargetedCombinerParameter</code> to the given <code>U</code>.
+     *
+     * @param targetIn the <code>U</code> target for this <code>TargetedCombinerParameter</code>
+     */
+    public void setTarget(U targetIn) {
+        this.target	= targetIn;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getTargetId()) != null) {
+            stringBuilder.append("targetId=");
+            stringBuilder.append(objectToDump.toString());
         }
-        
-        public TargetedCombinerParameter() {
-                
+        if ((objectToDump = this.getTarget()) != null) {
+            stringBuilder.append("target=");
+            stringBuilder.append(objectToDump.toString());
         }
-        
-        /**
-         * Gets the target id of this <code>TargetedCombinerParameter</code>.
-         * 
-         * @return the <code>T</code> id of this <code>TargetedCombinerParameter</code>
-         */
-        public T getTargetId() {
-                return this.targetId;
-        }
-        
-        /**
-         * Sets the target id to the given <code>T</code> value.
-         * 
-         * @param targetIdIn the <code>T</code> to set as the target id
-         */
-        public void setTargetId(T targetIdIn) {
-                this.targetId	= targetIdIn;
-        }
-        
-        /**
-         * Gets the target for this <code>TargetedCombinerParameter</code>.
-         * 
-         * @return the <code>U</code> target for this <code>TargetedCombinerParameter</code>
-         */
-        public U getTarget() {
-                return this.target;
-        }
-        
-        /**
-         * Sets the target for this <code>TargetedCombinerParameter</code> to the given <code>U</code>.
-         * 
-         * @param targetIn the <code>U</code> target for this <code>TargetedCombinerParameter</code>
-         */
-        public void setTarget(U targetIn) {
-                this.target	= targetIn;
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getTargetId()) != null) {
-                        stringBuilder.append("targetId=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getTarget()) != null) {
-                        stringBuilder.append("target=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/TargetedCombinerParameterMap.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/TargetedCombinerParameterMap.java
index 3bbff1c..2edf297 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/TargetedCombinerParameterMap.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/TargetedCombinerParameterMap.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,7 +40,7 @@
 /**
  * TargetedCombinerParameterMap is a utility for maintaining a collection of {@link com.att.research.xacmlatt.policy.TargetedCombinerParameter}
  * objects with the mappings to their targets.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  *
@@ -48,128 +48,128 @@
  * @param <U> the type of the object referenced by the identifier
  */
 public class TargetedCombinerParameterMap<T, U> {
-        List<TargetedCombinerParameter<T,U>>	targetedCombinerParameters		= null;
-        Map<T,U>								mapTargetIdToTarget				= new HashMap<T,U>();
-        Map<U,List<CombinerParameter>>			mapTargetToCombinerParameters	= null;
-        
-        private void ensureTargetedCombinerParameters() {
-                if (this.targetedCombinerParameters == null) {
-                        this.targetedCombinerParameters	= new ArrayList<TargetedCombinerParameter<T,U>>();
+    List<TargetedCombinerParameter<T,U>>	targetedCombinerParameters		= null;
+    Map<T,U>								mapTargetIdToTarget				= new HashMap<T,U>();
+    Map<U,List<CombinerParameter>>			mapTargetToCombinerParameters	= null;
+
+    private void ensureTargetedCombinerParameters() {
+        if (this.targetedCombinerParameters == null) {
+            this.targetedCombinerParameters	= new ArrayList<TargetedCombinerParameter<T,U>>();
+        }
+    }
+
+    /**
+     * Gets the target from the given <code>TargetedCombinerParameter</code> if present.  If not, find the
+     * target in the target id to target mapping, update the <code>TargetedCombinerParameter</code> and then
+     * return the target.
+     *
+     * @param targetedCombinerParameter the <code>TargetedCombinerParameter</code> to resolve
+     * @return the target for the given <code>TargetedCombinerParameter</code>
+     */
+    protected U resolve(TargetedCombinerParameter<T,U> targetedCombinerParameter) {
+        U result;
+        if ((result = targetedCombinerParameter.getTarget()) != null) {
+            return result;
+        } else if ((result = this.mapTargetIdToTarget.get(targetedCombinerParameter.getTargetId())) != null) {
+            targetedCombinerParameter.setTarget(result);
+            return result;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * Ensures the <code>Map</code> from targets to <code>List</code> of <code>CombinerParameter</code>s has been
+     * created if needed.
+     *
+     * @throws IllegalStateException if there are <code>TargetedCombinerParameter</code>s that cannot be resolved
+     */
+    protected void ensureMap() throws IllegalStateException {
+        if (this.mapTargetToCombinerParameters == null) {
+            if (this.targetedCombinerParameters != null && this.targetedCombinerParameters.size() > 0) {
+                this.mapTargetToCombinerParameters	= new HashMap<U,List<CombinerParameter>>();
+                for (TargetedCombinerParameter<T,U> targetedCombinerParameter: this.targetedCombinerParameters) {
+                    U	target	= this.resolve(targetedCombinerParameter);
+                    if (target == null) {
+                        throw new IllegalStateException("Unresolved TargetCombinerParameter \"" + targetedCombinerParameter.toString() + "\"");
+                    }
+                    List<CombinerParameter>	listCombinerParameters	= this.mapTargetToCombinerParameters.get(target);
+                    if (listCombinerParameters == null) {
+                        listCombinerParameters	= new ArrayList<CombinerParameter>();
+                        this.mapTargetToCombinerParameters.put(target, listCombinerParameters);
+                    }
+                    listCombinerParameters.add(targetedCombinerParameter);
                 }
+            }
         }
-        
-        /**
-         * Gets the target from the given <code>TargetedCombinerParameter</code> if present.  If not, find the
-         * target in the target id to target mapping, update the <code>TargetedCombinerParameter</code> and then
-         * return the target.
-         * 
-         * @param targetedCombinerParameter the <code>TargetedCombinerParameter</code> to resolve
-         * @return the target for the given <code>TargetedCombinerParameter</code>
-         */
-        protected U resolve(TargetedCombinerParameter<T,U> targetedCombinerParameter) {
-                U result;
-                if ((result = targetedCombinerParameter.getTarget()) != null) {
-                        return result;
-                } else if ((result = this.mapTargetIdToTarget.get(targetedCombinerParameter.getTargetId())) != null) {
-                        targetedCombinerParameter.setTarget(result);
-                        return result;
-                } else {
-                        return null;
-                }
+    }
+
+    /**
+     * Creates a new <code>TargetedCombinerParameterMap</code>.
+     */
+    public TargetedCombinerParameterMap() {
+    }
+
+    /**
+     * Adds a new target object to the identifier map.
+     *
+     * @param targetId the id for the target
+     * @param target the target
+     */
+    public void addTarget(T targetId, U target) {
+        this.mapTargetIdToTarget.put(targetId, target);
+    }
+
+    /**
+     * Adds a new <code>TargetedCombinerParameter</code> to this <code>TargetedCombinerParameterMap</code>.
+     *
+     * @param targetdCombinerParameter the <code>TargetedCombinerParameter</code> to add
+     */
+    public void addCombinerParameter(TargetedCombinerParameter<T,U> targetdCombinerParameter) {
+        this.ensureTargetedCombinerParameters();
+        this.targetedCombinerParameters.add(targetdCombinerParameter);
+        this.mapTargetToCombinerParameters	= null;
+    }
+
+    /**
+     * Adds the contents of the given <code>Collection</code> of <code>TargetedCombinerParameter</code>s to this <code>TargetedCombinerParameterMap</code>.
+     *
+     * @param listTargetedCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to add
+     */
+    public void addCombinerParameters(Collection<TargetedCombinerParameter<T,U>> listTargetedCombinerParameters) {
+        this.ensureTargetedCombinerParameters();
+        this.targetedCombinerParameters.addAll(listTargetedCombinerParameters);
+        this.mapTargetToCombinerParameters	= null;
+    }
+
+    /**
+     * Sets the set of <code>TargetedCombinerParameter</code>s for this <code>TargetedCombinerParameterMap</code> to the contents of the
+     * given <code>Collection</code>>
+     *
+     * @param listTargetedCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to set
+     */
+    public void setCombinerParameters(Collection<TargetedCombinerParameter<T,U>> listTargetedCombinerParameters) {
+        this.targetedCombinerParameters	= null;
+        if (listTargetedCombinerParameters != null) {
+            this.addCombinerParameters(targetedCombinerParameters);
         }
-        
-        /**
-         * Ensures the <code>Map</code> from targets to <code>List</code> of <code>CombinerParameter</code>s has been
-         * created if needed.
-         * 
-         * @throws IllegalStateException if there are <code>TargetedCombinerParameter</code>s that cannot be resolved
-         */
-        protected void ensureMap() throws IllegalStateException {
-                if (this.mapTargetToCombinerParameters == null) {
-                        if (this.targetedCombinerParameters != null && this.targetedCombinerParameters.size() > 0) {
-                                this.mapTargetToCombinerParameters	= new HashMap<U,List<CombinerParameter>>();
-                                for (TargetedCombinerParameter<T,U> targetedCombinerParameter: this.targetedCombinerParameters) {
-                                        U	target	= this.resolve(targetedCombinerParameter);
-                                        if (target == null) {
-                                                throw new IllegalStateException("Unresolved TargetCombinerParameter \"" + targetedCombinerParameter.toString() + "\"");
-                                        }
-                                        List<CombinerParameter>	listCombinerParameters	= this.mapTargetToCombinerParameters.get(target);
-                                        if (listCombinerParameters == null) {
-                                                listCombinerParameters	= new ArrayList<CombinerParameter>();
-                                                this.mapTargetToCombinerParameters.put(target, listCombinerParameters);
-                                        }
-                                        listCombinerParameters.add(targetedCombinerParameter);
-                                }
-                        }
-                }
-        }
-        
-        /**
-         * Creates a new <code>TargetedCombinerParameterMap</code>.
-         */
-        public TargetedCombinerParameterMap() {
-        }
-        
-        /**
-         * Adds a new target object to the identifier map.
-         * 
-         * @param targetId the id for the target
-         * @param target the target
-         */
-        public void addTarget(T targetId, U target) {
-                this.mapTargetIdToTarget.put(targetId, target);
-        }
-        
-        /**
-         * Adds a new <code>TargetedCombinerParameter</code> to this <code>TargetedCombinerParameterMap</code>.
-         * 
-         * @param targetdCombinerParameter the <code>TargetedCombinerParameter</code> to add
-         */
-        public void addCombinerParameter(TargetedCombinerParameter<T,U> targetdCombinerParameter) {
-                this.ensureTargetedCombinerParameters();
-                this.targetedCombinerParameters.add(targetdCombinerParameter);
-                this.mapTargetToCombinerParameters	= null;
-        }
-        
-        /**
-         * Adds the contents of the given <code>Collection</code> of <code>TargetedCombinerParameter</code>s to this <code>TargetedCombinerParameterMap</code>.
-         * 
-         * @param listTargetedCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to add
-         */
-        public void addCombinerParameters(Collection<TargetedCombinerParameter<T,U>> listTargetedCombinerParameters) {
-                this.ensureTargetedCombinerParameters();
-                this.targetedCombinerParameters.addAll(listTargetedCombinerParameters);
-                this.mapTargetToCombinerParameters	= null;
-        }
-        
-        /**
-         * Sets the set of <code>TargetedCombinerParameter</code>s for this <code>TargetedCombinerParameterMap</code> to the contents of the
-         * given <code>Collection</code>>
-         * 
-         * @param listTargetedCombinerParameters the <code>Collection</code> of <code>TargetedCombinerParameter</code>s to set
-         */
-        public void setCombinerParameters(Collection<TargetedCombinerParameter<T,U>> listTargetedCombinerParameters) {
-                this.targetedCombinerParameters	= null;
-                if (listTargetedCombinerParameters != null) {
-                        this.addCombinerParameters(targetedCombinerParameters);
-                }
-        }
-        
-        /**
-         * Looks up the given target in the map for any {@link CombinerParameter}s for the
-         * given target.
-         * 
-         * @param target the target
-         * @return a <code>List</code> of <code>CombinerParameter</code>s for the target or null if none
-         * @throws IllegalStateException if there are <code>TargetedCombinerParameter</code>s that cannot be resolved
-         */
-        public List<CombinerParameter> getCombinerParameters(U target) throws IllegalStateException {
-                this.ensureMap();
-                return (this.mapTargetToCombinerParameters == null ? null : this.mapTargetToCombinerParameters.get(target));
-        }
-        
-        public Iterator<TargetedCombinerParameter<T,U>> getTargetedCombinerParameters() {
-                return (this.targetedCombinerParameters == null ? null : this.targetedCombinerParameters.iterator());
-        }
+    }
+
+    /**
+     * Looks up the given target in the map for any {@link CombinerParameter}s for the
+     * given target.
+     *
+     * @param target the target
+     * @return a <code>List</code> of <code>CombinerParameter</code>s for the target or null if none
+     * @throws IllegalStateException if there are <code>TargetedCombinerParameter</code>s that cannot be resolved
+     */
+    public List<CombinerParameter> getCombinerParameters(U target) throws IllegalStateException {
+        this.ensureMap();
+        return (this.mapTargetToCombinerParameters == null ? null : this.mapTargetToCombinerParameters.get(target));
+    }
+
+    public Iterator<TargetedCombinerParameter<T,U>> getTargetedCombinerParameters() {
+        return (this.targetedCombinerParameters == null ? null : this.targetedCombinerParameters.iterator());
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/VariableDefinition.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/VariableDefinition.java
index b600859..4aef982 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/VariableDefinition.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/VariableDefinition.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,92 +35,92 @@
 
 /**
  * VariableDefinition extends {@link PolicyComponent} to represent a XACML VariableDefinition element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class VariableDefinition extends PolicyComponent {
-        private String id;
-        private Expression expression;
-        
-        public VariableDefinition(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private String id;
+    private Expression expression;
 
-        public VariableDefinition(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-        
-        public VariableDefinition() {
-                super();
-        }
+    public VariableDefinition(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        /**
-         * Gets the id of the variable for this <code>VariableDefinition</code>.
-         * 
-         * @return the <code>String</code> id for the variable for this <code>VariableDefinition</code>.
-         */
-        public String getId() {
-                return this.id;
-        }
-        
-        /**
-         * Sets the id of the variable for this <code>VariableDefinition</code>.
-         * 
-         * @param idIn the <code>String</code> id for the variable for this <code>VariableDefinition</code>.
-         */
-        public void setId(String idIn) {
-                this.id	= idIn;
-        }
-        
-        /**
-         * Gets the {@link Expression} for this <code>VariableDefinition</code>.
-         * 
-         * @return the <code>Expression</code> for this <code>VariableDefinition</code>.
-         */
-        public Expression getExpression() {
-                return this.expression;
-        }
-        
-        /**
-         * Sets the <code>Expression</code> for this <code>VariableDefinition</code>.
-         * 
-         * @param expressionIn the <code>Expression</code> for this <code>VariableDefinition</code>
-         */
-        public void setExpression(Expression expressionIn) {
-                this.expression	= expressionIn;
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getId()) != null) {
-                        stringBuilder.append(",id=");
-                        stringBuilder.append((String)objectToDump);
-                }
-                if ((objectToDump = this.getExpression()) != null) {
-                        stringBuilder.append(",expression=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    public VariableDefinition(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing variable id");
-                        return false;
-                } else if (this.getExpression() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing variable expression");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
+    public VariableDefinition() {
+        super();
+    }
+
+    /**
+     * Gets the id of the variable for this <code>VariableDefinition</code>.
+     *
+     * @return the <code>String</code> id for the variable for this <code>VariableDefinition</code>.
+     */
+    public String getId() {
+        return this.id;
+    }
+
+    /**
+     * Sets the id of the variable for this <code>VariableDefinition</code>.
+     *
+     * @param idIn the <code>String</code> id for the variable for this <code>VariableDefinition</code>.
+     */
+    public void setId(String idIn) {
+        this.id	= idIn;
+    }
+
+    /**
+     * Gets the {@link Expression} for this <code>VariableDefinition</code>.
+     *
+     * @return the <code>Expression</code> for this <code>VariableDefinition</code>.
+     */
+    public Expression getExpression() {
+        return this.expression;
+    }
+
+    /**
+     * Sets the <code>Expression</code> for this <code>VariableDefinition</code>.
+     *
+     * @param expressionIn the <code>Expression</code> for this <code>VariableDefinition</code>
+     */
+    public void setExpression(Expression expressionIn) {
+        this.expression	= expressionIn;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getId()) != null) {
+            stringBuilder.append(",id=");
+            stringBuilder.append((String)objectToDump);
         }
+        if ((objectToDump = this.getExpression()) != null) {
+            stringBuilder.append(",expression=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing variable id");
+            return false;
+        } else if (this.getExpression() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing variable expression");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
+        }
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/VariableMap.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/VariableMap.java
index 8f26331..80d7fd0 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/VariableMap.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/VariableMap.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,95 +42,95 @@
 /**
  * VariableMap is a collection of {@link com.att.research.xacmlatt.pdp.policy.VariableDefinition}s that are accessible by
  * the variable identifier.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class VariableMap {
-        private List<VariableDefinition>		variableDefinitions;
-        private Map<String, VariableDefinition> mapVariableDefinitions;
-        
-        private void ensureVariableDefinitions() {
-                if (this.variableDefinitions == null) {
-                        this.variableDefinitions	= new ArrayList<VariableDefinition>();
-                }
-        }
-        
-        private void ensureMap() {
-                if (this.mapVariableDefinitions == null) {
-                        this.mapVariableDefinitions	= new HashMap<String, VariableDefinition>();
-                }
-        }
-        
-        public VariableMap() {
-        }
+    private List<VariableDefinition>		variableDefinitions;
+    private Map<String, VariableDefinition> mapVariableDefinitions;
 
-        /**
-         * Gets the <code>VariableDefinition</code> with the given <code>String</code> id.
-         * 
-         * @param variableId the <code>String</code> identifier of the <code>VariableDefinition</code> to retrieve
-         * @return the <code>VariableDefinition</code> with the given <code>String</code> id or null if not found.
-         */
-        public VariableDefinition getVariableDefinition(String variableId) {
-                return (this.mapVariableDefinitions == null ? null : this.mapVariableDefinitions.get(variableId));
+    private void ensureVariableDefinitions() {
+        if (this.variableDefinitions == null) {
+            this.variableDefinitions	= new ArrayList<VariableDefinition>();
         }
-        
-        /**
-         * Gets an <code>Iterator</code> over the <code>VariableDefinition</code>s in this <code>VariableMap</code>
-         * in the order they were added.
-         * 
-         * @return an <code>Iterator</code> over the <code>VariableDefinition</code>s in this <code>VariableMap</code>
-         */
-        public Iterator<VariableDefinition> getVariableDefinitions() {
-                return (this.variableDefinitions == null ? null : this.variableDefinitions.iterator());
+    }
+
+    private void ensureMap() {
+        if (this.mapVariableDefinitions == null) {
+            this.mapVariableDefinitions	= new HashMap<String, VariableDefinition>();
         }
-        
-        /**
-         * Adds the given <code>VariableDefinition</code> to this <code>VariableMap</code>.
-         * 
-         * @param variableDefinition the <code>VariableDefinition</code> to add
-         */
-        public void add(VariableDefinition variableDefinition) {
-                this.ensureMap();
-                this.ensureVariableDefinitions();
-                this.variableDefinitions.add(variableDefinition);
-                this.mapVariableDefinitions.put(variableDefinition.getId(), variableDefinition);
+    }
+
+    public VariableMap() {
+    }
+
+    /**
+     * Gets the <code>VariableDefinition</code> with the given <code>String</code> id.
+     *
+     * @param variableId the <code>String</code> identifier of the <code>VariableDefinition</code> to retrieve
+     * @return the <code>VariableDefinition</code> with the given <code>String</code> id or null if not found.
+     */
+    public VariableDefinition getVariableDefinition(String variableId) {
+        return (this.mapVariableDefinitions == null ? null : this.mapVariableDefinitions.get(variableId));
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the <code>VariableDefinition</code>s in this <code>VariableMap</code>
+     * in the order they were added.
+     *
+     * @return an <code>Iterator</code> over the <code>VariableDefinition</code>s in this <code>VariableMap</code>
+     */
+    public Iterator<VariableDefinition> getVariableDefinitions() {
+        return (this.variableDefinitions == null ? null : this.variableDefinitions.iterator());
+    }
+
+    /**
+     * Adds the given <code>VariableDefinition</code> to this <code>VariableMap</code>.
+     *
+     * @param variableDefinition the <code>VariableDefinition</code> to add
+     */
+    public void add(VariableDefinition variableDefinition) {
+        this.ensureMap();
+        this.ensureVariableDefinitions();
+        this.variableDefinitions.add(variableDefinition);
+        this.mapVariableDefinitions.put(variableDefinition.getId(), variableDefinition);
+    }
+
+    /**
+     * Adds the contents of the given <code>Collection</code> of <code>VariableDefinition</code>s to the set of
+     * <code>VariableDefinition</code>s in this <code>VariableMap</code>>
+     *
+     * @param listVariableDefinitions the <code>Collection</code> of <code>VariableDefinition</code>s to add
+     */
+    public void addVariableDefinitions(Collection<VariableDefinition> listVariableDefinitions) {
+        for (VariableDefinition variableDefinition: listVariableDefinitions) {
+            this.add(variableDefinition);
         }
-        
-        /**
-         * Adds the contents of the given <code>Collection</code> of <code>VariableDefinition</code>s to the set of
-         * <code>VariableDefinition</code>s in this <code>VariableMap</code>>
-         * 
-         * @param listVariableDefinitions the <code>Collection</code> of <code>VariableDefinition</code>s to add
-         */
-        public void addVariableDefinitions(Collection<VariableDefinition> listVariableDefinitions) {
-                for (VariableDefinition variableDefinition: listVariableDefinitions) {
-                        this.add(variableDefinition);
-                }
+    }
+
+    /**
+     * Sets the <code>VariableDefinition</code>s in this <code>VariableMap</code> to the contents of the given
+     * <code>Collection</code>.
+     *
+     * @param listVariableDefinitions the <code>Collection</code> of <code>VariableDefinition</code> to set
+     */
+    public void setVariableDefinitions(Collection<VariableDefinition> listVariableDefinitions) {
+        this.variableDefinitions	= null;
+        this.mapVariableDefinitions	= null;
+        if (listVariableDefinitions != null) {
+            this.addVariableDefinitions(variableDefinitions);
         }
-        
-        /**
-         * Sets the <code>VariableDefinition</code>s in this <code>VariableMap</code> to the contents of the given
-         * <code>Collection</code>.
-         * 
-         * @param listVariableDefinitions the <code>Collection</code> of <code>VariableDefinition</code> to set
-         */
-        public void setVariableDefinitions(Collection<VariableDefinition> listVariableDefinitions) {
-                this.variableDefinitions	= null;
-                this.mapVariableDefinitions	= null;
-                if (listVariableDefinitions != null) {
-                        this.addVariableDefinitions(variableDefinitions);
-                }		
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        if (this.mapVariableDefinitions.size() > 0) {
+            stringBuilder.append("variableDefinitions=");
+            stringBuilder.append(StringUtils.toString(this.mapVariableDefinitions.values().iterator()));
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                if (this.mapVariableDefinitions.size() > 0) {
-                        stringBuilder.append("variableDefinitions=");
-                        stringBuilder.append(StringUtils.toString(this.mapVariableDefinitions.values().iterator()));
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAdviceExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAdviceExpression.java
index f1f8e91..f7ef0f8 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAdviceExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAdviceExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -51,161 +51,161 @@
 /**
  * DOMAdviceExpression extends {@link com.att.research.xacmlatt.pdp.policy.AdviceExpression} with methods for creation
  * from {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMAdviceExpression extends AdviceExpression {
-        private static final Log logger	= LogFactory.getLog(DOMAdviceExpression.class);
-        
-        protected DOMAdviceExpression() {
+    private static final Log logger	= LogFactory.getLog(DOMAdviceExpression.class);
+
+    protected DOMAdviceExpression() {
+    }
+
+    /**
+     * Creates a new <code>AdviceExpression</code> by parsing the given <code>Node</code> representing a XACML AdviceExpression element.
+     *
+     * @param nodeAdviceExpression the <code>Node</code> representing the XACML AdviceExpression element
+     * @param policy the {@link com.att.research.xacmlatt.pdp.policy.Policy} encompassing the AdviceExpression element
+     * @return a new <code>AdviceExpression</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static AdviceExpression newInstance(Node nodeAdviceExpression, Policy policy) throws DOMStructureException {
+        Element elementAdviceExpression			= DOMUtil.getElement(nodeAdviceExpression);
+        boolean bLenient						= DOMProperties.isLenient();
+
+        DOMAdviceExpression domAdviceExpression	= new DOMAdviceExpression();
+
+        try {
+            NodeList children	= elementAdviceExpression.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION.equals(child.getLocalName())) {
+                            domAdviceExpression.addAttributeAssignmentExpression(DOMAttributeAssignmentExpression.newInstance(child, policy));
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeAdviceExpression);
+                        }
+                    }
+                }
+            }
+
+            domAdviceExpression.setAdviceId(DOMUtil.getIdentifierAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_ADVICEID, !bLenient));
+
+            String string	= DOMUtil.getStringAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_APPLIESTO, !bLenient);
+            RuleEffect ruleEffect	= RuleEffect.getRuleEffect(string);
+            if (ruleEffect == null && !bLenient) {
+                throw new DOMStructureException(nodeAdviceExpression, "Unknown EffectType \"" + string + "\"");
+            } else {
+                domAdviceExpression.setAppliesTo(ruleEffect);
+            }
+        } catch (DOMStructureException ex) {
+            domAdviceExpression.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
 
-        /**
-         * Creates a new <code>AdviceExpression</code> by parsing the given <code>Node</code> representing a XACML AdviceExpression element.
-         * 
-         * @param nodeAdviceExpression the <code>Node</code> representing the XACML AdviceExpression element
-         * @param policy the {@link com.att.research.xacmlatt.pdp.policy.Policy} encompassing the AdviceExpression element
-         * @return a new <code>AdviceExpression</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static AdviceExpression newInstance(Node nodeAdviceExpression, Policy policy) throws DOMStructureException {
-                Element elementAdviceExpression			= DOMUtil.getElement(nodeAdviceExpression);
-                boolean bLenient						= DOMProperties.isLenient();
-                
-                DOMAdviceExpression domAdviceExpression	= new DOMAdviceExpression();
-                
-                try {
-                        NodeList children	= elementAdviceExpression.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION.equals(child.getLocalName())) {
-                                                        domAdviceExpression.addAttributeAssignmentExpression(DOMAttributeAssignmentExpression.newInstance(child, policy));
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeAdviceExpression);
-                                                }
-                                        }
-                                }
-                        }
-                        
-                        domAdviceExpression.setAdviceId(DOMUtil.getIdentifierAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_ADVICEID, !bLenient));
-                        
-                        String string	= DOMUtil.getStringAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_APPLIESTO, !bLenient);
-                        RuleEffect ruleEffect	= RuleEffect.getRuleEffect(string);
-                        if (ruleEffect == null && !bLenient) {
-                                throw new DOMStructureException(nodeAdviceExpression, "Unknown EffectType \"" + string + "\"");
-                        } else {
-                                domAdviceExpression.setAppliesTo(ruleEffect);
-                        }
-                } catch (DOMStructureException ex) {
-                        domAdviceExpression.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+        return domAdviceExpression;
+    }
+
+    public static boolean repair(Node nodeAdviceExpression) throws DOMStructureException {
+        Element elementAdviceExpression	= DOMUtil.getElement(nodeAdviceExpression);
+        boolean result					= false;
+
+        NodeList children	= elementAdviceExpression.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION.equals(child.getLocalName())) {
+                        result			= DOMAttributeAssignmentExpression.repair(child) || result;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        nodeAdviceExpression.removeChild(child);
+                        result			= true;
+                    }
                 }
-                
-                return domAdviceExpression;
+            }
         }
-        
-        public static boolean repair(Node nodeAdviceExpression) throws DOMStructureException {
-                Element elementAdviceExpression	= DOMUtil.getElement(nodeAdviceExpression);
-                boolean result					= false;
-                
-                NodeList children	= elementAdviceExpression.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION.equals(child.getLocalName())) {
-                                                result			= DOMAttributeAssignmentExpression.repair(child) || result; 
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                nodeAdviceExpression.removeChild(child);
-                                                result			= true;
-                                        }
-                                }
-                        }
-                }
-                
-                result	= DOMUtil.repairIdentifierAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_ADVICEID, logger) || result;
-                result	= DOMUtil.repairStringAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_APPLIESTO, RuleEffect.DENY.getName(), logger) || result;
-                String stringRuleEffect	= DOMUtil.getStringAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_APPLIESTO);
-                RuleEffect ruleEffect	= RuleEffect.getRuleEffect(stringRuleEffect);
-                if (ruleEffect == null) {
-                        logger.warn("Setting invalid RuleEffect " + stringRuleEffect + " to " + RuleEffect.DENY.getName());
-                        elementAdviceExpression.setAttribute(XACML3.ATTRIBUTE_APPLIESTO, RuleEffect.DENY.getName());
-                        result	= true;
-                }
-                return result;
+
+        result	= DOMUtil.repairIdentifierAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_ADVICEID, logger) || result;
+        result	= DOMUtil.repairStringAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_APPLIESTO, RuleEffect.DENY.getName(), logger) || result;
+        String stringRuleEffect	= DOMUtil.getStringAttribute(elementAdviceExpression, XACML3.ATTRIBUTE_APPLIESTO);
+        RuleEffect ruleEffect	= RuleEffect.getRuleEffect(stringRuleEffect);
+        if (ruleEffect == null) {
+            logger.warn("Setting invalid RuleEffect " + stringRuleEffect + " to " + RuleEffect.DENY.getName());
+            elementAdviceExpression.setAttribute(XACML3.ATTRIBUTE_APPLIESTO, RuleEffect.DENY.getName());
+            result	= true;
         }
-        
-        /**
-         * Creates a <code>List</code> of <code>AdviceExpression</code>s by parsing the given <code>Node</code> representing a
-         * XACML AdviceExpressions element.
-         * 
-         * @param nodeAdviceExpressions the <code>Node</code> representing the XACML AdviceExpressions element
-         * @param policy the <code>Policy</code> encompassing the AdviceExpressions element
-         * @return a new <code>List</code> of <code>AdviceExpression</code>s parsed from the given <code>Node</code>.
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static List<AdviceExpression> newList(Node nodeAdviceExpressions, Policy policy) throws DOMStructureException {
-                Element elementAdviceExpressions	= DOMUtil.getElement(nodeAdviceExpressions);
-                boolean bLenient					= DOMProperties.isLenient();
-                
-                List<AdviceExpression> listAdviceExpressions	= new ArrayList<AdviceExpression>();
-                
-                NodeList children	= elementAdviceExpressions.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ADVICEEXPRESSION.equals(child.getLocalName())) {
-                                                listAdviceExpressions.add(DOMAdviceExpression.newInstance(child, policy));
-                                        } else if (!bLenient) {
-                                                throw DOMUtil.newUnexpectedElementException(child, nodeAdviceExpressions);
-                                        }
-                                }
-                        }
+        return result;
+    }
+
+    /**
+     * Creates a <code>List</code> of <code>AdviceExpression</code>s by parsing the given <code>Node</code> representing a
+     * XACML AdviceExpressions element.
+     *
+     * @param nodeAdviceExpressions the <code>Node</code> representing the XACML AdviceExpressions element
+     * @param policy the <code>Policy</code> encompassing the AdviceExpressions element
+     * @return a new <code>List</code> of <code>AdviceExpression</code>s parsed from the given <code>Node</code>.
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static List<AdviceExpression> newList(Node nodeAdviceExpressions, Policy policy) throws DOMStructureException {
+        Element elementAdviceExpressions	= DOMUtil.getElement(nodeAdviceExpressions);
+        boolean bLenient					= DOMProperties.isLenient();
+
+        List<AdviceExpression> listAdviceExpressions	= new ArrayList<AdviceExpression>();
+
+        NodeList children	= elementAdviceExpressions.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ADVICEEXPRESSION.equals(child.getLocalName())) {
+                        listAdviceExpressions.add(DOMAdviceExpression.newInstance(child, policy));
+                    } else if (!bLenient) {
+                        throw DOMUtil.newUnexpectedElementException(child, nodeAdviceExpressions);
+                    }
                 }
-                
-                if (listAdviceExpressions.size() == 0 && !bLenient) {
-                        throw DOMUtil.newMissingElementException(nodeAdviceExpressions, XACML3.XMLNS, XACML3.ELEMENT_ADVICEEXPRESSION);
-                }		
-                return listAdviceExpressions;
+            }
         }
-        
-        public static boolean repairList(Node nodeAdviceExpressions) throws DOMStructureException {
-                Element elementAdviceExpressions	= DOMUtil.getElement(nodeAdviceExpressions);
-                boolean result						= false;
-                
-                boolean sawAdviceExpression			= false;
-                NodeList children	= elementAdviceExpressions.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ADVICEEXPRESSION.equals(child.getLocalName())) {
-                                                sawAdviceExpression	= true;
-                                                result				= result || DOMAdviceExpression.repair(child);
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                nodeAdviceExpressions.removeChild(child);
-                                                result			= true;						
-                                        }
-                                }
-                        }
-                }
-                
-                if (!sawAdviceExpression) {
-                        throw DOMUtil.newMissingElementException(nodeAdviceExpressions, XACML3.XMLNS, XACML3.ELEMENT_ADVICEEXPRESSION);
-                }
-                
-                return result;
+
+        if (listAdviceExpressions.size() == 0 && !bLenient) {
+            throw DOMUtil.newMissingElementException(nodeAdviceExpressions, XACML3.XMLNS, XACML3.ELEMENT_ADVICEEXPRESSION);
         }
+        return listAdviceExpressions;
+    }
+
+    public static boolean repairList(Node nodeAdviceExpressions) throws DOMStructureException {
+        Element elementAdviceExpressions	= DOMUtil.getElement(nodeAdviceExpressions);
+        boolean result						= false;
+
+        boolean sawAdviceExpression			= false;
+        NodeList children	= elementAdviceExpressions.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ADVICEEXPRESSION.equals(child.getLocalName())) {
+                        sawAdviceExpression	= true;
+                        result				= result || DOMAdviceExpression.repair(child);
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        nodeAdviceExpressions.removeChild(child);
+                        result			= true;
+                    }
+                }
+            }
+        }
+
+        if (!sawAdviceExpression) {
+            throw DOMUtil.newMissingElementException(nodeAdviceExpressions, XACML3.XMLNS, XACML3.ELEMENT_ADVICEEXPRESSION);
+        }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAllOf.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAllOf.java
index 1add20d..5710843 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAllOf.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAllOf.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,84 +46,84 @@
 /**
  * DOMAllOf extends {@link com.att.research.xacmlatt.pdp.policy.AllOf} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMAllOf extends AllOf {
-        private static final Log logger	= LogFactory.getLog(DOMAllOf.class);
-        
-        protected DOMAllOf() {
-        }
-        
-        /**
-         * Creates a new <code>DOMAllOf</code> by parsing the given <code>Node</code> representing a XACML AllOf element.
-         * 
-         * @param nodeAllOf the <code>Node</code> representing the XACML AllOf element
-         * @return a new <code>DOMAllOf</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the given <code>Node</code>
-         */
-        public static AllOf newInstance(Node nodeAllOf) throws DOMStructureException {
-                Element elementAllOf	= DOMUtil.getElement(nodeAllOf);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                DOMAllOf domAllOf		= new DOMAllOf();
-                
-                try {
-                        NodeList children	= elementAllOf.getChildNodes();
-                        int numChildren;
-                        boolean sawMatch	= false;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_MATCH.equals(child.getLocalName())) {
-                                                        domAllOf.addMatch(DOMMatch.newInstance(child));
-                                                        sawMatch	= true;
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeAllOf);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMAllOf.class);
+
+    protected DOMAllOf() {
+    }
+
+    /**
+     * Creates a new <code>DOMAllOf</code> by parsing the given <code>Node</code> representing a XACML AllOf element.
+     *
+     * @param nodeAllOf the <code>Node</code> representing the XACML AllOf element
+     * @return a new <code>DOMAllOf</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the given <code>Node</code>
+     */
+    public static AllOf newInstance(Node nodeAllOf) throws DOMStructureException {
+        Element elementAllOf	= DOMUtil.getElement(nodeAllOf);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        DOMAllOf domAllOf		= new DOMAllOf();
+
+        try {
+            NodeList children	= elementAllOf.getChildNodes();
+            int numChildren;
+            boolean sawMatch	= false;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_MATCH.equals(child.getLocalName())) {
+                            domAllOf.addMatch(DOMMatch.newInstance(child));
+                            sawMatch	= true;
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeAllOf);
                         }
-                        if (!sawMatch && !bLenient) {
-                                throw DOMUtil.newMissingElementException(nodeAllOf, XACML3.XMLNS, XACML3.ELEMENT_MATCH);
-                        }
-                } catch (DOMStructureException ex) {
-                        domAllOf.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                return domAllOf;
+            }
+            if (!sawMatch && !bLenient) {
+                throw DOMUtil.newMissingElementException(nodeAllOf, XACML3.XMLNS, XACML3.ELEMENT_MATCH);
+            }
+        } catch (DOMStructureException ex) {
+            domAllOf.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        public static boolean repair(Node nodeAllOf) throws DOMStructureException {
-                Element elementAllOf	= DOMUtil.getElement(nodeAllOf);
-                boolean result			= false;
-                
-                NodeList children	= elementAllOf.getChildNodes();
-                int numChildren;
-                boolean sawMatch	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_MATCH.equals(child.getLocalName())) {
-                                                result		= DOMMatch.repair(child) || result;
-                                                sawMatch	= true;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementAllOf.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
+        return domAllOf;
+    }
+
+    public static boolean repair(Node nodeAllOf) throws DOMStructureException {
+        Element elementAllOf	= DOMUtil.getElement(nodeAllOf);
+        boolean result			= false;
+
+        NodeList children	= elementAllOf.getChildNodes();
+        int numChildren;
+        boolean sawMatch	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_MATCH.equals(child.getLocalName())) {
+                        result		= DOMMatch.repair(child) || result;
+                        sawMatch	= true;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementAllOf.removeChild(child);
+                        result	= true;
+                    }
                 }
-                if (!sawMatch) {
-                        throw DOMUtil.newMissingElementException(nodeAllOf, XACML3.XMLNS, XACML3.ELEMENT_MATCH);
-                }
-                
-                return result;
+            }
         }
+        if (!sawMatch) {
+            throw DOMUtil.newMissingElementException(nodeAllOf, XACML3.XMLNS, XACML3.ELEMENT_MATCH);
+        }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAnyOf.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAnyOf.java
index b60257b..393fda8 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAnyOf.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAnyOf.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,75 +46,75 @@
 /**
  * DOMAnyOf extends {@link com.att.research.xacmlatt.pdp.policy.AnyOf} with methods for creation
  * from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMAnyOf extends AnyOf {
-        private static final Log logger	= LogFactory.getLog(DOMAnyOf.class);
-        
-        protected DOMAnyOf() {
-        }
-        
-        /**
-         * Creates a new <code>DOMAnyOf</code> by parsing the given <code>Node</code> representing a XACML AnyOf element.
-         * 
-         * @param nodeAnyOf the <code>Node</code> representing the XACML AnyOf element
-         * @return a new <code>DOMAnyOf</code> parsed from the given <code>Node</code> 
-         * @throws DOMStructureException if there is an error parsing the given <code>Node</code>.
-         */
-        public static AnyOf newInstance(Node nodeAnyOf) throws DOMStructureException {
-                Element elementAnyOf	= DOMUtil.getElement(nodeAnyOf);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                DOMAnyOf domAnyOf		= new DOMAnyOf();
-                
-                try {
-                        NodeList children	= elementAnyOf.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && (XACML3.ELEMENT_ALLOF.equals(child.getLocalName()))) {
-                                                        domAnyOf.addAllOf(DOMAllOf.newInstance(child));
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeAnyOf);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMAnyOf.class);
+
+    protected DOMAnyOf() {
+    }
+
+    /**
+     * Creates a new <code>DOMAnyOf</code> by parsing the given <code>Node</code> representing a XACML AnyOf element.
+     *
+     * @param nodeAnyOf the <code>Node</code> representing the XACML AnyOf element
+     * @return a new <code>DOMAnyOf</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the given <code>Node</code>.
+     */
+    public static AnyOf newInstance(Node nodeAnyOf) throws DOMStructureException {
+        Element elementAnyOf	= DOMUtil.getElement(nodeAnyOf);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        DOMAnyOf domAnyOf		= new DOMAnyOf();
+
+        try {
+            NodeList children	= elementAnyOf.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && (XACML3.ELEMENT_ALLOF.equals(child.getLocalName()))) {
+                            domAnyOf.addAllOf(DOMAllOf.newInstance(child));
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeAnyOf);
                         }
-                } catch (DOMStructureException ex) {
-                        domAnyOf.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                
-                return domAnyOf;
+            }
+        } catch (DOMStructureException ex) {
+            domAnyOf.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        public static boolean repair(Node nodeAnyOf) throws DOMStructureException {
-                Element elementAnyOf	= DOMUtil.getElement(nodeAnyOf);
-                boolean result			= false;
-                
-                NodeList children	= elementAnyOf.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && (XACML3.ELEMENT_ALLOF.equals(child.getLocalName()))) {
-                                                result	= DOMAllOf.repair(child) || result;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementAnyOf.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
+
+        return domAnyOf;
+    }
+
+    public static boolean repair(Node nodeAnyOf) throws DOMStructureException {
+        Element elementAnyOf	= DOMUtil.getElement(nodeAnyOf);
+        boolean result			= false;
+
+        NodeList children	= elementAnyOf.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && (XACML3.ELEMENT_ALLOF.equals(child.getLocalName()))) {
+                        result	= DOMAllOf.repair(child) || result;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementAnyOf.removeChild(child);
+                        result	= true;
+                    }
                 }
-                
-                return result;
+            }
         }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMApply.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMApply.java
index 1971fcf..8c7341d 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMApply.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMApply.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,85 +47,85 @@
 /**
  * DOMApply extends {@link com.att.research.xacmlatt.pdp.policy.expressions.Apply} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMApply extends Apply {
-        private static final Log logger	= LogFactory.getLog(DOMApply.class);
-        
-        protected DOMApply() {
-        }
-        
-        /**
-         * Creates a new <code>Apply</code> by parsing the given <code>Node</core> representing a XACML Apply element.
-         * 
-         * @param nodeApply the <code>Node</code> representing the XACML Apply element
-         * @param policy the <code>Policy</code> encompassing the Apply element
-         * @return a new <code>Apply</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static Apply newInstance(Node nodeApply, Policy policy) throws DOMStructureException {
-                Element elementApply	= DOMUtil.getElement(nodeApply);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                DOMApply domApply		= new DOMApply();
-                
-                try {
-                        NodeList children	= nodeApply.getChildNodes();
-                        if (children != null) {
-                                int numChildren	= children.getLength();
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (child.getNodeType() == Node.ELEMENT_NODE && XACML3.XMLNS.equals(child.getNamespaceURI())) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
-                                                        domApply.setDescription(child.getTextContent());
-                                                } else if (DOMExpression.isExpression(child)) {
-                                                        domApply.addArgument(DOMExpression.newInstance(child, policy));
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeApply);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMApply.class);
+
+    protected DOMApply() {
+    }
+
+    /**
+     * Creates a new <code>Apply</code> by parsing the given <code>Node</core> representing a XACML Apply element.
+     *
+     * @param nodeApply the <code>Node</code> representing the XACML Apply element
+     * @param policy the <code>Policy</code> encompassing the Apply element
+     * @return a new <code>Apply</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static Apply newInstance(Node nodeApply, Policy policy) throws DOMStructureException {
+        Element elementApply	= DOMUtil.getElement(nodeApply);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        DOMApply domApply		= new DOMApply();
+
+        try {
+            NodeList children	= nodeApply.getChildNodes();
+            if (children != null) {
+                int numChildren	= children.getLength();
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (child.getNodeType() == Node.ELEMENT_NODE && XACML3.XMLNS.equals(child.getNamespaceURI())) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
+                            domApply.setDescription(child.getTextContent());
+                        } else if (DOMExpression.isExpression(child)) {
+                            domApply.addArgument(DOMExpression.newInstance(child, policy));
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeApply);
                         }
-                        
-                        domApply.setFunctionId(DOMUtil.getIdentifierAttribute(elementApply, XACML3.ATTRIBUTE_FUNCTIONID, !bLenient));
-                } catch (DOMStructureException ex) {
-                        domApply.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                
-                return domApply;
+            }
+
+            domApply.setFunctionId(DOMUtil.getIdentifierAttribute(elementApply, XACML3.ATTRIBUTE_FUNCTIONID, !bLenient));
+        } catch (DOMStructureException ex) {
+            domApply.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        public static boolean repair(Node nodeApply) throws DOMStructureException {
-                Element elementApply	= DOMUtil.getElement(nodeApply);
-                boolean result			= false;
-                
-                NodeList children	= nodeApply.getChildNodes();
-                if (children != null) {
-                        int numChildren	= children.getLength();
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (child.getNodeType() == Node.ELEMENT_NODE && XACML3.XMLNS.equals(child.getNamespaceURI())) {
-                                        String childName	= child.getLocalName();
-                                        if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
-                                        } else if (DOMExpression.isExpression(child)) {
-                                                result	= DOMExpression.repair(child) || result;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementApply.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
+
+        return domApply;
+    }
+
+    public static boolean repair(Node nodeApply) throws DOMStructureException {
+        Element elementApply	= DOMUtil.getElement(nodeApply);
+        boolean result			= false;
+
+        NodeList children	= nodeApply.getChildNodes();
+        if (children != null) {
+            int numChildren	= children.getLength();
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (child.getNodeType() == Node.ELEMENT_NODE && XACML3.XMLNS.equals(child.getNamespaceURI())) {
+                    String childName	= child.getLocalName();
+                    if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
+                    } else if (DOMExpression.isExpression(child)) {
+                        result	= DOMExpression.repair(child) || result;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementApply.removeChild(child);
+                        result	= true;
+                    }
                 }
-                
-                result					= DOMUtil.repairIdentifierAttribute(elementApply, XACML3.ATTRIBUTE_FUNCTIONID, XACML3.ID_FUNCTION_STRING_EQUAL, logger) || result;
-                
-                return result;
+            }
         }
+
+        result					= DOMUtil.repairIdentifierAttribute(elementApply, XACML3.ATTRIBUTE_FUNCTIONID, XACML3.ID_FUNCTION_STRING_EQUAL, logger) || result;
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeAssignmentExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeAssignmentExpression.java
index ed9310f..3f60d1a 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeAssignmentExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeAssignmentExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,90 +47,90 @@
 /**
  * DOMAttributeAssignmentExpression extends {@link com.att.research.xacmlatt.pdp.policy.AttributeAssignmentExpression} with
  * methods for creation from {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMAttributeAssignmentExpression extends AttributeAssignmentExpression {
-        private static final Log logger	= LogFactory.getLog(DOMAttributeAssignmentExpression.class);
-        
-        protected DOMAttributeAssignmentExpression() {
+    private static final Log logger	= LogFactory.getLog(DOMAttributeAssignmentExpression.class);
+
+    protected DOMAttributeAssignmentExpression() {
+    }
+
+    /**
+     * Creates a new <code>AttributeAssignmentExpression</code> by parsing the given <code>Node</code> representing
+     * a XACML AttributeAssignmentExpression element.
+     *
+     * @param nodeAttributeAssignmentExpression the <code>Node</code> representing the XACML AttributeAssignmentExpression element
+     * @return a new <code>AttributeAssignmentExpression</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static AttributeAssignmentExpression newInstance(Node nodeAttributeAssignmentExpression, Policy policy) throws DOMStructureException {
+        Element elementAttributeAssignmentExpression	= DOMUtil.getElement(nodeAttributeAssignmentExpression);
+        boolean bLenient								= DOMProperties.isLenient();
+
+        DOMAttributeAssignmentExpression domAttributeAssignmentExpression	= new DOMAttributeAssignmentExpression();
+
+        try {
+            Node node	= DOMUtil.getFirstChildElement(elementAttributeAssignmentExpression);
+            if (node == null) {
+                if (!bLenient) {
+                    throw DOMUtil.newMissingElementException(elementAttributeAssignmentExpression, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
+                }
+            } else {
+                domAttributeAssignmentExpression.setExpression(DOMExpression.newInstance(node, policy));
+            }
+
+            Identifier identifier;
+            domAttributeAssignmentExpression.setAttributeId(DOMUtil.getIdentifierAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));;
+            if ((identifier = DOMUtil.getIdentifierAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_CATEGORY)) != null) {
+                domAttributeAssignmentExpression.setCategory(identifier);
+            }
+
+            String issuer	= DOMUtil.getStringAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_ISSUER);
+            if (issuer != null) {
+                domAttributeAssignmentExpression.setIssuer(issuer);
+            }
+        } catch (DOMStructureException ex) {
+            domAttributeAssignmentExpression.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
 
-        /**
-         * Creates a new <code>AttributeAssignmentExpression</code> by parsing the given <code>Node</code> representing
-         * a XACML AttributeAssignmentExpression element.
-         * 
-         * @param nodeAttributeAssignmentExpression the <code>Node</code> representing the XACML AttributeAssignmentExpression element
-         * @return a new <code>AttributeAssignmentExpression</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static AttributeAssignmentExpression newInstance(Node nodeAttributeAssignmentExpression, Policy policy) throws DOMStructureException {
-                Element elementAttributeAssignmentExpression	= DOMUtil.getElement(nodeAttributeAssignmentExpression);
-                boolean bLenient								= DOMProperties.isLenient();
-                
-                DOMAttributeAssignmentExpression domAttributeAssignmentExpression	= new DOMAttributeAssignmentExpression();
-                
-                try {
-                        Node node	= DOMUtil.getFirstChildElement(elementAttributeAssignmentExpression);
-                        if (node == null) {
-                                if (!bLenient) {
-                                        throw DOMUtil.newMissingElementException(elementAttributeAssignmentExpression, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
-                                }
-                        } else {
-                                domAttributeAssignmentExpression.setExpression(DOMExpression.newInstance(node, policy));				
-                        }
-                        
-                        Identifier identifier;
-                        domAttributeAssignmentExpression.setAttributeId(DOMUtil.getIdentifierAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));;
-                        if ((identifier = DOMUtil.getIdentifierAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_CATEGORY)) != null) {
-                                domAttributeAssignmentExpression.setCategory(identifier);
-                        }
-                        
-                        String issuer	= DOMUtil.getStringAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_ISSUER);
-                        if (issuer != null) {
-                                domAttributeAssignmentExpression.setIssuer(issuer);
-                        }
-                } catch (DOMStructureException ex) {
-                        domAttributeAssignmentExpression.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+        return domAttributeAssignmentExpression;
+    }
+
+    public static boolean repair(Node nodeAttributeAssignmentExpression) throws DOMStructureException {
+        Element elementAttributeAssignmentExpression	= DOMUtil.getElement(nodeAttributeAssignmentExpression);
+        boolean result									= false;
+
+        if (DOMUtil.getFirstChildElement(elementAttributeAssignmentExpression) == null) {
+            /*
+             * See if we can repair the <AttributeAssignmentExpression DataType="">string</AttributeAssignmentExpression> pattern
+             */
+            Identifier identifier	= DOMUtil.getIdentifierAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_DATATYPE);
+            String textContent	= elementAttributeAssignmentExpression.getTextContent();
+            if (textContent != null) {
+                textContent	= textContent.trim();
+            }
+            if (textContent != null && textContent.length() > 0 && identifier != null) {
+                Element attributeValue	= elementAttributeAssignmentExpression.getOwnerDocument().createElementNS(XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+                attributeValue.setAttribute(XACML3.ATTRIBUTE_DATATYPE, identifier.stringValue());
+                attributeValue.setTextContent(textContent);
+                logger.warn("Adding a new AttributeValue using the DataType from the AttributeAssignment");
+                elementAttributeAssignmentExpression.removeAttribute(XACML3.ATTRIBUTE_DATATYPE);
+                while (elementAttributeAssignmentExpression.hasChildNodes()) {
+                    elementAttributeAssignmentExpression.removeChild(elementAttributeAssignmentExpression.getFirstChild());
                 }
-                
-                return domAttributeAssignmentExpression;
+                elementAttributeAssignmentExpression.appendChild(attributeValue);
+                result	= true;
+            } else {
+                throw DOMUtil.newMissingElementException(elementAttributeAssignmentExpression, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
+            }
         }
-        
-        public static boolean repair(Node nodeAttributeAssignmentExpression) throws DOMStructureException {
-                Element elementAttributeAssignmentExpression	= DOMUtil.getElement(nodeAttributeAssignmentExpression);
-                boolean result									= false;
-                
-                if (DOMUtil.getFirstChildElement(elementAttributeAssignmentExpression) == null) {
-                        /*
-                         * See if we can repair the <AttributeAssignmentExpression DataType="">string</AttributeAssignmentExpression> pattern
-                         */
-                        Identifier identifier	= DOMUtil.getIdentifierAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_DATATYPE);
-                        String textContent	= elementAttributeAssignmentExpression.getTextContent();
-                        if (textContent != null) {
-                                textContent	= textContent.trim();
-                        }
-                        if (textContent != null && textContent.length() > 0 && identifier != null) {
-                                Element attributeValue	= elementAttributeAssignmentExpression.getOwnerDocument().createElementNS(XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                                attributeValue.setAttribute(XACML3.ATTRIBUTE_DATATYPE, identifier.stringValue());
-                                attributeValue.setTextContent(textContent);
-                                logger.warn("Adding a new AttributeValue using the DataType from the AttributeAssignment");
-                                elementAttributeAssignmentExpression.removeAttribute(XACML3.ATTRIBUTE_DATATYPE);
-                                while (elementAttributeAssignmentExpression.hasChildNodes()) {
-                                        elementAttributeAssignmentExpression.removeChild(elementAttributeAssignmentExpression.getFirstChild());
-                                }
-                                elementAttributeAssignmentExpression.appendChild(attributeValue);
-                                result	= true;
-                        } else {
-                                throw DOMUtil.newMissingElementException(elementAttributeAssignmentExpression, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
-                        }
-                }
-                result	= DOMUtil.repairIdentifierAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
-                
-                return result;
-        }
+        result	= DOMUtil.repairIdentifierAttribute(elementAttributeAssignmentExpression, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeDesignator.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeDesignator.java
index 3165426..5e428db 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeDesignator.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeDesignator.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,63 +45,63 @@
 /**
  * DOMAttributeDesignator extends {@link com.att.research.xacmlatt.pdp.policy.expressions.AttributeDesignator} with methods
  * for creation from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMAttributeDesignator extends AttributeDesignator {
-        private static final Log logger	= LogFactory.getLog(DOMAttributeDesignator.class);
-        
-        protected DOMAttributeDesignator() {
+    private static final Log logger	= LogFactory.getLog(DOMAttributeDesignator.class);
+
+    protected DOMAttributeDesignator() {
+    }
+
+    /**
+     * Creates a new <code>DOMAttributeDesignator</code> by parsing the given <code>Node</code> representing a XACML AttributeDesignator
+     * element.
+     *
+     * @param nodeAttributeDesignator the <code>Node</code> representing the XACML AttributeDesignator element
+     * @return a new <code>DOMAttributeDesignator</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static AttributeDesignator newInstance(Node nodeAttributeDesignator) throws DOMStructureException {
+        Element elementAttributeDesignator				= DOMUtil.getElement(nodeAttributeDesignator);
+        boolean bLenient								= DOMProperties.isLenient();
+
+        DOMAttributeDesignator domAttributeDesignator	= new DOMAttributeDesignator();
+
+        try {
+            domAttributeDesignator.setCategory(DOMUtil.getIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_CATEGORY, !bLenient));
+            domAttributeDesignator.setAttributeId(DOMUtil.getIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));
+            domAttributeDesignator.setDataTypeId(DOMUtil.getIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_DATATYPE, !bLenient));
+
+            String string;
+            if ((string = DOMUtil.getStringAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_ISSUER)) != null) {
+                domAttributeDesignator.setIssuer(string);
+            }
+            Boolean mustBePresent	= DOMUtil.getBooleanAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_MUSTBEPRESENT, !bLenient);
+            if (mustBePresent != null) {
+                domAttributeDesignator.setMustBePresent(mustBePresent);
+            }
+        } catch (DOMStructureException ex) {
+            domAttributeDesignator.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        /**
-         * Creates a new <code>DOMAttributeDesignator</code> by parsing the given <code>Node</code> representing a XACML AttributeDesignator
-         * element.
-         * 
-         * @param nodeAttributeDesignator the <code>Node</code> representing the XACML AttributeDesignator element
-         * @return a new <code>DOMAttributeDesignator</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static AttributeDesignator newInstance(Node nodeAttributeDesignator) throws DOMStructureException {
-                Element elementAttributeDesignator				= DOMUtil.getElement(nodeAttributeDesignator);
-                boolean bLenient								= DOMProperties.isLenient();
-                
-                DOMAttributeDesignator domAttributeDesignator	= new DOMAttributeDesignator();
-                
-                try {
-                        domAttributeDesignator.setCategory(DOMUtil.getIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_CATEGORY, !bLenient));
-                        domAttributeDesignator.setAttributeId(DOMUtil.getIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));
-                        domAttributeDesignator.setDataTypeId(DOMUtil.getIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_DATATYPE, !bLenient));
-                        
-                        String string;			
-                        if ((string = DOMUtil.getStringAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_ISSUER)) != null) {
-                                domAttributeDesignator.setIssuer(string);
-                        }
-                        Boolean mustBePresent	= DOMUtil.getBooleanAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_MUSTBEPRESENT, !bLenient);
-                        if (mustBePresent != null) {
-                                domAttributeDesignator.setMustBePresent(mustBePresent);
-                        }
-                } catch (DOMStructureException ex) {
-                        domAttributeDesignator.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                
-                return domAttributeDesignator;
-        }
-        
-        public static boolean repair(Node nodeAttributeDesignator) throws DOMStructureException {
-                Element elementAttributeDesignator	= DOMUtil.getElement(nodeAttributeDesignator);
-                boolean result						= false;
-                
-                result								= DOMUtil.repairIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
-                result								= DOMUtil.repairIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
-                result								= DOMUtil.repairIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
-                result								= DOMUtil.repairBooleanAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_MUSTBEPRESENT, false, logger) || result;
-                
-                return result;
-        }
+
+        return domAttributeDesignator;
+    }
+
+    public static boolean repair(Node nodeAttributeDesignator) throws DOMStructureException {
+        Element elementAttributeDesignator	= DOMUtil.getElement(nodeAttributeDesignator);
+        boolean result						= false;
+
+        result								= DOMUtil.repairIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
+        result								= DOMUtil.repairIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
+        result								= DOMUtil.repairIdentifierAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
+        result								= DOMUtil.repairBooleanAttribute(elementAttributeDesignator, XACML3.ATTRIBUTE_MUSTBEPRESENT, false, logger) || result;
+
+        return result;
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeSelector.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeSelector.java
index 49ae4ba..fa3d22b 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeSelector.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMAttributeSelector.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,62 +46,62 @@
 /**
  * DOMAttributeSelector extends {@link com.att.research.xacmlatt.pdp.policy.expressions.AttributeSelector} with methods
  * for creation from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMAttributeSelector extends AttributeSelector {
-        private static Log logger	= LogFactory.getLog(DOMAttributeSelector.class);
-        
-        protected DOMAttributeSelector() {
+    private static Log logger	= LogFactory.getLog(DOMAttributeSelector.class);
+
+    protected DOMAttributeSelector() {
+    }
+
+    /**
+     * Creates a new <code>DOMAttributeSelector</code> by parsing the given <code>Node</code> representing a XACML AttributeSelector element.
+     *
+     * @param nodeAttributeSelector the <code>Node</code> representing the XACML AttributeSelector element
+     * @return a new <code>DOMAttributeSelector</code> parsed from the given <code>Node</code>.
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static AttributeSelector newInstance(Node nodeAttributeSelector) throws DOMStructureException {
+        Element elementAttributeSelector			= DOMUtil.getElement(nodeAttributeSelector);
+        boolean bLenient							= DOMProperties.isLenient();
+
+        DOMAttributeSelector domAttributeSelector	= new DOMAttributeSelector();
+
+        try {
+            domAttributeSelector.setCategory(DOMUtil.getIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_CATEGORY, !bLenient));
+
+            Identifier identifier;
+            if ((identifier = DOMUtil.getIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_CONTEXTSELECTORID)) != null) {
+                domAttributeSelector.setContextSelectorId(identifier);
+            }
+
+            domAttributeSelector.setPath(DOMUtil.getStringAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_PATH, !bLenient));
+            domAttributeSelector.setDataTypeId(DOMUtil.getIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_DATATYPE, !bLenient));
+            Boolean mustBePresent	= DOMUtil.getBooleanAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_MUSTBEPRESENT, !bLenient);
+            if (mustBePresent != null) {
+                domAttributeSelector.setMustBePresent(mustBePresent);
+            }
+        } catch (DOMStructureException ex) {
+            domAttributeSelector.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
 
-        /**
-         * Creates a new <code>DOMAttributeSelector</code> by parsing the given <code>Node</code> representing a XACML AttributeSelector element.
-         * 
-         * @param nodeAttributeSelector the <code>Node</code> representing the XACML AttributeSelector element
-         * @return a new <code>DOMAttributeSelector</code> parsed from the given <code>Node</code>.
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static AttributeSelector newInstance(Node nodeAttributeSelector) throws DOMStructureException {
-                Element elementAttributeSelector			= DOMUtil.getElement(nodeAttributeSelector);
-                boolean bLenient							= DOMProperties.isLenient();
-                
-                DOMAttributeSelector domAttributeSelector	= new DOMAttributeSelector();
-                
-                try {
-                        domAttributeSelector.setCategory(DOMUtil.getIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_CATEGORY, !bLenient));
-                        
-                        Identifier identifier;			
-                        if ((identifier = DOMUtil.getIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_CONTEXTSELECTORID)) != null) {
-                                domAttributeSelector.setContextSelectorId(identifier);
-                        }
-                        
-                        domAttributeSelector.setPath(DOMUtil.getStringAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_PATH, !bLenient));
-                        domAttributeSelector.setDataTypeId(DOMUtil.getIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_DATATYPE, !bLenient));
-                        Boolean mustBePresent	= DOMUtil.getBooleanAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_MUSTBEPRESENT, !bLenient);
-                        if (mustBePresent != null) {
-                                domAttributeSelector.setMustBePresent(mustBePresent);
-                        }
-                } catch (DOMStructureException ex) {
-                        domAttributeSelector.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                
-                return domAttributeSelector;
-        }
-        
-        public static boolean repair(Node nodeAttributeSelector) throws DOMStructureException {
-                Element elementAttributeSelector	= DOMUtil.getElement(nodeAttributeSelector);
-                boolean result						= false;
-                
-                result								= DOMUtil.repairIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
-                result								= DOMUtil.repairStringAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_PATH, "/", logger) || result;
-                result								= DOMUtil.repairIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
-                result								= DOMUtil.repairBooleanAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_MUSTBEPRESENT, false, logger) || result;
-                
-                return result;
-        }
+        return domAttributeSelector;
+    }
+
+    public static boolean repair(Node nodeAttributeSelector) throws DOMStructureException {
+        Element elementAttributeSelector	= DOMUtil.getElement(nodeAttributeSelector);
+        boolean result						= false;
+
+        result								= DOMUtil.repairIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
+        result								= DOMUtil.repairStringAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_PATH, "/", logger) || result;
+        result								= DOMUtil.repairIdentifierAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
+        result								= DOMUtil.repairBooleanAttribute(elementAttributeSelector, XACML3.ATTRIBUTE_MUSTBEPRESENT, false, logger) || result;
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMCombinerParameter.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMCombinerParameter.java
index efc968e..23b79b5 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMCombinerParameter.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMCombinerParameter.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -50,154 +50,154 @@
 /**
  * DOMCombinerParameter extends {@link com.att.research.xacmlatt.pdp.policy.CombinerParameter} with methods for
  * creation from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMCombinerParameter extends CombinerParameter {
-        private static final Log logger	= LogFactory.getLog(DOMCombinerParameter.class);
-        
-        protected DOMCombinerParameter() {
-                
-        }
-        
-        /**
-         * Creates a new <code>CombinerParameter</code> by parsing the given <code>Node</code> representing a XACML CombinerParameter element.
-         * 
-         * @param nodeCombinerParameter the <code>Node</code> representing the XACML CombinerParameter element
-         * @return a new <code>CombinerParameter</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static CombinerParameter newInstance(Node nodeCombinerParameter) throws DOMStructureException {
-                Element elementCombinerParameter		= DOMUtil.getElement(nodeCombinerParameter);
-                boolean bLenient						= DOMProperties.isLenient();
-                
-                DOMCombinerParameter combinerParameter	= new DOMCombinerParameter();
-                
-                try {
-                        NodeList children					= elementCombinerParameter.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                        if (combinerParameter.getAttributeValue() != null && !bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, elementCombinerParameter);
-                                                        } else {
-                                                                combinerParameter.setAttributeValue(DOMAttributeValue.newInstance(child, null));
-                                                        }
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, elementCombinerParameter);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMCombinerParameter.class);
+
+    protected DOMCombinerParameter() {
+
+    }
+
+    /**
+     * Creates a new <code>CombinerParameter</code> by parsing the given <code>Node</code> representing a XACML CombinerParameter element.
+     *
+     * @param nodeCombinerParameter the <code>Node</code> representing the XACML CombinerParameter element
+     * @return a new <code>CombinerParameter</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static CombinerParameter newInstance(Node nodeCombinerParameter) throws DOMStructureException {
+        Element elementCombinerParameter		= DOMUtil.getElement(nodeCombinerParameter);
+        boolean bLenient						= DOMProperties.isLenient();
+
+        DOMCombinerParameter combinerParameter	= new DOMCombinerParameter();
+
+        try {
+            NodeList children					= elementCombinerParameter.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                            if (combinerParameter.getAttributeValue() != null && !bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, elementCombinerParameter);
+                            } else {
+                                combinerParameter.setAttributeValue(DOMAttributeValue.newInstance(child, null));
+                            }
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, elementCombinerParameter);
                         }
-                        
-                        if (combinerParameter.getAttributeValue() == null && !bLenient) {
-                                throw DOMUtil.newMissingElementException(elementCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                        }			
-                        combinerParameter.setName(DOMUtil.getStringAttribute(elementCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, !bLenient));
-                } catch (DOMStructureException ex) {
-                        combinerParameter.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                
-                return combinerParameter;
+            }
+
+            if (combinerParameter.getAttributeValue() == null && !bLenient) {
+                throw DOMUtil.newMissingElementException(elementCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+            }
+            combinerParameter.setName(DOMUtil.getStringAttribute(elementCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, !bLenient));
+        } catch (DOMStructureException ex) {
+            combinerParameter.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        public static boolean repair(Node nodeCombinerParameter) throws DOMStructureException {
-                Element elementCombinerParameter	= DOMUtil.getElement(nodeCombinerParameter);
-                boolean result						= false;
-                
-                NodeList children					= elementCombinerParameter.getChildNodes();
-                int numChildren;
-                boolean sawAttributeValue			= false;
-                
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                if (sawAttributeValue) {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementCombinerParameter.removeChild(child);
-                                                        result	= true;
-                                                } else {
-                                                        result				= DOMAttributeValue.repair(child) || result;
-                                                        sawAttributeValue	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementCombinerParameter.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+
+        return combinerParameter;
+    }
+
+    public static boolean repair(Node nodeCombinerParameter) throws DOMStructureException {
+        Element elementCombinerParameter	= DOMUtil.getElement(nodeCombinerParameter);
+        boolean result						= false;
+
+        NodeList children					= elementCombinerParameter.getChildNodes();
+        int numChildren;
+        boolean sawAttributeValue			= false;
+
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                        if (sawAttributeValue) {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementCombinerParameter.removeChild(child);
+                            result	= true;
+                        } else {
+                            result				= DOMAttributeValue.repair(child) || result;
+                            sawAttributeValue	= true;
                         }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementCombinerParameter.removeChild(child);
+                        result	= true;
+                    }
                 }
-                
-                if (!sawAttributeValue) {
-                        throw DOMUtil.newMissingElementException(elementCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                }
-                
-                result	= DOMUtil.repairStringAttribute(elementCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, "parameter", logger) || result;
-                
-                return result;
+            }
         }
-        
-        /**
-         * Creates a <code>List</code> of <code>CombinerParameter</code>s by parsing the given <code>Node</code> representing a
-         * XACML CombinerParameters element.
-         * 
-         * @param nodeCombinerParameters the <code>Node</code> representing the XACML CombinerParameters element
-         * @return a <code>List</code> of <code>CombinerParameter</code>s parsed from the given <code>Node</code>.
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static List<CombinerParameter> newList(Node nodeCombinerParameters) throws DOMStructureException {
-                Element elementCombinerParameters	= DOMUtil.getElement(nodeCombinerParameters);
-                boolean bLenient					= DOMProperties.isLenient();
-                
-                List<CombinerParameter> listCombinerParameters	= new ArrayList<CombinerParameter>();
-                
-                NodeList children	= elementCombinerParameters.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_COMBINERPARAMETER.equals(child.getLocalName())) {
-                                                listCombinerParameters.add(DOMCombinerParameter.newInstance(child));
-                                        } else if (!bLenient) {
-                                                throw DOMUtil.newUnexpectedElementException(child, elementCombinerParameters);
-                                        }
-                                }
-                        }
-                }
-                return listCombinerParameters;
+
+        if (!sawAttributeValue) {
+            throw DOMUtil.newMissingElementException(elementCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
         }
-        
-        public static boolean repairList(Node nodeCombinerParameters) throws DOMStructureException {
-                Element elementCombinerParameters	= DOMUtil.getElement(nodeCombinerParameters);
-                boolean result						= false;
-                
-                NodeList children	= elementCombinerParameters.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_COMBINERPARAMETER.equals(child.getLocalName())) {
-                                                result	= DOMCombinerParameter.repair(child) || result;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementCombinerParameters.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
+
+        result	= DOMUtil.repairStringAttribute(elementCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, "parameter", logger) || result;
+
+        return result;
+    }
+
+    /**
+     * Creates a <code>List</code> of <code>CombinerParameter</code>s by parsing the given <code>Node</code> representing a
+     * XACML CombinerParameters element.
+     *
+     * @param nodeCombinerParameters the <code>Node</code> representing the XACML CombinerParameters element
+     * @return a <code>List</code> of <code>CombinerParameter</code>s parsed from the given <code>Node</code>.
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static List<CombinerParameter> newList(Node nodeCombinerParameters) throws DOMStructureException {
+        Element elementCombinerParameters	= DOMUtil.getElement(nodeCombinerParameters);
+        boolean bLenient					= DOMProperties.isLenient();
+
+        List<CombinerParameter> listCombinerParameters	= new ArrayList<CombinerParameter>();
+
+        NodeList children	= elementCombinerParameters.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_COMBINERPARAMETER.equals(child.getLocalName())) {
+                        listCombinerParameters.add(DOMCombinerParameter.newInstance(child));
+                    } else if (!bLenient) {
+                        throw DOMUtil.newUnexpectedElementException(child, elementCombinerParameters);
+                    }
                 }
-                return result;
+            }
         }
+        return listCombinerParameters;
+    }
+
+    public static boolean repairList(Node nodeCombinerParameters) throws DOMStructureException {
+        Element elementCombinerParameters	= DOMUtil.getElement(nodeCombinerParameters);
+        boolean result						= false;
+
+        NodeList children	= elementCombinerParameters.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_COMBINERPARAMETER.equals(child.getLocalName())) {
+                        result	= DOMCombinerParameter.repair(child) || result;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementCombinerParameters.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMDocumentRepair.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMDocumentRepair.java
index cfa4c5e..1a00fa6 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMDocumentRepair.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMDocumentRepair.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,51 +40,51 @@
 /**
  * DOMDocumentRepair extends {@link com.att.research.xacml.std.dom.DOMDocumentRepair} to repair Policy documents as well as
  * Request and Response documents.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DOMDocumentRepair extends com.att.research.xacml.std.dom.DOMDocumentRepair {
-        protected boolean repairPolicy(Node nodePolicy) throws DOMStructureException {
-                return DOMPolicy.repair(nodePolicy);
-        }
-        
-        protected boolean repairPolicySet(Node nodePolicySet) throws DOMStructureException {
-                return DOMPolicySet.repair(nodePolicySet);
-        }
-        
-        public DOMDocumentRepair() {
+    protected boolean repairPolicy(Node nodePolicy) throws DOMStructureException {
+        return DOMPolicy.repair(nodePolicy);
+    }
+
+    protected boolean repairPolicySet(Node nodePolicySet) throws DOMStructureException {
+        return DOMPolicySet.repair(nodePolicySet);
+    }
+
+    public DOMDocumentRepair() {
+    }
+
+    /**
+     * Determines what kind of XACML document is represented by the given <code>Document</code> and
+     * attempts to repair it.
+     *
+     * @param document the <code>Document</code> to check
+     * @return true if any repairs were made in the <code>Document</code>, else false
+     * @throws DOMStructureException if there were unrecoverable errors found
+     * @throws UnsupportedDocumentTypeException if the root element is not a XACML Request or Response.
+     */
+    public boolean repair(Document document) throws DOMStructureException, UnsupportedDocumentTypeException {
+        Node firstChild	= DOMUtil.getFirstChildElement(document);
+        if (firstChild == null || !DOMUtil.isElement(firstChild)) {
+            return false;
         }
 
-        /**
-         * Determines what kind of XACML document is represented by the given <code>Document</code> and
-         * attempts to repair it.
-         * 
-         * @param document the <code>Document</code> to check
-         * @return true if any repairs were made in the <code>Document</code>, else false
-         * @throws DOMStructureException if there were unrecoverable errors found
-         * @throws UnsupportedDocumentTypeException if the root element is not a XACML Request or Response.
-         */
-        public boolean repair(Document document) throws DOMStructureException, UnsupportedDocumentTypeException {
-                Node firstChild	= DOMUtil.getFirstChildElement(document);
-                if (firstChild == null || !DOMUtil.isElement(firstChild)) {
-                        return false;
-                }
-                
-                if (!DOMUtil.isInNamespace(firstChild, XACML3.XMLNS)) {
-                        throw new UnsupportedDocumentTypeException("Not a XACML document: " + DOMUtil.getNodeLabel(firstChild));
-                }
-                if (XACML3.ELEMENT_REQUEST.equals(firstChild.getLocalName())) {
-                        return this.repairRequest(firstChild);
-                } else if (XACML3.ELEMENT_RESPONSE.equals(firstChild.getLocalName())) {
-                        return this.repairResponse(firstChild);
-                } else if (XACML3.ELEMENT_POLICY.equals(firstChild.getLocalName())) {
-                        return this.repairPolicy(firstChild);
-                } else if (XACML3.ELEMENT_POLICYSET.equals(firstChild.getLocalName())) {
-                        return this.repairPolicySet(firstChild);
-                } else {
-                        throw new UnsupportedDocumentTypeException("Not a XACML Request or Response: " + DOMUtil.getNodeLabel(firstChild));
-                }
+        if (!DOMUtil.isInNamespace(firstChild, XACML3.XMLNS)) {
+            throw new UnsupportedDocumentTypeException("Not a XACML document: " + DOMUtil.getNodeLabel(firstChild));
         }
+        if (XACML3.ELEMENT_REQUEST.equals(firstChild.getLocalName())) {
+            return this.repairRequest(firstChild);
+        } else if (XACML3.ELEMENT_RESPONSE.equals(firstChild.getLocalName())) {
+            return this.repairResponse(firstChild);
+        } else if (XACML3.ELEMENT_POLICY.equals(firstChild.getLocalName())) {
+            return this.repairPolicy(firstChild);
+        } else if (XACML3.ELEMENT_POLICYSET.equals(firstChild.getLocalName())) {
+            return this.repairPolicySet(firstChild);
+        } else {
+            throw new UnsupportedDocumentTypeException("Not a XACML Request or Response: " + DOMUtil.getNodeLabel(firstChild));
+        }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMExpression.java
index b265f15..bc455de 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -51,90 +51,90 @@
 /**
  * DOMExpression extends {@link com.att.research.xacmlatt.pdp.policy.Expression} with methods for creation
  * from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public abstract class DOMExpression extends Expression {
-        private static final Log logger	= LogFactory.getLog(DOMExpression.class);
-        
-        protected DOMExpression() {
-        }
-        
-        public static boolean isExpression(Node nodeExpression) {
-                String nodeName	= nodeExpression.getLocalName();
-                return (XACML3.ELEMENT_APPLY.equals(nodeName) ||
-                                XACML3.ELEMENT_ATTRIBUTEDESIGNATOR.equals(nodeName) ||
-                                XACML3.ELEMENT_ATTRIBUTESELECTOR.equals(nodeName) ||
-                                XACML3.ELEMENT_ATTRIBUTEVALUE.equals(nodeName) ||
-                                XACML3.ELEMENT_FUNCTION.equals(nodeName) ||
-                                XACML3.ELEMENT_VARIABLEREFERENCE.equals(nodeName)
-                                );
-        }
-        
-        /**
-         * Creates a new <code>Expression</code> of the appropriate sub-type based on the name of the given <code>Node</code>.
-         * 
-         * @param nodeExpression the <code>Node</code> to parse
-         * @param policy the {@link com.att.research.xacmlatt.pdp.policy.Policy} containing the Expression element
-         * @return a new <code>Expression</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static Expression newInstance(Node nodeExpression, Policy policy) throws DOMStructureException {
-                Element elementExpression	= DOMUtil.getElement(nodeExpression);
-                boolean bLenient			= DOMProperties.isLenient();
-        
-                if (DOMUtil.isInNamespace(elementExpression, XACML3.XMLNS)) {
-                        if (elementExpression.getLocalName().equals(XACML3.ELEMENT_APPLY)) {
-                                return DOMApply.newInstance(elementExpression, policy);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTEDESIGNATOR)) {
-                                return DOMAttributeDesignator.newInstance(elementExpression);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTESELECTOR)) {
-                                return DOMAttributeSelector.newInstance(elementExpression);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTEVALUE)) {
-                                AttributeValue<?> attributeValue	= null;
-                                try {
-                                        attributeValue	= DOMAttributeValue.newInstance(elementExpression, null);
-                                } catch (DOMStructureException ex) {
-                                        return new AttributeValueExpression(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                                }
-                                return new AttributeValueExpression(attributeValue);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_FUNCTION)) {
-                                return new Function(DOMUtil.getIdentifierAttribute(elementExpression, XACML3.ATTRIBUTE_FUNCTIONID));
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_VARIABLEREFERENCE)) {
-                                return new VariableReference(policy, DOMUtil.getStringAttribute(elementExpression, XACML3.ATTRIBUTE_VARIABLEID));
-                        } else if (!bLenient) {
-                                throw DOMUtil.newUnexpectedElementException(nodeExpression);
-                        } else {
-                                return null;
-                        }
-                } else if (!bLenient) {
-                        throw DOMUtil.newUnexpectedElementException(nodeExpression);
-                } else {
-                        return null;
+    private static final Log logger	= LogFactory.getLog(DOMExpression.class);
+
+    protected DOMExpression() {
+    }
+
+    public static boolean isExpression(Node nodeExpression) {
+        String nodeName	= nodeExpression.getLocalName();
+        return (XACML3.ELEMENT_APPLY.equals(nodeName) ||
+                XACML3.ELEMENT_ATTRIBUTEDESIGNATOR.equals(nodeName) ||
+                XACML3.ELEMENT_ATTRIBUTESELECTOR.equals(nodeName) ||
+                XACML3.ELEMENT_ATTRIBUTEVALUE.equals(nodeName) ||
+                XACML3.ELEMENT_FUNCTION.equals(nodeName) ||
+                XACML3.ELEMENT_VARIABLEREFERENCE.equals(nodeName)
+               );
+    }
+
+    /**
+     * Creates a new <code>Expression</code> of the appropriate sub-type based on the name of the given <code>Node</code>.
+     *
+     * @param nodeExpression the <code>Node</code> to parse
+     * @param policy the {@link com.att.research.xacmlatt.pdp.policy.Policy} containing the Expression element
+     * @return a new <code>Expression</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static Expression newInstance(Node nodeExpression, Policy policy) throws DOMStructureException {
+        Element elementExpression	= DOMUtil.getElement(nodeExpression);
+        boolean bLenient			= DOMProperties.isLenient();
+
+        if (DOMUtil.isInNamespace(elementExpression, XACML3.XMLNS)) {
+            if (elementExpression.getLocalName().equals(XACML3.ELEMENT_APPLY)) {
+                return DOMApply.newInstance(elementExpression, policy);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTEDESIGNATOR)) {
+                return DOMAttributeDesignator.newInstance(elementExpression);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTESELECTOR)) {
+                return DOMAttributeSelector.newInstance(elementExpression);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTEVALUE)) {
+                AttributeValue<?> attributeValue	= null;
+                try {
+                    attributeValue	= DOMAttributeValue.newInstance(elementExpression, null);
+                } catch (DOMStructureException ex) {
+                    return new AttributeValueExpression(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
                 }
+                return new AttributeValueExpression(attributeValue);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_FUNCTION)) {
+                return new Function(DOMUtil.getIdentifierAttribute(elementExpression, XACML3.ATTRIBUTE_FUNCTIONID));
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_VARIABLEREFERENCE)) {
+                return new VariableReference(policy, DOMUtil.getStringAttribute(elementExpression, XACML3.ATTRIBUTE_VARIABLEID));
+            } else if (!bLenient) {
+                throw DOMUtil.newUnexpectedElementException(nodeExpression);
+            } else {
+                return null;
+            }
+        } else if (!bLenient) {
+            throw DOMUtil.newUnexpectedElementException(nodeExpression);
+        } else {
+            return null;
         }
-        
-        public static boolean repair(Node nodeExpression) throws DOMStructureException {
-                Element elementExpression	= DOMUtil.getElement(nodeExpression);
-                if (DOMUtil.isInNamespace(elementExpression, XACML3.XMLNS)) {
-                        if (elementExpression.getLocalName().equals(XACML3.ELEMENT_APPLY)) {
-                                return DOMApply.repair(elementExpression);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTEDESIGNATOR)) {
-                                return DOMAttributeDesignator.repair(elementExpression);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTESELECTOR)) {
-                                return DOMAttributeSelector.repair(elementExpression);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTEVALUE)) {
-                                return DOMAttributeValue.repair(elementExpression);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_FUNCTION)) {
-                                return DOMUtil.repairIdentifierAttribute(elementExpression, XACML3.ATTRIBUTE_FUNCTIONID, XACML3.ID_FUNCTION_STRING_EQUAL, logger);
-                        } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_VARIABLEREFERENCE)) {
-                                return DOMUtil.repairStringAttribute(elementExpression, XACML3.ATTRIBUTE_VARIABLEID, "variableId", logger);
-                        } else {
-                                throw DOMUtil.newUnexpectedElementException(nodeExpression);
-                        }
-                } else {
-                        throw DOMUtil.newUnexpectedElementException(nodeExpression);
-                }
+    }
+
+    public static boolean repair(Node nodeExpression) throws DOMStructureException {
+        Element elementExpression	= DOMUtil.getElement(nodeExpression);
+        if (DOMUtil.isInNamespace(elementExpression, XACML3.XMLNS)) {
+            if (elementExpression.getLocalName().equals(XACML3.ELEMENT_APPLY)) {
+                return DOMApply.repair(elementExpression);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTEDESIGNATOR)) {
+                return DOMAttributeDesignator.repair(elementExpression);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTESELECTOR)) {
+                return DOMAttributeSelector.repair(elementExpression);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_ATTRIBUTEVALUE)) {
+                return DOMAttributeValue.repair(elementExpression);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_FUNCTION)) {
+                return DOMUtil.repairIdentifierAttribute(elementExpression, XACML3.ATTRIBUTE_FUNCTIONID, XACML3.ID_FUNCTION_STRING_EQUAL, logger);
+            } else if (elementExpression.getLocalName().equals(XACML3.ELEMENT_VARIABLEREFERENCE)) {
+                return DOMUtil.repairStringAttribute(elementExpression, XACML3.ATTRIBUTE_VARIABLEID, "variableId", logger);
+            } else {
+                throw DOMUtil.newUnexpectedElementException(nodeExpression);
+            }
+        } else {
+            throw DOMUtil.newUnexpectedElementException(nodeExpression);
         }
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMMatch.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMMatch.java
index 6244903..d371296 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMMatch.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMMatch.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,147 +47,147 @@
 /**
  * DOMMatch extends {@link com.att.research.xacmlatt.pdp.policy.Match} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMMatch extends Match {
-        private static Log logger	= LogFactory.getLog(DOMMatch.class);
-        
-        protected DOMMatch() {
+    private static Log logger	= LogFactory.getLog(DOMMatch.class);
+
+    protected DOMMatch() {
+    }
+
+    /**
+     * Creates a new <code>DOMMatch</code> by parsing the given <code>Node</code> representing a XACML Match element.
+     *
+     * @param nodeMatch the <code>Node</code> representing the XACML Match element
+     * @return a new <code>DOMMatch</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the given <code>Node</code>
+     */
+    public static Match newInstance(Node nodeMatch) throws DOMStructureException {
+        Element elementMatch	= DOMUtil.getElement(nodeMatch);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        DOMMatch domMatch		= new DOMMatch();
+
+        try {
+            NodeList children	= elementMatch.getChildNodes();
+            int numChildren;
+
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                            String childName	= child.getLocalName();
+                            if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(childName)) {
+                                domMatch.setAttributeValue(DOMAttributeValue.newInstance(child, null));
+                            } else if (XACML3.ELEMENT_ATTRIBUTEDESIGNATOR.equals(childName)) {
+                                if (domMatch.getAttributeRetrievalBase() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodeMatch);
+                                }
+                                domMatch.setAttributeRetrievalBase(DOMAttributeDesignator.newInstance(child));
+                            } else if (XACML3.ELEMENT_ATTRIBUTESELECTOR.equals(childName)) {
+                                if (domMatch.getAttributeRetrievalBase() != null) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodeMatch);
+                                }
+                                domMatch.setAttributeRetrievalBase(DOMAttributeSelector.newInstance(child));
+                            } else if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeMatch);
+                            }
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeMatch);
+                        }
+                    }
+                }
+            }
+
+            /*
+             * We have to see exactly one of these
+             */
+            if (domMatch.getAttributeRetrievalBase() == null && !bLenient) {
+                throw DOMUtil.newMissingElementException(nodeMatch, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEDESIGNATOR + " or " + XACML3.ELEMENT_ATTRIBUTESELECTOR);
+            } else if (domMatch.getAttributeValue() == null && !bLenient) {
+                throw DOMUtil.newMissingElementException(nodeMatch, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+            }
+
+            domMatch.setMatchId(DOMUtil.getIdentifierAttribute(elementMatch, XACML3.ATTRIBUTE_MATCHID, !bLenient));
+
+        } catch (DOMStructureException ex) {
+            domMatch.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        /**
-         * Creates a new <code>DOMMatch</code> by parsing the given <code>Node</code> representing a XACML Match element.
-         * 
-         * @param nodeMatch the <code>Node</code> representing the XACML Match element
-         * @return a new <code>DOMMatch</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the given <code>Node</code>
+        return domMatch;
+    }
+
+    public static boolean repair(Node nodeMatch) throws DOMStructureException {
+        Element elementMatch	= DOMUtil.getElement(nodeMatch);
+        boolean result			= false;
+
+        NodeList children	= elementMatch.getChildNodes();
+        int numChildren;
+        boolean sawAttributeRetrievalBase	= false;
+        boolean sawAttributeValue			= false;
+
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(childName)) {
+                            if (sawAttributeValue) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementMatch.removeChild(child);
+                                result	= true;
+                            } else {
+                                result				= DOMAttributeValue.repair(child) || result;
+                                sawAttributeValue	= true;
+                            }
+                        } else if (XACML3.ELEMENT_ATTRIBUTEDESIGNATOR.equals(childName)) {
+                            if (sawAttributeRetrievalBase) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementMatch.removeChild(child);
+                                result	= true;
+                            } else {
+                                result						= DOMAttributeDesignator.repair(child) || result;
+                                sawAttributeRetrievalBase	= true;
+                            }
+                        } else if (XACML3.ELEMENT_ATTRIBUTESELECTOR.equals(childName)) {
+                            if (sawAttributeRetrievalBase) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementMatch.removeChild(child);
+                                result	= true;
+                            } else {
+                                result	= DOMAttributeSelector.repair(child) || result;
+                                sawAttributeRetrievalBase	= true;
+                            }
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementMatch.removeChild(child);
+                            result	= true;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementMatch.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+
+        /*
+         * We have to see exactly one of these
          */
-        public static Match newInstance(Node nodeMatch) throws DOMStructureException {
-                Element elementMatch	= DOMUtil.getElement(nodeMatch);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                DOMMatch domMatch		= new DOMMatch();
-                
-                try {
-                        NodeList children	= elementMatch.getChildNodes();
-                        int numChildren;
-                        
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                        String childName	= child.getLocalName();
-                                                        if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(childName)) {
-                                                                domMatch.setAttributeValue(DOMAttributeValue.newInstance(child, null));
-                                                        } else if (XACML3.ELEMENT_ATTRIBUTEDESIGNATOR.equals(childName)) {
-                                                                if (domMatch.getAttributeRetrievalBase() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodeMatch);
-                                                                }
-                                                                domMatch.setAttributeRetrievalBase(DOMAttributeDesignator.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_ATTRIBUTESELECTOR.equals(childName)) {
-                                                                if (domMatch.getAttributeRetrievalBase() != null) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodeMatch);
-                                                                }
-                                                                domMatch.setAttributeRetrievalBase(DOMAttributeSelector.newInstance(child));
-                                                        } else if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeMatch);
-                                                        }
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeMatch);
-                                                }
-                                        }
-                                }
-                        }
-                        
-                        /*
-                         * We have to see exactly one of these
-                         */
-                        if (domMatch.getAttributeRetrievalBase() == null && !bLenient) {
-                                throw DOMUtil.newMissingElementException(nodeMatch, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEDESIGNATOR + " or " + XACML3.ELEMENT_ATTRIBUTESELECTOR);
-                        } else if (domMatch.getAttributeValue() == null && !bLenient) {
-                                throw DOMUtil.newMissingElementException(nodeMatch, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                        }
-                        
-                        domMatch.setMatchId(DOMUtil.getIdentifierAttribute(elementMatch, XACML3.ATTRIBUTE_MATCHID, !bLenient));
-                        
-                } catch (DOMStructureException ex) {
-                        domMatch.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                return domMatch;
+        if (!sawAttributeRetrievalBase) {
+            throw DOMUtil.newMissingElementException(nodeMatch, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEDESIGNATOR + " or " + XACML3.ELEMENT_ATTRIBUTESELECTOR);
+        } else if (!sawAttributeValue) {
+            throw DOMUtil.newMissingElementException(nodeMatch, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
         }
-        
-        public static boolean repair(Node nodeMatch) throws DOMStructureException {
-                Element elementMatch	= DOMUtil.getElement(nodeMatch);
-                boolean result			= false;
-                
-                NodeList children	= elementMatch.getChildNodes();
-                int numChildren;
-                boolean sawAttributeRetrievalBase	= false;
-                boolean sawAttributeValue			= false;
-                
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(childName)) {
-                                                        if (sawAttributeValue) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementMatch.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                result				= DOMAttributeValue.repair(child) || result;
-                                                                sawAttributeValue	= true;
-                                                        }
-                                                } else if (XACML3.ELEMENT_ATTRIBUTEDESIGNATOR.equals(childName)) {
-                                                        if (sawAttributeRetrievalBase) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementMatch.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                result						= DOMAttributeDesignator.repair(child) || result;
-                                                                sawAttributeRetrievalBase	= true;
-                                                        }
-                                                } else if (XACML3.ELEMENT_ATTRIBUTESELECTOR.equals(childName)) {
-                                                        if (sawAttributeRetrievalBase) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementMatch.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                result	= DOMAttributeSelector.repair(child) || result;
-                                                                sawAttributeRetrievalBase	= true;
-                                                        }
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementMatch.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementMatch.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                
-                /*
-                 * We have to see exactly one of these
-                 */
-                if (!sawAttributeRetrievalBase) {
-                        throw DOMUtil.newMissingElementException(nodeMatch, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEDESIGNATOR + " or " + XACML3.ELEMENT_ATTRIBUTESELECTOR);
-                } else if (!sawAttributeValue) {
-                        throw DOMUtil.newMissingElementException(nodeMatch, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                }
-                result	= DOMUtil.repairIdentifierAttribute(elementMatch, XACML3.ATTRIBUTE_MATCHID, logger) || result;
-                
-                return result;
-        }
+        result	= DOMUtil.repairIdentifierAttribute(elementMatch, XACML3.ATTRIBUTE_MATCHID, logger) || result;
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMObligationExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMObligationExpression.java
index b7b7bce..ed8fae4 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMObligationExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMObligationExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -51,165 +51,165 @@
 /**
  * DOMObligationExpression extends {@link com.att.research.xacmlatt.pdp.policy.ObligationExpression} with methods
  * for creation from {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMObligationExpression extends ObligationExpression {
-        private static final Log logger	= LogFactory.getLog(DOMObligationExpression.class);
-        
-        protected DOMObligationExpression() {
-        }
-        
-        /**
-         * Creates a new <code>ObligationExpression</code> by parsing the given <code>Node</code> representing a XACML ObligationExpression element.
-         * 
-         * @param nodeObligationExpression the <code>Node</code> representing the XACML ObligationExpression element
-         * @param policy the {@link com.att.research.xacmlatt.pdp.policy.Policy} encompassing the ObligationExpression element
-         * @return a new <code>ObligationExpression</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static ObligationExpression newInstance(Node nodeObligationExpression, Policy policy) throws DOMStructureException {
-                Element elementObligationExpression	= DOMUtil.getElement(nodeObligationExpression);
-                boolean bLenient					= DOMProperties.isLenient();
-                
-                DOMObligationExpression domObligationExpression	= new DOMObligationExpression();
-                
-                try {
-                        NodeList children	= elementObligationExpression.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION.equals(child.getLocalName())) {
-                                                        domObligationExpression.addAttributeAssignmentExpression(DOMAttributeAssignmentExpression.newInstance(child, policy));
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeObligationExpression);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMObligationExpression.class);
+
+    protected DOMObligationExpression() {
+    }
+
+    /**
+     * Creates a new <code>ObligationExpression</code> by parsing the given <code>Node</code> representing a XACML ObligationExpression element.
+     *
+     * @param nodeObligationExpression the <code>Node</code> representing the XACML ObligationExpression element
+     * @param policy the {@link com.att.research.xacmlatt.pdp.policy.Policy} encompassing the ObligationExpression element
+     * @return a new <code>ObligationExpression</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static ObligationExpression newInstance(Node nodeObligationExpression, Policy policy) throws DOMStructureException {
+        Element elementObligationExpression	= DOMUtil.getElement(nodeObligationExpression);
+        boolean bLenient					= DOMProperties.isLenient();
+
+        DOMObligationExpression domObligationExpression	= new DOMObligationExpression();
+
+        try {
+            NodeList children	= elementObligationExpression.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION.equals(child.getLocalName())) {
+                            domObligationExpression.addAttributeAssignmentExpression(DOMAttributeAssignmentExpression.newInstance(child, policy));
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeObligationExpression);
                         }
-                        
-                        domObligationExpression.setObligationId(DOMUtil.getIdentifierAttribute(elementObligationExpression, XACML3.ATTRIBUTE_OBLIGATIONID, !bLenient));
-                        
-                        String string			= DOMUtil.getStringAttribute(elementObligationExpression, XACML3.ATTRIBUTE_FULFILLON, !bLenient);
-                        RuleEffect ruleEffectType	= RuleEffect.getRuleEffect(string);
-                        if (ruleEffectType == null) {
-                                if (!bLenient) {
-                                        throw new DOMStructureException(nodeObligationExpression, "Invalid EffectType \"" + string + "\" in \"" + DOMUtil.getNodeLabel(nodeObligationExpression) + "\"");
-                                }
-                        } else {
-                                domObligationExpression.setRuleEffect(ruleEffectType);
-                        }
-                } catch (DOMStructureException ex) {
-                        domObligationExpression.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                return domObligationExpression;
-        }
-        
-        public static boolean repair(Node nodeObligationExpression) throws DOMStructureException {
-                Element elementObligationExpression	= DOMUtil.getElement(nodeObligationExpression);
-                boolean result						= false;
-                
-                NodeList children	= elementObligationExpression.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION.equals(child.getLocalName())) {
-                                                result	= DOMAttributeAssignmentExpression.repair(child) || result;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementObligationExpression.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
+            }
+
+            domObligationExpression.setObligationId(DOMUtil.getIdentifierAttribute(elementObligationExpression, XACML3.ATTRIBUTE_OBLIGATIONID, !bLenient));
+
+            String string			= DOMUtil.getStringAttribute(elementObligationExpression, XACML3.ATTRIBUTE_FULFILLON, !bLenient);
+            RuleEffect ruleEffectType	= RuleEffect.getRuleEffect(string);
+            if (ruleEffectType == null) {
+                if (!bLenient) {
+                    throw new DOMStructureException(nodeObligationExpression, "Invalid EffectType \"" + string + "\" in \"" + DOMUtil.getNodeLabel(nodeObligationExpression) + "\"");
                 }
-                
-                result					= DOMUtil.repairIdentifierAttribute(elementObligationExpression, XACML3.ATTRIBUTE_OBLIGATIONID, logger) || result;
-                result					= DOMUtil.repairStringAttribute(elementObligationExpression, XACML3.ATTRIBUTE_FULFILLON, RuleEffect.DENY.getName(), logger) || result;
-                
-                String string			= DOMUtil.getStringAttribute(elementObligationExpression, XACML3.ATTRIBUTE_FULFILLON);
-                RuleEffect ruleEffectType	= RuleEffect.getRuleEffect(string);
-                if (ruleEffectType == null) {
-                        logger.warn("Setting invalid RuleEffect " + string + " to " + RuleEffect.DENY.getName());
-                        elementObligationExpression.setAttribute(XACML3.ATTRIBUTE_FULFILLON, RuleEffect.DENY.getName());
+            } else {
+                domObligationExpression.setRuleEffect(ruleEffectType);
+            }
+        } catch (DOMStructureException ex) {
+            domObligationExpression.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
+        }
+        return domObligationExpression;
+    }
+
+    public static boolean repair(Node nodeObligationExpression) throws DOMStructureException {
+        Element elementObligationExpression	= DOMUtil.getElement(nodeObligationExpression);
+        boolean result						= false;
+
+        NodeList children	= elementObligationExpression.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION.equals(child.getLocalName())) {
+                        result	= DOMAttributeAssignmentExpression.repair(child) || result;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementObligationExpression.removeChild(child);
                         result	= true;
+                    }
                 }
-                
-                return result;
+            }
         }
-        
-        /**
-         * Creates a <code>List</code> of <code>ObligationExpression</code>s by parsing the given <code>Node</code>
-         * representing a XACML ObligationExpressions element.
-         * 
-         * @param nodeObligationExpressions the <code>Node</code> representing the XACML ObligationExpressions element
-         * @param policy the <code>Policy</code> encompassing the ObligationExpressions element
-         * @return a new <code>List</code> of <code>ObligationExpression</code>s parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static List<ObligationExpression> newList(Node nodeObligationExpressions, Policy policy) throws DOMStructureException {
-                Element elementObligationExpressions	= DOMUtil.getElement(nodeObligationExpressions);
-                boolean bLenient						= DOMProperties.isLenient();
-                
-                List<ObligationExpression> listObligationExpressions	= new ArrayList<ObligationExpression>();
-                
-                NodeList children	= elementObligationExpressions.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_OBLIGATIONEXPRESSION.equals(child.getLocalName())) {
-                                                listObligationExpressions.add(DOMObligationExpression.newInstance(child, policy));
-                                        } else if (!bLenient) {
-                                                throw DOMUtil.newUnexpectedElementException(child, elementObligationExpressions);
-                                        }
-                                }
-                        }
-                }
-                
-                if (listObligationExpressions.size() == 0 && !bLenient) {
-                        throw DOMUtil.newMissingElementException(elementObligationExpressions, XACML3.XMLNS, XACML3.ELEMENT_OBLIGATIONEXPRESSION);
-                }
-                
-                return listObligationExpressions;
+
+        result					= DOMUtil.repairIdentifierAttribute(elementObligationExpression, XACML3.ATTRIBUTE_OBLIGATIONID, logger) || result;
+        result					= DOMUtil.repairStringAttribute(elementObligationExpression, XACML3.ATTRIBUTE_FULFILLON, RuleEffect.DENY.getName(), logger) || result;
+
+        String string			= DOMUtil.getStringAttribute(elementObligationExpression, XACML3.ATTRIBUTE_FULFILLON);
+        RuleEffect ruleEffectType	= RuleEffect.getRuleEffect(string);
+        if (ruleEffectType == null) {
+            logger.warn("Setting invalid RuleEffect " + string + " to " + RuleEffect.DENY.getName());
+            elementObligationExpression.setAttribute(XACML3.ATTRIBUTE_FULFILLON, RuleEffect.DENY.getName());
+            result	= true;
         }
-        
-        public static boolean repairList(Node nodeObligationExpressions) throws DOMStructureException {
-                Element elementObligationExpressions	= DOMUtil.getElement(nodeObligationExpressions);
-                boolean result							= false;
-                
-                boolean sawObligationExpression			= false;
-                NodeList children	= elementObligationExpressions.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_OBLIGATIONEXPRESSION.equals(child.getLocalName())) {
-                                                result					= DOMObligationExpression.repair(child) || result;
-                                                sawObligationExpression	= true;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementObligationExpressions.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
+
+        return result;
+    }
+
+    /**
+     * Creates a <code>List</code> of <code>ObligationExpression</code>s by parsing the given <code>Node</code>
+     * representing a XACML ObligationExpressions element.
+     *
+     * @param nodeObligationExpressions the <code>Node</code> representing the XACML ObligationExpressions element
+     * @param policy the <code>Policy</code> encompassing the ObligationExpressions element
+     * @return a new <code>List</code> of <code>ObligationExpression</code>s parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static List<ObligationExpression> newList(Node nodeObligationExpressions, Policy policy) throws DOMStructureException {
+        Element elementObligationExpressions	= DOMUtil.getElement(nodeObligationExpressions);
+        boolean bLenient						= DOMProperties.isLenient();
+
+        List<ObligationExpression> listObligationExpressions	= new ArrayList<ObligationExpression>();
+
+        NodeList children	= elementObligationExpressions.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_OBLIGATIONEXPRESSION.equals(child.getLocalName())) {
+                        listObligationExpressions.add(DOMObligationExpression.newInstance(child, policy));
+                    } else if (!bLenient) {
+                        throw DOMUtil.newUnexpectedElementException(child, elementObligationExpressions);
+                    }
                 }
-                if (!sawObligationExpression) {
-                        throw DOMUtil.newMissingElementException(elementObligationExpressions, XACML3.XMLNS, XACML3.ELEMENT_OBLIGATIONEXPRESSION);
-                }
-                
-                return result;
+            }
         }
 
+        if (listObligationExpressions.size() == 0 && !bLenient) {
+            throw DOMUtil.newMissingElementException(elementObligationExpressions, XACML3.XMLNS, XACML3.ELEMENT_OBLIGATIONEXPRESSION);
+        }
+
+        return listObligationExpressions;
+    }
+
+    public static boolean repairList(Node nodeObligationExpressions) throws DOMStructureException {
+        Element elementObligationExpressions	= DOMUtil.getElement(nodeObligationExpressions);
+        boolean result							= false;
+
+        boolean sawObligationExpression			= false;
+        NodeList children	= elementObligationExpressions.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_OBLIGATIONEXPRESSION.equals(child.getLocalName())) {
+                        result					= DOMObligationExpression.repair(child) || result;
+                        sawObligationExpression	= true;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementObligationExpressions.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+        if (!sawObligationExpression) {
+            throw DOMUtil.newMissingElementException(elementObligationExpressions, XACML3.XMLNS, XACML3.ELEMENT_OBLIGATIONEXPRESSION);
+        }
+
+        return result;
+    }
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicy.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicy.java
index 3383817..ee472c7 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicy.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicy.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -61,275 +61,275 @@
 /**
  * DOMPolicy extends {@link com.att.research.xacmlatt.pdp.policy.Policy} with methods for creation from a
  * DOM {@link org.w3c.dom.Node}.
- * 
+ *
  * @author car
  * @version $Revision: 1.4 $
  */
 public class DOMPolicy {
-        private static final Log logger	= LogFactory.getLog(DOMPolicy.class);
-        
-        /**
-         * Creates a new <code>DOMPolicy</code> to be configured from a DOM <code>Node</code>.
-         */
-        protected DOMPolicy() {
+    private static final Log logger	= LogFactory.getLog(DOMPolicy.class);
+
+    /**
+     * Creates a new <code>DOMPolicy</code> to be configured from a DOM <code>Node</code>.
+     */
+    protected DOMPolicy() {
+    }
+
+    /**
+     * Creates a new <code>DOMPolicy</code> by parsing the given <code>Node</code> representing a XACML Policy element.
+     *
+     * @param nodePolicy the <code>Node</code> representing the Policy element
+     * @param policyDefaultsParent the <code>PolicyDefaults</code> of the parent element of the Policy element or null if this is the root
+     * @return a new <code>DOMPolicy</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static Policy newInstance(Node nodePolicy, PolicySet policySetParent, PolicyDefaults policyDefaultsParent) throws DOMStructureException {
+        Element elementPolicy	= DOMUtil.getElement(nodePolicy);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        Policy domPolicy		= new Policy(policySetParent);
+
+        Identifier identifier;
+        Integer integer;
+        Iterator<?> iterator;
+
+        try {
+            NodeList children	= elementPolicy.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                /*
+                 * Run through once, quickly, to set the PolicyDefaults for the new DOMPolicySet
+                 */
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isNamespaceElement(child, XACML3.XMLNS) && XACML3.ELEMENT_POLICYDEFAULTS.equals(child.getLocalName())) {
+                        if (domPolicy.getPolicyDefaults() != null && !bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
+                        }
+                        domPolicy.setPolicyDefaults(DOMPolicyDefaults.newInstance(child, policyDefaultsParent));
+                    }
+                }
+                if (domPolicy.getPolicyDefaults() == null) {
+                    domPolicy.setPolicyDefaults(policyDefaultsParent);
+                }
+
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                            String childName	= child.getLocalName();
+                            if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
+                                if (domPolicy.getDescription() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
+                                }
+                                domPolicy.setDescription(child.getTextContent());
+                            } else if (XACML3.ELEMENT_POLICYISSUER.equals(childName)) {
+                                if (domPolicy.getPolicyIssuer() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
+                                }
+                                domPolicy.setPolicyIssuer(DOMPolicyIssuer.newInstance(child));
+                            } else if (XACML3.ELEMENT_POLICYDEFAULTS.equals(childName)) {
+                            } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
+                                if (domPolicy.getTarget() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
+                                }
+                                domPolicy.setTarget(DOMTarget.newInstance(child));
+                            } else if (XACML3.ELEMENT_COMBINERPARAMETERS.equals(childName)) {
+                                domPolicy.addCombinerParameters(DOMCombinerParameter.newList(child));
+                            } else if (XACML3.ELEMENT_RULECOMBINERPARAMETERS.equals(childName)) {
+                                domPolicy.addRuleCombinerParameter(DOMRuleCombinerParameters.newInstance(child));
+                            } else if (XACML3.ELEMENT_VARIABLEDEFINITION.equals(childName)) {
+                                domPolicy.addVariableDefinition(DOMVariableDefinition.newInstance(child, domPolicy));
+                            } else if (XACML3.ELEMENT_RULE.equals(childName)) {
+                                domPolicy.addRule(DOMRule.newInstance(child, domPolicy));
+                            } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
+                                if ((iterator = domPolicy.getObligationExpressions()) != null && iterator.hasNext() && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
+                                }
+                                domPolicy.setObligationExpressions(DOMObligationExpression.newList(child, domPolicy));
+                            } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
+                                if ((iterator = domPolicy.getAdviceExpressions())!= null && iterator.hasNext() && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
+                                }
+                                domPolicy.setAdviceExpressions(DOMAdviceExpression.newList(child, domPolicy));
+                            } else if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
+                            }
+                        }
+                    }
+                }
+            }
+            domPolicy.setIdentifier(DOMUtil.getIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_POLICYID, !bLenient));
+            domPolicy.setVersion(DOMUtil.getVersionAttribute(elementPolicy, XACML3.ATTRIBUTE_VERSION, !bLenient));
+
+            identifier	= DOMUtil.getIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_RULECOMBININGALGID, !bLenient);
+            CombiningAlgorithm<Rule> combiningAlgorithmRule	= null;
+            try {
+                combiningAlgorithmRule	= CombiningAlgorithmFactory.newInstance().getRuleCombiningAlgorithm(identifier);
+            } catch (FactoryException ex) {
+                if (!bLenient) {
+                    throw new DOMStructureException("Failed to get CombiningAlgorithm", ex);
+                }
+            }
+            if (combiningAlgorithmRule == null && !bLenient) {
+                throw new DOMStructureException(elementPolicy, "Unknown rule combining algorithm \"" + identifier.toString() + "\" in \"" + DOMUtil.getNodeLabel(nodePolicy));
+            } else {
+                domPolicy.setRuleCombiningAlgorithm(combiningAlgorithmRule);
+            }
+
+
+            if ((integer = DOMUtil.getIntegerAttribute(elementPolicy, XACML3.ATTRIBUTE_MAXDELEGATIONDEPTH)) != null) {
+                domPolicy.setMaxDelegationDepth(integer);
+            }
+        } catch (DOMStructureException ex) {
+            domPolicy.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
 
-        /**
-         * Creates a new <code>DOMPolicy</code> by parsing the given <code>Node</code> representing a XACML Policy element.
-         * 
-         * @param nodePolicy the <code>Node</code> representing the Policy element
-         * @param policyDefaultsParent the <code>PolicyDefaults</code> of the parent element of the Policy element or null if this is the root
-         * @return a new <code>DOMPolicy</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static Policy newInstance(Node nodePolicy, PolicySet policySetParent, PolicyDefaults policyDefaultsParent) throws DOMStructureException {
-                Element elementPolicy	= DOMUtil.getElement(nodePolicy);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                Policy domPolicy		= new Policy(policySetParent);
-                
-                Identifier identifier;
-                Integer integer;		
-                Iterator<?> iterator;
-        
-                try {
-                        NodeList children	= elementPolicy.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                /*
-                                 * Run through once, quickly, to set the PolicyDefaults for the new DOMPolicySet
-                                 */
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isNamespaceElement(child, XACML3.XMLNS) && XACML3.ELEMENT_POLICYDEFAULTS.equals(child.getLocalName())) {
-                                                if (domPolicy.getPolicyDefaults() != null && !bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
-                                                }
-                                                domPolicy.setPolicyDefaults(DOMPolicyDefaults.newInstance(child, policyDefaultsParent));
-                                        }
-                                }
-                                if (domPolicy.getPolicyDefaults() == null) {
-                                        domPolicy.setPolicyDefaults(policyDefaultsParent);
-                                }
-                                
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                        String childName	= child.getLocalName();
-                                                        if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
-                                                                if (domPolicy.getDescription() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
-                                                                }
-                                                                domPolicy.setDescription(child.getTextContent());
-                                                        } else if (XACML3.ELEMENT_POLICYISSUER.equals(childName)) {
-                                                                if (domPolicy.getPolicyIssuer() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
-                                                                }
-                                                                domPolicy.setPolicyIssuer(DOMPolicyIssuer.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_POLICYDEFAULTS.equals(childName)) {
-                                                        } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
-                                                                if (domPolicy.getTarget() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
-                                                                }
-                                                                domPolicy.setTarget(DOMTarget.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_COMBINERPARAMETERS.equals(childName)) {
-                                                                domPolicy.addCombinerParameters(DOMCombinerParameter.newList(child));
-                                                        } else if (XACML3.ELEMENT_RULECOMBINERPARAMETERS.equals(childName)) {
-                                                                domPolicy.addRuleCombinerParameter(DOMRuleCombinerParameters.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_VARIABLEDEFINITION.equals(childName)) {
-                                                                domPolicy.addVariableDefinition(DOMVariableDefinition.newInstance(child, domPolicy));
-                                                        } else if (XACML3.ELEMENT_RULE.equals(childName)) {
-                                                                domPolicy.addRule(DOMRule.newInstance(child, domPolicy));
-                                                        } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
-                                                                if ((iterator = domPolicy.getObligationExpressions()) != null && iterator.hasNext() && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
-                                                                }
-                                                                domPolicy.setObligationExpressions(DOMObligationExpression.newList(child, domPolicy));
-                                                        } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
-                                                                if ((iterator = domPolicy.getAdviceExpressions())!= null && iterator.hasNext() && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
-                                                                }
-                                                                domPolicy.setAdviceExpressions(DOMAdviceExpression.newList(child, domPolicy));
-                                                        } else if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodePolicy);
-                                                        }
-                                                }
-                                        }
-                                }
-                        }
-                        domPolicy.setIdentifier(DOMUtil.getIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_POLICYID, !bLenient));
-                        domPolicy.setVersion(DOMUtil.getVersionAttribute(elementPolicy, XACML3.ATTRIBUTE_VERSION, !bLenient));
-                        
-                        identifier	= DOMUtil.getIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_RULECOMBININGALGID, !bLenient);
-                        CombiningAlgorithm<Rule> combiningAlgorithmRule	= null;
-                        try {
-                                combiningAlgorithmRule	= CombiningAlgorithmFactory.newInstance().getRuleCombiningAlgorithm(identifier);
-                        } catch (FactoryException ex) {
-                                if (!bLenient) {
-                                        throw new DOMStructureException("Failed to get CombiningAlgorithm", ex);
-                                }
-                        }
-                        if (combiningAlgorithmRule == null && !bLenient) {
-                                throw new DOMStructureException(elementPolicy, "Unknown rule combining algorithm \"" + identifier.toString() + "\" in \"" + DOMUtil.getNodeLabel(nodePolicy));
+        return domPolicy;
+    }
+
+    public static boolean repair(Node nodePolicy) throws DOMStructureException {
+        Element elementPolicy	= DOMUtil.getElement(nodePolicy);
+        boolean result			= false;
+
+        NodeList children	= elementPolicy.getChildNodes();
+        int numChildren;
+        boolean sawDescription		= false;
+        boolean sawIssuer			= false;
+        boolean sawTarget			= false;
+        boolean sawPolicyDefaults	= false;
+        boolean sawObligationExprs	= false;
+        boolean sawAdviceExprs		= false;
+
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
+                            if (sawDescription) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicy.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawDescription	= true;
+                            }
+                        } else if (XACML3.ELEMENT_POLICYISSUER.equals(childName)) {
+                            if (sawIssuer) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicy.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawDescription	= true;
+                                result	= DOMPolicyIssuer.repair(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_POLICYDEFAULTS.equals(childName)) {
+                            if (sawPolicyDefaults) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicy.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawPolicyDefaults		= true;
+                                result			= DOMPolicyDefaults.repair(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
+                            if (sawTarget) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicy.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawTarget		= true;
+                                result			= DOMTarget.repair(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_COMBINERPARAMETERS.equals(childName)) {
+                            result	= DOMCombinerParameter.repair(child) || result;
+                        } else if (XACML3.ELEMENT_RULECOMBINERPARAMETERS.equals(childName)) {
+                            result	= DOMRuleCombinerParameters.repair(child) || result;
+                        } else if (XACML3.ELEMENT_VARIABLEDEFINITION.equals(childName)) {
+                            result	= DOMVariableDefinition.repair(child) || result;
+                        } else if (XACML3.ELEMENT_RULE.equals(childName)) {
+                            result	= DOMRule.repair(child) || result;
+                        } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
+                            if (sawObligationExprs) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicy.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawObligationExprs	= true;
+                                result				= DOMObligationExpression.repairList(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
+                            if (sawAdviceExprs) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicy.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawAdviceExprs		= true;
+                                result				= DOMAdviceExpression.repairList(child) || result;
+                            }
                         } else {
-                                domPolicy.setRuleCombiningAlgorithm(combiningAlgorithmRule);
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementPolicy.removeChild(child);
+                            result	= true;
                         }
-                        
-                        
-                        if ((integer = DOMUtil.getIntegerAttribute(elementPolicy, XACML3.ATTRIBUTE_MAXDELEGATIONDEPTH)) != null) {
-                                domPolicy.setMaxDelegationDepth(integer);
-                        }
-                } catch (DOMStructureException ex) {
-                        domPolicy.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                
-                return domPolicy;
+            }
         }
-        
-        public static boolean repair(Node nodePolicy) throws DOMStructureException {
-                Element elementPolicy	= DOMUtil.getElement(nodePolicy);
-                boolean result			= false;
-                
-                NodeList children	= elementPolicy.getChildNodes();
-                int numChildren;
-                boolean sawDescription		= false;
-                boolean sawIssuer			= false;
-                boolean sawTarget			= false;
-                boolean sawPolicyDefaults	= false;
-                boolean sawObligationExprs	= false;
-                boolean sawAdviceExprs		= false;
-                
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
-                                                        if (sawDescription) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicy.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawDescription	= true;
-                                                        }
-                                                } else if (XACML3.ELEMENT_POLICYISSUER.equals(childName)) {
-                                                        if (sawIssuer) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicy.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawDescription	= true;
-                                                                result	= DOMPolicyIssuer.repair(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_POLICYDEFAULTS.equals(childName)) {
-                                                        if (sawPolicyDefaults) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicy.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawPolicyDefaults		= true;
-                                                                result			= DOMPolicyDefaults.repair(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
-                                                        if (sawTarget) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicy.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawTarget		= true;
-                                                                result			= DOMTarget.repair(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_COMBINERPARAMETERS.equals(childName)) {
-                                                        result	= DOMCombinerParameter.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_RULECOMBINERPARAMETERS.equals(childName)) {
-                                                        result	= DOMRuleCombinerParameters.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_VARIABLEDEFINITION.equals(childName)) {
-                                                        result	= DOMVariableDefinition.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_RULE.equals(childName)) {
-                                                        result	= DOMRule.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
-                                                        if (sawObligationExprs) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicy.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawObligationExprs	= true;
-                                                                result				= DOMObligationExpression.repairList(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
-                                                        if (sawAdviceExprs) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicy.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawAdviceExprs		= true;
-                                                                result				= DOMAdviceExpression.repairList(child) || result;
-                                                        }
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementPolicy.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        }
-                                }
-                        }
-                }
-                result	= DOMUtil.repairIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_POLICYID, logger) || result;
-                result	= DOMUtil.repairVersionAttribute(elementPolicy, XACML3.ATTRIBUTE_VERSION, logger) || result;
-                result	= DOMUtil.repairIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_RULECOMBININGALGID, XACML3.ID_RULE_DENY_OVERRIDES, logger) || result;
-                
-                Identifier identifier	= DOMUtil.getIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_RULECOMBININGALGID);
-                CombiningAlgorithm<Rule> combiningAlgorithmRule	= null;
-                try {
-                        combiningAlgorithmRule	= CombiningAlgorithmFactory.newInstance().getRuleCombiningAlgorithm(identifier);
-                } catch (FactoryException ex) {
-                        combiningAlgorithmRule	= null;
-                }
-                if(combiningAlgorithmRule == null) {
-                        logger.warn("Setting invalid " + XACML3.ATTRIBUTE_RULECOMBININGALGID + " attribute " + identifier.stringValue() + " to " + XACML3.ID_RULE_DENY_OVERRIDES.stringValue());
-                        elementPolicy.setAttribute(XACML3.ATTRIBUTE_RULECOMBININGALGID, XACML3.ID_RULE_DENY_OVERRIDES.stringValue());
-                        result	= true;
-                }
-                return result;
+        result	= DOMUtil.repairIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_POLICYID, logger) || result;
+        result	= DOMUtil.repairVersionAttribute(elementPolicy, XACML3.ATTRIBUTE_VERSION, logger) || result;
+        result	= DOMUtil.repairIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_RULECOMBININGALGID, XACML3.ID_RULE_DENY_OVERRIDES, logger) || result;
+
+        Identifier identifier	= DOMUtil.getIdentifierAttribute(elementPolicy, XACML3.ATTRIBUTE_RULECOMBININGALGID);
+        CombiningAlgorithm<Rule> combiningAlgorithmRule	= null;
+        try {
+            combiningAlgorithmRule	= CombiningAlgorithmFactory.newInstance().getRuleCombiningAlgorithm(identifier);
+        } catch (FactoryException ex) {
+            combiningAlgorithmRule	= null;
         }
-        
-        public static void main(String args[]) {
-                try {
-                        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                        documentBuilderFactory.setNamespaceAware(true);
-                        DocumentBuilder documentBuilder					= documentBuilderFactory.newDocumentBuilder();
-                        
-                        for (String fileName: args) {
-                                File filePolicy	= new File(fileName);
-                                if (filePolicy.exists() && filePolicy.canRead()) {
-                                        try {
-                                                Document documentPolicy	= documentBuilder.parse(filePolicy);
-                                                if (documentPolicy.getFirstChild() == null) {
-                                                        System.err.println(fileName + ": Error: No Policy found");
-                                                } else if (!XACML3.ELEMENT_POLICY.equals(documentPolicy.getFirstChild().getLocalName())) {
-                                                        System.err.println(fileName + ": Error: Not a Policy documnt");
-                                                } else {
-                                                        Policy	policy	= DOMPolicy.newInstance(documentPolicy.getFirstChild(), null, null);
-                                                        System.out.println(fileName + ": validate()=" + policy.validate());
-                                                        System.out.println(StringUtils.prettyPrint(policy.toString()));
-                                                }
-                                        } catch (Exception ex) {
-                                                System.err.println("Exception processing policy file \"" + fileName + "\"");
-                                                ex.printStackTrace(System.err);
-                                        }
-                                } else {
-                                        System.err.println("Cannot read policy file \"" + fileName + "\"");
-                                }
+        if(combiningAlgorithmRule == null) {
+            logger.warn("Setting invalid " + XACML3.ATTRIBUTE_RULECOMBININGALGID + " attribute " + identifier.stringValue() + " to " + XACML3.ID_RULE_DENY_OVERRIDES.stringValue());
+            elementPolicy.setAttribute(XACML3.ATTRIBUTE_RULECOMBININGALGID, XACML3.ID_RULE_DENY_OVERRIDES.stringValue());
+            result	= true;
+        }
+        return result;
+    }
+
+    public static void main(String args[]) {
+        try {
+            DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+            documentBuilderFactory.setNamespaceAware(true);
+            DocumentBuilder documentBuilder					= documentBuilderFactory.newDocumentBuilder();
+
+            for (String fileName: args) {
+                File filePolicy	= new File(fileName);
+                if (filePolicy.exists() && filePolicy.canRead()) {
+                    try {
+                        Document documentPolicy	= documentBuilder.parse(filePolicy);
+                        if (documentPolicy.getFirstChild() == null) {
+                            System.err.println(fileName + ": Error: No Policy found");
+                        } else if (!XACML3.ELEMENT_POLICY.equals(documentPolicy.getFirstChild().getLocalName())) {
+                            System.err.println(fileName + ": Error: Not a Policy documnt");
+                        } else {
+                            Policy	policy	= DOMPolicy.newInstance(documentPolicy.getFirstChild(), null, null);
+                            System.out.println(fileName + ": validate()=" + policy.validate());
+                            System.out.println(StringUtils.prettyPrint(policy.toString()));
                         }
-                } catch (Exception ex) {
+                    } catch (Exception ex) {
+                        System.err.println("Exception processing policy file \"" + fileName + "\"");
                         ex.printStackTrace(System.err);
-                        System.exit(1);
+                    }
+                } else {
+                    System.err.println("Cannot read policy file \"" + fileName + "\"");
                 }
-                System.exit(0);
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace(System.err);
+            System.exit(1);
         }
+        System.exit(0);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyCombinerParameter.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyCombinerParameter.java
index 46d4777..cf4f73f 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyCombinerParameter.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyCombinerParameter.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -49,96 +49,96 @@
 /**
  * DOMPolicyCombinerParameter extends {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter} for
  * {@link com.att.research.xacmlatt.pdp.policy.Policy}s with methods for creation from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMPolicyCombinerParameter extends TargetedCombinerParameter<Identifier, PolicySetChild> {
-        private static final Log logger	= LogFactory.getLog(DOMPolicyCombinerParameter.class);
-        
-        protected DOMPolicyCombinerParameter() {
-                
-        }
-        
-        /**
-         * Creates a new <code>TargetedCombinerParameter</code> for <code>Policy</code>s by parsing the given <code>Node</code>
-         * representing a XACML PolicyCombinerParameter element.
-         * 
-         * @param nodeCombinerParameter the <code>Node</code> representing the XACML PolicyCombinerParameter element
-         * @return a new <code>TargetedCombinerParameter</code> for <code>Policy</code>s parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static TargetedCombinerParameter<Identifier,PolicySetChild> newInstance(Node nodeCombinerParameter) throws DOMStructureException {
-                Element elementPolicyCombinerParameter					= DOMUtil.getElement(nodeCombinerParameter);
-                boolean bLenient										= DOMProperties.isLenient();
-                
-                DOMPolicyCombinerParameter domPolicyCombinerParameter	= new DOMPolicyCombinerParameter();
-                
-                try {
-                        NodeList children	= elementPolicyCombinerParameter.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                        domPolicyCombinerParameter.setAttributeValue(DOMAttributeValue.newInstance(child, null));
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeCombinerParameter);
-                                                }
-                                        }
-                                }
-                        }
-                        if (domPolicyCombinerParameter.getAttributeValue() == null && !bLenient) {
-                                throw DOMUtil.newMissingElementException(nodeCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                        }
-                        domPolicyCombinerParameter.setName(DOMUtil.getStringAttribute(elementPolicyCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, !bLenient));
-                        domPolicyCombinerParameter.setTargetId(DOMUtil.getIdentifierAttribute(elementPolicyCombinerParameter, XACML3.ATTRIBUTE_POLICYIDREF, !bLenient));
-                        
-                } catch (DOMStructureException ex) {
-                        domPolicyCombinerParameter.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                
-                return domPolicyCombinerParameter;
-                
-        }
-        public static boolean repair(Node nodePolicyCombinerParameter) throws DOMStructureException {
-                Element elementPolicyCombinerParameter	= DOMUtil.getElement(nodePolicyCombinerParameter);
-                boolean result							= false;
-                
-                NodeList children			= elementPolicyCombinerParameter.getChildNodes();
-                int numChildren;
-                boolean sawAttributeValue	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                if (sawAttributeValue) {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementPolicyCombinerParameter.removeChild(child);
-                                                        result	= true;
-                                                } else {
-                                                        sawAttributeValue	= true;
-                                                        result				= DOMAttributeValue.repair(child) || result;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementPolicyCombinerParameter.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                if (!sawAttributeValue) {
-                        throw DOMUtil.newMissingElementException(nodePolicyCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                }
-                result	= DOMUtil.repairStringAttribute(elementPolicyCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, "parameter", logger) || result;
-                result	= DOMUtil.repairIdentifierAttribute(elementPolicyCombinerParameter, XACML3.ATTRIBUTE_POLICYIDREF, logger) || result;
+    private static final Log logger	= LogFactory.getLog(DOMPolicyCombinerParameter.class);
 
-                return result;
+    protected DOMPolicyCombinerParameter() {
+
+    }
+
+    /**
+     * Creates a new <code>TargetedCombinerParameter</code> for <code>Policy</code>s by parsing the given <code>Node</code>
+     * representing a XACML PolicyCombinerParameter element.
+     *
+     * @param nodeCombinerParameter the <code>Node</code> representing the XACML PolicyCombinerParameter element
+     * @return a new <code>TargetedCombinerParameter</code> for <code>Policy</code>s parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static TargetedCombinerParameter<Identifier,PolicySetChild> newInstance(Node nodeCombinerParameter) throws DOMStructureException {
+        Element elementPolicyCombinerParameter					= DOMUtil.getElement(nodeCombinerParameter);
+        boolean bLenient										= DOMProperties.isLenient();
+
+        DOMPolicyCombinerParameter domPolicyCombinerParameter	= new DOMPolicyCombinerParameter();
+
+        try {
+            NodeList children	= elementPolicyCombinerParameter.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                            domPolicyCombinerParameter.setAttributeValue(DOMAttributeValue.newInstance(child, null));
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeCombinerParameter);
+                        }
+                    }
+                }
+            }
+            if (domPolicyCombinerParameter.getAttributeValue() == null && !bLenient) {
+                throw DOMUtil.newMissingElementException(nodeCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+            }
+            domPolicyCombinerParameter.setName(DOMUtil.getStringAttribute(elementPolicyCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, !bLenient));
+            domPolicyCombinerParameter.setTargetId(DOMUtil.getIdentifierAttribute(elementPolicyCombinerParameter, XACML3.ATTRIBUTE_POLICYIDREF, !bLenient));
+
+        } catch (DOMStructureException ex) {
+            domPolicyCombinerParameter.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
+
+        return domPolicyCombinerParameter;
+
+    }
+    public static boolean repair(Node nodePolicyCombinerParameter) throws DOMStructureException {
+        Element elementPolicyCombinerParameter	= DOMUtil.getElement(nodePolicyCombinerParameter);
+        boolean result							= false;
+
+        NodeList children			= elementPolicyCombinerParameter.getChildNodes();
+        int numChildren;
+        boolean sawAttributeValue	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                        if (sawAttributeValue) {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementPolicyCombinerParameter.removeChild(child);
+                            result	= true;
+                        } else {
+                            sawAttributeValue	= true;
+                            result				= DOMAttributeValue.repair(child) || result;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementPolicyCombinerParameter.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+        if (!sawAttributeValue) {
+            throw DOMUtil.newMissingElementException(nodePolicyCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+        }
+        result	= DOMUtil.repairStringAttribute(elementPolicyCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, "parameter", logger) || result;
+        result	= DOMUtil.repairIdentifierAttribute(elementPolicyCombinerParameter, XACML3.ATTRIBUTE_POLICYIDREF, logger) || result;
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java
index 53e6a68..14bbc23 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDef.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,106 +47,106 @@
 
 /**
  * DOMPolicyDef extends {@link com.att.research.xacmlatt.pdp.policy.PolicyDef} with methods for loading them from a <code>File</code>.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public abstract class DOMPolicyDef {
-        protected DOMPolicyDef() {
+    protected DOMPolicyDef() {
+    }
+
+    protected static PolicyDef newInstance(Document document, PolicySet policySetParent) throws DOMStructureException {
+        PolicyDef policyDef	= null;
+        try {
+            Node rootNode	= document.getFirstChild();
+            while (rootNode != null && rootNode.getNodeType() != Node.ELEMENT_NODE) {
+                rootNode = rootNode.getNextSibling();
+            }
+            if (rootNode == null) {
+                throw new Exception("No child in document");
+            }
+
+            if (DOMUtil.isInNamespace(rootNode, XACML3.XMLNS)) {
+                if (XACML3.ELEMENT_POLICY.equals(rootNode.getLocalName())) {
+                    policyDef	= DOMPolicy.newInstance(rootNode, policySetParent, null);
+                    if (policyDef == null) {
+                        throw new DOMStructureException("Failed to parse Policy");
+                    }
+                } else if (XACML3.ELEMENT_POLICYSET.equals(rootNode.getLocalName())) {
+                    policyDef	= DOMPolicySet.newInstance(rootNode, policySetParent, null);
+                    if (policyDef == null) {
+                        throw new DOMStructureException("Failed to parse PolicySet");
+                    }
+                } else {
+                    throw DOMUtil.newUnexpectedElementException(rootNode);
+                }
+            } else {
+                throw DOMUtil.newUnexpectedElementException(rootNode);
+            }
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception parsing Policy: " + ex.getMessage(), ex);
         }
-        
-        protected static PolicyDef newInstance(Document document, PolicySet policySetParent) throws DOMStructureException {
-                PolicyDef policyDef	= null;
-                try {
-                        Node rootNode	= document.getFirstChild();
-                        while (rootNode != null && rootNode.getNodeType() != Node.ELEMENT_NODE) {
-                            rootNode = rootNode.getNextSibling();
-                        }
-                        if (rootNode == null) {
-                                throw new Exception("No child in document");
-                        }
-                        
-                        if (DOMUtil.isInNamespace(rootNode, XACML3.XMLNS)) {
-                                if (XACML3.ELEMENT_POLICY.equals(rootNode.getLocalName())) {
-                                        policyDef	= DOMPolicy.newInstance(rootNode, policySetParent, null);
-                                        if (policyDef == null) {
-                                                throw new DOMStructureException("Failed to parse Policy");
-                                        }
-                                } else if (XACML3.ELEMENT_POLICYSET.equals(rootNode.getLocalName())) {
-                                        policyDef	= DOMPolicySet.newInstance(rootNode, policySetParent, null);
-                                        if (policyDef == null) {
-                                                throw new DOMStructureException("Failed to parse PolicySet");
-                                        }
-                                } else {
-                                        throw DOMUtil.newUnexpectedElementException(rootNode);
-                                }
-                        } else {
-                                throw DOMUtil.newUnexpectedElementException(rootNode);
-                        }
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception parsing Policy: " + ex.getMessage(), ex);
-                }
-                return policyDef;		
+        return policyDef;
+    }
+
+    public static PolicyDef load(InputStream inputStream) throws DOMStructureException {
+        /*
+         * Get the DocumentBuilderFactory
+         */
+        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+        if (documentBuilderFactory == null) {
+            throw new DOMStructureException("No XML DocumentBuilderFactory configured");
         }
-        
-        public static PolicyDef load(InputStream inputStream) throws DOMStructureException {
-                /*
-                 * Get the DocumentBuilderFactory
-                 */
-                DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                if (documentBuilderFactory == null) {
-                        throw new DOMStructureException("No XML DocumentBuilderFactory configured");
-                }
-                documentBuilderFactory.setNamespaceAware(true);
-                
-                /*
-                 * Get the DocumentBuilder
-                 */
-                DocumentBuilder documentBuilder	= null;
-                try {
-                        documentBuilder	= documentBuilderFactory.newDocumentBuilder();
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
-                }
-                
-                /*
-                 * Parse the XML file
-                 */
-                PolicyDef policyDef	= null;
-                try {
-                        Document document	= documentBuilder.parse(inputStream);
-                        if (document == null) {
-                                throw new Exception("Null document returned");
-                        }			
-                        policyDef	= newInstance(document, null);			
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception loading Policy from input stream: " + ex.getMessage(), ex);
-                }
-                return policyDef;
+        documentBuilderFactory.setNamespaceAware(true);
+
+        /*
+         * Get the DocumentBuilder
+         */
+        DocumentBuilder documentBuilder	= null;
+        try {
+            documentBuilder	= documentBuilderFactory.newDocumentBuilder();
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
         }
 
-        /**
-         * Creates a new <code>PolicyDef</code> derived object by loading the given <code>File</code> containing a XACML 3.0
-         * Policy or PolicySet.
-         * 
-         * @param filePolicy the <code>File</code> containing the XACML Policy or PolicySet
-         * @return the newly created <code>PolicyDef</code>
-         * @throws DOMStructureException if there is an error loading the <code>PolicyDef</code>
+        /*
+         * Parse the XML file
          */
-        public static PolicyDef load(File filePolicy) throws DOMStructureException {
-                /*
-                 * Parse the XML file
-                 */
-                PolicyDef policyDef	= null;
-                try {
-                        Document document	= DOMUtil.loadDocument(filePolicy);
-                        if (document == null) {
-                                throw new Exception("Null document returned");
-                        }			
-                        policyDef	= newInstance(document, null);			
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception loading Policy file \"" + filePolicy.getAbsolutePath() + "\": " + ex.getMessage(), ex);
-                }
-                return policyDef;
+        PolicyDef policyDef	= null;
+        try {
+            Document document	= documentBuilder.parse(inputStream);
+            if (document == null) {
+                throw new Exception("Null document returned");
+            }
+            policyDef	= newInstance(document, null);
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception loading Policy from input stream: " + ex.getMessage(), ex);
         }
+        return policyDef;
+    }
+
+    /**
+     * Creates a new <code>PolicyDef</code> derived object by loading the given <code>File</code> containing a XACML 3.0
+     * Policy or PolicySet.
+     *
+     * @param filePolicy the <code>File</code> containing the XACML Policy or PolicySet
+     * @return the newly created <code>PolicyDef</code>
+     * @throws DOMStructureException if there is an error loading the <code>PolicyDef</code>
+     */
+    public static PolicyDef load(File filePolicy) throws DOMStructureException {
+        /*
+         * Parse the XML file
+         */
+        PolicyDef policyDef	= null;
+        try {
+            Document document	= DOMUtil.loadDocument(filePolicy);
+            if (document == null) {
+                throw new Exception("Null document returned");
+            }
+            policyDef	= newInstance(document, null);
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception loading Policy file \"" + filePolicy.getAbsolutePath() + "\": " + ex.getMessage(), ex);
+        }
+        return policyDef;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDefaults.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDefaults.java
index 1c4ab46..fbde2fc 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDefaults.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyDefaults.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -49,75 +49,75 @@
 /**
  * DOMPolicyDefaults extends {@link com.att.research.xacmlatt.pdp.policy.PolicyDefaults} with methods for creation from
  * DOM {@org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMPolicyDefaults extends PolicyDefaults {
-        private static final Log logger	= LogFactory.getLog(DOMPolicyDefaults.class);
-        
-        protected DOMPolicyDefaults(URI xpathVersionIn, PolicyDefaults policyDefaultsParentIn) {
-                super(xpathVersionIn, policyDefaultsParentIn);
+    private static final Log logger	= LogFactory.getLog(DOMPolicyDefaults.class);
+
+    protected DOMPolicyDefaults(URI xpathVersionIn, PolicyDefaults policyDefaultsParentIn) {
+        super(xpathVersionIn, policyDefaultsParentIn);
+    }
+
+    /**
+     * Creates a new <code>DOMPolicyDefaults</code> by parsing the given <code>Node</code> representing a XACML PolicyDefaults element.
+     *
+     * @param nodePolicyDefaults the <code>Node</code> representing the PolicyDefaults element.
+     * @param policyDefaultsParent the <code>PolicyDefaults</code> parent for the new <code>DOMPolicyDefaults</code>
+     * @return a new <code>DOMPolicyDefaults</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion is not possible
+     */
+    public static PolicyDefaults newInstance(Node nodePolicyDefaults, PolicyDefaults policyDefaultsParent) throws DOMStructureException {
+        Element elementPolicyDefaults	= DOMUtil.getElement(nodePolicyDefaults);
+        boolean bLenient				= DOMProperties.isLenient();
+
+        URI uriXPathVersion		= null;
+
+        NodeList children	= elementPolicyDefaults.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_XPATHVERSION.equals(child.getLocalName())) {
+                        uriXPathVersion	= DOMUtil.getURIContent(child);
+                    } else if (!bLenient) {
+                        throw DOMUtil.newUnexpectedElementException(child, nodePolicyDefaults);
+                    }
+                }
+            }
+        }
+        return new DOMPolicyDefaults(uriXPathVersion, policyDefaultsParent);
+    }
+
+    public static boolean repair(Node nodePolicyDefaults) throws DOMStructureException {
+        Element elementPolicyDefaults	= DOMUtil.getElement(nodePolicyDefaults);
+        boolean result					= false;
+
+        NodeList children	= elementPolicyDefaults.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_XPATHVERSION.equals(child.getLocalName())) {
+                        try {
+                            DOMUtil.getURIContent(child);
+                        } catch (DOMStructureException ex) {
+                            logger.warn("Setting invalid " + XACML3.ELEMENT_XPATHVERSION + " attribute " + child.getTextContent() + " to " + XACML.XPATHVERSION_2_0);
+                            child.setTextContent(XACML.XPATHVERSION_2_0);
+                            result	= true;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementPolicyDefaults.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
         }
 
-        /**
-         * Creates a new <code>DOMPolicyDefaults</code> by parsing the given <code>Node</code> representing a XACML PolicyDefaults element.
-         * 
-         * @param nodePolicyDefaults the <code>Node</code> representing the PolicyDefaults element.
-         * @param policyDefaultsParent the <code>PolicyDefaults</code> parent for the new <code>DOMPolicyDefaults</code>
-         * @return a new <code>DOMPolicyDefaults</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion is not possible
-         */
-        public static PolicyDefaults newInstance(Node nodePolicyDefaults, PolicyDefaults policyDefaultsParent) throws DOMStructureException {
-                Element elementPolicyDefaults	= DOMUtil.getElement(nodePolicyDefaults);
-                boolean bLenient				= DOMProperties.isLenient();
-                
-                URI uriXPathVersion		= null;
-
-                NodeList children	= elementPolicyDefaults.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_XPATHVERSION.equals(child.getLocalName())) {
-                                                uriXPathVersion	= DOMUtil.getURIContent(child);
-                                        } else if (!bLenient) {
-                                                throw DOMUtil.newUnexpectedElementException(child, nodePolicyDefaults);
-                                        }
-                                }
-                        }
-                }
-                return new DOMPolicyDefaults(uriXPathVersion, policyDefaultsParent);
-        }
-        
-        public static boolean repair(Node nodePolicyDefaults) throws DOMStructureException {
-                Element elementPolicyDefaults	= DOMUtil.getElement(nodePolicyDefaults);
-                boolean result					= false;
-                
-                NodeList children	= elementPolicyDefaults.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_XPATHVERSION.equals(child.getLocalName())) {
-                                                try {
-                                                        DOMUtil.getURIContent(child);
-                                                } catch (DOMStructureException ex) {
-                                                        logger.warn("Setting invalid " + XACML3.ELEMENT_XPATHVERSION + " attribute " + child.getTextContent() + " to " + XACML.XPATHVERSION_2_0);
-                                                        child.setTextContent(XACML.XPATHVERSION_2_0);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementPolicyDefaults.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                
-                return result;
-        }
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyIdReference.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyIdReference.java
index 9fb9d4a..56339e6 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyIdReference.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyIdReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,38 +42,38 @@
 /**
  * DOMPolicyIdReference extends {@link com.att.research.xacmlatt.pdp.policy.PolicyIdReference} with methods for creation
  * from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMPolicyIdReference {
-        
-        protected DOMPolicyIdReference() {
+
+    protected DOMPolicyIdReference() {
+    }
+
+    /**
+     * Creates a new <code>PolicyIdReference</code> parsed from the given <code>Node</code> representing a XACML PolicyIdReference element.
+     *
+     * @param nodePolicyIdReference the <code>Node</code> representing the XACML PolicyIdReference element
+     * @return a new <code>PolicyIdReference</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static PolicyIdReference newInstance(Node nodePolicyIdReference, PolicySet policySetParent) throws DOMStructureException {
+        PolicyIdReference domPolicyIdReference	= new PolicyIdReference(policySetParent);
+
+        try {
+            domPolicyIdReference.setIdReferenceMatch(DOMIdReferenceMatch.newInstance(nodePolicyIdReference));
+        } catch (DOMStructureException ex) {
+            domPolicyIdReference.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
 
-        /**
-         * Creates a new <code>PolicyIdReference</code> parsed from the given <code>Node</code> representing a XACML PolicyIdReference element.
-         * 
-         * @param nodePolicyIdReference the <code>Node</code> representing the XACML PolicyIdReference element
-         * @return a new <code>PolicyIdReference</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static PolicyIdReference newInstance(Node nodePolicyIdReference, PolicySet policySetParent) throws DOMStructureException {
-                PolicyIdReference domPolicyIdReference	= new PolicyIdReference(policySetParent);
-                
-                try {
-                        domPolicyIdReference.setIdReferenceMatch(DOMIdReferenceMatch.newInstance(nodePolicyIdReference));
-                } catch (DOMStructureException ex) {
-                        domPolicyIdReference.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                
-                return domPolicyIdReference;
-        }
-        
-        public static boolean repair(Node nodePolicyIdReference) throws DOMStructureException {
-                return DOMIdReferenceMatch.repair(nodePolicyIdReference);
-        }
+        return domPolicyIdReference;
+    }
+
+    public static boolean repair(Node nodePolicyIdReference) throws DOMStructureException {
+        return DOMIdReferenceMatch.repair(nodePolicyIdReference);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyIssuer.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyIssuer.java
index 13defc7..ddc8c38 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyIssuer.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyIssuer.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -49,98 +49,98 @@
 /**
  * DOMPolicyIssuer extends {@link com.att.research.xacmlatt.pdp.policy.PolicyIsser} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMPolicyIssuer extends PolicyIssuer {
-        private static Log 			logger							= LogFactory.getLog(DOMPolicyIssuer.class);
-        private static Identifier	identifierCategoryPolicyIssuer 	= new IdentifierImpl("urn:att:names:tc:xacml:3.0:policy-issuer");
-        
-        protected DOMPolicyIssuer() {
-                super();
-        }
-        
-        /**
-         * Creates a new <code>DOMPolicyIssuer</code> by parsing the given <code>Node</code> representing a XACML PolicyIssuer element.
-         * 
-         * @param nodePolicyIssuer the <code>Node</code> representing the PolicyIssuer element
-         * @return the new <code>DOMPolicyIssuer</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion is not possible
-         */
-        public static PolicyIssuer newInstance(Node nodePolicyIssuer) throws DOMStructureException {
-                Element elementPolicyIssuer		= DOMUtil.getElement(nodePolicyIssuer);
-                boolean bLenient				= DOMProperties.isLenient();
-                
-                DOMPolicyIssuer domPolicyIssuer	= new DOMPolicyIssuer();
-                
-                try {
-                        NodeList children	= elementPolicyIssuer.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                        String childName	= child.getLocalName();
-                                                        if (XACML3.ELEMENT_CONTENT.equals(childName)) {
-                                                                if (domPolicyIssuer.getContent() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicyIssuer);
-                                                                }
-                                                                domPolicyIssuer.setContent(child);
-                                                        } else if (XACML3.ELEMENT_ATTRIBUTE.equals(childName)) {
-                                                                domPolicyIssuer.add(DOMAttribute.newInstance(identifierCategoryPolicyIssuer, child));
-                                                        } else if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodePolicyIssuer);
-                                                        }
-                                                }
-                                        }
+    private static Log 			logger							= LogFactory.getLog(DOMPolicyIssuer.class);
+    private static Identifier	identifierCategoryPolicyIssuer 	= new IdentifierImpl("urn:att:names:tc:xacml:3.0:policy-issuer");
+
+    protected DOMPolicyIssuer() {
+        super();
+    }
+
+    /**
+     * Creates a new <code>DOMPolicyIssuer</code> by parsing the given <code>Node</code> representing a XACML PolicyIssuer element.
+     *
+     * @param nodePolicyIssuer the <code>Node</code> representing the PolicyIssuer element
+     * @return the new <code>DOMPolicyIssuer</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion is not possible
+     */
+    public static PolicyIssuer newInstance(Node nodePolicyIssuer) throws DOMStructureException {
+        Element elementPolicyIssuer		= DOMUtil.getElement(nodePolicyIssuer);
+        boolean bLenient				= DOMProperties.isLenient();
+
+        DOMPolicyIssuer domPolicyIssuer	= new DOMPolicyIssuer();
+
+        try {
+            NodeList children	= elementPolicyIssuer.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                            String childName	= child.getLocalName();
+                            if (XACML3.ELEMENT_CONTENT.equals(childName)) {
+                                if (domPolicyIssuer.getContent() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicyIssuer);
                                 }
+                                domPolicyIssuer.setContent(child);
+                            } else if (XACML3.ELEMENT_ATTRIBUTE.equals(childName)) {
+                                domPolicyIssuer.add(DOMAttribute.newInstance(identifierCategoryPolicyIssuer, child));
+                            } else if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodePolicyIssuer);
+                            }
                         }
-                } catch (DOMStructureException ex) {
-                        domPolicyIssuer.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                
-                return domPolicyIssuer;		
+            }
+        } catch (DOMStructureException ex) {
+            domPolicyIssuer.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        public static boolean repair(Node nodePolicyIssuer) throws DOMStructureException {
-                Element elementPolicyIssuer		= DOMUtil.getElement(nodePolicyIssuer);
-                boolean result					= false;
-                
-                boolean sawContent				= false;
-                NodeList children	= elementPolicyIssuer.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_CONTENT.equals(childName)) {
-                                                        if (sawContent) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicyIssuer.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawContent	= true;
-                                                        }
-                                                } else if (XACML3.ELEMENT_ATTRIBUTE.equals(childName)) {
-                                                        result	= DOMAttribute.repair(child) || result;
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementPolicyIssuer.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        }
-                                }
+
+        return domPolicyIssuer;
+    }
+
+    public static boolean repair(Node nodePolicyIssuer) throws DOMStructureException {
+        Element elementPolicyIssuer		= DOMUtil.getElement(nodePolicyIssuer);
+        boolean result					= false;
+
+        boolean sawContent				= false;
+        NodeList children	= elementPolicyIssuer.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_CONTENT.equals(childName)) {
+                            if (sawContent) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicyIssuer.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawContent	= true;
+                            }
+                        } else if (XACML3.ELEMENT_ATTRIBUTE.equals(childName)) {
+                            result	= DOMAttribute.repair(child) || result;
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementPolicyIssuer.removeChild(child);
+                            result	= true;
                         }
+                    }
                 }
-                
-                return result;
+            }
         }
 
+        return result;
+    }
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyRepair.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyRepair.java
index f14e50d..3cab8f9 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyRepair.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicyRepair.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -49,85 +49,85 @@
 /**
  * DOMPolicyRepair is an application for reading a XACML Policy or PolicySet document and ensuring it has the required attributes and then writing
  * the repaired Policy or PolicySet to an output file.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DOMPolicyRepair {
-        private static final String	DEFAULT_VERSION	= "1.0";
-        
-        public static void main(String[] args) {
-                InputStream	inputStream		= System.in;
-                OutputStream outputStream	= System.out;
-                
-                for (int i = 0 ; i < args.length ; ) {
-                        if (args[i].equals("-i")) {
-                                if (i+1 < args.length) {
-                                        try {
-                                                inputStream	= new FileInputStream(args[i+1]);
-                                        } catch (IOException ex) {
-                                                System.err.println("IOException opening \"" + args[i+1] + "\" for reading.");
-                                                System.exit(1);
-                                        }
-                                        i	+= 2;
-                                } else {
-                                        i++;
-                                }
-                        } else if (args[i].equals("-o")) {
-                                if (i+1 < args.length){
-                                        try {
-                                                outputStream = new FileOutputStream(args[i+1]);
-                                        } catch (IOException ex) {
-                                                System.err.println("IOException opening \"" + args[i+1] + "\" for writing.");
-                                                ex.printStackTrace(System.err);
-                                                System.exit(1);;
-                                        }
-                                        i	+= 2;
-                                } else {
-                                        i++;
-                                }
-                        } else {
-                                System.err.println("Unrecognized command line option \"" + args[i] + "\"");
-                                System.exit(1);
-                        }
-                }
-                
-                /*
-                 * Get the XML Parser for the input file
-                 */
-                DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                documentBuilderFactory.setNamespaceAware(true);
-                try {
-                        DocumentBuilder documentBuilder				= documentBuilderFactory.newDocumentBuilder();
-                        Document documentInput						= documentBuilder.parse(inputStream);
-                        Element elementRoot							= DOMUtil.getFirstChildElement(documentInput);
-                        if (elementRoot == null) {
-                                System.err.println("No root element");
-                                System.exit(1);
-                        } else if (!XACML3.ELEMENT_POLICY.equals(elementRoot.getLocalName()) && !XACML3.ELEMENT_POLICYSET.equals(elementRoot.getLocalName())) {
-                                System.err.println("Root element is not a Policy or PolicySet");
-                                System.exit(1);
-                        }
-                        
-                        /*
-                         * Make sure there is a Version attribute
-                         */
-                        Node nodeVersion	= DOMUtil.getAttribute(elementRoot, XACML3.ATTRIBUTE_VERSION);
-                        if (nodeVersion == null) {
-                                System.out.println("Adding Version attribute with value \"" + DEFAULT_VERSION + "\"");
-                                elementRoot.setAttribute(XACML3.ATTRIBUTE_VERSION, DEFAULT_VERSION);
-                        }
-                        
-                        /*
-                         * Write out the updated document
-                         */
-                        String newDocument	= DOMUtil.toString(documentInput);
-                        outputStream.write(newDocument.getBytes());
-                } catch (Exception ex) {
-                        ex.printStackTrace(System.err);
+    private static final String	DEFAULT_VERSION	= "1.0";
+
+    public static void main(String[] args) {
+        InputStream	inputStream		= System.in;
+        OutputStream outputStream	= System.out;
+
+        for (int i = 0 ; i < args.length ; ) {
+            if (args[i].equals("-i")) {
+                if (i+1 < args.length) {
+                    try {
+                        inputStream	= new FileInputStream(args[i+1]);
+                    } catch (IOException ex) {
+                        System.err.println("IOException opening \"" + args[i+1] + "\" for reading.");
                         System.exit(1);
+                    }
+                    i	+= 2;
+                } else {
+                    i++;
                 }
-                System.exit(0);
+            } else if (args[i].equals("-o")) {
+                if (i+1 < args.length) {
+                    try {
+                        outputStream = new FileOutputStream(args[i+1]);
+                    } catch (IOException ex) {
+                        System.err.println("IOException opening \"" + args[i+1] + "\" for writing.");
+                        ex.printStackTrace(System.err);
+                        System.exit(1);;
+                    }
+                    i	+= 2;
+                } else {
+                    i++;
+                }
+            } else {
+                System.err.println("Unrecognized command line option \"" + args[i] + "\"");
+                System.exit(1);
+            }
         }
 
+        /*
+         * Get the XML Parser for the input file
+         */
+        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+        documentBuilderFactory.setNamespaceAware(true);
+        try {
+            DocumentBuilder documentBuilder				= documentBuilderFactory.newDocumentBuilder();
+            Document documentInput						= documentBuilder.parse(inputStream);
+            Element elementRoot							= DOMUtil.getFirstChildElement(documentInput);
+            if (elementRoot == null) {
+                System.err.println("No root element");
+                System.exit(1);
+            } else if (!XACML3.ELEMENT_POLICY.equals(elementRoot.getLocalName()) && !XACML3.ELEMENT_POLICYSET.equals(elementRoot.getLocalName())) {
+                System.err.println("Root element is not a Policy or PolicySet");
+                System.exit(1);
+            }
+
+            /*
+             * Make sure there is a Version attribute
+             */
+            Node nodeVersion	= DOMUtil.getAttribute(elementRoot, XACML3.ATTRIBUTE_VERSION);
+            if (nodeVersion == null) {
+                System.out.println("Adding Version attribute with value \"" + DEFAULT_VERSION + "\"");
+                elementRoot.setAttribute(XACML3.ATTRIBUTE_VERSION, DEFAULT_VERSION);
+            }
+
+            /*
+             * Write out the updated document
+             */
+            String newDocument	= DOMUtil.toString(documentInput);
+            outputStream.write(newDocument.getBytes());
+        } catch (Exception ex) {
+            ex.printStackTrace(System.err);
+            System.exit(1);
+        }
+        System.exit(0);
+    }
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySet.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySet.java
index 0363c78..fbf80d8 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySet.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySet.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -60,310 +60,310 @@
 /**
  * DOMPolicySet extends {@link com.att.research.xacmlatt.pdp.policy.PolicySet} with methods for creation
  * from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.4 $
  */
 public class DOMPolicySet {
-        private static final Log logger	= LogFactory.getLog(DOMPolicySet.class);
-        
-        protected DOMPolicySet() {
-        }
-        
-        /**
-         * Creates a new <code>PolicySet</code> by parsing the given <code>Node</code> representing a XACML PolicySet element.
-         * 
-         * @param nodePolicySet the <code>Node</code> representing the XACML PolicySetelement
-         * @param policyDefaultsParent the {@link com.att.research.xacmlatt.pdp.policy.PolicyDefaults} from the parent element
-         * @return a new <code>PolicySet</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static PolicySet newInstance(Node nodePolicySet, PolicySet policySetParent, PolicyDefaults policyDefaultsParent) throws DOMStructureException {
-                Element elementPolicySet	= DOMUtil.getElement(nodePolicySet);
-                boolean bLenient			= DOMProperties.isLenient();
-                
-                PolicySet domPolicySet		= new PolicySet(policySetParent);
-                
-                Iterator<?> iterator;
-                Identifier identifier;
-                Integer integer;
-                
-                try {
-                        NodeList children	= elementPolicySet.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                /*
-                                 * Run through once, quickly, to set the PolicyDefaults for the new DOMPolicySet
-                                 */
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isNamespaceElement(child, XACML3.XMLNS) && XACML3.ELEMENT_POLICYDEFAULTS.equals(child.getLocalName())) {
-                                                if (domPolicySet.getPolicyDefaults() != null && !bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
-                                                }
-                                                domPolicySet.setPolicyDefaults(DOMPolicyDefaults.newInstance(child, policyDefaultsParent));
-                                        }
-                                }
-                                if (domPolicySet.getPolicyDefaults() == null) {
-                                        domPolicySet.setPolicyDefaults(policyDefaultsParent);
-                                }
-                                
-                                /*
-                                 * Now process the other elements so we can pull up the parent policy defaults
-                                 */
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                        String childName	= child.getLocalName();
-                                                        if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
-                                                                if (domPolicySet.getDescription() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
-                                                                }
-                                                                domPolicySet.setDescription(child.getTextContent());
-                                                        } else if (XACML3.ELEMENT_POLICYISSUER.equals(childName)) {
-                                                                if (domPolicySet.getPolicyIssuer() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
-                                                                }
-                                                                domPolicySet.setPolicyIssuer(DOMPolicyIssuer.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_POLICYSETDEFAULTS.equals(childName)) {
-                                                        } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
-                                                                if (domPolicySet.getTarget() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
-                                                                }
-                                                                domPolicySet.setTarget(DOMTarget.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_POLICYSET.equals(childName)) {
-                                                                domPolicySet.addChild(DOMPolicySet.newInstance(child, domPolicySet, domPolicySet.getPolicyDefaults()));
-                                                        } else if (XACML3.ELEMENT_POLICY.equals(childName)) {
-                                                                domPolicySet.addChild(DOMPolicy.newInstance(child, domPolicySet, domPolicySet.getPolicyDefaults()));
-                                                        } else if (XACML3.ELEMENT_POLICYIDREFERENCE.equals(childName)) {
-                                                                domPolicySet.addChild(DOMPolicyIdReference.newInstance(child, domPolicySet));
-                                                        } else if (XACML3.ELEMENT_POLICYSETIDREFERENCE.equals(childName)) {
-                                                                domPolicySet.addChild(DOMPolicySetIdReference.newInstance(child, domPolicySet));
-                                                        } else if (XACML3.ELEMENT_COMBINERPARAMETERS.equals(childName)) {
-                                                                domPolicySet.addCombinerParameters(DOMCombinerParameter.newList(child));
-                                                        } else if (XACML3.ELEMENT_POLICYCOMBINERPARAMETERS.equals(childName)) {
-                                                                domPolicySet.addPolicyCombinerParameter(DOMPolicyCombinerParameter.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_POLICYSETCOMBINERPARAMETERS.equals(childName)) {
-                                                                domPolicySet.addPolicyCombinerParameter(DOMPolicySetCombinerParameter.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
-                                                                if ((iterator = domPolicySet.getObligationExpressions()) != null && iterator.hasNext() && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
-                                                                }
-                                                                domPolicySet.setObligationExpressions(DOMObligationExpression.newList(child, null));
-                                                        } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
-                                                                if ((iterator = domPolicySet.getAdviceExpressions()) != null && iterator.hasNext() && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
-                                                                }
-                                                                domPolicySet.setAdviceExpressions(DOMAdviceExpression.newList(child, null));
-                                                        } else if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
-                                                        }
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
-                                                }
-                                        }
-                                }
-                        }
-                        if (domPolicySet.getTarget() == null && !bLenient) {
-                                throw DOMUtil.newMissingElementException(nodePolicySet, XACML3.XMLNS, XACML3.ELEMENT_TARGET);
-                        }
-                        
-                        /*
-                         * Get the attributes
-                         */
-                        domPolicySet.setIdentifier(DOMUtil.getIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYSETID, !bLenient));
-                        domPolicySet.setVersion(DOMUtil.getVersionAttribute(elementPolicySet, XACML3.ATTRIBUTE_VERSION, !bLenient));
-                        
-                        identifier	= DOMUtil.getIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYCOMBININGALGID, !bLenient);
-                        CombiningAlgorithm<PolicySetChild> combiningAlgorithm	= null;
-                        try {
-                                combiningAlgorithm	= CombiningAlgorithmFactory.newInstance().getPolicyCombiningAlgorithm(identifier);
-                        } catch (FactoryException ex) {
-                                if (!bLenient) {
-                                        throw new DOMStructureException("Failed to get CombinginAlgorithm", ex);
-                                }
-                        }
-                        if (combiningAlgorithm == null && !bLenient) {
-                                throw new DOMStructureException(elementPolicySet, "Unknown policy combining algorithm \"" + identifier.toString() + "\" in \"" + DOMUtil.getNodeLabel(nodePolicySet));
-                        } else {
-                                domPolicySet.setPolicyCombiningAlgorithm(combiningAlgorithm);
-                        }
-                        
-                        if ((integer = DOMUtil.getIntegerAttribute(elementPolicySet, XACML3.ATTRIBUTE_MAXDELEGATIONDEPTH)) != null) {
-                                domPolicySet.setMaxDelegationDepth(integer);
-                        }
-                } catch (DOMStructureException ex) {
-                        domPolicySet.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                
-                return domPolicySet;
-        }
-        
-        public static boolean repair(Node nodePolicySet) throws DOMStructureException {
-                Element elementPolicySet	= DOMUtil.getElement(nodePolicySet);
-                boolean result				= false;
-                
-                NodeList children	= elementPolicySet.getChildNodes();
-                int numChildren;
-                boolean sawDescription		= false;
-                boolean sawPolicyIssuer		= false;
-                boolean sawPolicyDefaults	= false;
-                boolean sawTarget			= false;
-                boolean sawObligationExprs	= false;
-                boolean sawAdviceExprs		= false;
-                
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        /*
-                         * Now process the other elements so we can pull up the parent policy defaults
-                         */
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
-                                                        if (sawDescription) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicySet.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawDescription	= true;
-                                                        }
-                                                } else if (XACML3.ELEMENT_POLICYISSUER.equals(childName)) {
-                                                        if (sawPolicyIssuer) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicySet.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawPolicyIssuer	= true;
-                                                                result	= DOMPolicyIssuer.repair(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_POLICYSETDEFAULTS.equals(childName)) {
-                                                        if (sawPolicyDefaults) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicySet.removeChild(child);
-                                                                result	= true;								
-                                                        } else {
-                                                                sawPolicyDefaults	= true;
-                                                                result				= DOMPolicyDefaults.repair(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
-                                                        if (sawTarget) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicySet.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawTarget	= true;
-                                                                result		= DOMTarget.repair(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_POLICYSET.equals(childName)) {
-                                                        result	= DOMPolicySet.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_POLICY.equals(childName)) {
-                                                        result 	= DOMPolicy.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_POLICYIDREFERENCE.equals(childName)) {
-                                                        result	= DOMPolicyIdReference.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_POLICYSETIDREFERENCE.equals(childName)) {
-                                                        result	= DOMPolicySetIdReference.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_COMBINERPARAMETERS.equals(childName)) {
-                                                        result	= DOMCombinerParameter.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_POLICYCOMBINERPARAMETERS.equals(childName)) {
-                                                        result	= DOMPolicyCombinerParameter.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_POLICYSETCOMBINERPARAMETERS.equals(childName)) {
-                                                        result	= DOMPolicySetCombinerParameter.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
-                                                        if (sawObligationExprs) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicySet.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawObligationExprs	= true;
-                                                                result				= DOMObligationExpression.repairList(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
-                                                        if (sawAdviceExprs) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementPolicySet.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawAdviceExprs	= true;
-                                                                result			= DOMAdviceExpression.repairList(child) || result;
-                                                        }
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementPolicySet.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else  {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementPolicySet.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                if (!sawTarget) {
-                        throw DOMUtil.newMissingElementException(nodePolicySet, XACML3.XMLNS, XACML3.ELEMENT_TARGET);
-                }
-                
+    private static final Log logger	= LogFactory.getLog(DOMPolicySet.class);
+
+    protected DOMPolicySet() {
+    }
+
+    /**
+     * Creates a new <code>PolicySet</code> by parsing the given <code>Node</code> representing a XACML PolicySet element.
+     *
+     * @param nodePolicySet the <code>Node</code> representing the XACML PolicySetelement
+     * @param policyDefaultsParent the {@link com.att.research.xacmlatt.pdp.policy.PolicyDefaults} from the parent element
+     * @return a new <code>PolicySet</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static PolicySet newInstance(Node nodePolicySet, PolicySet policySetParent, PolicyDefaults policyDefaultsParent) throws DOMStructureException {
+        Element elementPolicySet	= DOMUtil.getElement(nodePolicySet);
+        boolean bLenient			= DOMProperties.isLenient();
+
+        PolicySet domPolicySet		= new PolicySet(policySetParent);
+
+        Iterator<?> iterator;
+        Identifier identifier;
+        Integer integer;
+
+        try {
+            NodeList children	= elementPolicySet.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
                 /*
-                 * Get the attributes
+                 * Run through once, quickly, to set the PolicyDefaults for the new DOMPolicySet
                  */
-                result	= DOMUtil.repairIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYSETID, logger) || result;
-                result	= DOMUtil.repairVersionAttribute(elementPolicySet, XACML3.ATTRIBUTE_VERSION, logger) || result;
-                result	= DOMUtil.repairIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYCOMBININGALGID, XACML3.ID_POLICY_DENY_OVERRIDES, logger) || result;
-                
-                Identifier identifier	= DOMUtil.getIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYCOMBININGALGID);
-                CombiningAlgorithm<PolicySetChild> combiningAlgorithm	= null;
-                try {
-                        combiningAlgorithm	= CombiningAlgorithmFactory.newInstance().getPolicyCombiningAlgorithm(identifier);
-                } catch (FactoryException ex) {
-                        combiningAlgorithm	= null;
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isNamespaceElement(child, XACML3.XMLNS) && XACML3.ELEMENT_POLICYDEFAULTS.equals(child.getLocalName())) {
+                        if (domPolicySet.getPolicyDefaults() != null && !bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
+                        }
+                        domPolicySet.setPolicyDefaults(DOMPolicyDefaults.newInstance(child, policyDefaultsParent));
+                    }
                 }
-                if (combiningAlgorithm == null) {
-                        logger.warn("Setting invalid " + XACML3.ATTRIBUTE_POLICYCOMBININGALGID + " attribute " + identifier.stringValue() + " to " + XACML3.ID_POLICY_DENY_OVERRIDES.stringValue());
-                        elementPolicySet.setAttribute(XACML3.ATTRIBUTE_POLICYCOMBININGALGID, XACML3.ID_POLICY_DENY_OVERRIDES.stringValue());
-                        result	= true;
+                if (domPolicySet.getPolicyDefaults() == null) {
+                    domPolicySet.setPolicyDefaults(policyDefaultsParent);
                 }
-                
-                return result;
+
+                /*
+                 * Now process the other elements so we can pull up the parent policy defaults
+                 */
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                            String childName	= child.getLocalName();
+                            if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
+                                if (domPolicySet.getDescription() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
+                                }
+                                domPolicySet.setDescription(child.getTextContent());
+                            } else if (XACML3.ELEMENT_POLICYISSUER.equals(childName)) {
+                                if (domPolicySet.getPolicyIssuer() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
+                                }
+                                domPolicySet.setPolicyIssuer(DOMPolicyIssuer.newInstance(child));
+                            } else if (XACML3.ELEMENT_POLICYSETDEFAULTS.equals(childName)) {
+                            } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
+                                if (domPolicySet.getTarget() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
+                                }
+                                domPolicySet.setTarget(DOMTarget.newInstance(child));
+                            } else if (XACML3.ELEMENT_POLICYSET.equals(childName)) {
+                                domPolicySet.addChild(DOMPolicySet.newInstance(child, domPolicySet, domPolicySet.getPolicyDefaults()));
+                            } else if (XACML3.ELEMENT_POLICY.equals(childName)) {
+                                domPolicySet.addChild(DOMPolicy.newInstance(child, domPolicySet, domPolicySet.getPolicyDefaults()));
+                            } else if (XACML3.ELEMENT_POLICYIDREFERENCE.equals(childName)) {
+                                domPolicySet.addChild(DOMPolicyIdReference.newInstance(child, domPolicySet));
+                            } else if (XACML3.ELEMENT_POLICYSETIDREFERENCE.equals(childName)) {
+                                domPolicySet.addChild(DOMPolicySetIdReference.newInstance(child, domPolicySet));
+                            } else if (XACML3.ELEMENT_COMBINERPARAMETERS.equals(childName)) {
+                                domPolicySet.addCombinerParameters(DOMCombinerParameter.newList(child));
+                            } else if (XACML3.ELEMENT_POLICYCOMBINERPARAMETERS.equals(childName)) {
+                                domPolicySet.addPolicyCombinerParameter(DOMPolicyCombinerParameter.newInstance(child));
+                            } else if (XACML3.ELEMENT_POLICYSETCOMBINERPARAMETERS.equals(childName)) {
+                                domPolicySet.addPolicyCombinerParameter(DOMPolicySetCombinerParameter.newInstance(child));
+                            } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
+                                if ((iterator = domPolicySet.getObligationExpressions()) != null && iterator.hasNext() && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
+                                }
+                                domPolicySet.setObligationExpressions(DOMObligationExpression.newList(child, null));
+                            } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
+                                if ((iterator = domPolicySet.getAdviceExpressions()) != null && iterator.hasNext() && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
+                                }
+                                domPolicySet.setAdviceExpressions(DOMAdviceExpression.newList(child, null));
+                            } else if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
+                            }
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodePolicySet);
+                        }
+                    }
+                }
+            }
+            if (domPolicySet.getTarget() == null && !bLenient) {
+                throw DOMUtil.newMissingElementException(nodePolicySet, XACML3.XMLNS, XACML3.ELEMENT_TARGET);
+            }
+
+            /*
+             * Get the attributes
+             */
+            domPolicySet.setIdentifier(DOMUtil.getIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYSETID, !bLenient));
+            domPolicySet.setVersion(DOMUtil.getVersionAttribute(elementPolicySet, XACML3.ATTRIBUTE_VERSION, !bLenient));
+
+            identifier	= DOMUtil.getIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYCOMBININGALGID, !bLenient);
+            CombiningAlgorithm<PolicySetChild> combiningAlgorithm	= null;
+            try {
+                combiningAlgorithm	= CombiningAlgorithmFactory.newInstance().getPolicyCombiningAlgorithm(identifier);
+            } catch (FactoryException ex) {
+                if (!bLenient) {
+                    throw new DOMStructureException("Failed to get CombinginAlgorithm", ex);
+                }
+            }
+            if (combiningAlgorithm == null && !bLenient) {
+                throw new DOMStructureException(elementPolicySet, "Unknown policy combining algorithm \"" + identifier.toString() + "\" in \"" + DOMUtil.getNodeLabel(nodePolicySet));
+            } else {
+                domPolicySet.setPolicyCombiningAlgorithm(combiningAlgorithm);
+            }
+
+            if ((integer = DOMUtil.getIntegerAttribute(elementPolicySet, XACML3.ATTRIBUTE_MAXDELEGATIONDEPTH)) != null) {
+                domPolicySet.setMaxDelegationDepth(integer);
+            }
+        } catch (DOMStructureException ex) {
+            domPolicySet.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
 
-        public static void main(String args[]) {
-                try {
-                        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                        documentBuilderFactory.setNamespaceAware(true);
-                        DocumentBuilder documentBuilder					= documentBuilderFactory.newDocumentBuilder();
-                        
-                        for (String fileName: args) {
-                                File filePolicy	= new File(fileName);
-                                if (filePolicy.exists() && filePolicy.canRead()) {
-                                        try {
-                                                Document documentPolicy	= documentBuilder.parse(filePolicy);
-                                                if (documentPolicy.getFirstChild() == null) {
-                                                        System.err.println(fileName + ": Error: No PolicySet found");
-                                                } else if (!XACML3.ELEMENT_POLICYSET.equals(documentPolicy.getFirstChild().getLocalName())) {
-                                                        System.err.println(fileName + ": Error: Not a PolicySet document");
-                                                } else {
-                                                        PolicySet	policySet	= DOMPolicySet.newInstance(documentPolicy.getFirstChild(), null, null);
-                                                        System.out.println(fileName + ": validate()=" + policySet.validate());
-                                                        System.out.println(StringUtils.prettyPrint(policySet.toString()));
-                                                }
-                                        } catch (Exception ex) {
-                                                System.err.println("Exception processing policy set file \"" + fileName + "\"");
-                                                ex.printStackTrace(System.err);
-                                        }
-                                } else {
-                                        System.err.println("Cannot read policy set file \"" + fileName + "\"");
-                                }
+        return domPolicySet;
+    }
+
+    public static boolean repair(Node nodePolicySet) throws DOMStructureException {
+        Element elementPolicySet	= DOMUtil.getElement(nodePolicySet);
+        boolean result				= false;
+
+        NodeList children	= elementPolicySet.getChildNodes();
+        int numChildren;
+        boolean sawDescription		= false;
+        boolean sawPolicyIssuer		= false;
+        boolean sawPolicyDefaults	= false;
+        boolean sawTarget			= false;
+        boolean sawObligationExprs	= false;
+        boolean sawAdviceExprs		= false;
+
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            /*
+             * Now process the other elements so we can pull up the parent policy defaults
+             */
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
+                            if (sawDescription) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicySet.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawDescription	= true;
+                            }
+                        } else if (XACML3.ELEMENT_POLICYISSUER.equals(childName)) {
+                            if (sawPolicyIssuer) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicySet.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawPolicyIssuer	= true;
+                                result	= DOMPolicyIssuer.repair(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_POLICYSETDEFAULTS.equals(childName)) {
+                            if (sawPolicyDefaults) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicySet.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawPolicyDefaults	= true;
+                                result				= DOMPolicyDefaults.repair(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
+                            if (sawTarget) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicySet.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawTarget	= true;
+                                result		= DOMTarget.repair(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_POLICYSET.equals(childName)) {
+                            result	= DOMPolicySet.repair(child) || result;
+                        } else if (XACML3.ELEMENT_POLICY.equals(childName)) {
+                            result 	= DOMPolicy.repair(child) || result;
+                        } else if (XACML3.ELEMENT_POLICYIDREFERENCE.equals(childName)) {
+                            result	= DOMPolicyIdReference.repair(child) || result;
+                        } else if (XACML3.ELEMENT_POLICYSETIDREFERENCE.equals(childName)) {
+                            result	= DOMPolicySetIdReference.repair(child) || result;
+                        } else if (XACML3.ELEMENT_COMBINERPARAMETERS.equals(childName)) {
+                            result	= DOMCombinerParameter.repair(child) || result;
+                        } else if (XACML3.ELEMENT_POLICYCOMBINERPARAMETERS.equals(childName)) {
+                            result	= DOMPolicyCombinerParameter.repair(child) || result;
+                        } else if (XACML3.ELEMENT_POLICYSETCOMBINERPARAMETERS.equals(childName)) {
+                            result	= DOMPolicySetCombinerParameter.repair(child) || result;
+                        } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
+                            if (sawObligationExprs) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicySet.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawObligationExprs	= true;
+                                result				= DOMObligationExpression.repairList(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
+                            if (sawAdviceExprs) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementPolicySet.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawAdviceExprs	= true;
+                                result			= DOMAdviceExpression.repairList(child) || result;
+                            }
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementPolicySet.removeChild(child);
+                            result	= true;
                         }
-                } catch (Exception ex) {
-                        ex.printStackTrace(System.err);
-                        System.exit(1);
+                    } else  {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementPolicySet.removeChild(child);
+                        result	= true;
+                    }
                 }
-                System.exit(0);
+            }
         }
+        if (!sawTarget) {
+            throw DOMUtil.newMissingElementException(nodePolicySet, XACML3.XMLNS, XACML3.ELEMENT_TARGET);
+        }
+
+        /*
+         * Get the attributes
+         */
+        result	= DOMUtil.repairIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYSETID, logger) || result;
+        result	= DOMUtil.repairVersionAttribute(elementPolicySet, XACML3.ATTRIBUTE_VERSION, logger) || result;
+        result	= DOMUtil.repairIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYCOMBININGALGID, XACML3.ID_POLICY_DENY_OVERRIDES, logger) || result;
+
+        Identifier identifier	= DOMUtil.getIdentifierAttribute(elementPolicySet, XACML3.ATTRIBUTE_POLICYCOMBININGALGID);
+        CombiningAlgorithm<PolicySetChild> combiningAlgorithm	= null;
+        try {
+            combiningAlgorithm	= CombiningAlgorithmFactory.newInstance().getPolicyCombiningAlgorithm(identifier);
+        } catch (FactoryException ex) {
+            combiningAlgorithm	= null;
+        }
+        if (combiningAlgorithm == null) {
+            logger.warn("Setting invalid " + XACML3.ATTRIBUTE_POLICYCOMBININGALGID + " attribute " + identifier.stringValue() + " to " + XACML3.ID_POLICY_DENY_OVERRIDES.stringValue());
+            elementPolicySet.setAttribute(XACML3.ATTRIBUTE_POLICYCOMBININGALGID, XACML3.ID_POLICY_DENY_OVERRIDES.stringValue());
+            result	= true;
+        }
+
+        return result;
+    }
+
+    public static void main(String args[]) {
+        try {
+            DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+            documentBuilderFactory.setNamespaceAware(true);
+            DocumentBuilder documentBuilder					= documentBuilderFactory.newDocumentBuilder();
+
+            for (String fileName: args) {
+                File filePolicy	= new File(fileName);
+                if (filePolicy.exists() && filePolicy.canRead()) {
+                    try {
+                        Document documentPolicy	= documentBuilder.parse(filePolicy);
+                        if (documentPolicy.getFirstChild() == null) {
+                            System.err.println(fileName + ": Error: No PolicySet found");
+                        } else if (!XACML3.ELEMENT_POLICYSET.equals(documentPolicy.getFirstChild().getLocalName())) {
+                            System.err.println(fileName + ": Error: Not a PolicySet document");
+                        } else {
+                            PolicySet	policySet	= DOMPolicySet.newInstance(documentPolicy.getFirstChild(), null, null);
+                            System.out.println(fileName + ": validate()=" + policySet.validate());
+                            System.out.println(StringUtils.prettyPrint(policySet.toString()));
+                        }
+                    } catch (Exception ex) {
+                        System.err.println("Exception processing policy set file \"" + fileName + "\"");
+                        ex.printStackTrace(System.err);
+                    }
+                } else {
+                    System.err.println("Cannot read policy set file \"" + fileName + "\"");
+                }
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace(System.err);
+            System.exit(1);
+        }
+        System.exit(0);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySetCombinerParameter.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySetCombinerParameter.java
index f70a5ad..8649c8e 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySetCombinerParameter.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySetCombinerParameter.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -49,98 +49,98 @@
 /**
  * DOMPolicySetCombinerParameter extends {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter} for
  * {@link com.att.research.xacmlatt.pdp.policy.PolicySet}s with methods for creation from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMPolicySetCombinerParameter extends TargetedCombinerParameter<Identifier, PolicySetChild> {
-        public static final Log logger	= LogFactory.getLog(DOMPolicySetCombinerParameter.class);
-        
-        protected DOMPolicySetCombinerParameter() {
-                
-        }
-        
-        /**
-         * Creates a new <code>TargetedCombinerParameter</code> for <code>PolicySet</code>s by parsing the given <code>Node</code>
-         * representing a XACML PolicySetCombinerParameter element.
-         * 
-         * @param nodeCombinerParameter the <code>Node</code> representing the XACML PolicySetCombinerParameter element
-         * @return a new <code>TargetedCombinerParameter</code> for <code>PolicySet</code>s parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static TargetedCombinerParameter<Identifier,PolicySetChild> newInstance(Node nodeCombinerParameter) throws DOMStructureException {
-                Element elementPolicySetCombinerParameter					= DOMUtil.getElement(nodeCombinerParameter);
-                boolean bLenient											= DOMProperties.isLenient();
-                
-                DOMPolicySetCombinerParameter domPolicySetCombinerParameter	= new DOMPolicySetCombinerParameter();
-                
-                try {
-                        NodeList children	= elementPolicySetCombinerParameter.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                        if (domPolicySetCombinerParameter.getAttributeValue() != null && !bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeCombinerParameter);
-                                                        }
-                                                        domPolicySetCombinerParameter.setAttributeValue(DOMAttributeValue.newInstance(child, null));
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeCombinerParameter);
-                                                }
-                                        }
-                                }
+    public static final Log logger	= LogFactory.getLog(DOMPolicySetCombinerParameter.class);
+
+    protected DOMPolicySetCombinerParameter() {
+
+    }
+
+    /**
+     * Creates a new <code>TargetedCombinerParameter</code> for <code>PolicySet</code>s by parsing the given <code>Node</code>
+     * representing a XACML PolicySetCombinerParameter element.
+     *
+     * @param nodeCombinerParameter the <code>Node</code> representing the XACML PolicySetCombinerParameter element
+     * @return a new <code>TargetedCombinerParameter</code> for <code>PolicySet</code>s parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static TargetedCombinerParameter<Identifier,PolicySetChild> newInstance(Node nodeCombinerParameter) throws DOMStructureException {
+        Element elementPolicySetCombinerParameter					= DOMUtil.getElement(nodeCombinerParameter);
+        boolean bLenient											= DOMProperties.isLenient();
+
+        DOMPolicySetCombinerParameter domPolicySetCombinerParameter	= new DOMPolicySetCombinerParameter();
+
+        try {
+            NodeList children	= elementPolicySetCombinerParameter.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                            if (domPolicySetCombinerParameter.getAttributeValue() != null && !bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeCombinerParameter);
+                            }
+                            domPolicySetCombinerParameter.setAttributeValue(DOMAttributeValue.newInstance(child, null));
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeCombinerParameter);
                         }
-                        if (domPolicySetCombinerParameter.getAttributeValue() == null && !bLenient) {
-                                throw DOMUtil.newMissingElementException(elementPolicySetCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                        }
-                        domPolicySetCombinerParameter.setName(DOMUtil.getStringAttribute(elementPolicySetCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, !bLenient));
-                        domPolicySetCombinerParameter.setTargetId(DOMUtil.getIdentifierAttribute(elementPolicySetCombinerParameter, XACML3.ATTRIBUTE_POLICYSETIDREF, !bLenient));
-                } catch (DOMStructureException ex) {
-                        domPolicySetCombinerParameter.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                
-                return domPolicySetCombinerParameter;
-                
+            }
+            if (domPolicySetCombinerParameter.getAttributeValue() == null && !bLenient) {
+                throw DOMUtil.newMissingElementException(elementPolicySetCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+            }
+            domPolicySetCombinerParameter.setName(DOMUtil.getStringAttribute(elementPolicySetCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, !bLenient));
+            domPolicySetCombinerParameter.setTargetId(DOMUtil.getIdentifierAttribute(elementPolicySetCombinerParameter, XACML3.ATTRIBUTE_POLICYSETIDREF, !bLenient));
+        } catch (DOMStructureException ex) {
+            domPolicySetCombinerParameter.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        public static boolean repair(Node nodeCombinerParameter) throws DOMStructureException {
-                Element elementPolicySetCombinerParameter	= DOMUtil.getElement(nodeCombinerParameter);
-                boolean result								= false;
-                
-                NodeList children	= elementPolicySetCombinerParameter.getChildNodes();
-                int numChildren;
-                boolean sawAttributeValue	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                if (sawAttributeValue) {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementPolicySetCombinerParameter.removeChild(child);
-                                                        result	= true;
-                                                } else {
-                                                        sawAttributeValue	= true;
-                                                        result				= DOMAttributeValue.repair(child) || result;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementPolicySetCombinerParameter.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+
+        return domPolicySetCombinerParameter;
+
+    }
+
+    public static boolean repair(Node nodeCombinerParameter) throws DOMStructureException {
+        Element elementPolicySetCombinerParameter	= DOMUtil.getElement(nodeCombinerParameter);
+        boolean result								= false;
+
+        NodeList children	= elementPolicySetCombinerParameter.getChildNodes();
+        int numChildren;
+        boolean sawAttributeValue	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                        if (sawAttributeValue) {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementPolicySetCombinerParameter.removeChild(child);
+                            result	= true;
+                        } else {
+                            sawAttributeValue	= true;
+                            result				= DOMAttributeValue.repair(child) || result;
                         }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementPolicySetCombinerParameter.removeChild(child);
+                        result	= true;
+                    }
                 }
-                if (!sawAttributeValue) {
-                        throw DOMUtil.newMissingElementException(elementPolicySetCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                }
-                result	= DOMUtil.repairStringAttribute(elementPolicySetCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, "parameter", logger) || result;
-                result	= DOMUtil.repairIdentifierAttribute(elementPolicySetCombinerParameter, XACML3.ATTRIBUTE_POLICYSETIDREF, logger) || result;
-                return result;
+            }
         }
+        if (!sawAttributeValue) {
+            throw DOMUtil.newMissingElementException(elementPolicySetCombinerParameter, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+        }
+        result	= DOMUtil.repairStringAttribute(elementPolicySetCombinerParameter, XACML3.ATTRIBUTE_PARAMETERNAME, "parameter", logger) || result;
+        result	= DOMUtil.repairIdentifierAttribute(elementPolicySetCombinerParameter, XACML3.ATTRIBUTE_POLICYSETIDREF, logger) || result;
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySetIdReference.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySetIdReference.java
index 1c8e423..9fa7636 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySetIdReference.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMPolicySetIdReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,37 +42,37 @@
 /**
  * DOMPolicySetIdReference extends {@link com.att.research.xacmlatt.pdp.policy.PolicySetIdReference} with methods for creation
  * from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMPolicySetIdReference {
-        protected DOMPolicySetIdReference() {
+    protected DOMPolicySetIdReference() {
+    }
+
+    /**
+     * Creates a new <code>PolicySetIdReference</code> parsed from the given <code>Node</code> representing a XACML PolicySetIdReference element.
+     *
+     * @param nodePolicySetIdReference the <code>Node</code> representing the XACML PolicySetIdReference element
+     * @return a new <code>PolicySetIdReference</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static PolicySetIdReference newInstance(Node nodePolicySetIdReference, PolicySet policySetParent) throws DOMStructureException {
+        PolicySetIdReference domPolicySetIdReference	= new PolicySetIdReference(policySetParent);
+
+        try {
+            domPolicySetIdReference.setIdReferenceMatch(DOMIdReferenceMatch.newInstance(nodePolicySetIdReference));
+        } catch (DOMStructureException ex) {
+            domPolicySetIdReference.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
 
-        /**
-         * Creates a new <code>PolicySetIdReference</code> parsed from the given <code>Node</code> representing a XACML PolicySetIdReference element.
-         * 
-         * @param nodePolicySetIdReference the <code>Node</code> representing the XACML PolicySetIdReference element
-         * @return a new <code>PolicySetIdReference</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static PolicySetIdReference newInstance(Node nodePolicySetIdReference, PolicySet policySetParent) throws DOMStructureException {
-                PolicySetIdReference domPolicySetIdReference	= new PolicySetIdReference(policySetParent);
-                
-                try {
-                        domPolicySetIdReference.setIdReferenceMatch(DOMIdReferenceMatch.newInstance(nodePolicySetIdReference));
-                } catch (DOMStructureException ex) {
-                        domPolicySetIdReference.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                
-                return domPolicySetIdReference;
-        }
-        
-        public static boolean repair(Node nodePolicySetIdReference) throws DOMStructureException {
-                return DOMIdReferenceMatch.repair(nodePolicySetIdReference);
-        }
+        return domPolicySetIdReference;
+    }
+
+    public static boolean repair(Node nodePolicySetIdReference) throws DOMStructureException {
+        return DOMIdReferenceMatch.repair(nodePolicySetIdReference);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMRule.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMRule.java
index e11fdd5..b34cacd 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMRule.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMRule.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -52,190 +52,190 @@
 /**
  * DOMRule extends {@link com.att.research.xacmlatt.pdp.policy.Rule} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMRule extends Rule {
-        private static final Log logger	= LogFactory.getLog(DOMRule.class);
-        
-        protected DOMRule() {
-        }
+    private static final Log logger	= LogFactory.getLog(DOMRule.class);
 
-        /**
-         * Creates a new <code>Rule</code> by parsing the given <code>Node</code> representing a XACML Rule element.
-         * 
-         * @param nodeRule the <code>Node</code> representing the XACML Rule element
-         * @param policy the {@link com.att.research.xacmlatt.pdp.policy.Policy} encompassing the Rule element
-         * @return a new <code>Rule</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static Rule newInstance(Node nodeRule, Policy policy) throws DOMStructureException {
-                Element elementRule	= DOMUtil.getElement(nodeRule);
-                boolean bLenient	= DOMProperties.isLenient();
-                
-                DOMRule domRule		= new DOMRule();
-                
-                domRule.setPolicy(policy);
-                
-                Iterator<?> iterator;
-                
-                try {
-                        NodeList children	= elementRule.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                        String childName	= child.getLocalName();
-                                                        if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
-                                                                if (domRule.getDescription() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRule);
-                                                                }
-                                                                domRule.setDescription(child.getTextContent());
-                                                        } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
-                                                                if (domRule.getTarget() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRule);
-                                                                }
-                                                                domRule.setTarget(DOMTarget.newInstance(child));
-                                                        } else if (XACML3.ELEMENT_CONDITION.equals(childName)) {
-                                                                if (domRule.getCondition() != null && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRule);
-                                                                }
-                                                                Node nodeExpression	= DOMUtil.getFirstChildElement(child);
-                                                                if (nodeExpression == null && !bLenient) {
-                                                                        throw DOMUtil.newMissingElementException(child, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
-                                                                }
-                                                                domRule.setCondition(new Condition(DOMExpression.newInstance(nodeExpression, policy)));
-                                                        } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
-                                                                if ((iterator = domRule.getObligationExpressions()) != null && iterator.hasNext() && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRule);
-                                                                }
-                                                                domRule.setObligationExpressions(DOMObligationExpression.newList(child, policy));
-                                                        } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
-                                                                if ((iterator = domRule.getAdviceExpressions()) != null && iterator.hasNext() && !bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRule);
-                                                                }
-                                                                domRule.setAdviceExpressions(DOMAdviceExpression.newList(child, policy));
-                                                        } else if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeRule);								
-                                                        }
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRule);
-                                                }
-                                        }
+    protected DOMRule() {
+    }
+
+    /**
+     * Creates a new <code>Rule</code> by parsing the given <code>Node</code> representing a XACML Rule element.
+     *
+     * @param nodeRule the <code>Node</code> representing the XACML Rule element
+     * @param policy the {@link com.att.research.xacmlatt.pdp.policy.Policy} encompassing the Rule element
+     * @return a new <code>Rule</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static Rule newInstance(Node nodeRule, Policy policy) throws DOMStructureException {
+        Element elementRule	= DOMUtil.getElement(nodeRule);
+        boolean bLenient	= DOMProperties.isLenient();
+
+        DOMRule domRule		= new DOMRule();
+
+        domRule.setPolicy(policy);
+
+        Iterator<?> iterator;
+
+        try {
+            NodeList children	= elementRule.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                            String childName	= child.getLocalName();
+                            if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
+                                if (domRule.getDescription() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodeRule);
                                 }
+                                domRule.setDescription(child.getTextContent());
+                            } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
+                                if (domRule.getTarget() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodeRule);
+                                }
+                                domRule.setTarget(DOMTarget.newInstance(child));
+                            } else if (XACML3.ELEMENT_CONDITION.equals(childName)) {
+                                if (domRule.getCondition() != null && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodeRule);
+                                }
+                                Node nodeExpression	= DOMUtil.getFirstChildElement(child);
+                                if (nodeExpression == null && !bLenient) {
+                                    throw DOMUtil.newMissingElementException(child, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
+                                }
+                                domRule.setCondition(new Condition(DOMExpression.newInstance(nodeExpression, policy)));
+                            } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
+                                if ((iterator = domRule.getObligationExpressions()) != null && iterator.hasNext() && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodeRule);
+                                }
+                                domRule.setObligationExpressions(DOMObligationExpression.newList(child, policy));
+                            } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
+                                if ((iterator = domRule.getAdviceExpressions()) != null && iterator.hasNext() && !bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodeRule);
+                                }
+                                domRule.setAdviceExpressions(DOMAdviceExpression.newList(child, policy));
+                            } else if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeRule);
+                            }
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeRule);
                         }
-                        
-                        domRule.setRuleId(DOMUtil.getStringAttribute(elementRule, XACML3.ATTRIBUTE_RULEID, !bLenient));
-                        String string			= DOMUtil.getStringAttribute(elementRule, XACML3.ATTRIBUTE_EFFECT, !bLenient);
-                        RuleEffect ruleEffect	= RuleEffect.getRuleEffect(string);
-                        if (ruleEffect == null && !bLenient) {
-                                throw new DOMStructureException(elementRule, "Unknown RuleEffect \"" + string + "\" in \"" + DOMUtil.getNodeLabel(nodeRule) + "\"");
-                        } 
-                        domRule.setRuleEffect(ruleEffect);
-                        
-                } catch (DOMStructureException ex) {
-                        domRule.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
+                    }
                 }
-                return domRule;
+            }
+
+            domRule.setRuleId(DOMUtil.getStringAttribute(elementRule, XACML3.ATTRIBUTE_RULEID, !bLenient));
+            String string			= DOMUtil.getStringAttribute(elementRule, XACML3.ATTRIBUTE_EFFECT, !bLenient);
+            RuleEffect ruleEffect	= RuleEffect.getRuleEffect(string);
+            if (ruleEffect == null && !bLenient) {
+                throw new DOMStructureException(elementRule, "Unknown RuleEffect \"" + string + "\" in \"" + DOMUtil.getNodeLabel(nodeRule) + "\"");
+            }
+            domRule.setRuleEffect(ruleEffect);
+
+        } catch (DOMStructureException ex) {
+            domRule.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
-        
-        public static boolean repair(Node nodeRule) throws DOMStructureException {
-                Element elementRule	= DOMUtil.getElement(nodeRule);
-                boolean result		= false;
-                
-                NodeList children	= elementRule.getChildNodes();
-                int numChildren;
-                boolean sawDescription				= false;
-                boolean sawTarget					= false;
-                boolean sawCondition				= false;
-                boolean sawObligationExpressions	= false;
-                boolean sawAdviceExpressions		= false;
-                
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
-                                                        if (sawDescription) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementRule.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawDescription	= true;
-                                                        }
-                                                } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
-                                                        if (sawTarget) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementRule.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawTarget	= true;
-                                                                result		= DOMTarget.repair(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_CONDITION.equals(childName)) {
-                                                        if (sawCondition) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementRule.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawCondition		= true;
-                                                                Node nodeExpression	= DOMUtil.getFirstChildElement(child);
-                                                                if (nodeExpression == null) {
-                                                                        throw DOMUtil.newMissingElementException(child, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
-                                                                }
-                                                                result				= DOMExpression.repair(nodeExpression) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
-                                                        if (sawObligationExpressions) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementRule.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawObligationExpressions	= true;
-                                                                result						= DOMObligationExpression.repairList(child) || result;
-                                                        }
-                                                } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
-                                                        if (sawAdviceExpressions) {
-                                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                                elementRule.removeChild(child);
-                                                                result	= true;
-                                                        } else {
-                                                                sawAdviceExpressions	= true;
-                                                                result					= DOMAdviceExpression.repairList(child) || result;
-                                                        }
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementRule.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementRule.removeChild(child);
-                                                result	= true;
-                                        }
+        return domRule;
+    }
+
+    public static boolean repair(Node nodeRule) throws DOMStructureException {
+        Element elementRule	= DOMUtil.getElement(nodeRule);
+        boolean result		= false;
+
+        NodeList children	= elementRule.getChildNodes();
+        int numChildren;
+        boolean sawDescription				= false;
+        boolean sawTarget					= false;
+        boolean sawCondition				= false;
+        boolean sawObligationExpressions	= false;
+        boolean sawAdviceExpressions		= false;
+
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_DESCRIPTION.equals(childName)) {
+                            if (sawDescription) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementRule.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawDescription	= true;
+                            }
+                        } else if (XACML3.ELEMENT_TARGET.equals(childName)) {
+                            if (sawTarget) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementRule.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawTarget	= true;
+                                result		= DOMTarget.repair(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_CONDITION.equals(childName)) {
+                            if (sawCondition) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementRule.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawCondition		= true;
+                                Node nodeExpression	= DOMUtil.getFirstChildElement(child);
+                                if (nodeExpression == null) {
+                                    throw DOMUtil.newMissingElementException(child, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
                                 }
+                                result				= DOMExpression.repair(nodeExpression) || result;
+                            }
+                        } else if (XACML3.ELEMENT_OBLIGATIONEXPRESSIONS.equals(childName)) {
+                            if (sawObligationExpressions) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementRule.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawObligationExpressions	= true;
+                                result						= DOMObligationExpression.repairList(child) || result;
+                            }
+                        } else if (XACML3.ELEMENT_ADVICEEXPRESSIONS.equals(childName)) {
+                            if (sawAdviceExpressions) {
+                                logger.warn("Unexpected element " + child.getNodeName());
+                                elementRule.removeChild(child);
+                                result	= true;
+                            } else {
+                                sawAdviceExpressions	= true;
+                                result					= DOMAdviceExpression.repairList(child) || result;
+                            }
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementRule.removeChild(child);
+                            result	= true;
                         }
-                }
-                
-                result	= DOMUtil.repairStringAttribute(elementRule, XACML3.ATTRIBUTE_RULEID, IdentifierImpl.gensym().stringValue(), logger) || result;
-                result	= DOMUtil.repairStringAttribute(elementRule, XACML3.ATTRIBUTE_EFFECT, RuleEffect.DENY.getName(), logger) || result;
-                
-                String string			= DOMUtil.getStringAttribute(elementRule, XACML3.ATTRIBUTE_EFFECT);
-                RuleEffect ruleEffect	= RuleEffect.getRuleEffect(string);
-                if (ruleEffect == null) {
-                        logger.warn("Setting invalid " + XACML3.ATTRIBUTE_EFFECT + " attribute " + string + " to " + RuleEffect.DENY.getName());
-                        elementRule.setAttribute(XACML3.ATTRIBUTE_EFFECT, RuleEffect.DENY.getName());
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementRule.removeChild(child);
                         result	= true;
-                } 
-
-                return result;
+                    }
+                }
+            }
         }
+
+        result	= DOMUtil.repairStringAttribute(elementRule, XACML3.ATTRIBUTE_RULEID, IdentifierImpl.gensym().stringValue(), logger) || result;
+        result	= DOMUtil.repairStringAttribute(elementRule, XACML3.ATTRIBUTE_EFFECT, RuleEffect.DENY.getName(), logger) || result;
+
+        String string			= DOMUtil.getStringAttribute(elementRule, XACML3.ATTRIBUTE_EFFECT);
+        RuleEffect ruleEffect	= RuleEffect.getRuleEffect(string);
+        if (ruleEffect == null) {
+            logger.warn("Setting invalid " + XACML3.ATTRIBUTE_EFFECT + " attribute " + string + " to " + RuleEffect.DENY.getName());
+            elementRule.setAttribute(XACML3.ATTRIBUTE_EFFECT, RuleEffect.DENY.getName());
+            result	= true;
+        }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMRuleCombinerParameters.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMRuleCombinerParameters.java
index 7f866b2..32a196c 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMRuleCombinerParameters.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMRuleCombinerParameters.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,96 +48,96 @@
 /**
  * DOMRuleCombinerParameters extends {@link com.att.research.xacmlatt.pdp.policy.TargetedCombinerParameter} with methods
  * for creation from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMRuleCombinerParameters extends TargetedCombinerParameter<String,Rule> {
-        private static final Log logger	= LogFactory.getLog(DOMRuleCombinerParameters.class);
-        
-        protected DOMRuleCombinerParameters() {
-        }
+    private static final Log logger	= LogFactory.getLog(DOMRuleCombinerParameters.class);
 
-        /**
-         * Creates a new <code>TargetedCombinerParameter</code> for {@link com.att.research.xacmlatt.pdp.policy.Rule}s by parsing the
-         * given <code>Node</code> representing a XACML RuleCombinerParameters element.
-         * 
-         * @param nodeRuleCombinerParameters the <code>Node</code> representing the XACML RuleCombinerParameters element.
-         * @return a new <code>TargetedCombinerParameter</code> for <code>Rule</code>s parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>.
-         */
-        public static TargetedCombinerParameter<String,Rule> newInstance(Node nodeRuleCombinerParameters) throws DOMStructureException {
-                Element elementRuleCombinerParameters	= DOMUtil.getElement(nodeRuleCombinerParameters);
-                boolean bLenient						= DOMProperties.isLenient();
-                
-                DOMRuleCombinerParameters domRuleCombinerParameters	= new DOMRuleCombinerParameters();
-                
-                try {
-                        NodeList children	= elementRuleCombinerParameters.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                        if (domRuleCombinerParameters.getAttributeValue() != null) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeRuleCombinerParameters);
-                                                        }
-                                                        domRuleCombinerParameters.setAttributeValue(DOMAttributeValue.newInstance(child, null));
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRuleCombinerParameters);
-                                                }
-                                        }
-                                }
-                        }
-                        if (domRuleCombinerParameters.getAttributeValue() == null && !bLenient) {
-                                throw DOMUtil.newMissingElementException(nodeRuleCombinerParameters, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                        }
-                        domRuleCombinerParameters.setName(DOMUtil.getStringAttribute(elementRuleCombinerParameters, XACML3.ATTRIBUTE_PARAMETERNAME, !bLenient));
-                        domRuleCombinerParameters.setTargetId(DOMUtil.getStringAttribute(elementRuleCombinerParameters, XACML3.ATTRIBUTE_RULEIDREF, !bLenient));
-                } catch (DOMStructureException ex) {
-                        domRuleCombinerParameters.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                return domRuleCombinerParameters;
-        }
-        
-        public static boolean repair(Node nodeRuleCombinerParameters) throws DOMStructureException {
-                Element elementRuleCombinerParameters	= DOMUtil.getElement(nodeRuleCombinerParameters);
-                boolean result							= false;
-                
-                NodeList children			= elementRuleCombinerParameters.getChildNodes();
-                int numChildren;
-                boolean sawAttributeValue	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                if (sawAttributeValue) {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementRuleCombinerParameters.removeChild(child);
-                                                        result	= true;
-                                                } else {
-                                                        sawAttributeValue	= true;
-                                                        result				= result || DOMAttributeValue.repair(child);
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementRuleCombinerParameters.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                if (!sawAttributeValue) {
-                        throw DOMUtil.newMissingElementException(nodeRuleCombinerParameters, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                }
-                result	= result || DOMUtil.repairStringAttribute(elementRuleCombinerParameters, XACML3.ATTRIBUTE_PARAMETERNAME, "parameter", logger);
-                result	= result || DOMUtil.repairIdentifierAttribute(elementRuleCombinerParameters, XACML3.ATTRIBUTE_RULEIDREF, logger);
+    protected DOMRuleCombinerParameters() {
+    }
 
-                return result;
+    /**
+     * Creates a new <code>TargetedCombinerParameter</code> for {@link com.att.research.xacmlatt.pdp.policy.Rule}s by parsing the
+     * given <code>Node</code> representing a XACML RuleCombinerParameters element.
+     *
+     * @param nodeRuleCombinerParameters the <code>Node</code> representing the XACML RuleCombinerParameters element.
+     * @return a new <code>TargetedCombinerParameter</code> for <code>Rule</code>s parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>.
+     */
+    public static TargetedCombinerParameter<String,Rule> newInstance(Node nodeRuleCombinerParameters) throws DOMStructureException {
+        Element elementRuleCombinerParameters	= DOMUtil.getElement(nodeRuleCombinerParameters);
+        boolean bLenient						= DOMProperties.isLenient();
+
+        DOMRuleCombinerParameters domRuleCombinerParameters	= new DOMRuleCombinerParameters();
+
+        try {
+            NodeList children	= elementRuleCombinerParameters.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                            if (domRuleCombinerParameters.getAttributeValue() != null) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeRuleCombinerParameters);
+                            }
+                            domRuleCombinerParameters.setAttributeValue(DOMAttributeValue.newInstance(child, null));
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeRuleCombinerParameters);
+                        }
+                    }
+                }
+            }
+            if (domRuleCombinerParameters.getAttributeValue() == null && !bLenient) {
+                throw DOMUtil.newMissingElementException(nodeRuleCombinerParameters, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+            }
+            domRuleCombinerParameters.setName(DOMUtil.getStringAttribute(elementRuleCombinerParameters, XACML3.ATTRIBUTE_PARAMETERNAME, !bLenient));
+            domRuleCombinerParameters.setTargetId(DOMUtil.getStringAttribute(elementRuleCombinerParameters, XACML3.ATTRIBUTE_RULEIDREF, !bLenient));
+        } catch (DOMStructureException ex) {
+            domRuleCombinerParameters.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
+        return domRuleCombinerParameters;
+    }
+
+    public static boolean repair(Node nodeRuleCombinerParameters) throws DOMStructureException {
+        Element elementRuleCombinerParameters	= DOMUtil.getElement(nodeRuleCombinerParameters);
+        boolean result							= false;
+
+        NodeList children			= elementRuleCombinerParameters.getChildNodes();
+        int numChildren;
+        boolean sawAttributeValue	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                        if (sawAttributeValue) {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementRuleCombinerParameters.removeChild(child);
+                            result	= true;
+                        } else {
+                            sawAttributeValue	= true;
+                            result				= result || DOMAttributeValue.repair(child);
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementRuleCombinerParameters.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+        if (!sawAttributeValue) {
+            throw DOMUtil.newMissingElementException(nodeRuleCombinerParameters, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+        }
+        result	= result || DOMUtil.repairStringAttribute(elementRuleCombinerParameters, XACML3.ATTRIBUTE_PARAMETERNAME, "parameter", logger);
+        result	= result || DOMUtil.repairIdentifierAttribute(elementRuleCombinerParameters, XACML3.ATTRIBUTE_RULEIDREF, logger);
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMTarget.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMTarget.java
index c95377c..7427399 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMTarget.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMTarget.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,77 +46,77 @@
 /**
  * DOMTarget extends {@link com.att.research.xacmlatt.pdp.policy.Target} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMTarget extends Target {
-        private static final Log logger	= LogFactory.getLog(DOMTarget.class);
-        
-        /**
-         * Creates an empty <code>DOMTarget</code>.
-         */
-        protected DOMTarget() {
-        }
-        
-        /**
-         * Creates a new <code>DOMTarget</code> by parsing the given <code>Node</code> representing a XACML Target element.
-         * 
-         * @param nodeTarget the <code>Node</code> representing the XACML Target element
-         * @return a new <code>DOMTarget</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static Target newInstance(Node nodeTarget) throws DOMStructureException {
-                Element elementTarget	= DOMUtil.getElement(nodeTarget);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                DOMTarget domTarget		= new DOMTarget();
-                try {
-                        NodeList children	= elementTarget.getChildNodes();
-                        int numChildren;
-                        if (children != null && (numChildren = children.getLength()) > 0) {
-                                for (int i = 0 ; i < numChildren ; i++) {
-                                        Node child	= children.item(i);
-                                        if (DOMUtil.isElement(child)) {
-                                                if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ANYOF.equals(child.getLocalName())) {
-                                                        domTarget.addAnyOf(DOMAnyOf.newInstance(child));
-                                                } else if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeTarget);
-                                                }
-                                        }
-                                }
-                        }
-                } catch (DOMStructureException ex) {
-                        domTarget.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                
-                return domTarget;
-        }
-        
-        public static boolean repair(Node nodeTarget) throws DOMStructureException {
-                Element elementTarget	= DOMUtil.getElement(nodeTarget);
-                boolean result			= false;
-                
-                NodeList children	= elementTarget.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ANYOF.equals(child.getLocalName())) {
-                                                result	= DOMAnyOf.repair(child) || result;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementTarget.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
+    private static final Log logger	= LogFactory.getLog(DOMTarget.class);
 
-                return result;
+    /**
+     * Creates an empty <code>DOMTarget</code>.
+     */
+    protected DOMTarget() {
+    }
+
+    /**
+     * Creates a new <code>DOMTarget</code> by parsing the given <code>Node</code> representing a XACML Target element.
+     *
+     * @param nodeTarget the <code>Node</code> representing the XACML Target element
+     * @return a new <code>DOMTarget</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static Target newInstance(Node nodeTarget) throws DOMStructureException {
+        Element elementTarget	= DOMUtil.getElement(nodeTarget);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        DOMTarget domTarget		= new DOMTarget();
+        try {
+            NodeList children	= elementTarget.getChildNodes();
+            int numChildren;
+            if (children != null && (numChildren = children.getLength()) > 0) {
+                for (int i = 0 ; i < numChildren ; i++) {
+                    Node child	= children.item(i);
+                    if (DOMUtil.isElement(child)) {
+                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ANYOF.equals(child.getLocalName())) {
+                            domTarget.addAnyOf(DOMAnyOf.newInstance(child));
+                        } else if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeTarget);
+                        }
+                    }
+                }
+            }
+        } catch (DOMStructureException ex) {
+            domTarget.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
         }
+
+        return domTarget;
+    }
+
+    public static boolean repair(Node nodeTarget) throws DOMStructureException {
+        Element elementTarget	= DOMUtil.getElement(nodeTarget);
+        boolean result			= false;
+
+        NodeList children	= elementTarget.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ANYOF.equals(child.getLocalName())) {
+                        result	= DOMAnyOf.repair(child) || result;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementTarget.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMVariableDefinition.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMVariableDefinition.java
index 1cd51f5..e040d4c 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMVariableDefinition.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/DOMVariableDefinition.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,69 +46,69 @@
 /**
  * DOMVariableDefinition extends {@link com.att.research.xacmlatt.pdp.policy.VariableDefinition} with methods
  * for creation from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMVariableDefinition extends VariableDefinition {
-        private static final Log logger	= LogFactory.getLog(DOMVariableDefinition.class);
-        
-        protected DOMVariableDefinition() {
+    private static final Log logger	= LogFactory.getLog(DOMVariableDefinition.class);
+
+    protected DOMVariableDefinition() {
+    }
+
+    /**
+     * Creates a new <code>VariableDefinition</code> by parsing the given <code>Node</code> representing a XACML VariableDefinition element.
+     *
+     * @param nodeVariableDefinition the <code>Node</code> representing the XACML VariableDefinition element
+     * @param policy the <code>Policy</code> encompassing the VariableDefinition element
+     * @return a new <code>VariableDefinition</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static VariableDefinition newInstance(Node nodeVariableDefinition, Policy policy) throws DOMStructureException {
+        Element elementVariableDefinition			= DOMUtil.getElement(nodeVariableDefinition);
+        boolean bLenient							= DOMProperties.isLenient();
+
+        DOMVariableDefinition domVariableDefinition	= new DOMVariableDefinition();
+
+        try {
+            Element elementExpression	= DOMUtil.getFirstChildElement(elementVariableDefinition);
+            if (elementExpression != null) {
+                if (DOMExpression.isExpression(elementExpression)) {
+                    domVariableDefinition.setExpression(DOMExpression.newInstance(elementExpression, policy));
+                } else if (!bLenient) {
+                    throw DOMUtil.newUnexpectedElementException(elementExpression, elementVariableDefinition);
+                }
+            } else if (!bLenient) {
+                throw DOMUtil.newMissingElementException(elementVariableDefinition, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
+            }
+            domVariableDefinition.setId(DOMUtil.getStringAttribute(elementVariableDefinition, XACML3.ATTRIBUTE_VARIABLEID, !bLenient));
+        } catch (DOMStructureException ex) {
+            domVariableDefinition.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            if (DOMProperties.throwsExceptions()) {
+                throw ex;
+            }
+        }
+        return domVariableDefinition;
+    }
+
+    public static boolean repair(Node nodeVariableDefinition) throws DOMStructureException {
+        Element elementVariableDefinition			= DOMUtil.getElement(nodeVariableDefinition);
+        boolean result								= false;
+
+        Element elementExpression	= DOMUtil.getFirstChildElement(elementVariableDefinition);
+        if (elementExpression != null) {
+            if (DOMExpression.isExpression(elementExpression)) {
+                result	= result || DOMExpression.repair(elementExpression);
+            } else {
+                logger.warn("Unexpected element " + elementExpression.getNodeName());
+                elementVariableDefinition.removeChild(elementExpression);
+                result	= true;
+            }
+        } else {
+            throw DOMUtil.newMissingElementException(elementVariableDefinition, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
         }
 
-        /**
-         * Creates a new <code>VariableDefinition</code> by parsing the given <code>Node</code> representing a XACML VariableDefinition element.
-         * 
-         * @param nodeVariableDefinition the <code>Node</code> representing the XACML VariableDefinition element
-         * @param policy the <code>Policy</code> encompassing the VariableDefinition element
-         * @return a new <code>VariableDefinition</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static VariableDefinition newInstance(Node nodeVariableDefinition, Policy policy) throws DOMStructureException {
-                Element elementVariableDefinition			= DOMUtil.getElement(nodeVariableDefinition);
-                boolean bLenient							= DOMProperties.isLenient();
-                
-                DOMVariableDefinition domVariableDefinition	= new DOMVariableDefinition();
-                
-                try {
-                        Element elementExpression	= DOMUtil.getFirstChildElement(elementVariableDefinition);
-                        if (elementExpression != null) {
-                                if (DOMExpression.isExpression(elementExpression)) {
-                                        domVariableDefinition.setExpression(DOMExpression.newInstance(elementExpression, policy));
-                                } else if (!bLenient) {
-                                        throw DOMUtil.newUnexpectedElementException(elementExpression, elementVariableDefinition);
-                                }
-                        } else if (!bLenient) {
-                                throw DOMUtil.newMissingElementException(elementVariableDefinition, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
-                        }
-                        domVariableDefinition.setId(DOMUtil.getStringAttribute(elementVariableDefinition, XACML3.ATTRIBUTE_VARIABLEID, !bLenient));
-                } catch (DOMStructureException ex) {
-                        domVariableDefinition.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        if (DOMProperties.throwsExceptions()) {
-                                throw ex;
-                        }
-                }
-                return domVariableDefinition;
-        }
-        
-        public static boolean repair(Node nodeVariableDefinition) throws DOMStructureException {
-                Element elementVariableDefinition			= DOMUtil.getElement(nodeVariableDefinition);
-                boolean result								= false;
-                
-                Element elementExpression	= DOMUtil.getFirstChildElement(elementVariableDefinition);
-                if (elementExpression != null) {
-                        if (DOMExpression.isExpression(elementExpression)) {
-                                result	= result || DOMExpression.repair(elementExpression);
-                        } else {
-                                logger.warn("Unexpected element " + elementExpression.getNodeName());
-                                elementVariableDefinition.removeChild(elementExpression);
-                                result	= true;
-                        }
-                } else {
-                        throw DOMUtil.newMissingElementException(elementVariableDefinition, XACML3.XMLNS, XACML3.ELEMENT_EXPRESSION);
-                }
-                
-                result	= result || DOMUtil.repairStringAttribute(elementVariableDefinition, XACML3.ATTRIBUTE_VARIABLEID, "variable", logger);
-                return result;
-        }
+        result	= result || DOMUtil.repairStringAttribute(elementVariableDefinition, XACML3.ATTRIBUTE_VARIABLEID, "variable", logger);
+        return result;
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/package-info.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/package-info.java
index c487c9f..4198bca 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/package-info.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/dom/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacmlatt.pdp.policy.dom contains class definitions that extend {@link com.att.research.xacmlatt.pdp.policy} classes
  * with methods for creation from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/Apply.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/Apply.java
index 9c8c1cd..af51d46 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/Apply.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/Apply.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -52,139 +52,139 @@
 
 /**
  * Apply extends {@link com.att.research.xacmlatt.pdp.policy.Expression} to implement the XACML Apply Expression element.
- *  
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class Apply extends Expression {
-        private Identifier functionId;
-        private FunctionDefinition functionDefinition;
-        private String description;
-        private List<Expression> arguments	= new ArrayList<Expression>();
-        
-        protected List<Expression> getArgumentList() {
-                return this.arguments;
-        }
-        
-        protected void clearArgumentList() {
-                this.getArgumentList().clear();
-        }
-        
-        public Apply(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private Identifier functionId;
+    private FunctionDefinition functionDefinition;
+    private String description;
+    private List<Expression> arguments	= new ArrayList<Expression>();
 
-        public Apply(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
+    protected List<Expression> getArgumentList() {
+        return this.arguments;
+    }
 
-        public Apply() {
+    protected void clearArgumentList() {
+        this.getArgumentList().clear();
+    }
+
+    public Apply(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public Apply(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public Apply() {
+    }
+
+    public Apply(Identifier functionIdIn, String descriptionIn, Collection<Expression> argumentsIn) {
+        this.functionId		= functionIdIn;
+        this.description	= descriptionIn;
+        if (argumentsIn != null) {
+            this.arguments.addAll(argumentsIn);
         }
-        
-        public Apply(Identifier functionIdIn, String descriptionIn, Collection<Expression> argumentsIn) {
-                this.functionId		= functionIdIn;
-                this.description	= descriptionIn;
-                if (argumentsIn != null) {
-                        this.arguments.addAll(argumentsIn);
+    }
+
+    public Identifier getFunctionId() {
+        return this.functionId;
+    }
+
+    public void setFunctionId(Identifier identifier) {
+        this.functionId			= identifier;
+        this.functionDefinition	= null;
+    }
+
+    /**
+     * Gets and caches the {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} matching the
+     * <code>Identifier</code> for the FunctionId in this <code>Apply</code>.
+     *
+     * @return the <code>FunctionDefinition</code> for the <code>Identifier</code> for the Function Id for this <code>Apply</code>
+     */
+    public FunctionDefinition getFunctionDefinition() {
+        if (this.functionDefinition == null) {
+            Identifier thisFunctionId	= this.getFunctionId();
+            if (thisFunctionId != null) {
+                try {
+                    this.functionDefinition	= FunctionDefinitionFactory.newInstance().getFunctionDefinition(thisFunctionId);
+                } catch (FactoryException ex) {
+                    this.setStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "FactoryException getting FunctionDefinition");
                 }
+            }
         }
-        
-        public Identifier getFunctionId() {
-                return this.functionId;
+        return this.functionDefinition;
+    }
+
+    public String getDescription() {
+        return this.description;
+    }
+
+    public void setDescription(String string) {
+        this.description	= string;
+    }
+
+    public Iterator<Expression> getArguments() {
+        return this.getArgumentList().iterator();
+    }
+
+    public void setArguments(Collection<Expression> listExpressions) {
+        this.clearArgumentList();
+        if (listExpressions != null) {
+            this.addArguments(listExpressions);
         }
-        
-        public void setFunctionId(Identifier identifier) {
-                this.functionId			= identifier;
-                this.functionDefinition	= null;
+    }
+
+    public void addArgument(Expression expression) {
+        this.getArgumentList().add(expression);
+    }
+
+    public void addArguments(Collection<Expression> listExpressions) {
+        this.getArgumentList().addAll(listExpressions);
+    }
+
+    @Override
+    public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
-        
-        /**
-         * Gets and caches the {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} matching the
-         * <code>Identifier</code> for the FunctionId in this <code>Apply</code>.
-         * 
-         * @return the <code>FunctionDefinition</code> for the <code>Identifier</code> for the Function Id for this <code>Apply</code>
+
+        /*
+         * Get the FunctionDefinition
          */
-        public FunctionDefinition getFunctionDefinition() {
-                if (this.functionDefinition == null) {
-                        Identifier thisFunctionId	= this.getFunctionId();
-                        if (thisFunctionId != null) {
-                                try {
-                                        this.functionDefinition	= FunctionDefinitionFactory.newInstance().getFunctionDefinition(thisFunctionId);
-                                } catch (FactoryException ex) {
-                                        this.setStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "FactoryException getting FunctionDefinition");
-                                }
-                        }
-                }
-                return this.functionDefinition;
-        }
-        
-        public String getDescription() {
-                return this.description;
-        }
-        
-        public void setDescription(String string) {
-                this.description	= string;
-        }
-        
-        public Iterator<Expression> getArguments() {
-                return this.getArgumentList().iterator();
-        }
-        
-        public void setArguments(Collection<Expression> listExpressions) {
-                this.clearArgumentList();
-                if (listExpressions != null) {
-                        this.addArguments(listExpressions);
-                }
-        }
-        
-        public void addArgument(Expression expression) {
-                this.getArgumentList().add(expression);
-        }
-        
-        public void addArguments(Collection<Expression> listExpressions) {
-                this.getArgumentList().addAll(listExpressions);
+        FunctionDefinition thisFunctionDefinition	= this.getFunctionDefinition();
+        if (thisFunctionDefinition == null) {
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Unknown Function \"" + this.getFunctionId().toString() + "\""));
         }
 
-        @Override
-        public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                /*
-                 * Get the FunctionDefinition
-                 */
-                FunctionDefinition thisFunctionDefinition	= this.getFunctionDefinition();
-                if (thisFunctionDefinition == null) {
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Unknown Function \"" + this.getFunctionId().toString() + "\""));
-                }
-                
-                /*
-                 * Get all of the arguments and convert them into FunctionArgument objects.
-                 */
-                List<FunctionArgument> listFunctionArguments	= new ArrayList<FunctionArgument>();
-                Iterator<Expression> iterExpressionArguments	= this.getArguments();
-                if (iterExpressionArguments != null) {
-                        while (iterExpressionArguments.hasNext()) {
-                                listFunctionArguments.add(new FunctionArgumentExpression(iterExpressionArguments.next(), evaluationContext, policyDefaults));
-                        }
-                }
-                
-                /*
-                 * Apply the FunctionDefinition to the arguments
-                 */
-                return thisFunctionDefinition.evaluate(evaluationContext, listFunctionArguments);
+        /*
+         * Get all of the arguments and convert them into FunctionArgument objects.
+         */
+        List<FunctionArgument> listFunctionArguments	= new ArrayList<FunctionArgument>();
+        Iterator<Expression> iterExpressionArguments	= this.getArguments();
+        if (iterExpressionArguments != null) {
+            while (iterExpressionArguments.hasNext()) {
+                listFunctionArguments.add(new FunctionArgumentExpression(iterExpressionArguments.next(), evaluationContext, policyDefaults));
+            }
         }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getFunctionId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing FunctionId");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
+        /*
+         * Apply the FunctionDefinition to the arguments
+         */
+        return thisFunctionDefinition.evaluate(evaluationContext, listFunctionArguments);
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getFunctionId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing FunctionId");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeDesignator.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeDesignator.java
index 7e4879a..0757dd8 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeDesignator.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeDesignator.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -56,180 +56,180 @@
 /**
  * AttributeDesignator extends {@link com.att.research.xacmlatt.pdp.policy.expression.AttributeRetrievalBase} to represent the
  * XACML AttributeDesignator element.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class AttributeDesignator extends AttributeRetrievalBase {
-        private Identifier attributeId;
-        private String issuer;
-        private PIPRequest pipRequestCached;
-        private MissingAttributeDetail missingAttributeDetail;
-        private StatusDetail statusDetail;
-        
-        protected PIPRequest getPIPRequest() {
-                if (this.pipRequestCached == null) {
-                        this.pipRequestCached	= new StdPIPRequest(this.getCategory(), this.getAttributeId(), this.getDataTypeId(), this.getIssuer());
-                }
-                return this.pipRequestCached;
+    private Identifier attributeId;
+    private String issuer;
+    private PIPRequest pipRequestCached;
+    private MissingAttributeDetail missingAttributeDetail;
+    private StatusDetail statusDetail;
+
+    protected PIPRequest getPIPRequest() {
+        if (this.pipRequestCached == null) {
+            this.pipRequestCached	= new StdPIPRequest(this.getCategory(), this.getAttributeId(), this.getDataTypeId(), this.getIssuer());
         }
-        
-        protected MissingAttributeDetail getMissingAttributeDetail() {
-                if (this.missingAttributeDetail == null) {
-                        this.missingAttributeDetail	= new StdMutableMissingAttributeDetail(this.getCategory(), this.getAttributeId(), this.getDataTypeId(), this.getIssuer());
-                }
-                return this.missingAttributeDetail;
+        return this.pipRequestCached;
+    }
+
+    protected MissingAttributeDetail getMissingAttributeDetail() {
+        if (this.missingAttributeDetail == null) {
+            this.missingAttributeDetail	= new StdMutableMissingAttributeDetail(this.getCategory(), this.getAttributeId(), this.getDataTypeId(), this.getIssuer());
         }
-        
-        protected StatusDetail getStatusDetail() {
-                if (this.statusDetail == null) {
-                        this.statusDetail	= new StdStatusDetail(this.getMissingAttributeDetail());
-                }
-                return this.statusDetail;
+        return this.missingAttributeDetail;
+    }
+
+    protected StatusDetail getStatusDetail() {
+        if (this.statusDetail == null) {
+            this.statusDetail	= new StdStatusDetail(this.getMissingAttributeDetail());
         }
-        
-        public AttributeDesignator(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
+        return this.statusDetail;
+    }
+
+    public AttributeDesignator(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public AttributeDesignator(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public AttributeDesignator() {
+    }
+
+    public Identifier getAttributeId() {
+        return this.attributeId;
+    }
+
+    public void setAttributeId(Identifier identifierAttributeId) {
+        this.attributeId	= identifierAttributeId;
+    }
+
+    public String getIssuer() {
+        return this.issuer;
+    }
+
+    public void setIssuer(String issuerIn) {
+        this.issuer	= issuerIn;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (!super.validateComponent()) {
+            return false;
+        } else if (this.getAttributeId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeId");
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    /**
+     * Determines if the given <code>Attribute</code> has the same category, attribute id, and issuer as this
+     * <code>AttributeDesignator</code>.
+     *
+     * @param attribute the <code>Attribute</code> to test
+     * @return true if the <code>Attribute</code> matches, else false
+     */
+    protected boolean match(Attribute attribute) {
+        if (!this.getCategory().equals(attribute.getCategory())) {
+            return false;
+        } else if (!this.getAttributeId().equals(attribute.getAttributeId())) {
+            return false;
+        } else if (this.getIssuer() != null && !this.getIssuer().equals(attribute.getIssuer())) {
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    /**
+     * Determines if the given <code>AttributeValue</code> has the same data type id as this
+     * <code>AttributeDesignator</code>.
+     *
+     * @param attributeValue the <code>AttributeValue</code> to test
+     * @return true if the <code>AttributeValue</code> maches, else false
+     */
+    protected boolean match(AttributeValue<?> attributeValue) {
+        if (!this.getDataTypeId().equals(attributeValue.getDataTypeId())) {
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    @Override
+    public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return ExpressionResult.newInstance(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
 
-        public AttributeDesignator(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
-
-        public AttributeDesignator() {
-        }
-        
-        public Identifier getAttributeId() {
-                return this.attributeId;
-        }
-        
-        public void setAttributeId(Identifier identifierAttributeId) {
-                this.attributeId	= identifierAttributeId;
-        }
-        
-        public String getIssuer() {
-                return this.issuer;
-        }
-        
-        public void setIssuer(String issuerIn) {
-                this.issuer	= issuerIn;
-        }
-        
-        @Override
-        protected boolean validateComponent() {
-                if (!super.validateComponent()) {
-                        return false;
-                } else if (this.getAttributeId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeId");
-                        return false;
-                } else {
-                        return true;
-                }
-        }
-        
-        /**
-         * Determines if the given <code>Attribute</code> has the same category, attribute id, and issuer as this
-         * <code>AttributeDesignator</code>.
-         * 
-         * @param attribute the <code>Attribute</code> to test
-         * @return true if the <code>Attribute</code> matches, else false
+        /*
+         * Set up the PIPRequest representing this
          */
-        protected boolean match(Attribute attribute) {
-                if (!this.getCategory().equals(attribute.getCategory())) {
-                        return false;
-                } else if (!this.getAttributeId().equals(attribute.getAttributeId())) {
-                        return false;
-                } else if (this.getIssuer() != null && !this.getIssuer().equals(attribute.getIssuer())) {
-                        return false;
-                } else {
-                        return true;
-                }
-        }
-        
-        /**
-         * Determines if the given <code>AttributeValue</code> has the same data type id as this
-         * <code>AttributeDesignator</code>.
-         * 
-         * @param attributeValue the <code>AttributeValue</code> to test
-         * @return true if the <code>AttributeValue</code> maches, else false
+        PIPRequest pipRequest	= this.getPIPRequest();
+        assert(pipRequest != null);
+
+        /*
+         * Query the evaluation context for results
          */
-        protected boolean match(AttributeValue<?> attributeValue) {
-                if (!this.getDataTypeId().equals(attributeValue.getDataTypeId())) {
-                        return false;
-                } else {
-                        return true;
-                }
+        PIPResponse pipResponse	= null;
+        try {
+            pipResponse	= evaluationContext.getAttributes(pipRequest);
+        } catch (PIPException ex) {
+            throw new EvaluationException("PIPException getting Attributes", ex);
+        }
+        assert(pipResponse != null);
+
+        /*
+         * See if the request was successful
+         */
+        Status pipStatus		= pipResponse.getStatus();
+        if (pipStatus != null && !pipStatus.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {
+            return ExpressionResult.newInstance(pipStatus);
         }
 
-        @Override
-        public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return ExpressionResult.newInstance(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        /*
+         * See if there were any results
+         */
+        Bag bagAttributeValues				= new Bag();
+        Collection<Attribute> listAttributes	= pipResponse.getAttributes();
+        for (Attribute attribute : listAttributes) {
+            if (this.match(attribute)) {
+                for (AttributeValue<?> attributeValue: attribute.getValues()) {
+                    if (this.match(attributeValue)) {
+                        bagAttributeValues.add(attributeValue);
+                    }
                 }
-                
-                /*
-                 * Set up the PIPRequest representing this
-                 */
-                PIPRequest pipRequest	= this.getPIPRequest();
-                assert(pipRequest != null);
-                
-                /*
-                 * Query the evaluation context for results
-                 */
-                PIPResponse pipResponse	= null;
-                try {
-                        pipResponse	= evaluationContext.getAttributes(pipRequest);
-                } catch (PIPException ex) {
-                        throw new EvaluationException("PIPException getting Attributes", ex);
-                }
-                assert(pipResponse != null);
-                
-                /*
-                 * See if the request was successful
-                 */
-                Status pipStatus		= pipResponse.getStatus();
-                if (pipStatus != null && !pipStatus.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {
-                        return ExpressionResult.newInstance(pipStatus);
-                }
-                
-                /*
-                 * See if there were any results
-                 */
-                Bag bagAttributeValues				= new Bag();
-                Collection<Attribute> listAttributes	= pipResponse.getAttributes();
-                for (Attribute attribute : listAttributes) {
-                        if (this.match(attribute)) {
-                                for (AttributeValue<?> attributeValue: attribute.getValues()) {
-                                        if (this.match(attributeValue)) {
-                                                bagAttributeValues.add(attributeValue);
-                                        }
-                                }
-                        }		
-                }
-                if (this.getMustBePresent() && bagAttributeValues.size() == 0) {
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE, "Missing required attribute", new StdStatusDetail(this.getMissingAttributeDetail())));
-                } else {
-                        return ExpressionResult.newBag(bagAttributeValues);
-                }
+            }
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getAttributeId()) != null) {
-                        stringBuilder.append(",attributeId=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getIssuer()) != null) {
-                        stringBuilder.append(",issuer=");
-                        stringBuilder.append((String)objectToDump);
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        if (this.getMustBePresent() && bagAttributeValues.size() == 0) {
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE, "Missing required attribute", new StdStatusDetail(this.getMissingAttributeDetail())));
+        } else {
+            return ExpressionResult.newBag(bagAttributeValues);
         }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getAttributeId()) != null) {
+            stringBuilder.append(",attributeId=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getIssuer()) != null) {
+            stringBuilder.append(",issuer=");
+            stringBuilder.append((String)objectToDump);
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeRetrievalBase.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeRetrievalBase.java
index ee34122..367b745 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeRetrievalBase.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeRetrievalBase.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,146 +45,146 @@
  * implements {@link com.att.research.xacmlatt.pdp.eval.Evaluatable} to serve as an abstract base class
  * for the {@link com.att.research.xacmlatt.pdp.policy.AttributeSelector} and {@link com.att.research.xacmlatt.pdp.policy.AttributeDesignator}
  * classes.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public abstract class AttributeRetrievalBase extends Expression {
-        private Identifier	category;
-        private Identifier	dataTypeId;
-        private Boolean		mustBePresent;
-        
-        protected AttributeRetrievalBase(StatusCode statusCodeIn,
-                        String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private Identifier	category;
+    private Identifier	dataTypeId;
+    private Boolean		mustBePresent;
 
-        protected AttributeRetrievalBase(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
+    protected AttributeRetrievalBase(StatusCode statusCodeIn,
+                                     String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        protected AttributeRetrievalBase() {
-        }
-        
-        protected AttributeRetrievalBase(Identifier categoryIn, Identifier dataTypeIdIn, Boolean mustBePresentIn) {
-                this.category		= categoryIn;
-                this.dataTypeId		= dataTypeIdIn;
-                this.mustBePresent	= mustBePresentIn;
-        }
+    protected AttributeRetrievalBase(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-        /**
-         * Gets the {@link com.att.research.xacml.api.Identifier} for the category associated with this
-         * <code>AttributeRetrievalBase</code>.
-         * 
-         * @return the <code>Identifier</code> for the category of this <code>AttributeRetrievalBase</code>.
-         */
-        public Identifier getCategory() {
-                return this.category;
-        }
-        
-        /**
-         * Sets the <code>Identifier</code> for the category associated with this <code>AttributeRetrievalBase</code>.
-         * 
-         * @param categoryIn the <code>Identifier</code> for the category associated with this <code>AttributeRetrievalBase</code>
-         */
-        public void setCategory(Identifier categoryIn) {
-                this.category	= categoryIn;
-        }
-        
-        /**
-         * Gets the <code>Identifier</code> for the data type associated with this <code>AttributeRetrievalBase</code>.
-         * 
-         * @return the <code>Identifier</code> for the data type associated with this <code>AttributeRetrievalBase</code>
-         */
-        public Identifier getDataTypeId() {
-                return this.dataTypeId;
-        }
-        
-        /**
-         * Sets the <code>Identifier</code> for the data type associated with this <code>AttributeRetrievalBase</code>.
-         * 
-         * @param dataTypeIn the <code>Identifier</code> for the data type associated with this <code>AttributeRetrievalBase</code>
-         */
-        public void setDataTypeId(Identifier dataTypeIn) {
-                // allow old-style Ids for Durations since there is no structural or semantic changes, just a different Id.
-                if (dataTypeIn.equals(XACML.ID_DATATYPE_WD_DAYTIMEDURATION)) {
-                        dataTypeIn	= DataTypes.DT_DAYTIMEDURATION.getId();
-                } else if (dataTypeIn.equals(XACML.ID_DATATYPE_WD_YEARMONTHDURATION)) {
-                        dataTypeIn	= DataTypes.DT_YEARMONTHDURATION.getId();
-                }
-                this.dataTypeId	= dataTypeIn;
-        }
-        
-        /**
-         * Determines if a value must be found for this <code>AttributeRetrievalBase</code> when it is evaluated.  If true,
-         * and no value is found, an indeterminate result is returned, otherwise an empty bag is returned.
-         * 
-         * @return true if the value of this <code>AttributeRetrievalBase</code> must be found, else false
-         */
-        public Boolean getMustBePresent() {
-                return this.mustBePresent;
-        }
-        
-        /**
-         * Sets the flag indicating whether a value must be found for this <code>AttributeRetrievalBase</code>.
-         * 
-         * @param b the boolean value for the flag
-         */
-        public void setMustBePresent(boolean b) {
-                this.mustBePresent	= b;
-        }
+    protected AttributeRetrievalBase() {
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getCategory() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Category");
-                        return false;
-                } else if (this.getDataTypeId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing DataType");
-                        return false;
-                } else if (this.getMustBePresent() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing MustBePresent");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
-        }
-        
-        @Override public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getCategory()) != null) {
-                        stringBuilder.append(",category=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getDataTypeId()) != null) {
-                        stringBuilder.append(",dataType=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getMustBePresent()) != null) {
-                        stringBuilder.append(",mustBePresent=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    protected AttributeRetrievalBase(Identifier categoryIn, Identifier dataTypeIdIn, Boolean mustBePresentIn) {
+        this.category		= categoryIn;
+        this.dataTypeId		= dataTypeIdIn;
+        this.mustBePresent	= mustBePresentIn;
+    }
 
-        /**
-         * Creates the appropriate {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} for an empty list based
-         * on the <code>getMustBePresent</code> value.
-         * 
-         * @return an appropriate <code>ExpressionResult</code>
-         */
-        protected ExpressionResult getEmptyResult(String statusMessage, StatusDetail statusDetail) {
-                if (this.getMustBePresent() != null && this.getMustBePresent().booleanValue()) {
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE, statusMessage, statusDetail));
-                } else {
-                        return ExpressionResult.newEmpty();
-                }
+    /**
+     * Gets the {@link com.att.research.xacml.api.Identifier} for the category associated with this
+     * <code>AttributeRetrievalBase</code>.
+     *
+     * @return the <code>Identifier</code> for the category of this <code>AttributeRetrievalBase</code>.
+     */
+    public Identifier getCategory() {
+        return this.category;
+    }
+
+    /**
+     * Sets the <code>Identifier</code> for the category associated with this <code>AttributeRetrievalBase</code>.
+     *
+     * @param categoryIn the <code>Identifier</code> for the category associated with this <code>AttributeRetrievalBase</code>
+     */
+    public void setCategory(Identifier categoryIn) {
+        this.category	= categoryIn;
+    }
+
+    /**
+     * Gets the <code>Identifier</code> for the data type associated with this <code>AttributeRetrievalBase</code>.
+     *
+     * @return the <code>Identifier</code> for the data type associated with this <code>AttributeRetrievalBase</code>
+     */
+    public Identifier getDataTypeId() {
+        return this.dataTypeId;
+    }
+
+    /**
+     * Sets the <code>Identifier</code> for the data type associated with this <code>AttributeRetrievalBase</code>.
+     *
+     * @param dataTypeIn the <code>Identifier</code> for the data type associated with this <code>AttributeRetrievalBase</code>
+     */
+    public void setDataTypeId(Identifier dataTypeIn) {
+        // allow old-style Ids for Durations since there is no structural or semantic changes, just a different Id.
+        if (dataTypeIn.equals(XACML.ID_DATATYPE_WD_DAYTIMEDURATION)) {
+            dataTypeIn	= DataTypes.DT_DAYTIMEDURATION.getId();
+        } else if (dataTypeIn.equals(XACML.ID_DATATYPE_WD_YEARMONTHDURATION)) {
+            dataTypeIn	= DataTypes.DT_YEARMONTHDURATION.getId();
         }
+        this.dataTypeId	= dataTypeIn;
+    }
+
+    /**
+     * Determines if a value must be found for this <code>AttributeRetrievalBase</code> when it is evaluated.  If true,
+     * and no value is found, an indeterminate result is returned, otherwise an empty bag is returned.
+     *
+     * @return true if the value of this <code>AttributeRetrievalBase</code> must be found, else false
+     */
+    public Boolean getMustBePresent() {
+        return this.mustBePresent;
+    }
+
+    /**
+     * Sets the flag indicating whether a value must be found for this <code>AttributeRetrievalBase</code>.
+     *
+     * @param b the boolean value for the flag
+     */
+    public void setMustBePresent(boolean b) {
+        this.mustBePresent	= b;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getCategory() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Category");
+            return false;
+        } else if (this.getDataTypeId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing DataType");
+            return false;
+        } else if (this.getMustBePresent() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing MustBePresent");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
+        }
+    }
+
+    @Override public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getCategory()) != null) {
+            stringBuilder.append(",category=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getDataTypeId()) != null) {
+            stringBuilder.append(",dataType=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getMustBePresent()) != null) {
+            stringBuilder.append(",mustBePresent=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    /**
+     * Creates the appropriate {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} for an empty list based
+     * on the <code>getMustBePresent</code> value.
+     *
+     * @return an appropriate <code>ExpressionResult</code>
+     */
+    protected ExpressionResult getEmptyResult(String statusMessage, StatusDetail statusDetail) {
+        if (this.getMustBePresent() != null && this.getMustBePresent().booleanValue()) {
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE, statusMessage, statusDetail));
+        } else {
+            return ExpressionResult.newEmpty();
+        }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeSelector.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeSelector.java
index 75a7e65..37d20a1 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeSelector.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeSelector.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -69,235 +69,235 @@
 /**
  * AttributeSelector extends {@link com.att.research.xacmlatt.pdp.policy.expressions.AttributeRetrievalBase} to implement
  * the XACML AttributeSelector element.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class AttributeSelector extends AttributeRetrievalBase {
-        private Identifier 		contextSelectorId;
-        private String			path;
-        @SuppressWarnings("unused")
-        private DataType<?> 	dataType;
-        
-        protected DataType<?> getDataType() {
-                Identifier dataTypeIdThis	= this.getDataTypeId();
-                if (dataTypeIdThis == null) {
-                        return null;
-                } else {
-                        DataTypeFactory dataTypeFactory		= null;
-                        try {
-                                dataTypeFactory	= DataTypeFactory.newInstance();
-                                if (dataTypeFactory == null) {
-                                        return null;
-                                }
-                        } catch (FactoryException ex) {
-                                return null;
-                        }
-                        return (this.dataType	= dataTypeFactory.getDataType(dataTypeIdThis));
+    private Identifier 		contextSelectorId;
+    private String			path;
+    @SuppressWarnings("unused")
+    private DataType<?> 	dataType;
+
+    protected DataType<?> getDataType() {
+        Identifier dataTypeIdThis	= this.getDataTypeId();
+        if (dataTypeIdThis == null) {
+            return null;
+        } else {
+            DataTypeFactory dataTypeFactory		= null;
+            try {
+                dataTypeFactory	= DataTypeFactory.newInstance();
+                if (dataTypeFactory == null) {
+                    return null;
                 }
+            } catch (FactoryException ex) {
+                return null;
+            }
+            return (this.dataType	= dataTypeFactory.getDataType(dataTypeIdThis));
         }
+    }
 
-        public AttributeSelector(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    public AttributeSelector(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        public AttributeSelector(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
+    public AttributeSelector(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-        public AttributeSelector() {
+    public AttributeSelector() {
+    }
+
+    public Identifier getContextSelectorId() {
+        return this.contextSelectorId;
+    }
+
+    public void setContextSelectorId(Identifier identifier) {
+        this.contextSelectorId	= identifier;
+    }
+
+    public String getPath() {
+        return this.path;
+    }
+
+    public void setPath(String pathIn) {
+        this.path	= pathIn;
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (!super.validateComponent()) {
+            return false;
+        } else if (this.getPath() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Path");
+            return false;
+        } else {
+            return true;
         }
-        
-        public Identifier getContextSelectorId() {
-                return this.contextSelectorId;
+    }
+
+    /**
+     * If there is a context selector ID, get the attributes from the given <code>RequestAttributes</code> with that
+     * ID, ensure they are <code>XPathExpression</code>s and return them.
+     *
+     * @param requestAttributes
+     * @return
+     */
+    protected List<XPathExpression> getContextSelectorValues(RequestAttributes requestAttributes) {
+        Identifier thisContextSelectorId	= this.getContextSelectorId();
+        if (thisContextSelectorId == null) {
+            return null;
         }
-        
-        public void setContextSelectorId(Identifier identifier) {
-                this.contextSelectorId	= identifier;
-        }
-        
-        public String getPath() {
-                return this.path;
-        }
-        
-        public void setPath(String pathIn) {
-                this.path	= pathIn;
-        }
-        
-        @Override
-        protected boolean validateComponent() {
-                if (!super.validateComponent()) {
-                        return false;
-                } else if (this.getPath() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Path");
-                        return false;
-                } else {
-                        return true;
+        List<XPathExpression> listXPathExpressions	= null;
+        Iterator<Attribute> iterAttributes	= requestAttributes.getAttributes(thisContextSelectorId);
+        if (iterAttributes != null) {
+            while (iterAttributes.hasNext()) {
+                Attribute attribute	= iterAttributes.next();
+                Iterator<AttributeValue<XPathExpressionWrapper>> iterXPathExpressions	= attribute.findValues(DataTypes.DT_XPATHEXPRESSION);
+                if (iterXPathExpressions != null && iterXPathExpressions.hasNext()) {
+                    if (listXPathExpressions == null) {
+                        listXPathExpressions	= new ArrayList<XPathExpression>();
+                    }
+                    listXPathExpressions.add(iterXPathExpressions.next().getValue());
                 }
+            }
         }
-        
-        /**
-         * If there is a context selector ID, get the attributes from the given <code>RequestAttributes</code> with that
-         * ID, ensure they are <code>XPathExpression</code>s and return them.
-         * 
-         * @param requestAttributes
-         * @return
+        return listXPathExpressions;
+    }
+
+    @Override
+    public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        }
+
+        /*
+         * Get the DataType for this AttributeSelector for converting the resulting nodes into AttributeValues
          */
-        protected List<XPathExpression> getContextSelectorValues(RequestAttributes requestAttributes) {
-                Identifier thisContextSelectorId	= this.getContextSelectorId();
-                if (thisContextSelectorId == null) {
-                        return null;
-                }
-                List<XPathExpression> listXPathExpressions	= null;
-                Iterator<Attribute> iterAttributes	= requestAttributes.getAttributes(thisContextSelectorId);
-                if (iterAttributes != null) {
-                        while (iterAttributes.hasNext()) {
-                                Attribute attribute	= iterAttributes.next();
-                                Iterator<AttributeValue<XPathExpressionWrapper>> iterXPathExpressions	= attribute.findValues(DataTypes.DT_XPATHEXPRESSION);
-                                if (iterXPathExpressions != null && iterXPathExpressions.hasNext()) {
-                                        if (listXPathExpressions == null) {
-                                                listXPathExpressions	= new ArrayList<XPathExpression>();
-                                        }
-                                        listXPathExpressions.add(iterXPathExpressions.next().getValue());
-                                }
-                        }
-                }
-                return listXPathExpressions;
+        DataType<?> thisDataType	= this.getDataType();
+
+        /*
+         * Get the Request so we can find the XPathExpression to locate the root node and to find the Content element
+         * of the requested category.
+         */
+        Request request	= evaluationContext.getRequest();
+        assert(request != null);
+
+        /*
+         * Get the RequestAttributes objects for our Category.  If none are found, then we abort quickly with either
+         * an empty or indeterminate result.
+         */
+        Iterator<RequestAttributes> iterRequestAttributes	= request.getRequestAttributes(this.getCategory());
+        if (iterRequestAttributes == null || !iterRequestAttributes.hasNext()) {
+            return this.getEmptyResult("No Attributes with Category " + this.getCategory().toString(), null);
         }
 
-        @Override
-        public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                /*
-                 * Get the DataType for this AttributeSelector for converting the resulting nodes into AttributeValues
-                 */
-                DataType<?> thisDataType	= this.getDataType();
-                
-                /*
-                 * Get the Request so we can find the XPathExpression to locate the root node and to find the Content element
-                 * of the requested category.
-                 */
-                Request request	= evaluationContext.getRequest();
-                assert(request != null);
-                
-                /*
-                 * Get the RequestAttributes objects for our Category.  If none are found, then we abort quickly with either
-                 * an empty or indeterminate result.
-                 */
-                Iterator<RequestAttributes> iterRequestAttributes	= request.getRequestAttributes(this.getCategory());
-                if (iterRequestAttributes == null || !iterRequestAttributes.hasNext()) {
-                        return this.getEmptyResult("No Attributes with Category " + this.getCategory().toString(), null);
-                }
-                
-                /*
-                 * Section 5.30 of the XACML 3.0 specification is a little vague about how to use the
-                 * ContextSelectorId in the face of having multiple Attributes elements with the same CategoryId.  My interpretation
-                 * is that each is distinct, so we look for an attribute matching the ContextSelectorId in each matching Attributes element
-                 * and use that to search the Content in that particular Attributes element.  If either an Attribute matching the context selector id
-                 * is not found or there is no Content, then that particular Attributes element is skipped.
-                 */
-                Bag bagAttributeValues						= new Bag();
-                StdStatus statusFirstError					= null;
-                while (iterRequestAttributes.hasNext()) {
-                        RequestAttributes requestAttributes	= iterRequestAttributes.next();
-                        
-                        /*
-                         * See if we have a Content element to query.
-                         */
-                        Node nodeContentRoot	= requestAttributes.getContentRoot();
-                        if (nodeContentRoot != null) {
-                                List<Node> listNodesToQuery					= new ArrayList<Node>();
-                                List<XPathExpression> listXPathExpressions	= this.getContextSelectorValues(requestAttributes);
-                                if (listXPathExpressions == null) {
-                                        listNodesToQuery.add(nodeContentRoot);
-                                } else {
-                                        Iterator<XPathExpression> iterXPathExpressions	= listXPathExpressions.iterator();
-                                        while (iterXPathExpressions.hasNext()) {
-                                                XPathExpression xpathExpression	= iterXPathExpressions.next();
-                                                Node nodeContent	= requestAttributes.getContentNodeByXpathExpression(xpathExpression);
-                                                if (nodeContent != null) {
-                                                        listNodesToQuery.add(nodeContent);
-                                                }
-                                        }
-                                }
-                                
-                                /*
-                                 * If there are any nodes to query, do so now and add the results
-                                 */
-                                if (listNodesToQuery.size() > 0) {
-                                        for (Node nodeToQuery : listNodesToQuery) {
-                                                NodeList nodeList	= null;
-                                                try {
-                                                        XPath xPath	= XPathFactory.newInstance().newXPath();
-                                                        xPath.setNamespaceContext(new NodeNamespaceContext(nodeToQuery.getOwnerDocument()));
-                                                        XPathExpression xPathExpression	= xPath.compile(this.getPath());
-                                                        Node nodeToQueryDocumentRoot	= null;
-                                                        try {
-                                                                nodeToQueryDocumentRoot	= DOMUtil.getDirectDocumentChild(nodeToQuery);
-                                                        } catch (DOMStructureException ex) {
-                                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Exception processing context node: " + ex.getMessage()));
-                                                        }
-                                                        nodeList	= (NodeList)xPathExpression.evaluate(nodeToQueryDocumentRoot, XPathConstants.NODESET);
-                                                } catch (XPathExpressionException ex) {
-                                                        if (statusFirstError == null) {
-                                                                statusFirstError	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "XPathExpressionException: " + ex.getMessage());
-                                                        }
-                                                }
-                                                if (nodeList != null && nodeList.getLength() > 0) {
-                                                        for (int i = 0 ; i < nodeList.getLength() ; i++) {
-                                                                AttributeValue<?> attributeValueNode	= null;
-                                                                try {
-                                                                        attributeValueNode	= thisDataType.createAttributeValue(nodeList.item(i));
-                                                                } catch (DataTypeException ex) {
-                                                                        if (statusFirstError == null) {
-                                                                                statusFirstError	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage());
-                                                                        }
-                                                                }
-                                                                if (attributeValueNode != null) {
-                                                                        bagAttributeValues.add(attributeValueNode);
-                                                                } else if (statusFirstError == null) {
-                                                                        statusFirstError	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Unable to convert node to " + this.getDataTypeId().toString());
-                                                                }
-                                                        }
-                                                }
-                                        }
-                                }
-                        }
-                        
-                }
-                
-                if (bagAttributeValues.size() == 0) {
-                        if (statusFirstError == null) {
-                                return this.getEmptyResult("No Content found", null);
-                        } else {
-                                return ExpressionResult.newError(statusFirstError);
-                        }
+        /*
+         * Section 5.30 of the XACML 3.0 specification is a little vague about how to use the
+         * ContextSelectorId in the face of having multiple Attributes elements with the same CategoryId.  My interpretation
+         * is that each is distinct, so we look for an attribute matching the ContextSelectorId in each matching Attributes element
+         * and use that to search the Content in that particular Attributes element.  If either an Attribute matching the context selector id
+         * is not found or there is no Content, then that particular Attributes element is skipped.
+         */
+        Bag bagAttributeValues						= new Bag();
+        StdStatus statusFirstError					= null;
+        while (iterRequestAttributes.hasNext()) {
+            RequestAttributes requestAttributes	= iterRequestAttributes.next();
+
+            /*
+             * See if we have a Content element to query.
+             */
+            Node nodeContentRoot	= requestAttributes.getContentRoot();
+            if (nodeContentRoot != null) {
+                List<Node> listNodesToQuery					= new ArrayList<Node>();
+                List<XPathExpression> listXPathExpressions	= this.getContextSelectorValues(requestAttributes);
+                if (listXPathExpressions == null) {
+                    listNodesToQuery.add(nodeContentRoot);
                 } else {
-                        return ExpressionResult.newBag(bagAttributeValues);
+                    Iterator<XPathExpression> iterXPathExpressions	= listXPathExpressions.iterator();
+                    while (iterXPathExpressions.hasNext()) {
+                        XPathExpression xpathExpression	= iterXPathExpressions.next();
+                        Node nodeContent	= requestAttributes.getContentNodeByXpathExpression(xpathExpression);
+                        if (nodeContent != null) {
+                            listNodesToQuery.add(nodeContent);
+                        }
+                    }
                 }
+
+                /*
+                 * If there are any nodes to query, do so now and add the results
+                 */
+                if (listNodesToQuery.size() > 0) {
+                    for (Node nodeToQuery : listNodesToQuery) {
+                        NodeList nodeList	= null;
+                        try {
+                            XPath xPath	= XPathFactory.newInstance().newXPath();
+                            xPath.setNamespaceContext(new NodeNamespaceContext(nodeToQuery.getOwnerDocument()));
+                            XPathExpression xPathExpression	= xPath.compile(this.getPath());
+                            Node nodeToQueryDocumentRoot	= null;
+                            try {
+                                nodeToQueryDocumentRoot	= DOMUtil.getDirectDocumentChild(nodeToQuery);
+                            } catch (DOMStructureException ex) {
+                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Exception processing context node: " + ex.getMessage()));
+                            }
+                            nodeList	= (NodeList)xPathExpression.evaluate(nodeToQueryDocumentRoot, XPathConstants.NODESET);
+                        } catch (XPathExpressionException ex) {
+                            if (statusFirstError == null) {
+                                statusFirstError	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "XPathExpressionException: " + ex.getMessage());
+                            }
+                        }
+                        if (nodeList != null && nodeList.getLength() > 0) {
+                            for (int i = 0 ; i < nodeList.getLength() ; i++) {
+                                AttributeValue<?> attributeValueNode	= null;
+                                try {
+                                    attributeValueNode	= thisDataType.createAttributeValue(nodeList.item(i));
+                                } catch (DataTypeException ex) {
+                                    if (statusFirstError == null) {
+                                        statusFirstError	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage());
+                                    }
+                                }
+                                if (attributeValueNode != null) {
+                                    bagAttributeValues.add(attributeValueNode);
+                                } else if (statusFirstError == null) {
+                                    statusFirstError	= new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Unable to convert node to " + this.getDataTypeId().toString());
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getContextSelectorId()) != null) {
-                        stringBuilder.append(",contextSelectorId=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getPath()) != null) {
-                        stringBuilder.append(",path=");
-                        stringBuilder.append((String)objectToDump);
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+
+        if (bagAttributeValues.size() == 0) {
+            if (statusFirstError == null) {
+                return this.getEmptyResult("No Content found", null);
+            } else {
+                return ExpressionResult.newError(statusFirstError);
+            }
+        } else {
+            return ExpressionResult.newBag(bagAttributeValues);
         }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getContextSelectorId()) != null) {
+            stringBuilder.append(",contextSelectorId=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getPath()) != null) {
+            stringBuilder.append(",path=");
+            stringBuilder.append((String)objectToDump);
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeValueExpression.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeValueExpression.java
index 2f8c567..850d9fc 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeValueExpression.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/AttributeValueExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,67 +43,67 @@
 /**
  * AttributeValueExpression extends {@link com.att.research.xacmlatt.pdp.policy.Expression} to represent XACML
  * AttributeValue elements in an Expression context.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class AttributeValueExpression extends Expression {
-        private AttributeValue<?> attributeValue;
-        
-        public AttributeValueExpression(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
+    private AttributeValue<?> attributeValue;
+
+    public AttributeValueExpression(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public AttributeValueExpression(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public AttributeValueExpression() {
+    }
+
+    public AttributeValueExpression(AttributeValue<?> attributeValueIn) {
+        this.attributeValue	= attributeValueIn;
+    }
+
+    public AttributeValue<?> getAttributeValue() {
+        return this.attributeValue;
+    }
+
+    public void setAttributeValue(AttributeValue<?> attributeValueIn) {
+        this.attributeValue	= attributeValueIn;
+    }
+
+    @Override
+    public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
 
-        public AttributeValueExpression(StatusCode statusCodeIn) {
-                super(statusCodeIn);
-        }
+        return ExpressionResult.newSingle(this.getAttributeValue());
+    }
 
-        public AttributeValueExpression() {
+    @Override
+    protected boolean validateComponent() {
+        if (this.getAttributeValue() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeValue");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
-        
-        public AttributeValueExpression(AttributeValue<?> attributeValueIn) {
-                this.attributeValue	= attributeValueIn;
-        }
-        
-        public AttributeValue<?> getAttributeValue() {
-                return this.attributeValue;
-        }
-        
-        public void setAttributeValue(AttributeValue<?> attributeValueIn) {
-                this.attributeValue	= attributeValueIn;
-        }
-        
-        @Override
-        public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                return ExpressionResult.newSingle(this.getAttributeValue());
-        }
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getAttributeValue() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeValue");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        Object objectToDump;
+        if ((objectToDump = this.getAttributeValue()) != null) {
+            stringBuilder.append("attributeValue=");
+            stringBuilder.append(objectToDump.toString());
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                Object objectToDump;
-                if ((objectToDump = this.getAttributeValue()) != null) {
-                        stringBuilder.append("attributeValue=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/Function.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/Function.java
index d4c80a3..83e9dc7 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/Function.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/Function.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,79 +47,79 @@
 
 /**
  * Function extends {@link com.att.research.xacmlatt.pdp.policy.Expression} to implement the XACML Function element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class Function extends Expression {
-        private Identifier functionId;
-        private AttributeValue<URI> attributeValue;
-        private ExpressionResult expressionResultOk;
-        
-        protected ExpressionResult getExpressionResultOk() {
-                if (this.expressionResultOk == null) {
-                        this.expressionResultOk	= ExpressionResult.newSingle(this.getAttributeValue());
-                }
-                return this.expressionResultOk;
-        }
-        
-        public Function(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
-        }
+    private Identifier functionId;
+    private AttributeValue<URI> attributeValue;
+    private ExpressionResult expressionResultOk;
 
-        public Function(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+    protected ExpressionResult getExpressionResultOk() {
+        if (this.expressionResultOk == null) {
+            this.expressionResultOk	= ExpressionResult.newSingle(this.getAttributeValue());
         }
+        return this.expressionResultOk;
+    }
 
-        public Function() {
-        }
-        
-        public Function(Identifier functionIdIn) {
-                this.functionId	= functionIdIn;
-        }
-        
-        public Identifier getFunctionId() {
-                return this.functionId;
-        }
-        
-        public void setFunctionId(Identifier identifier) {
-                this.functionId	= identifier;
-                this.attributeValue	= null;
-                this.expressionResultOk	= null;
-        }
-        
-        public AttributeValue<URI> getAttributeValue() {
-                if (this.attributeValue == null) {
-                        Identifier thisFunctionId	= this.getFunctionId();
-                        if (thisFunctionId != null) {
-                                try {
-                                        this.attributeValue	= DataTypes.DT_ANYURI.createAttributeValue(thisFunctionId);
-                                } catch (DataTypeException ex) {
-                                        this.attributeValue	= null;
-                                }
-                        }
-                }
-                return this.attributeValue;
-        }
+    public Function(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
 
-        @Override
-        public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                } else {
-                        return this.getExpressionResultOk();
-                }
-        }
+    public Function(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getFunctionId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing FunctionId");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
+    public Function() {
+    }
+
+    public Function(Identifier functionIdIn) {
+        this.functionId	= functionIdIn;
+    }
+
+    public Identifier getFunctionId() {
+        return this.functionId;
+    }
+
+    public void setFunctionId(Identifier identifier) {
+        this.functionId	= identifier;
+        this.attributeValue	= null;
+        this.expressionResultOk	= null;
+    }
+
+    public AttributeValue<URI> getAttributeValue() {
+        if (this.attributeValue == null) {
+            Identifier thisFunctionId	= this.getFunctionId();
+            if (thisFunctionId != null) {
+                try {
+                    this.attributeValue	= DataTypes.DT_ANYURI.createAttributeValue(thisFunctionId);
+                } catch (DataTypeException ex) {
+                    this.attributeValue	= null;
                 }
+            }
         }
+        return this.attributeValue;
+    }
+
+    @Override
+    public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
+        } else {
+            return this.getExpressionResultOk();
+        }
+    }
+
+    @Override
+    protected boolean validateComponent() {
+        if (this.getFunctionId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing FunctionId");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
+        }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/VariableReference.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/VariableReference.java
index 5c8ae33..f055950 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/VariableReference.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/VariableReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,124 +46,124 @@
 /**
  * VariableReference extends {@link com.att.research.xacmlatt.pdp.policy.Expression} to implement the XACML VariableReference
  * element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class VariableReference extends Expression implements Traceable {
-        private static final ExpressionResult ER_SE_NO_EXPRESSION	= ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Expression for VariableDefinition"));
-        
-        private Policy policy;
-        private String variableId;
-        private VariableDefinition variableDefinition;
-        
-        protected VariableDefinition getVariableDefinition() {
-                if (this.variableDefinition == null) {
-                        Policy thisPolicy	= this.getPolicy();
-                        if (thisPolicy != null) {
-                                String thisVariableId	= this.getVariableId();
-                                if (thisVariableId != null) {
-                                        this.variableDefinition	= thisPolicy.getVariableDefinition(thisVariableId);
-                                }
-                        }
+    private static final ExpressionResult ER_SE_NO_EXPRESSION	= ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Expression for VariableDefinition"));
+
+    private Policy policy;
+    private String variableId;
+    private VariableDefinition variableDefinition;
+
+    protected VariableDefinition getVariableDefinition() {
+        if (this.variableDefinition == null) {
+            Policy thisPolicy	= this.getPolicy();
+            if (thisPolicy != null) {
+                String thisVariableId	= this.getVariableId();
+                if (thisVariableId != null) {
+                    this.variableDefinition	= thisPolicy.getVariableDefinition(thisVariableId);
                 }
-                return this.variableDefinition;
+            }
         }
-        
-        public VariableReference(StatusCode statusCodeIn, String statusMessageIn) {
-                super(statusCodeIn, statusMessageIn);
+        return this.variableDefinition;
+    }
+
+    public VariableReference(StatusCode statusCodeIn, String statusMessageIn) {
+        super(statusCodeIn, statusMessageIn);
+    }
+
+    public VariableReference(StatusCode statusCodeIn) {
+        super(statusCodeIn);
+    }
+
+    public VariableReference() {
+    }
+
+    public VariableReference(Policy policyIn, String variableIdIn) {
+        this.policy		= policyIn;
+        this.variableId	= variableIdIn;
+    }
+
+    public Policy getPolicy() {
+        return this.policy;
+    }
+
+    public void setPolicy(Policy policyIn) {
+        this.policy	= policyIn;
+    }
+
+    public String getVariableId() {
+        return this.variableId;
+    }
+
+    public void setVariableId(String variableIdIn) {
+        this.variableId	= variableIdIn;
+    }
+
+    @Override
+    public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
+        if (!this.validate()) {
+            return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
         }
 
-        public VariableReference(StatusCode statusCodeIn) {
-                super(statusCodeIn);
+        VariableDefinition variableDefinition	= this.getVariableDefinition();
+        if (variableDefinition == null) {
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No VariableDefinition found for \"" + this.getVariableId() + "\""));
+        }
+        Expression expression					= variableDefinition.getExpression();
+        if (expression == null) {
+            return ER_SE_NO_EXPRESSION;
         }
 
-        public VariableReference() {
-        }
-        
-        public VariableReference(Policy policyIn, String variableIdIn) {
-                this.policy		= policyIn;
-                this.variableId	= variableIdIn;
-        }
-        
-        public Policy getPolicy() {
-                return this.policy;
-        }
-        
-        public void setPolicy(Policy policyIn) {
-                this.policy	= policyIn;
-        }
-        
-        public String getVariableId() {
-                return this.variableId;
-        }
-        
-        public void setVariableId(String variableIdIn) {
-                this.variableId	= variableIdIn;
+        ExpressionResult result = expression.evaluate(evaluationContext, policyDefaults);
+
+        if (evaluationContext.isTracing()) {
+            evaluationContext.trace(new StdTraceEvent<ExpressionResult>("Variable", this, result));
         }
 
-        @Override
-        public ExpressionResult evaluate(EvaluationContext evaluationContext, PolicyDefaults policyDefaults) throws EvaluationException {
-                if (!this.validate()) {
-                        return ExpressionResult.newError(new StdStatus(this.getStatusCode(), this.getStatusMessage()));
-                }
-                
-                VariableDefinition variableDefinition	= this.getVariableDefinition();
-                if (variableDefinition == null) {
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No VariableDefinition found for \"" + this.getVariableId() + "\""));
-                }
-                Expression expression					= variableDefinition.getExpression();
-                if (expression == null) {
-                        return ER_SE_NO_EXPRESSION;
-                }
-                
-                ExpressionResult result = expression.evaluate(evaluationContext, policyDefaults);
-                
-                if (evaluationContext.isTracing()) {
-                        evaluationContext.trace(new StdTraceEvent<ExpressionResult>("Variable", this, result));
-                }
-                
-                return result;
-        }
+        return result;
+    }
 
-        @Override
-        protected boolean validateComponent() {
-                if (this.getVariableId() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing VariableId");
-                        return false;
-                } else if (this.getPolicy() == null) {
-                        this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "VariableReference not in a Policy");
-                        return false;
-                } else {
-                        this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
-                        return true;
-                }
+    @Override
+    protected boolean validateComponent() {
+        if (this.getVariableId() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing VariableId");
+            return false;
+        } else if (this.getPolicy() == null) {
+            this.setStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "VariableReference not in a Policy");
+            return false;
+        } else {
+            this.setStatus(StdStatusCode.STATUS_CODE_OK, null);
+            return true;
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                String stringToDump;
-                if ((stringToDump = this.getVariableId()) != null) {
-                        stringBuilder.append(",variableId=");
-                        stringBuilder.append(stringToDump);
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    }
 
-        @Override
-        public String getTraceId() {
-                return this.variableId;
-        }
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
 
-        @Override
-        public Traceable getCause() {
-                return this.policy;
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        String stringToDump;
+        if ((stringToDump = this.getVariableId()) != null) {
+            stringBuilder.append(",variableId=");
+            stringBuilder.append(stringToDump);
         }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public String getTraceId() {
+        return this.variableId;
+    }
+
+    @Override
+    public Traceable getCause() {
+        return this.policy;
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/package-info.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/package-info.java
index 33b2ef7..49024d6 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/package-info.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/expressions/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacmlatt.pdp.policy.expressions contains class definitions that represent specific XACML elements sub-typed from
  * the Expression element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/package-info.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/package-info.java
index 275995c..c76527a 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/package-info.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/policy/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacmlatt.pdp.policy contains class definitions that represent a XACML 3.0 Policy such that it can be
  * used to implement the {@link com.att.research.xacml.pdp.PDPEngine} <code>decide</code> method.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdCombiningAlgorithmFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdCombiningAlgorithmFactory.java
index 9115e92..fc6bb30 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdCombiningAlgorithmFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdCombiningAlgorithmFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,67 +43,67 @@
 
 /**
  * StdCombiningAlgorithmFactory extends {@link com.att.research.xacmlatt.pdp.policy.CombiningAlgorithmFactory} to implement
- * a mapping from {@link com.att.research.xacml.api.Identifier}s to 
+ * a mapping from {@link com.att.research.xacml.api.Identifier}s to
  * the standard {@link com.att.research.xacmlatt.pdp.policy.CombiningAlgorithm} implementations.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class StdCombiningAlgorithmFactory extends CombiningAlgorithmFactory {
-        private static Map<Identifier,CombiningAlgorithm<Rule>> 				mapRuleCombiningAlgorithms	
-                = new HashMap<Identifier,CombiningAlgorithm<Rule>>();
-        private static Map<Identifier,CombiningAlgorithm<PolicySetChild>> 		mapPolicyCombiningAlgorithms	
-                = new HashMap<Identifier,CombiningAlgorithm<PolicySetChild>>();
-        private static boolean needInit	= true;
-        
-        protected static void registerRuleCombiningAlgorithm(CombiningAlgorithm<Rule> ruleCombiningAlgorithm) {
-                mapRuleCombiningAlgorithms.put(ruleCombiningAlgorithm.getId(), ruleCombiningAlgorithm);
-        }
-        
-        protected static void registerPolicyCombiningAlgorithm(CombiningAlgorithm<PolicySetChild> policyCombiningAlgorithm) {
-                mapPolicyCombiningAlgorithms.put(policyCombiningAlgorithm.getId(), policyCombiningAlgorithm);
-        }
-        
-        @SuppressWarnings("unchecked")
-        private static void initMap() {
+    private static Map<Identifier,CombiningAlgorithm<Rule>> 				mapRuleCombiningAlgorithms
+        = new HashMap<Identifier,CombiningAlgorithm<Rule>>();
+    private static Map<Identifier,CombiningAlgorithm<PolicySetChild>> 		mapPolicyCombiningAlgorithms
+        = new HashMap<Identifier,CombiningAlgorithm<PolicySetChild>>();
+    private static boolean needInit	= true;
+
+    protected static void registerRuleCombiningAlgorithm(CombiningAlgorithm<Rule> ruleCombiningAlgorithm) {
+        mapRuleCombiningAlgorithms.put(ruleCombiningAlgorithm.getId(), ruleCombiningAlgorithm);
+    }
+
+    protected static void registerPolicyCombiningAlgorithm(CombiningAlgorithm<PolicySetChild> policyCombiningAlgorithm) {
+        mapPolicyCombiningAlgorithms.put(policyCombiningAlgorithm.getId(), policyCombiningAlgorithm);
+    }
+
+    @SuppressWarnings("unchecked")
+    private static void initMap() {
+        if (needInit) {
+            synchronized(mapRuleCombiningAlgorithms) {
                 if (needInit) {
-                        synchronized(mapRuleCombiningAlgorithms) {
-                                if (needInit) {
-                                        needInit	= false;
-                                        Field[]	declaredFields	= StdCombiningAlgorithms.class.getFields();
-                                        for (Field field : declaredFields) {
-                                                if (Modifier.isStatic(field.getModifiers()) &&
-                                                        Modifier.isPublic(field.getModifiers()) &&
-                                                        field.getName().startsWith(StdCombiningAlgorithms.PREFIX_CA) &&
-                                                        CombiningAlgorithm.class.isAssignableFrom(field.getType())
-                                                                ) {
-                                                        try {
-                                                                if (field.getName().startsWith(StdCombiningAlgorithms.PREFIX_RULE)) {
-                                                                        registerRuleCombiningAlgorithm((CombiningAlgorithm<Rule>)field.get(null));
-                                                                } else if (field.getName().startsWith(StdCombiningAlgorithms.PREFIX_POLICY)) {
-                                                                        registerPolicyCombiningAlgorithm((CombiningAlgorithm<PolicySetChild>)field.get(null));
-                                                                }
-                                                        } catch (IllegalAccessException ex) {
-                                                                
-                                                        }
-                                                }
-                                        }
+                    needInit	= false;
+                    Field[]	declaredFields	= StdCombiningAlgorithms.class.getFields();
+                    for (Field field : declaredFields) {
+                        if (Modifier.isStatic(field.getModifiers()) &&
+                                Modifier.isPublic(field.getModifiers()) &&
+                                field.getName().startsWith(StdCombiningAlgorithms.PREFIX_CA) &&
+                                CombiningAlgorithm.class.isAssignableFrom(field.getType())
+                           ) {
+                            try {
+                                if (field.getName().startsWith(StdCombiningAlgorithms.PREFIX_RULE)) {
+                                    registerRuleCombiningAlgorithm((CombiningAlgorithm<Rule>)field.get(null));
+                                } else if (field.getName().startsWith(StdCombiningAlgorithms.PREFIX_POLICY)) {
+                                    registerPolicyCombiningAlgorithm((CombiningAlgorithm<PolicySetChild>)field.get(null));
                                 }
+                            } catch (IllegalAccessException ex) {
+
+                            }
                         }
+                    }
                 }
+            }
         }
-        
-        public StdCombiningAlgorithmFactory() {
-                initMap();
-        }
+    }
 
-        @Override
-        public CombiningAlgorithm<Rule> getRuleCombiningAlgorithm(Identifier combiningAlgorithmId) {
-                return mapRuleCombiningAlgorithms.get(combiningAlgorithmId);
-        }
+    public StdCombiningAlgorithmFactory() {
+        initMap();
+    }
 
-        @Override
-        public CombiningAlgorithm<PolicySetChild> getPolicyCombiningAlgorithm(Identifier combiningAlgorithmId) {
-                return mapPolicyCombiningAlgorithms.get(combiningAlgorithmId);
-        }	
+    @Override
+    public CombiningAlgorithm<Rule> getRuleCombiningAlgorithm(Identifier combiningAlgorithmId) {
+        return mapRuleCombiningAlgorithms.get(combiningAlgorithmId);
+    }
+
+    @Override
+    public CombiningAlgorithm<PolicySetChild> getPolicyCombiningAlgorithm(Identifier combiningAlgorithmId) {
+        return mapPolicyCombiningAlgorithms.get(combiningAlgorithmId);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdCombiningAlgorithms.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdCombiningAlgorithms.java
index 6b89b20..6ce6972 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdCombiningAlgorithms.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdCombiningAlgorithms.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -51,95 +51,95 @@
 /**
  * StdCombiningAlgorithms contains single instances of each of the {@link com.att.research.xacmlatt.pdp.policy.CombiningAlgorithm}
  * implementations in the {@link com.att.research.xacmlatt.pdp.std.combiners} package.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class StdCombiningAlgorithms {
 
-        protected StdCombiningAlgorithms() {
-        }
-        
-        public static final String	PREFIX_CA		= "CA_";
-        public static final String	PREFIX_RULE		= PREFIX_CA + "RULE_";
-        public static final String	PREFIX_POLICY	= PREFIX_CA + "POLICY_";
+    protected StdCombiningAlgorithms() {
+    }
 
-        // C.2 Deny-overrides
-        public static final CombiningAlgorithm<Rule> CA_RULE_DENY_OVERRIDES				
-                = new DenyOverrides<Rule>(XACML3.ID_RULE_DENY_OVERRIDES);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_DENY_OVERRIDES	
-                = new DenyOverrides<PolicySetChild>(XACML3.ID_POLICY_DENY_OVERRIDES);
-        
-        // C.3 Ordered-deny-overrides
-        public static final CombiningAlgorithm<Rule> CA_RULE_ORDERED_DENY_OVERRIDES
-                = new DenyOverrides<Rule>(XACML3.ID_RULE_ORDERED_DENY_OVERRIDES);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_ORDERED_DENY_OVERRIDES
-                = new DenyOverrides<PolicySetChild>(XACML3.ID_POLICY_ORDERED_DENY_OVERRIDES);
-        
-        // C.4 Permit-overrides
-        public static final CombiningAlgorithm<Rule> CA_RULE_PERMIT_OVERRIDES				
-                = new PermitOverrides<Rule>(XACML3.ID_RULE_PERMIT_OVERRIDES);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_PERMIT_OVERRIDES	
-                = new PermitOverrides<PolicySetChild>(XACML3.ID_POLICY_PERMIT_OVERRIDES);
-        
-        // C.5 Ordered-permit-overrides
-        public static final CombiningAlgorithm<Rule> CA_RULE_ORDERED_PERMIT_OVERRIDES
-                = new PermitOverrides<Rule>(XACML3.ID_RULE_ORDERED_PERMIT_OVERRIDES);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_ORDERED_PERMIT_OVERRIDES
-                = new PermitOverrides<PolicySetChild>(XACML3.ID_POLICY_ORDERED_PERMIT_OVERRIDES);
-        
-        // C.6 Deny-unless-permit
-        public static final CombiningAlgorithm<Rule> CA_RULE_DENY_UNLESS_PERMIT
-                = new DenyUnlessPermit<Rule>(XACML3.ID_RULE_DENY_UNLESS_PERMIT);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_DENY_UNLESS_PERMIT
-                = new DenyUnlessPermit<PolicySetChild>(XACML3.ID_POLICY_DENY_UNLESS_PERMIT);
-        
-        // C.7 Permit-unles-deny
-        public static final CombiningAlgorithm<Rule> CA_RULE_PERMIT_UNLESS_DENY
-                = new PermitUnlessDeny<Rule>(XACML3.ID_RULE_PERMIT_UNLESS_DENY);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_PERMIT_UNLESS_DENY
-                = new PermitUnlessDeny<PolicySetChild>(XACML3.ID_POLICY_PERMIT_UNLESS_DENY);
-        
-        // C.8 First-applicable
-        public static final CombiningAlgorithm<Rule> CA_RULE_FIRST_APPLICABLE
-                = new FirstApplicable<Rule>(XACML1.ID_RULE_FIRST_APPLICABLE);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_FIRST_APPLICABLE
-                = new FirstApplicable<PolicySetChild>(XACML1.ID_POLICY_FIRST_APPLICABLE);
-        
-        // C.9 Only-one-applicable
-        //public static final CombiningAlgorithm<Rule> CA_RULE_ONLY_ONE_APPLICABLE
-        //	= new OnlyOneApplicable<Rule>(XACML1.ID_RULE_ONLY_ONE_APPLICABLE);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_ONLY_ONE_APPLICABLE
-                = new OnlyOneApplicable(XACML1.ID_POLICY_ONLY_ONE_APPLICABLE);
-        
-        // C.10 Legacy Deny-overrides
-        public static final CombiningAlgorithm<Rule> CA_RULE_LEGACY_DENY_OVERRIDES		
-                = new LegacyDenyOverridesRule(XACML1.ID_RULE_DENY_OVERRIDES);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_LEGACY_DENY_OVERRIDES	
-                = new LegacyDenyOverridesPolicy(XACML1.ID_POLICY_DENY_OVERRIDES);
-        
-        // C.11 Legacy Ordered-deny-overrides
-        public static final CombiningAlgorithm<Rule> CA_RULE_LEGACY_ORDERED_DENY_OVERRIDES		
-                = new LegacyDenyOverridesRule(XACML1.ID_RULE_ORDERED_DENY_OVERRIDES);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_LEGACY_ORDERED_DENY_OVERRIDES	
-                = new LegacyDenyOverridesPolicy(XACML1.ID_POLICY_ORDERED_DENY_OVERRIDES);
-        
-        // C.12 Legacy Permit-overrides
-        public static final CombiningAlgorithm<Rule> CA_RULE_LEGACY_PERMIT_OVERRIDES		
-                = new LegacyPermitOverridesRule(XACML1.ID_RULE_PERMIT_OVERRIDES);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_LEGACY_PERMIT_OVERRIDES	
-                = new LegacyPermitOverridesPolicy(XACML1.ID_POLICY_PERMIT_OVERRIDES);
-        
-        // C.13 Legacy Ordered-permit-overrides
-        public static final CombiningAlgorithm<Rule> CA_RULE_LEGACY_ORDERED_PERMIT_OVERRIDES		
-                = new LegacyPermitOverridesRule(XACML1.ID_RULE_ORDERED_PERMIT_OVERRIDES);
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_LEGACY_ORDERED_PERMIT_OVERRIDES	
-                = new LegacyPermitOverridesPolicy(XACML1.ID_POLICY_ORDERED_PERMIT_OVERRIDES);
-        
-        //
-        // Custom AT&T Policy Combing Algorithms
-        //
-        public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_COMBINED_PERMIT_OVERRIDES
-                = new CombinedPermitOverrides<PolicySetChild>(ATTPDPProperties.ID_POLICY_COMBINEDPERMITOVERRIDES);
-        
+    public static final String	PREFIX_CA		= "CA_";
+    public static final String	PREFIX_RULE		= PREFIX_CA + "RULE_";
+    public static final String	PREFIX_POLICY	= PREFIX_CA + "POLICY_";
+
+    // C.2 Deny-overrides
+    public static final CombiningAlgorithm<Rule> CA_RULE_DENY_OVERRIDES
+        = new DenyOverrides<Rule>(XACML3.ID_RULE_DENY_OVERRIDES);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_DENY_OVERRIDES
+        = new DenyOverrides<PolicySetChild>(XACML3.ID_POLICY_DENY_OVERRIDES);
+
+    // C.3 Ordered-deny-overrides
+    public static final CombiningAlgorithm<Rule> CA_RULE_ORDERED_DENY_OVERRIDES
+        = new DenyOverrides<Rule>(XACML3.ID_RULE_ORDERED_DENY_OVERRIDES);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_ORDERED_DENY_OVERRIDES
+        = new DenyOverrides<PolicySetChild>(XACML3.ID_POLICY_ORDERED_DENY_OVERRIDES);
+
+    // C.4 Permit-overrides
+    public static final CombiningAlgorithm<Rule> CA_RULE_PERMIT_OVERRIDES
+        = new PermitOverrides<Rule>(XACML3.ID_RULE_PERMIT_OVERRIDES);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_PERMIT_OVERRIDES
+        = new PermitOverrides<PolicySetChild>(XACML3.ID_POLICY_PERMIT_OVERRIDES);
+
+    // C.5 Ordered-permit-overrides
+    public static final CombiningAlgorithm<Rule> CA_RULE_ORDERED_PERMIT_OVERRIDES
+        = new PermitOverrides<Rule>(XACML3.ID_RULE_ORDERED_PERMIT_OVERRIDES);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_ORDERED_PERMIT_OVERRIDES
+        = new PermitOverrides<PolicySetChild>(XACML3.ID_POLICY_ORDERED_PERMIT_OVERRIDES);
+
+    // C.6 Deny-unless-permit
+    public static final CombiningAlgorithm<Rule> CA_RULE_DENY_UNLESS_PERMIT
+        = new DenyUnlessPermit<Rule>(XACML3.ID_RULE_DENY_UNLESS_PERMIT);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_DENY_UNLESS_PERMIT
+        = new DenyUnlessPermit<PolicySetChild>(XACML3.ID_POLICY_DENY_UNLESS_PERMIT);
+
+    // C.7 Permit-unles-deny
+    public static final CombiningAlgorithm<Rule> CA_RULE_PERMIT_UNLESS_DENY
+        = new PermitUnlessDeny<Rule>(XACML3.ID_RULE_PERMIT_UNLESS_DENY);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_PERMIT_UNLESS_DENY
+        = new PermitUnlessDeny<PolicySetChild>(XACML3.ID_POLICY_PERMIT_UNLESS_DENY);
+
+    // C.8 First-applicable
+    public static final CombiningAlgorithm<Rule> CA_RULE_FIRST_APPLICABLE
+        = new FirstApplicable<Rule>(XACML1.ID_RULE_FIRST_APPLICABLE);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_FIRST_APPLICABLE
+        = new FirstApplicable<PolicySetChild>(XACML1.ID_POLICY_FIRST_APPLICABLE);
+
+    // C.9 Only-one-applicable
+    //public static final CombiningAlgorithm<Rule> CA_RULE_ONLY_ONE_APPLICABLE
+    //	= new OnlyOneApplicable<Rule>(XACML1.ID_RULE_ONLY_ONE_APPLICABLE);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_ONLY_ONE_APPLICABLE
+        = new OnlyOneApplicable(XACML1.ID_POLICY_ONLY_ONE_APPLICABLE);
+
+    // C.10 Legacy Deny-overrides
+    public static final CombiningAlgorithm<Rule> CA_RULE_LEGACY_DENY_OVERRIDES
+        = new LegacyDenyOverridesRule(XACML1.ID_RULE_DENY_OVERRIDES);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_LEGACY_DENY_OVERRIDES
+        = new LegacyDenyOverridesPolicy(XACML1.ID_POLICY_DENY_OVERRIDES);
+
+    // C.11 Legacy Ordered-deny-overrides
+    public static final CombiningAlgorithm<Rule> CA_RULE_LEGACY_ORDERED_DENY_OVERRIDES
+        = new LegacyDenyOverridesRule(XACML1.ID_RULE_ORDERED_DENY_OVERRIDES);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_LEGACY_ORDERED_DENY_OVERRIDES
+        = new LegacyDenyOverridesPolicy(XACML1.ID_POLICY_ORDERED_DENY_OVERRIDES);
+
+    // C.12 Legacy Permit-overrides
+    public static final CombiningAlgorithm<Rule> CA_RULE_LEGACY_PERMIT_OVERRIDES
+        = new LegacyPermitOverridesRule(XACML1.ID_RULE_PERMIT_OVERRIDES);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_LEGACY_PERMIT_OVERRIDES
+        = new LegacyPermitOverridesPolicy(XACML1.ID_POLICY_PERMIT_OVERRIDES);
+
+    // C.13 Legacy Ordered-permit-overrides
+    public static final CombiningAlgorithm<Rule> CA_RULE_LEGACY_ORDERED_PERMIT_OVERRIDES
+        = new LegacyPermitOverridesRule(XACML1.ID_RULE_ORDERED_PERMIT_OVERRIDES);
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_LEGACY_ORDERED_PERMIT_OVERRIDES
+        = new LegacyPermitOverridesPolicy(XACML1.ID_POLICY_ORDERED_PERMIT_OVERRIDES);
+
+    //
+    // Custom AT&T Policy Combing Algorithms
+    //
+    public static final CombiningAlgorithm<PolicySetChild> CA_POLICY_COMBINED_PERMIT_OVERRIDES
+        = new CombinedPermitOverrides<PolicySetChild>(ATTPDPProperties.ID_POLICY_COMBINEDPERMITOVERRIDES);
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdEvaluationContext.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdEvaluationContext.java
index 4efb273..0a2d8bd 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdEvaluationContext.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdEvaluationContext.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -50,121 +50,121 @@
 /**
  * StdEvaluationContext implements the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} interface using
  * default factories to load the XACML policies, and get the PIP engines.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class StdEvaluationContext implements EvaluationContext {
-        private Log logger	= LogFactory.getLog(this.getClass());
-        private Properties properties;
-        private Request request;
-        private RequestFinder requestFinder;
-        private PolicyFinder policyFinder;
-        private TraceEngine traceEngine;
-        
-        /**
-         * Creates a new <code>StdEvaluationContext</code> with the given {@link com.att.research.xacml.api.Request} and
-         * {@link com.att.research.xacmlatt.pdp.policy.PolicyDef}.
-         * 
-         * @param requestIn the <code>Request</code>
-         * @param policyDef the <code>PolicyDef</code>
-         */
-        public StdEvaluationContext(Request requestIn, PolicyFinder policyFinderIn, PIPFinder pipFinder, TraceEngine traceEngineIn, Properties properties) {
-                this.properties		= properties;
-                this.request		= requestIn;
-                this.policyFinder	= policyFinderIn;
-                if (traceEngineIn != null) {
-                        this.traceEngine	= traceEngineIn;
+    private Log logger	= LogFactory.getLog(this.getClass());
+    private Properties properties;
+    private Request request;
+    private RequestFinder requestFinder;
+    private PolicyFinder policyFinder;
+    private TraceEngine traceEngine;
+
+    /**
+     * Creates a new <code>StdEvaluationContext</code> with the given {@link com.att.research.xacml.api.Request} and
+     * {@link com.att.research.xacmlatt.pdp.policy.PolicyDef}.
+     *
+     * @param requestIn the <code>Request</code>
+     * @param policyDef the <code>PolicyDef</code>
+     */
+    public StdEvaluationContext(Request requestIn, PolicyFinder policyFinderIn, PIPFinder pipFinder, TraceEngine traceEngineIn, Properties properties) {
+        this.properties		= properties;
+        this.request		= requestIn;
+        this.policyFinder	= policyFinderIn;
+        if (traceEngineIn != null) {
+            this.traceEngine	= traceEngineIn;
+        } else {
+            try {
+                if (this.properties == null) {
+                    this.traceEngine	= TraceEngineFactory.newInstance().getTraceEngine();
                 } else {
-                        try {
-                                if (this.properties == null) {
-                                        this.traceEngine	= TraceEngineFactory.newInstance().getTraceEngine();
-                                } else {
-                                        this.traceEngine	= TraceEngineFactory.newInstance(this.properties).getTraceEngine(this.properties);
-                                }
-                        } catch (FactoryException ex) {
-                                this.logger.error("FactoryException creating TraceEngine: " + ex.toString(), ex);
-                        }
+                    this.traceEngine	= TraceEngineFactory.newInstance(this.properties).getTraceEngine(this.properties);
                 }
-                
-                if (pipFinder == null) {
-                        this.requestFinder		= new RequestFinder(null, new RequestEngine(requestIn));
-                } else {
-                        if (pipFinder instanceof RequestFinder) {
-                                this.requestFinder	= (RequestFinder)pipFinder;
-                        } else {
-                                this.requestFinder	= new RequestFinder(pipFinder, new RequestEngine(requestIn));
-                        }
-                }
-        }
-        
-        public StdEvaluationContext(Request requestIn, PolicyFinder policyFinderIn, PIPFinder pipFinder, TraceEngine traceEngineIn) {
-                this(requestIn, policyFinderIn, pipFinder, traceEngineIn, null);
-        }
-        
-        public StdEvaluationContext(Request requestIn, PolicyFinder policyFinderIn, PIPFinder pipFinder) {
-                this(requestIn, policyFinderIn, pipFinder, null);
+            } catch (FactoryException ex) {
+                this.logger.error("FactoryException creating TraceEngine: " + ex.toString(), ex);
+            }
         }
 
-        @Override
-        public Request getRequest() {
-                return this.request;
+        if (pipFinder == null) {
+            this.requestFinder		= new RequestFinder(null, new RequestEngine(requestIn));
+        } else {
+            if (pipFinder instanceof RequestFinder) {
+                this.requestFinder	= (RequestFinder)pipFinder;
+            } else {
+                this.requestFinder	= new RequestFinder(pipFinder, new RequestEngine(requestIn));
+            }
         }
+    }
 
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest) throws PIPException {
-                return this.requestFinder.getAttributes(pipRequest, null);
-        }
-        
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
-                return this.requestFinder.getAttributes(pipRequest, exclude);
-        }
-        
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderRoot) throws PIPException {
-                return this.requestFinder.getAttributes(pipRequest, exclude, pipFinderRoot);
-        }
+    public StdEvaluationContext(Request requestIn, PolicyFinder policyFinderIn, PIPFinder pipFinder, TraceEngine traceEngineIn) {
+        this(requestIn, policyFinderIn, pipFinder, traceEngineIn, null);
+    }
 
-        @Override
-        public PolicyFinderResult<PolicyDef> getRootPolicyDef() {
-                return this.policyFinder.getRootPolicyDef(this);
-        }
+    public StdEvaluationContext(Request requestIn, PolicyFinder policyFinderIn, PIPFinder pipFinder) {
+        this(requestIn, policyFinderIn, pipFinder, null);
+    }
 
-        @Override
-        public PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch) {
-                return this.policyFinder.getPolicy(idReferenceMatch);
-        }
+    @Override
+    public Request getRequest() {
+        return this.request;
+    }
 
-        @Override
-        public PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch) {
-                return this.policyFinder.getPolicySet(idReferenceMatch);
-        }
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest) throws PIPException {
+        return this.requestFinder.getAttributes(pipRequest, null);
+    }
 
-        @Override
-        public void trace(TraceEvent<?> traceEvent) {
-                if (this.traceEngine != null) {
-                        this.traceEngine.trace(traceEvent);
-                }
-        }
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
+        return this.requestFinder.getAttributes(pipRequest, exclude);
+    }
 
-        @Override
-        public boolean isTracing() {
-                return (this.traceEngine == null ? false : this.traceEngine.isTracing());
-        }
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderRoot) throws PIPException {
+        return this.requestFinder.getAttributes(pipRequest, exclude, pipFinderRoot);
+    }
 
-        @Override
-        public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
-                return this.requestFinder.getMatchingAttributes(pipRequest, exclude);
-        }
+    @Override
+    public PolicyFinderResult<PolicyDef> getRootPolicyDef() {
+        return this.policyFinder.getRootPolicyDef(this);
+    }
 
-        @Override
-        public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
-                return this.requestFinder.getMatchingAttributes(pipRequest, exclude, pipFinderParent);
-        }
+    @Override
+    public PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch) {
+        return this.policyFinder.getPolicy(idReferenceMatch);
+    }
 
-        @Override
-        public Collection<PIPEngine> getPIPEngines() {
-                return this.requestFinder.getPIPEngines();
+    @Override
+    public PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch) {
+        return this.policyFinder.getPolicySet(idReferenceMatch);
+    }
+
+    @Override
+    public void trace(TraceEvent<?> traceEvent) {
+        if (this.traceEngine != null) {
+            this.traceEngine.trace(traceEvent);
         }
+    }
+
+    @Override
+    public boolean isTracing() {
+        return (this.traceEngine == null ? false : this.traceEngine.isTracing());
+    }
+
+    @Override
+    public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
+        return this.requestFinder.getMatchingAttributes(pipRequest, exclude);
+    }
+
+    @Override
+    public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
+        return this.requestFinder.getMatchingAttributes(pipRequest, exclude, pipFinderParent);
+    }
+
+    @Override
+    public Collection<PIPEngine> getPIPEngines() {
+        return this.requestFinder.getPIPEngines();
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdEvaluationContextFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdEvaluationContextFactory.java
index 66014b3..20249ee 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdEvaluationContextFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdEvaluationContextFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,136 +48,136 @@
 /**
  * StdEvaluationContextFactory extends {@link com.att.research.xacmlatt.pdp.eval.EvaluationContextFactory} to implement
  * the <code>getEvaluationContext</code> method with a standard {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext}.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class StdEvaluationContextFactory extends EvaluationContextFactory {
-        private Log logger					= LogFactory.getLog(this.getClass());
-        private PolicyFinder policyFinder;
-        private PIPFinder pipFinder;
-        private TraceEngine traceEngine;
-        
-        /**
-         * Should this properties file be passed onward when instantiating the PolicyFinder 
-         * and the PIPFinder?
-         * 
-         * If yes, then we are assuming that the given properties were not just meant to
-         * configure the evaluation context, but all the other engines that get created.
-         * 
-         * If no, then we are assuming the given properties were only meant for the evaluation
-         * context. But this implementation as of 7/14 does not even need the properties for
-         * configuring itseof.
-         * 
-         * The problem is, the caller does not have the ability to instantiate the PIPFinder
-         * and PolicyFinder engines. This is done internally by the evaluation context. So how
-         * can they have the ability to customize PIP/Policy factories with their own properties 
-         * object if the properties file isn't passed on?
-         * 
-         * Thus, this class will pass on the properties file if given in the constructor.
-         * 
-         */
-        protected Properties properties = null;
+    private Log logger					= LogFactory.getLog(this.getClass());
+    private PolicyFinder policyFinder;
+    private PIPFinder pipFinder;
+    private TraceEngine traceEngine;
 
-        protected PolicyFinder getPolicyFinder() {
+    /**
+     * Should this properties file be passed onward when instantiating the PolicyFinder
+     * and the PIPFinder?
+     *
+     * If yes, then we are assuming that the given properties were not just meant to
+     * configure the evaluation context, but all the other engines that get created.
+     *
+     * If no, then we are assuming the given properties were only meant for the evaluation
+     * context. But this implementation as of 7/14 does not even need the properties for
+     * configuring itseof.
+     *
+     * The problem is, the caller does not have the ability to instantiate the PIPFinder
+     * and PolicyFinder engines. This is done internally by the evaluation context. So how
+     * can they have the ability to customize PIP/Policy factories with their own properties
+     * object if the properties file isn't passed on?
+     *
+     * Thus, this class will pass on the properties file if given in the constructor.
+     *
+     */
+    protected Properties properties = null;
+
+    protected PolicyFinder getPolicyFinder() {
+        if (this.policyFinder == null) {
+            synchronized(this) {
                 if (this.policyFinder == null) {
-                        synchronized(this) {
-                                if (this.policyFinder == null) {
-                                        try {
-                                                if (this.properties == null) {
-                                                        if (this.logger.isDebugEnabled()) {
-                                                                this.logger.debug("getting Policy finder using default properties");
-                                                        }
-                                                        PolicyFinderFactory policyFinderFactory	= PolicyFinderFactory.newInstance();
-                                                        this.policyFinder	= policyFinderFactory.getPolicyFinder();
-                                                } else {
-                                                        if (this.logger.isDebugEnabled()) {
-                                                                this.logger.debug("getting Policy finder using properties: " + this.properties);
-                                                        }
-                                                        PolicyFinderFactory policyFinderFactory	= PolicyFinderFactory.newInstance(this.properties);
-                                                        this.policyFinder	= policyFinderFactory.getPolicyFinder(this.properties);
-                                                }
-                                        } catch (Exception ex) {
-                                                this.logger.error("Exception getting PolicyFinder: " + ex.getMessage(), ex);
-                                        }
-                                }
+                    try {
+                        if (this.properties == null) {
+                            if (this.logger.isDebugEnabled()) {
+                                this.logger.debug("getting Policy finder using default properties");
+                            }
+                            PolicyFinderFactory policyFinderFactory	= PolicyFinderFactory.newInstance();
+                            this.policyFinder	= policyFinderFactory.getPolicyFinder();
+                        } else {
+                            if (this.logger.isDebugEnabled()) {
+                                this.logger.debug("getting Policy finder using properties: " + this.properties);
+                            }
+                            PolicyFinderFactory policyFinderFactory	= PolicyFinderFactory.newInstance(this.properties);
+                            this.policyFinder	= policyFinderFactory.getPolicyFinder(this.properties);
                         }
+                    } catch (Exception ex) {
+                        this.logger.error("Exception getting PolicyFinder: " + ex.getMessage(), ex);
+                    }
                 }
-                return this.policyFinder;
+            }
         }
-        
-        protected PIPFinder getPIPFinder() {
+        return this.policyFinder;
+    }
+
+    protected PIPFinder getPIPFinder() {
+        if (this.pipFinder == null) {
+            synchronized(this) {
                 if (this.pipFinder == null) {
-                        synchronized(this) {
-                                if (this.pipFinder == null) {
-                                        try {
-                                                if (this.properties == null) {
-                                                        if (this.logger.isDebugEnabled()) {
-                                                                this.logger.debug("getting PIP finder using default properties");
-                                                        }
-                                                        PIPFinderFactory pipFinderFactory	= PIPFinderFactory.newInstance();
-                                                        this.pipFinder						= pipFinderFactory.getFinder();
-                                                } else {
-                                                        if (this.logger.isDebugEnabled()) {
-                                                                this.logger.debug("getting PIP finder using properties: " + this.properties);
-                                                        }
-                                                        PIPFinderFactory pipFinderFactory	= PIPFinderFactory.newInstance(this.properties);
-                                                        this.pipFinder						= pipFinderFactory.getFinder(this.properties);
-                                                }
-                                        } catch (Exception ex) {
-                                                this.logger.error("Exception getting PIPFinder: " + ex.toString(), ex);
-                                        }
-                                }
+                    try {
+                        if (this.properties == null) {
+                            if (this.logger.isDebugEnabled()) {
+                                this.logger.debug("getting PIP finder using default properties");
+                            }
+                            PIPFinderFactory pipFinderFactory	= PIPFinderFactory.newInstance();
+                            this.pipFinder						= pipFinderFactory.getFinder();
+                        } else {
+                            if (this.logger.isDebugEnabled()) {
+                                this.logger.debug("getting PIP finder using properties: " + this.properties);
+                            }
+                            PIPFinderFactory pipFinderFactory	= PIPFinderFactory.newInstance(this.properties);
+                            this.pipFinder						= pipFinderFactory.getFinder(this.properties);
                         }
+                    } catch (Exception ex) {
+                        this.logger.error("Exception getting PIPFinder: " + ex.toString(), ex);
+                    }
                 }
-                return this.pipFinder;
+            }
         }
-        
-        protected TraceEngine getTraceEngine() {
+        return this.pipFinder;
+    }
+
+    protected TraceEngine getTraceEngine() {
+        if (this.traceEngine == null) {
+            synchronized(this) {
                 if (this.traceEngine == null) {
-                        synchronized(this) {
-                                if (this.traceEngine == null) {
-                                        try {
-                                                if (this.properties == null) {
-                                                        TraceEngineFactory traceEngineFactory	= TraceEngineFactory.newInstance();
-                                                        this.traceEngine	= traceEngineFactory.getTraceEngine();
-                                                } else {
-                                                        TraceEngineFactory traceEngineFactory	= TraceEngineFactory.newInstance(this.properties);
-                                                        this.traceEngine	= traceEngineFactory.getTraceEngine(this.properties);
-                                                }
-                                        } catch (Exception ex) {
-                                                this.logger.error("Exception getting TraceEngine: " + ex.toString(), ex);
-                                        }
-                                }
+                    try {
+                        if (this.properties == null) {
+                            TraceEngineFactory traceEngineFactory	= TraceEngineFactory.newInstance();
+                            this.traceEngine	= traceEngineFactory.getTraceEngine();
+                        } else {
+                            TraceEngineFactory traceEngineFactory	= TraceEngineFactory.newInstance(this.properties);
+                            this.traceEngine	= traceEngineFactory.getTraceEngine(this.properties);
                         }
+                    } catch (Exception ex) {
+                        this.logger.error("Exception getting TraceEngine: " + ex.toString(), ex);
+                    }
                 }
-                return this.traceEngine;
+            }
         }
-        
-        public StdEvaluationContextFactory() {
-        }
+        return this.traceEngine;
+    }
 
-        public StdEvaluationContextFactory(Properties properties) {
-                this.properties = properties;
-        }
+    public StdEvaluationContextFactory() {
+    }
 
-        @Override
-        public EvaluationContext getEvaluationContext(Request request) {
-                if (this.properties == null) {
-                        return new StdEvaluationContext(request, this.getPolicyFinder(), this.getPIPFinder(), this.getTraceEngine());
-                } else {
-                        return new StdEvaluationContext(request, this.getPolicyFinder(), this.getPIPFinder(), this.getTraceEngine(), this.properties);
-                }
-        }
+    public StdEvaluationContextFactory(Properties properties) {
+        this.properties = properties;
+    }
 
-        @Override
-        public void setPolicyFinder(PolicyFinder policyFinderIn) {
-                this.policyFinder	= policyFinderIn;
+    @Override
+    public EvaluationContext getEvaluationContext(Request request) {
+        if (this.properties == null) {
+            return new StdEvaluationContext(request, this.getPolicyFinder(), this.getPIPFinder(), this.getTraceEngine());
+        } else {
+            return new StdEvaluationContext(request, this.getPolicyFinder(), this.getPIPFinder(), this.getTraceEngine(), this.properties);
         }
+    }
 
-        @Override
-        public void setPIPFinder(PIPFinder pipFinderIn) {
-                this.pipFinder		= pipFinderIn;
-        }
+    @Override
+    public void setPolicyFinder(PolicyFinder policyFinderIn) {
+        this.policyFinder	= policyFinderIn;
+    }
+
+    @Override
+    public void setPIPFinder(PIPFinder pipFinderIn) {
+        this.pipFinder		= pipFinderIn;
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdFunctionDefinitionFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdFunctionDefinitionFactory.java
index 60efc20..64accea 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdFunctionDefinitionFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdFunctionDefinitionFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,48 +43,48 @@
  * StdFunctionDefinitionFactory is the default {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinitionFactory} implementation
  * used if no other <code>FunctionDefinitionFactory</code> implementation is supplied.  It contains all of the standard XACML 3.0
  * functions.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class StdFunctionDefinitionFactory extends FunctionDefinitionFactory {
-        private static Map<Identifier,FunctionDefinition> 	mapFunctionDefinitions	= new HashMap<Identifier,FunctionDefinition>();
-        private static boolean								needMapInit				= true;
-        
-        private static void register(FunctionDefinition functionDefinition) {
-                mapFunctionDefinitions.put(functionDefinition.getId(), functionDefinition);
-        }
-                
-        private static void initMap() {
-                if (needMapInit) {
-                        synchronized(mapFunctionDefinitions) {
-                                if (needMapInit) {
-                                        needMapInit	= false;
-                                        Field[] declaredFields	= StdFunctions.class.getDeclaredFields();
-                                        for (Field field : declaredFields) {
-                                                if (Modifier.isStatic(field.getModifiers()) && 
-                                                        field.getName().startsWith(StdFunctions.FD_PREFIX) &&
-                                                        FunctionDefinition.class.isAssignableFrom(field.getType()) &&
-                                                        Modifier.isPublic(field.getModifiers())
-                                                ) {
-                                                        try {
-                                                                register((FunctionDefinition)(field.get(null)));
-                                                        } catch (IllegalAccessException ex) {
-                                                                
-                                                        }
-                                                }
-                                        }
-                                }
-                        }
-                }
-        }
-        
-        public StdFunctionDefinitionFactory() {
-                initMap();
-        }
+    private static Map<Identifier,FunctionDefinition> 	mapFunctionDefinitions	= new HashMap<Identifier,FunctionDefinition>();
+    private static boolean								needMapInit				= true;
 
-        @Override
-        public FunctionDefinition getFunctionDefinition(Identifier functionId) {
-                return mapFunctionDefinitions.get(functionId);
+    private static void register(FunctionDefinition functionDefinition) {
+        mapFunctionDefinitions.put(functionDefinition.getId(), functionDefinition);
+    }
+
+    private static void initMap() {
+        if (needMapInit) {
+            synchronized(mapFunctionDefinitions) {
+                if (needMapInit) {
+                    needMapInit	= false;
+                    Field[] declaredFields	= StdFunctions.class.getDeclaredFields();
+                    for (Field field : declaredFields) {
+                        if (Modifier.isStatic(field.getModifiers()) &&
+                                field.getName().startsWith(StdFunctions.FD_PREFIX) &&
+                                FunctionDefinition.class.isAssignableFrom(field.getType()) &&
+                                Modifier.isPublic(field.getModifiers())
+                           ) {
+                            try {
+                                register((FunctionDefinition)(field.get(null)));
+                            } catch (IllegalAccessException ex) {
+
+                            }
+                        }
+                    }
+                }
+            }
         }
+    }
+
+    public StdFunctionDefinitionFactory() {
+        initMap();
+    }
+
+    @Override
+    public FunctionDefinition getFunctionDefinition(Identifier functionId) {
+        return mapFunctionDefinitions.get(functionId);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdFunctions.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdFunctions.java
index 9a55af6..ccc0650 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdFunctions.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdFunctions.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -76,424 +76,424 @@
 
 /**
  * StdFunctions contains the {@link com.att.research.xacml.api.Identifier} values for the standard XACML functions.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 @SuppressWarnings("deprecation")
 public class StdFunctions {
-        protected StdFunctions() {
-        }
-        
-        public static final String FD_PREFIX	= "FD_";
-        
-        /*
-         * A.3.1 Equality predicates
-         */
-        
-        public static final FunctionDefinition	FD_STRING_EQUAL				= new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_EQUAL_IGNORE_CASE	= new FunctionDefinitionStringEqualIgnoreCase(XACML3.ID_FUNCTION_STRING_EQUAL_IGNORE_CASE);
-        public static final FunctionDefinition	FD_BOOLEAN_EQUAL			= new FunctionDefinitionEquality<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_EQUAL, DataTypes.DT_BOOLEAN);
-        public static final FunctionDefinition	FD_INTEGER_EQUAL			= new FunctionDefinitionEquality<BigInteger>(XACML3.ID_FUNCTION_INTEGER_EQUAL, DataTypes.DT_INTEGER);
-        public static final FunctionDefinition	FD_DOUBLE_EQUAL				= new FunctionDefinitionEquality<Double>(XACML3.ID_FUNCTION_DOUBLE_EQUAL, DataTypes.DT_DOUBLE);
-        public static final FunctionDefinition	FD_DATE_EQUAL				= new FunctionDefinitionEquality<ISO8601Date>(XACML3.ID_FUNCTION_DATE_EQUAL, DataTypes.DT_DATE);
-        public static final FunctionDefinition	FD_TIME_EQUAL				= new FunctionDefinitionEquality<ISO8601Time>(XACML3.ID_FUNCTION_TIME_EQUAL, DataTypes.DT_TIME);
-        public static final FunctionDefinition	FD_DATETIME_EQUAL			= new FunctionDefinitionEquality<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_EQUAL, DataTypes.DT_DATETIME);
+    protected StdFunctions() {
+    }
 
-        // only difference between R3 and older (R1) versions of durations seem to be the identifiers, so send calls to the same place in either case
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_EQUAL_VERSION1	= new FunctionDefinitionEquality<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_EQUAL, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_EQUAL	= new FunctionDefinitionEquality<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_EQUAL, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_EQUAL_VERSION1	= new FunctionDefinitionEquality<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_EQUAL, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_EQUAL	= new FunctionDefinitionEquality<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_EQUAL, DataTypes.DT_YEARMONTHDURATION);
-        
-        // continue on with latest versions
-        public static final FunctionDefinition	FD_ANYURI_EQUAL				= new FunctionDefinitionEquality<URI>(XACML3.ID_FUNCTION_ANYURI_EQUAL, DataTypes.DT_ANYURI);
-        public static final FunctionDefinition	FD_X500NAME_EQUAL			= new FunctionDefinitionEquality<X500Principal>(XACML3.ID_FUNCTION_X500NAME_EQUAL, DataTypes.DT_X500NAME);
-        public static final FunctionDefinition	FD_RFC822NAME_EQUAL			= new FunctionDefinitionEquality<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_EQUAL, DataTypes.DT_RFC822NAME);
-        public static final FunctionDefinition	FD_HEXBINARY_EQUAL			= new FunctionDefinitionEquality<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_EQUAL, DataTypes.DT_HEXBINARY);
-        public static final FunctionDefinition	FD_BASE64BINARY_EQUAL		= new FunctionDefinitionEquality<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_EQUAL, DataTypes.DT_BASE64BINARY);
+    public static final String FD_PREFIX	= "FD_";
 
+    /*
+     * A.3.1 Equality predicates
+     */
 
-        
-                
-        /*
-         * Arithmetic Functions (See A.3.2)
-         */
-        
-        public static final FunctionDefinition	FD_INTEGER_ADD		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_ADD, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.ADD, 2);
-        public static final FunctionDefinition	FD_DOUBLE_ADD		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_ADD, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.ADD, 2);
-        public static final FunctionDefinition	FD_INTEGER_SUBTRACT		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_SUBTRACT, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.SUBTRACT, 2);
-        public static final FunctionDefinition	FD_DOUBLE_SUBTRACT		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_SUBTRACT, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.SUBTRACT, 2);
-        public static final FunctionDefinition	FD_INTEGER_MULTIPLY		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_MULTIPLY, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.MULTIPLY, 2);
-        public static final FunctionDefinition	FD_DOUBLE_MULTIPLY		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_MULTIPLY, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.MULTIPLY, 2);
-        public static final FunctionDefinition	FD_INTEGER_DIVIDE		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_DIVIDE, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.DIVIDE, 2);
-        public static final FunctionDefinition	FD_DOUBLE_DIVIDE		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_DIVIDE, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.DIVIDE, 2);
-        public static final FunctionDefinition	FD_INTEGER_MOD			= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_MOD, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.MOD, 2);
-        public static final FunctionDefinition	FD_INTEGER_ABS		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_ABS, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.ABS, 1);
-        public static final FunctionDefinition	FD_DOUBLE_ABS		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_ABS, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.ABS, 1);
-        public static final FunctionDefinition	FD_ROUND		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_ROUND, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.ROUND, 1);
-        public static final FunctionDefinition	FD_FLOOR		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_FLOOR, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.FLOOR, 1);
+    public static final FunctionDefinition	FD_STRING_EQUAL				= new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_EQUAL_IGNORE_CASE	= new FunctionDefinitionStringEqualIgnoreCase(XACML3.ID_FUNCTION_STRING_EQUAL_IGNORE_CASE);
+    public static final FunctionDefinition	FD_BOOLEAN_EQUAL			= new FunctionDefinitionEquality<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_EQUAL, DataTypes.DT_BOOLEAN);
+    public static final FunctionDefinition	FD_INTEGER_EQUAL			= new FunctionDefinitionEquality<BigInteger>(XACML3.ID_FUNCTION_INTEGER_EQUAL, DataTypes.DT_INTEGER);
+    public static final FunctionDefinition	FD_DOUBLE_EQUAL				= new FunctionDefinitionEquality<Double>(XACML3.ID_FUNCTION_DOUBLE_EQUAL, DataTypes.DT_DOUBLE);
+    public static final FunctionDefinition	FD_DATE_EQUAL				= new FunctionDefinitionEquality<ISO8601Date>(XACML3.ID_FUNCTION_DATE_EQUAL, DataTypes.DT_DATE);
+    public static final FunctionDefinition	FD_TIME_EQUAL				= new FunctionDefinitionEquality<ISO8601Time>(XACML3.ID_FUNCTION_TIME_EQUAL, DataTypes.DT_TIME);
+    public static final FunctionDefinition	FD_DATETIME_EQUAL			= new FunctionDefinitionEquality<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_EQUAL, DataTypes.DT_DATETIME);
+
+    // only difference between R3 and older (R1) versions of durations seem to be the identifiers, so send calls to the same place in either case
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_EQUAL_VERSION1	= new FunctionDefinitionEquality<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_EQUAL, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_EQUAL	= new FunctionDefinitionEquality<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_EQUAL, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_EQUAL_VERSION1	= new FunctionDefinitionEquality<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_EQUAL, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_EQUAL	= new FunctionDefinitionEquality<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_EQUAL, DataTypes.DT_YEARMONTHDURATION);
+
+    // continue on with latest versions
+    public static final FunctionDefinition	FD_ANYURI_EQUAL				= new FunctionDefinitionEquality<URI>(XACML3.ID_FUNCTION_ANYURI_EQUAL, DataTypes.DT_ANYURI);
+    public static final FunctionDefinition	FD_X500NAME_EQUAL			= new FunctionDefinitionEquality<X500Principal>(XACML3.ID_FUNCTION_X500NAME_EQUAL, DataTypes.DT_X500NAME);
+    public static final FunctionDefinition	FD_RFC822NAME_EQUAL			= new FunctionDefinitionEquality<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_EQUAL, DataTypes.DT_RFC822NAME);
+    public static final FunctionDefinition	FD_HEXBINARY_EQUAL			= new FunctionDefinitionEquality<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_EQUAL, DataTypes.DT_HEXBINARY);
+    public static final FunctionDefinition	FD_BASE64BINARY_EQUAL		= new FunctionDefinitionEquality<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_EQUAL, DataTypes.DT_BASE64BINARY);
 
 
 
-        
-        /*
-         * String Conversion Functions (See A.3.3)
-         */
-        public static final FunctionDefinition	FD_STRING_NORMALIZE_SPACE		= new FunctionDefinitionStringNormalize(XACML3.ID_FUNCTION_STRING_NORMALIZE_SPACE, FunctionDefinitionStringNormalize.OPERATION.SPACE);
-        public static final FunctionDefinition	FD_STRING_NORMALIZE_TO_LOWER_CASE	= new FunctionDefinitionStringNormalize(XACML3.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE, FunctionDefinitionStringNormalize.OPERATION.LOWER_CASE);
 
-        /*
-         * Numeric Data-Type Conversion Functions (See A.3.4)
-         */
-        public static final FunctionDefinition	FD_DOUBLE_TO_INTEGER		= new FunctionDefinitionNumberTypeConversion<BigInteger,Double>(XACML3.ID_FUNCTION_DOUBLE_TO_INTEGER, DataTypes.DT_INTEGER, DataTypes.DT_DOUBLE);
-        public static final FunctionDefinition	FD_INTEGER_TO_DOUBLE		= new FunctionDefinitionNumberTypeConversion<Double,BigInteger>(XACML3.ID_FUNCTION_INTEGER_TO_DOUBLE, DataTypes.DT_DOUBLE, DataTypes.DT_INTEGER);
+    /*
+     * Arithmetic Functions (See A.3.2)
+     */
+
+    public static final FunctionDefinition	FD_INTEGER_ADD		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_ADD, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.ADD, 2);
+    public static final FunctionDefinition	FD_DOUBLE_ADD		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_ADD, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.ADD, 2);
+    public static final FunctionDefinition	FD_INTEGER_SUBTRACT		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_SUBTRACT, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.SUBTRACT, 2);
+    public static final FunctionDefinition	FD_DOUBLE_SUBTRACT		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_SUBTRACT, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.SUBTRACT, 2);
+    public static final FunctionDefinition	FD_INTEGER_MULTIPLY		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_MULTIPLY, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.MULTIPLY, 2);
+    public static final FunctionDefinition	FD_DOUBLE_MULTIPLY		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_MULTIPLY, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.MULTIPLY, 2);
+    public static final FunctionDefinition	FD_INTEGER_DIVIDE		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_DIVIDE, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.DIVIDE, 2);
+    public static final FunctionDefinition	FD_DOUBLE_DIVIDE		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_DIVIDE, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.DIVIDE, 2);
+    public static final FunctionDefinition	FD_INTEGER_MOD			= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_MOD, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.MOD, 2);
+    public static final FunctionDefinition	FD_INTEGER_ABS		= new FunctionDefinitionArithmetic<BigInteger>(XACML3.ID_FUNCTION_INTEGER_ABS, DataTypes.DT_INTEGER, FunctionDefinitionArithmetic.OPERATION.ABS, 1);
+    public static final FunctionDefinition	FD_DOUBLE_ABS		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_DOUBLE_ABS, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.ABS, 1);
+    public static final FunctionDefinition	FD_ROUND		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_ROUND, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.ROUND, 1);
+    public static final FunctionDefinition	FD_FLOOR		= new FunctionDefinitionArithmetic<Double>(XACML3.ID_FUNCTION_FLOOR, DataTypes.DT_DOUBLE, FunctionDefinitionArithmetic.OPERATION.FLOOR, 1);
 
 
-        /*
-         * Logical Functions (See A.3.5)
-         */
-        public static final FunctionDefinition	FD_OR		= new FunctionDefinitionLogical(XACML3.ID_FUNCTION_OR, FunctionDefinitionLogical.OPERATION.OR);
-        public static final FunctionDefinition	FD_AND		= new FunctionDefinitionLogical(XACML3.ID_FUNCTION_AND, FunctionDefinitionLogical.OPERATION.AND);
-        public static final FunctionDefinition	FD_N_OF		= new FunctionDefinitionLogical(XACML3.ID_FUNCTION_N_OF, FunctionDefinitionLogical.OPERATION.N_OF);
-        public static final FunctionDefinition	FD_NOT		= new FunctionDefinitionLogical(XACML3.ID_FUNCTION_NOT, FunctionDefinitionLogical.OPERATION.NOT);
-        
-
-        /*
-         * Numeric Comparison Functions (See A.3.6 of xacml-3.0-core-spec-os-en.doc)
-         */
-        public static final FunctionDefinition	FD_INTEGER_GREATER_THAN		= new FunctionDefinitionComparison<BigInteger>(XACML3.ID_FUNCTION_INTEGER_GREATER_THAN, DataTypes.DT_INTEGER, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
-        public static final FunctionDefinition	FD_INTEGER_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<BigInteger>(XACML3.ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL, DataTypes.DT_INTEGER, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
-        public static final FunctionDefinition	FD_INTEGER_LESS_THAN		= new FunctionDefinitionComparison<BigInteger>(XACML3.ID_FUNCTION_INTEGER_LESS_THAN, DataTypes.DT_INTEGER, FunctionDefinitionComparison.OPERATION.LESS_THAN);
-        public static final FunctionDefinition	FD_INTEGER_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<BigInteger>(XACML3.ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL, DataTypes.DT_INTEGER, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
-        public static final FunctionDefinition	FD_DOUBLE_GREATER_THAN		= new FunctionDefinitionComparison<Double>(XACML3.ID_FUNCTION_DOUBLE_GREATER_THAN, DataTypes.DT_DOUBLE, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
-        public static final FunctionDefinition	FD_DOUBLE_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<Double>(XACML3.ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL, DataTypes.DT_DOUBLE, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
-        public static final FunctionDefinition	FD_DOUBLE_LESS_THAN		= new FunctionDefinitionComparison<Double>(XACML3.ID_FUNCTION_DOUBLE_LESS_THAN, DataTypes.DT_DOUBLE, FunctionDefinitionComparison.OPERATION.LESS_THAN);
-        public static final FunctionDefinition	FD_DOUBLE_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<Double>(XACML3.ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL, DataTypes.DT_DOUBLE, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
-        
-
-        /*
-         * Date and Time Arithmetic Functions (See A.3.7)
-         */
-        public static final FunctionDefinition	FD_DATETIME_ADD_DAYTIMEDURATION					= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION, DataTypes.DT_DATETIME, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
-        public static final FunctionDefinition	FD_DATETIME_ADD_DAYTIMEDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION, DataTypes.DT_DATETIME, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
-        public static final FunctionDefinition	FD_DATETIME_ADD_YEARMONTHDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathYearMonthDuration>(XACML3.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION, DataTypes.DT_DATETIME, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
-        public static final FunctionDefinition	FD_DATETIME_ADD_YEARMONTHDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathYearMonthDuration>(XACML1.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION, DataTypes.DT_DATETIME, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
-
-        public static final FunctionDefinition	FD_DATETIME_SUBTRACT_DAYTIMEDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION, DataTypes.DT_DATETIME, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
-        public static final FunctionDefinition	FD_DATETIME_SUBTRACT_DAYTIMEDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION, DataTypes.DT_DATETIME, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
-        public static final FunctionDefinition	FD_DATETIME_SUBTRACT_YEARMONTHDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathYearMonthDuration>(XACML3.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION, DataTypes.DT_DATETIME, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
-        public static final FunctionDefinition	FD_DATETIME_SUBTRACT_YEARMONTHDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathYearMonthDuration>(XACML1.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION, DataTypes.DT_DATETIME, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
-
-        public static final FunctionDefinition	FD_DATE_ADD_YEARMONTHDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601Date,XPathYearMonthDuration>(XACML3.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION, DataTypes.DT_DATE, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
-        public static final FunctionDefinition	FD_DATE_ADD_YEARMONTHDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601Date,XPathYearMonthDuration>(XACML1.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION, DataTypes.DT_DATE, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
-        public static final FunctionDefinition	FD_DATE_SUBTRACT_YEARMONTHDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601Date,XPathYearMonthDuration>(XACML3.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION, DataTypes.DT_DATE, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
-        public static final FunctionDefinition	FD_DATE_SUBTRACT_YEARMONTHDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601Date,XPathYearMonthDuration>(XACML1.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION, DataTypes.DT_DATE, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
 
 
-        /*
-         * Non Numeric Comparison Functions (See A.3.8)
-         */
-        public static final FunctionDefinition	FD_STRING_GREATER_THAN		= new FunctionDefinitionComparison<String>(XACML3.ID_FUNCTION_STRING_GREATER_THAN, DataTypes.DT_STRING, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
-        public static final FunctionDefinition	FD_STRING_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<String>(XACML3.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL, DataTypes.DT_STRING, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
-        public static final FunctionDefinition	FD_STRING_LESS_THAN		= new FunctionDefinitionComparison<String>(XACML3.ID_FUNCTION_STRING_LESS_THAN, DataTypes.DT_STRING, FunctionDefinitionComparison.OPERATION.LESS_THAN);
-        public static final FunctionDefinition	FD_STRING_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<String>(XACML3.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL, DataTypes.DT_STRING, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
-        public static final FunctionDefinition	FD_TIME_GREATER_THAN		= new FunctionDefinitionComparison<ISO8601Time>(XACML3.ID_FUNCTION_TIME_GREATER_THAN, DataTypes.DT_TIME, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
-        public static final FunctionDefinition	FD_TIME_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601Time>(XACML3.ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL, DataTypes.DT_TIME, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
-        public static final FunctionDefinition	FD_TIME_LESS_THAN		= new FunctionDefinitionComparison<ISO8601Time>(XACML3.ID_FUNCTION_TIME_LESS_THAN, DataTypes.DT_TIME, FunctionDefinitionComparison.OPERATION.LESS_THAN);
-        public static final FunctionDefinition	FD_TIME_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601Time>(XACML3.ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL, DataTypes.DT_TIME, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
-        public static final FunctionDefinition	FD_TIME_IN_RANGE		= new FunctionDefinitionTimeInRange<ISO8601Time>(XACML3.ID_FUNCTION_TIME_IN_RANGE, DataTypes.DT_TIME);
-        public static final FunctionDefinition	FD_DATE_GREATER_THAN		= new FunctionDefinitionComparison<ISO8601Date>(XACML3.ID_FUNCTION_DATE_GREATER_THAN, DataTypes.DT_DATE, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
-        public static final FunctionDefinition	FD_DATE_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601Date>(XACML3.ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL, DataTypes.DT_DATE, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
-        public static final FunctionDefinition	FD_DATE_LESS_THAN		= new FunctionDefinitionComparison<ISO8601Date>(XACML3.ID_FUNCTION_DATE_LESS_THAN, DataTypes.DT_DATE, FunctionDefinitionComparison.OPERATION.LESS_THAN);
-        public static final FunctionDefinition	FD_DATE_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601Date>(XACML3.ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL, DataTypes.DT_DATE, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
-        public static final FunctionDefinition	FD_DATETIME_GREATER_THAN		= new FunctionDefinitionComparison<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_GREATER_THAN, DataTypes.DT_DATETIME, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
-        public static final FunctionDefinition	FD_DATETIME_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL, DataTypes.DT_DATETIME, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
-        public static final FunctionDefinition	FD_DATETIME_LESS_THAN		= new FunctionDefinitionComparison<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_LESS_THAN, DataTypes.DT_DATETIME, FunctionDefinitionComparison.OPERATION.LESS_THAN);
-        public static final FunctionDefinition	FD_DATETIME_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL, DataTypes.DT_DATETIME, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
+    /*
+     * String Conversion Functions (See A.3.3)
+     */
+    public static final FunctionDefinition	FD_STRING_NORMALIZE_SPACE		= new FunctionDefinitionStringNormalize(XACML3.ID_FUNCTION_STRING_NORMALIZE_SPACE, FunctionDefinitionStringNormalize.OPERATION.SPACE);
+    public static final FunctionDefinition	FD_STRING_NORMALIZE_TO_LOWER_CASE	= new FunctionDefinitionStringNormalize(XACML3.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE, FunctionDefinitionStringNormalize.OPERATION.LOWER_CASE);
 
-        
-
-        /*
-         * String functions (See A.3.9 of xacml-3.0-core-spec-os-en.doc)
-         */
-        public static final FunctionDefinition	FD_BOOLEAN_FROM_STRING		= new FunctionDefinitionStringConversion<Boolean,String>(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_BOOLEAN		= new FunctionDefinitionStringConversion<String,Boolean>(XACML3.ID_FUNCTION_STRING_FROM_BOOLEAN, DataTypes.DT_STRING, DataTypes.DT_BOOLEAN);
-        public static final FunctionDefinition	FD_INTEGER_FROM_STRING		= new FunctionDefinitionStringConversion<BigInteger,String>(XACML3.ID_FUNCTION_INTEGER_FROM_STRING, DataTypes.DT_INTEGER, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_INTEGER		= new FunctionDefinitionStringConversion<String,BigInteger>(XACML3.ID_FUNCTION_STRING_FROM_INTEGER, DataTypes.DT_STRING, DataTypes.DT_INTEGER);
-        public static final FunctionDefinition	FD_DOUBLE_FROM_STRING		= new FunctionDefinitionStringConversion<Double,String>(XACML3.ID_FUNCTION_DOUBLE_FROM_STRING, DataTypes.DT_DOUBLE, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_DOUBLE		= new FunctionDefinitionStringConversion<String,Double>(XACML3.ID_FUNCTION_STRING_FROM_DOUBLE, DataTypes.DT_STRING, DataTypes.DT_DOUBLE);
-        public static final FunctionDefinition	FD_TIME_FROM_STRING		= new FunctionDefinitionStringConversion<ISO8601Time,String>(XACML3.ID_FUNCTION_TIME_FROM_STRING, DataTypes.DT_TIME, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_TIME		= new FunctionDefinitionStringConversion<String,ISO8601Time>(XACML3.ID_FUNCTION_STRING_FROM_TIME, DataTypes.DT_STRING, DataTypes.DT_TIME);
-        public static final FunctionDefinition	FD_DATE_FROM_STRING		= new FunctionDefinitionStringConversion<ISO8601Date,String>(XACML3.ID_FUNCTION_DATE_FROM_STRING, DataTypes.DT_DATE, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_DATE		= new FunctionDefinitionStringConversion<String,ISO8601Date>(XACML3.ID_FUNCTION_STRING_FROM_DATE, DataTypes.DT_STRING, DataTypes.DT_DATE);
-        public static final FunctionDefinition	FD_DATETIME_FROM_STRING		= new FunctionDefinitionStringConversion<ISO8601DateTime,String>(XACML3.ID_FUNCTION_DATETIME_FROM_STRING, DataTypes.DT_DATETIME, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_DATETIME		= new FunctionDefinitionStringConversion<String,ISO8601DateTime>(XACML3.ID_FUNCTION_STRING_FROM_DATETIME, DataTypes.DT_STRING, DataTypes.DT_DATETIME);
-        public static final FunctionDefinition	FD_ANYURI_FROM_STRING		= new FunctionDefinitionStringConversion<URI,String>(XACML3.ID_FUNCTION_ANYURI_FROM_STRING, DataTypes.DT_ANYURI, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_ANYURI		= new FunctionDefinitionStringConversion<String,URI>(XACML3.ID_FUNCTION_STRING_FROM_ANYURI, DataTypes.DT_STRING, DataTypes.DT_ANYURI);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_FROM_STRING		= new FunctionDefinitionStringConversion<XPathDayTimeDuration,String>(XACML3.ID_FUNCTION_DAYTIMEDURATION_FROM_STRING, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_DAYTIMEDURATION		= new FunctionDefinitionStringConversion<String,XPathDayTimeDuration>(XACML3.ID_FUNCTION_STRING_FROM_DAYTIMEDURATION, DataTypes.DT_STRING, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_FROM_STRING		= new FunctionDefinitionStringConversion<XPathYearMonthDuration,String>(XACML3.ID_FUNCTION_YEARMONTHDURATION_FROM_STRING, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_YEARMONTHDURATION		= new FunctionDefinitionStringConversion<String,XPathYearMonthDuration>(XACML3.ID_FUNCTION_STRING_FROM_YEARMONTHDURATION, DataTypes.DT_STRING, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_X500NAME_FROM_STRING		= new FunctionDefinitionStringConversion<X500Principal,String>(XACML3.ID_FUNCTION_X500NAME_FROM_STRING, DataTypes.DT_X500NAME, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_X500NAME		= new FunctionDefinitionStringConversion<String,X500Principal>(XACML3.ID_FUNCTION_STRING_FROM_X500NAME, DataTypes.DT_STRING, DataTypes.DT_X500NAME);
-        public static final FunctionDefinition	FD_RFC822NAME_FROM_STRING		= new FunctionDefinitionStringConversion<RFC822Name,String>(XACML3.ID_FUNCTION_RFC822NAME_FROM_STRING, DataTypes.DT_RFC822NAME, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_RFC822NAME		= new FunctionDefinitionStringConversion<String,RFC822Name>(XACML3.ID_FUNCTION_STRING_FROM_RFC822NAME, DataTypes.DT_STRING, DataTypes.DT_RFC822NAME);
-        public static final FunctionDefinition	FD_IPADDRESS_FROM_STRING		= new FunctionDefinitionStringConversion<IPAddress,String>(XACML3.ID_FUNCTION_IPADDRESS_FROM_STRING, DataTypes.DT_IPADDRESS, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_IPADDRESS		= new FunctionDefinitionStringConversion<String,IPAddress>(XACML3.ID_FUNCTION_STRING_FROM_IPADDRESS, DataTypes.DT_STRING, DataTypes.DT_IPADDRESS);
-        public static final FunctionDefinition	FD_DNSNAME_FROM_STRING		= new FunctionDefinitionStringConversion<RFC2396DomainName,String>(XACML3.ID_FUNCTION_DNSNAME_FROM_STRING, DataTypes.DT_DNSNAME, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_STRING_FROM_DNSNAME		= new FunctionDefinitionStringConversion<String,RFC2396DomainName>(XACML3.ID_FUNCTION_STRING_FROM_DNSNAME, DataTypes.DT_STRING, DataTypes.DT_DNSNAME);
-
-        // String Functions not converting Strings to/from DataType objects
-        public static final FunctionDefinition	FD_STRING_CONCATENATE		= new FunctionDefinitionStringFunctions<String,String>(XACML3.ID_FUNCTION_STRING_CONCATENATE, DataTypes.DT_STRING, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.CONCATENATE);
-        public static final FunctionDefinition	FD_STRING_STARTS_WITH		= new FunctionDefinitionStringFunctions<Boolean,String>(XACML3.ID_FUNCTION_STRING_STARTS_WITH, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.STARTS_WITH);
-        public static final FunctionDefinition	FD_ANYURI_STARTS_WITH		= new FunctionDefinitionStringFunctions<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_STARTS_WITH, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionStringFunctions.OPERATION.STARTS_WITH);
-        public static final FunctionDefinition	FD_STRING_ENDS_WITH		= new FunctionDefinitionStringFunctions<Boolean,String>(XACML3.ID_FUNCTION_STRING_ENDS_WITH, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.ENDS_WITH);
-        public static final FunctionDefinition	FD_ANYURI_ENDS_WITH		= new FunctionDefinitionStringFunctions<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_ENDS_WITH, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionStringFunctions.OPERATION.ENDS_WITH);
-        public static final FunctionDefinition	FD_STRING_CONTAINS		= new FunctionDefinitionStringFunctions<Boolean,String>(XACML3.ID_FUNCTION_STRING_CONTAINS, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.CONTAINS);
-        public static final FunctionDefinition	FD_ANYURI_CONTAINS		= new FunctionDefinitionStringFunctions<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_CONTAINS, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionStringFunctions.OPERATION.CONTAINS);
-        public static final FunctionDefinition	FD_STRING_SUBSTRING		= new FunctionDefinitionStringFunctions<String,String>(XACML3.ID_FUNCTION_STRING_SUBSTRING, DataTypes.DT_STRING, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.SUBSTRING);
-        public static final FunctionDefinition	FD_ANYURI_SUBSTRING		= new FunctionDefinitionStringFunctions<String, URI>(XACML3.ID_FUNCTION_ANYURI_SUBSTRING, DataTypes.DT_STRING, DataTypes.DT_ANYURI, FunctionDefinitionStringFunctions.OPERATION.SUBSTRING);
-        
-        /*
-         * Bag functions (See A.3.10)
-         */
-        public static final FunctionDefinition	FD_STRING_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<String>(XACML3.ID_FUNCTION_STRING_ONE_AND_ONLY, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_BOOLEAN_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_ONE_AND_ONLY, DataTypes.DT_BOOLEAN);
-        public static final FunctionDefinition	FD_INTEGER_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<BigInteger>(XACML3.ID_FUNCTION_INTEGER_ONE_AND_ONLY, DataTypes.DT_INTEGER);
-        public static final FunctionDefinition	FD_DOUBLE_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<Double>(XACML3.ID_FUNCTION_DOUBLE_ONE_AND_ONLY, DataTypes.DT_DOUBLE);
-        public static final FunctionDefinition	FD_TIME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<ISO8601Time>(XACML3.ID_FUNCTION_TIME_ONE_AND_ONLY, DataTypes.DT_TIME);
-        public static final FunctionDefinition	FD_DATE_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<ISO8601Date>(XACML3.ID_FUNCTION_DATE_ONE_AND_ONLY, DataTypes.DT_DATE);
-        public static final FunctionDefinition	FD_DATETIME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_ONE_AND_ONLY, DataTypes.DT_DATETIME);	
-        public static final FunctionDefinition	FD_ANYURI_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<URI>(XACML3.ID_FUNCTION_ANYURI_ONE_AND_ONLY, DataTypes.DT_ANYURI);
-        public static final FunctionDefinition	FD_HEXBINARY_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_ONE_AND_ONLY, DataTypes.DT_HEXBINARY);
-        public static final FunctionDefinition	FD_BASE64BINARY_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY, DataTypes.DT_BASE64BINARY);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_ONE_AND_ONLY_VERSION1		= new FunctionDefinitionBagOneAndOnly<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_ONE_AND_ONLY_VERSION1		= new FunctionDefinitionBagOneAndOnly<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_X500NAME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<X500Principal>(XACML3.ID_FUNCTION_X500NAME_ONE_AND_ONLY, DataTypes.DT_X500NAME);
-        public static final FunctionDefinition	FD_RFC822NAME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_ONE_AND_ONLY, DataTypes.DT_RFC822NAME);
-        public static final FunctionDefinition	FD_IPADDRESS_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_ONE_AND_ONLY, DataTypes.DT_IPADDRESS);
-        public static final FunctionDefinition	FD_DNSNAME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_ONE_AND_ONLY, DataTypes.DT_DNSNAME);
-        
-        public static final FunctionDefinition	FD_STRING_BAG_SIZE		= new FunctionDefinitionBagSize<String>(XACML3.ID_FUNCTION_STRING_BAG_SIZE, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_BOOLEAN_BAG_SIZE		= new FunctionDefinitionBagSize<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_BAG_SIZE, DataTypes.DT_BOOLEAN);
-        public static final FunctionDefinition	FD_INTEGER_BAG_SIZE		= new FunctionDefinitionBagSize<BigInteger>(XACML3.ID_FUNCTION_INTEGER_BAG_SIZE, DataTypes.DT_INTEGER);
-        public static final FunctionDefinition	FD_DOUBLE_BAG_SIZE		= new FunctionDefinitionBagSize<Double>(XACML3.ID_FUNCTION_DOUBLE_BAG_SIZE, DataTypes.DT_DOUBLE);
-        public static final FunctionDefinition	FD_TIME_BAG_SIZE			= new FunctionDefinitionBagSize<ISO8601Time>(XACML3.ID_FUNCTION_TIME_BAG_SIZE, DataTypes.DT_TIME);
-        public static final FunctionDefinition	FD_DATE_BAG_SIZE			= new FunctionDefinitionBagSize<ISO8601Date>(XACML3.ID_FUNCTION_DATE_BAG_SIZE, DataTypes.DT_DATE);
-        public static final FunctionDefinition	FD_DATETIME_BAG_SIZE		= new FunctionDefinitionBagSize<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_BAG_SIZE, DataTypes.DT_DATETIME);	
-        public static final FunctionDefinition	FD_ANYURI_BAG_SIZE		= new FunctionDefinitionBagSize<URI>(XACML3.ID_FUNCTION_ANYURI_BAG_SIZE, DataTypes.DT_ANYURI);
-        public static final FunctionDefinition	FD_HEXBINARY_BAG_SIZE		= new FunctionDefinitionBagSize<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_BAG_SIZE, DataTypes.DT_HEXBINARY);
-        public static final FunctionDefinition	FD_BASE64BINARY_BAG_SIZE		= new FunctionDefinitionBagSize<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_BAG_SIZE, DataTypes.DT_BASE64BINARY);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_BAG_SIZE	= new FunctionDefinitionBagSize<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_BAG_SIZE_VERSION1		= new FunctionDefinitionBagSize<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_BAG_SIZE		= new FunctionDefinitionBagSize<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_BAG_SIZE_VERSION1		= new FunctionDefinitionBagSize<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_X500NAME_BAG_SIZE		= new FunctionDefinitionBagSize<X500Principal>(XACML3.ID_FUNCTION_X500NAME_BAG_SIZE, DataTypes.DT_X500NAME);
-        public static final FunctionDefinition	FD_RFC822NAME_BAG_SIZE		= new FunctionDefinitionBagSize<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_BAG_SIZE, DataTypes.DT_RFC822NAME);
-        public static final FunctionDefinition	FD_IPADDRESS_BAG_SIZE		= new FunctionDefinitionBagSize<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_BAG_SIZE, DataTypes.DT_IPADDRESS);
-        public static final FunctionDefinition	FD_DNSNAME_BAG_SIZE		= new FunctionDefinitionBagSize<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_BAG_SIZE, DataTypes.DT_DNSNAME);
-        
-        public static final FunctionDefinition	FD_STRING_IS_IN		= new FunctionDefinitionBagIsIn<String>(XACML3.ID_FUNCTION_STRING_IS_IN, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_BOOLEAN_IS_IN		= new FunctionDefinitionBagIsIn<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_IS_IN, DataTypes.DT_BOOLEAN);
-        public static final FunctionDefinition	FD_INTEGER_IS_IN		= new FunctionDefinitionBagIsIn<BigInteger>(XACML3.ID_FUNCTION_INTEGER_IS_IN, DataTypes.DT_INTEGER);
-        public static final FunctionDefinition	FD_DOUBLE_IS_IN		= new FunctionDefinitionBagIsIn<Double>(XACML3.ID_FUNCTION_DOUBLE_IS_IN, DataTypes.DT_DOUBLE);
-        public static final FunctionDefinition	FD_TIME_IS_IN			= new FunctionDefinitionBagIsIn<ISO8601Time>(XACML3.ID_FUNCTION_TIME_IS_IN, DataTypes.DT_TIME);
-        public static final FunctionDefinition	FD_DATE_IS_IN			= new FunctionDefinitionBagIsIn<ISO8601Date>(XACML3.ID_FUNCTION_DATE_IS_IN, DataTypes.DT_DATE);
-        public static final FunctionDefinition	FD_DATETIME_IS_IN		= new FunctionDefinitionBagIsIn<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_IS_IN, DataTypes.DT_DATETIME);	
-        public static final FunctionDefinition	FD_ANYURI_IS_IN		= new FunctionDefinitionBagIsIn<URI>(XACML3.ID_FUNCTION_ANYURI_IS_IN, DataTypes.DT_ANYURI);
-        public static final FunctionDefinition	FD_HEXBINARY_IS_IN		= new FunctionDefinitionBagIsIn<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_IS_IN, DataTypes.DT_HEXBINARY);
-        public static final FunctionDefinition	FD_BASE64BINARY_IS_IN		= new FunctionDefinitionBagIsIn<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_IS_IN, DataTypes.DT_BASE64BINARY);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_IS_IN	= new FunctionDefinitionBagIsIn<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_IS_IN, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_IS_IN_VERSION1		= new FunctionDefinitionBagIsIn<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_IS_IN, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_IS_IN		= new FunctionDefinitionBagIsIn<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_IS_IN, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_IS_IN_VERSION1		= new FunctionDefinitionBagIsIn<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_IS_IN, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_X500NAME_IS_IN		= new FunctionDefinitionBagIsIn<X500Principal>(XACML3.ID_FUNCTION_X500NAME_IS_IN, DataTypes.DT_X500NAME);
-        public static final FunctionDefinition	FD_RFC822NAME_IS_IN		= new FunctionDefinitionBagIsIn<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_IS_IN, DataTypes.DT_RFC822NAME);
-        public static final FunctionDefinition	FD_IPADDRESS_IS_IN		= new FunctionDefinitionBagIsIn<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_IS_IN, DataTypes.DT_IPADDRESS);
-        public static final FunctionDefinition	FD_DNSNAME_IS_IN		= new FunctionDefinitionBagIsIn<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_IS_IN, DataTypes.DT_DNSNAME);
-        
-        public static final FunctionDefinition	FD_STRING_BAG		= new FunctionDefinitionBag<String>(XACML3.ID_FUNCTION_STRING_BAG, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_BOOLEAN_BAG		= new FunctionDefinitionBag<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_BAG, DataTypes.DT_BOOLEAN);
-        public static final FunctionDefinition	FD_INTEGER_BAG		= new FunctionDefinitionBag<BigInteger>(XACML3.ID_FUNCTION_INTEGER_BAG, DataTypes.DT_INTEGER);
-        public static final FunctionDefinition	FD_DOUBLE_BAG		= new FunctionDefinitionBag<Double>(XACML3.ID_FUNCTION_DOUBLE_BAG, DataTypes.DT_DOUBLE);
-        public static final FunctionDefinition	FD_TIME_BAG			= new FunctionDefinitionBag<ISO8601Time>(XACML3.ID_FUNCTION_TIME_BAG, DataTypes.DT_TIME);
-        public static final FunctionDefinition	FD_DATE_BAG			= new FunctionDefinitionBag<ISO8601Date>(XACML3.ID_FUNCTION_DATE_BAG, DataTypes.DT_DATE);
-        public static final FunctionDefinition	FD_DATETIME_BAG		= new FunctionDefinitionBag<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_BAG, DataTypes.DT_DATETIME);	
-        public static final FunctionDefinition	FD_ANYURI_BAG		= new FunctionDefinitionBag<URI>(XACML3.ID_FUNCTION_ANYURI_BAG, DataTypes.DT_ANYURI);
-        public static final FunctionDefinition	FD_HEXBINARY_BAG		= new FunctionDefinitionBag<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_BAG, DataTypes.DT_HEXBINARY);
-        public static final FunctionDefinition	FD_BASE64BINARY_BAG		= new FunctionDefinitionBag<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_BAG, DataTypes.DT_BASE64BINARY);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_BAG	= new FunctionDefinitionBag<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_BAG, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_BAG_VERSION1		= new FunctionDefinitionBag<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_BAG, DataTypes.DT_DAYTIMEDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_BAG		= new FunctionDefinitionBag<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_BAG, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_BAG_VERSION1		= new FunctionDefinitionBag<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_BAG, DataTypes.DT_YEARMONTHDURATION);
-        public static final FunctionDefinition	FD_X500NAME_BAG		= new FunctionDefinitionBag<X500Principal>(XACML3.ID_FUNCTION_X500NAME_BAG, DataTypes.DT_X500NAME);
-        public static final FunctionDefinition	FD_RFC822NAME_BAG		= new FunctionDefinitionBag<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_BAG, DataTypes.DT_RFC822NAME);
-        public static final FunctionDefinition	FD_IPADDRESS_BAG		= new FunctionDefinitionBag<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_BAG, DataTypes.DT_IPADDRESS);
-        public static final FunctionDefinition	FD_DNSNAME_BAG		= new FunctionDefinitionBag<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_BAG, DataTypes.DT_DNSNAME);
-
-        
-        /*
-         * Set Functions (See A.3.11)
-         * 
-         * (According to section 10.2.8, this doesn't seem to include
-         * IPAddress or DNSName datatype). This is because Xacml 3.0 did NOT
-         * define an equality operator for these 2 types. See discussion:
-         * 
-         * https://lists.oasis-open.org/archives/xacml/201104/msg00014.html
-         * 
-         * Also section 10.2.8 is missing XPathExpression versions of these functions.
-         * 
-         */
-        public static final FunctionDefinition	FD_STRING_INTERSECTION			= new FunctionDefinitionSet<String,String>(XACML3.ID_FUNCTION_STRING_INTERSECTION, DataTypes.DT_STRING, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_BOOLEAN_INTERSECTION			= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_INTERSECTION, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_INTEGER_INTERSECTION			= new FunctionDefinitionSet<BigInteger,BigInteger>(XACML3.ID_FUNCTION_INTEGER_INTERSECTION, DataTypes.DT_INTEGER, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_DOUBLE_INTERSECTION			= new FunctionDefinitionSet<Double,Double>(XACML3.ID_FUNCTION_DOUBLE_INTERSECTION, DataTypes.DT_DOUBLE, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_TIME_INTERSECTION			= new FunctionDefinitionSet<ISO8601Time,ISO8601Time>(XACML3.ID_FUNCTION_TIME_INTERSECTION, DataTypes.DT_TIME, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_DATE_INTERSECTION			= new FunctionDefinitionSet<ISO8601Date,ISO8601Date>(XACML3.ID_FUNCTION_DATE_INTERSECTION, DataTypes.DT_DATE, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_DATETIME_INTERSECTION		= new FunctionDefinitionSet<ISO8601DateTime, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_INTERSECTION, DataTypes.DT_DATETIME, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_ANYURI_INTERSECTION			= new FunctionDefinitionSet<URI, URI>(XACML3.ID_FUNCTION_ANYURI_INTERSECTION, DataTypes.DT_ANYURI, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_HEXBINARY_INTERSECTION		= new FunctionDefinitionSet<HexBinary,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_INTERSECTION, DataTypes.DT_HEXBINARY, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_BASE64BINARY_INTERSECTION		= new FunctionDefinitionSet<Base64Binary,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_INTERSECTION, DataTypes.DT_BASE64BINARY, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_INTERSECTION		= new FunctionDefinitionSet<XPathDayTimeDuration,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_INTERSECTION, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_INTERSECTION_VERSION1	= new FunctionDefinitionSet<XPathDayTimeDuration,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_INTERSECTION, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_INTERSECTION	= new FunctionDefinitionSet<XPathYearMonthDuration,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_INTERSECTION, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_INTERSECTION_VERSION1	= new FunctionDefinitionSet<XPathYearMonthDuration,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_INTERSECTION, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_X500NAME_INTERSECTION			= new FunctionDefinitionSet<X500Principal,X500Principal>(XACML3.ID_FUNCTION_X500NAME_INTERSECTION, DataTypes.DT_X500NAME, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.INTERSECTION);
-        public static final FunctionDefinition	FD_RFC822NAME_INTERSECTION			= new FunctionDefinitionSet<RFC822Name,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_INTERSECTION, DataTypes.DT_RFC822NAME, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.INTERSECTION);
-
-        public static final FunctionDefinition	FD_STRING_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,String>(XACML3.ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_BOOLEAN_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_INTEGER_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,BigInteger>(XACML3.ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_DOUBLE_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,Double>(XACML3.ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_TIME_AT_LEAST_ONE_MEMBER_OF			= new FunctionDefinitionSet<Boolean,ISO8601Time>(XACML3.ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_DATE_AT_LEAST_ONE_MEMBER_OF			= new FunctionDefinitionSet<Boolean,ISO8601Date>(XACML3.ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_DATETIME_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_ANYURI_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_HEXBINARY_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF_VERSION1	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF_VERSION1	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_X500NAME_AT_LEAST_ONE_MEMBER_OF			= new FunctionDefinitionSet<Boolean,X500Principal>(XACML3.ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-        public static final FunctionDefinition	FD_RFC822NAME_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
-
-        public static final FunctionDefinition	FD_STRING_UNION			= new FunctionDefinitionSet<String,String>(XACML3.ID_FUNCTION_STRING_UNION, DataTypes.DT_STRING, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_BOOLEAN_UNION		= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_UNION, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_INTEGER_UNION		= new FunctionDefinitionSet<BigInteger,BigInteger>(XACML3.ID_FUNCTION_INTEGER_UNION, DataTypes.DT_INTEGER, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_DOUBLE_UNION			= new FunctionDefinitionSet<Double,Double>(XACML3.ID_FUNCTION_DOUBLE_UNION, DataTypes.DT_DOUBLE, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_TIME_UNION			= new FunctionDefinitionSet<ISO8601Time,ISO8601Time>(XACML3.ID_FUNCTION_TIME_UNION, DataTypes.DT_TIME, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_DATE_UNION			= new FunctionDefinitionSet<ISO8601Date,ISO8601Date>(XACML3.ID_FUNCTION_DATE_UNION, DataTypes.DT_DATE, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_DATETIME_UNION		= new FunctionDefinitionSet<ISO8601DateTime, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_UNION, DataTypes.DT_DATETIME, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_ANYURI_UNION			= new FunctionDefinitionSet<URI, URI>(XACML3.ID_FUNCTION_ANYURI_UNION, DataTypes.DT_ANYURI, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_HEXBINARY_UNION		= new FunctionDefinitionSet<HexBinary,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_UNION, DataTypes.DT_HEXBINARY, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_BASE64BINARY_UNION		= new FunctionDefinitionSet<Base64Binary,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_UNION, DataTypes.DT_BASE64BINARY, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_UNION	= new FunctionDefinitionSet<XPathDayTimeDuration,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_UNION, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_UNION_VERSION1	= new FunctionDefinitionSet<XPathDayTimeDuration,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_UNION, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_UNION	= new FunctionDefinitionSet<XPathYearMonthDuration,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_UNION, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_UNION_VERSION1	= new FunctionDefinitionSet<XPathYearMonthDuration,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_UNION, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_X500NAME_UNION		= new FunctionDefinitionSet<X500Principal,X500Principal>(XACML3.ID_FUNCTION_X500NAME_UNION, DataTypes.DT_X500NAME, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.UNION);
-        public static final FunctionDefinition	FD_RFC822NAME_UNION		= new FunctionDefinitionSet<RFC822Name,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_UNION, DataTypes.DT_RFC822NAME, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.UNION);
-
-        public static final FunctionDefinition	FD_STRING_SUBSET		= new FunctionDefinitionSet<Boolean,String>(XACML3.ID_FUNCTION_STRING_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_BOOLEAN_SUBSET		= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_INTEGER_SUBSET		= new FunctionDefinitionSet<Boolean,BigInteger>(XACML3.ID_FUNCTION_INTEGER_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_DOUBLE_SUBSET		= new FunctionDefinitionSet<Boolean,Double>(XACML3.ID_FUNCTION_DOUBLE_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_TIME_SUBSET			= new FunctionDefinitionSet<Boolean,ISO8601Time>(XACML3.ID_FUNCTION_TIME_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_DATE_SUBSET			= new FunctionDefinitionSet<Boolean,ISO8601Date>(XACML3.ID_FUNCTION_DATE_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_DATETIME_SUBSET		= new FunctionDefinitionSet<Boolean, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_ANYURI_SUBSET		= new FunctionDefinitionSet<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_HEXBINARY_SUBSET		= new FunctionDefinitionSet<Boolean,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_BASE64BINARY_SUBSET		= new FunctionDefinitionSet<Boolean,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_SUBSET	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_SUBSET_VERSION1	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_SUBSET	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_SUBSET_VERSION1	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_X500NAME_SUBSET			= new FunctionDefinitionSet<Boolean,X500Principal>(XACML3.ID_FUNCTION_X500NAME_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.SUBSET);
-        public static final FunctionDefinition	FD_RFC822NAME_SUBSET		= new FunctionDefinitionSet<Boolean,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.SUBSET);
-
-        public static final FunctionDefinition	FD_STRING_SET_EQUALS		= new FunctionDefinitionSet<Boolean,String>(XACML3.ID_FUNCTION_STRING_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_BOOLEAN_SET_EQUALS		= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_INTEGER_SET_EQUALS		= new FunctionDefinitionSet<Boolean,BigInteger>(XACML3.ID_FUNCTION_INTEGER_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_DOUBLE_SET_EQUALS		= new FunctionDefinitionSet<Boolean,Double>(XACML3.ID_FUNCTION_DOUBLE_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_TIME_SET_EQUALS			= new FunctionDefinitionSet<Boolean,ISO8601Time>(XACML3.ID_FUNCTION_TIME_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_DATE_SET_EQUALS			= new FunctionDefinitionSet<Boolean,ISO8601Date>(XACML3.ID_FUNCTION_DATE_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_DATETIME_SET_EQUALS		= new FunctionDefinitionSet<Boolean, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_ANYURI_SET_EQUALS		= new FunctionDefinitionSet<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_HEXBINARY_SET_EQUALS		= new FunctionDefinitionSet<Boolean,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_BASE64BINARY_SET_EQUALS		= new FunctionDefinitionSet<Boolean,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_SET_EQUALS	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_DAYTIMEDURATION_SET_EQUALS_VERSION1	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_SET_EQUALS	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_YEARMONTHDURATION_SET_EQUALS_VERSION1	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_X500NAME_SET_EQUALS			= new FunctionDefinitionSet<Boolean,X500Principal>(XACML3.ID_FUNCTION_X500NAME_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-        public static final FunctionDefinition	FD_RFC822NAME_SET_EQUALS		= new FunctionDefinitionSet<Boolean,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.SET_EQUALS);
-
-        
-        /*
-         * Higher Order Bag functions (See A.3.12)
-         */
-        public static final FunctionDefinition	FD_ANY_OF		= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ANY_OF, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF);
-        public static final FunctionDefinition	FD_ANY_OF_VERSION1	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML1.ID_FUNCTION_ANY_OF, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF);
-        public static final FunctionDefinition	FD_ALL_OF		= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ALL_OF, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ALL_OF);
-        public static final FunctionDefinition	FD_ALL_OF_VERSION1	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML1.ID_FUNCTION_ALL_OF, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ALL_OF);
-        public static final FunctionDefinition	FD_ANY_OF_ANY	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ANY_OF_ANY, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF_ANY);
-        public static final FunctionDefinition	FD_ANY_OF_ANY_VERSION1	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML1.ID_FUNCTION_ANY_OF_ANY, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF_ANY);
-        public static final FunctionDefinition	FD_ALL_OF_ANY	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ALL_OF_ANY, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ALL_OF_ANY);
-        public static final FunctionDefinition	FD_ANY_OF_ALL	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ANY_OF_ALL, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF_ALL);
-        public static final FunctionDefinition	FD_ALL_OF_ALL	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ALL_OF_ALL, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ALL_OF_ALL);
-        public static final FunctionDefinition	FD_MAP			= new FunctionDefinitionHigherOrderBag<Object,Object>(XACML3.ID_FUNCTION_MAP, null, null, FunctionDefinitionHigherOrderBag.OPERATION.MAP);
-        public static final FunctionDefinition	FD_MAP_VERSION1	= new FunctionDefinitionHigherOrderBag<Object,Object>(XACML1.ID_FUNCTION_MAP, null, null, FunctionDefinitionHigherOrderBag.OPERATION.MAP);
-
-        
-        /*
-         * Regular Expression functions (See A.3.13)
-         */
-        public static final FunctionDefinition	FD_STRING_REGEXP_MATCH		= new FunctionDefinitionRegexpMatch<String>(XACML3.ID_FUNCTION_STRING_REGEXP_MATCH, DataTypes.DT_STRING);
-        public static final FunctionDefinition	FD_ANYURI_REGEXP_MATCH		= new FunctionDefinitionRegexpMatch<URI>(XACML3.ID_FUNCTION_ANYURI_REGEXP_MATCH, DataTypes.DT_ANYURI);
-        public static final FunctionDefinition	FD_IPADDRESS_REGEXP_MATCH	= new FunctionDefinitionRegexpMatch<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_REGEXP_MATCH, DataTypes.DT_IPADDRESS);
-        public static final FunctionDefinition	FD_DNSNAME_REGEXP_MATCH		= new FunctionDefinitionRegexpMatch<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_REGEXP_MATCH, DataTypes.DT_DNSNAME);
-        public static final FunctionDefinition	FD_RFC822NAME_REGEXP_MATCH	= new FunctionDefinitionRegexpMatch<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_REGEXP_MATCH, DataTypes.DT_RFC822NAME);
-        public static final FunctionDefinition	FD_X500NAME_REGEXP_MATCH	= new FunctionDefinitionRegexpMatch<X500Principal>(XACML3.ID_FUNCTION_X500NAME_REGEXP_MATCH, DataTypes.DT_X500NAME);
+    /*
+     * Numeric Data-Type Conversion Functions (See A.3.4)
+     */
+    public static final FunctionDefinition	FD_DOUBLE_TO_INTEGER		= new FunctionDefinitionNumberTypeConversion<BigInteger,Double>(XACML3.ID_FUNCTION_DOUBLE_TO_INTEGER, DataTypes.DT_INTEGER, DataTypes.DT_DOUBLE);
+    public static final FunctionDefinition	FD_INTEGER_TO_DOUBLE		= new FunctionDefinitionNumberTypeConversion<Double,BigInteger>(XACML3.ID_FUNCTION_INTEGER_TO_DOUBLE, DataTypes.DT_DOUBLE, DataTypes.DT_INTEGER);
 
 
-        /*
-         * Special Match functions (See A.3.14)
-         */
-        public static final FunctionDefinition	FD_X500NAME_MATCH	= new FunctionDefinitionX500NameMatch(XACML3.ID_FUNCTION_X500NAME_MATCH);
-        public static final FunctionDefinition	FD_RFC822NAME_MATCH	= new FunctionDefinitionRFC822NameMatch(XACML3.ID_FUNCTION_RFC822NAME_MATCH);
+    /*
+     * Logical Functions (See A.3.5)
+     */
+    public static final FunctionDefinition	FD_OR		= new FunctionDefinitionLogical(XACML3.ID_FUNCTION_OR, FunctionDefinitionLogical.OPERATION.OR);
+    public static final FunctionDefinition	FD_AND		= new FunctionDefinitionLogical(XACML3.ID_FUNCTION_AND, FunctionDefinitionLogical.OPERATION.AND);
+    public static final FunctionDefinition	FD_N_OF		= new FunctionDefinitionLogical(XACML3.ID_FUNCTION_N_OF, FunctionDefinitionLogical.OPERATION.N_OF);
+    public static final FunctionDefinition	FD_NOT		= new FunctionDefinitionLogical(XACML3.ID_FUNCTION_NOT, FunctionDefinitionLogical.OPERATION.NOT);
 
-        /*
-         * XPath based functions (See A.3.15)
-         * 
-         * THESE ARE OPTIONAL
-         * 
-         */
-        public static final FunctionDefinition	FD_XPATH_NODE_COUNT 			= new FunctionDefinitionXPath<BigInteger>(XACML3.ID_FUNCTION_XPATH_NODE_COUNT, DataTypes.DT_INTEGER, FunctionDefinitionXPath.OPERATION.COUNT);
+
+    /*
+     * Numeric Comparison Functions (See A.3.6 of xacml-3.0-core-spec-os-en.doc)
+     */
+    public static final FunctionDefinition	FD_INTEGER_GREATER_THAN		= new FunctionDefinitionComparison<BigInteger>(XACML3.ID_FUNCTION_INTEGER_GREATER_THAN, DataTypes.DT_INTEGER, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
+    public static final FunctionDefinition	FD_INTEGER_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<BigInteger>(XACML3.ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL, DataTypes.DT_INTEGER, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
+    public static final FunctionDefinition	FD_INTEGER_LESS_THAN		= new FunctionDefinitionComparison<BigInteger>(XACML3.ID_FUNCTION_INTEGER_LESS_THAN, DataTypes.DT_INTEGER, FunctionDefinitionComparison.OPERATION.LESS_THAN);
+    public static final FunctionDefinition	FD_INTEGER_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<BigInteger>(XACML3.ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL, DataTypes.DT_INTEGER, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
+    public static final FunctionDefinition	FD_DOUBLE_GREATER_THAN		= new FunctionDefinitionComparison<Double>(XACML3.ID_FUNCTION_DOUBLE_GREATER_THAN, DataTypes.DT_DOUBLE, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
+    public static final FunctionDefinition	FD_DOUBLE_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<Double>(XACML3.ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL, DataTypes.DT_DOUBLE, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
+    public static final FunctionDefinition	FD_DOUBLE_LESS_THAN		= new FunctionDefinitionComparison<Double>(XACML3.ID_FUNCTION_DOUBLE_LESS_THAN, DataTypes.DT_DOUBLE, FunctionDefinitionComparison.OPERATION.LESS_THAN);
+    public static final FunctionDefinition	FD_DOUBLE_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<Double>(XACML3.ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL, DataTypes.DT_DOUBLE, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
+
+
+    /*
+     * Date and Time Arithmetic Functions (See A.3.7)
+     */
+    public static final FunctionDefinition	FD_DATETIME_ADD_DAYTIMEDURATION					= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION, DataTypes.DT_DATETIME, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
+    public static final FunctionDefinition	FD_DATETIME_ADD_DAYTIMEDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION, DataTypes.DT_DATETIME, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
+    public static final FunctionDefinition	FD_DATETIME_ADD_YEARMONTHDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathYearMonthDuration>(XACML3.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION, DataTypes.DT_DATETIME, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
+    public static final FunctionDefinition	FD_DATETIME_ADD_YEARMONTHDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathYearMonthDuration>(XACML1.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION, DataTypes.DT_DATETIME, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
+
+    public static final FunctionDefinition	FD_DATETIME_SUBTRACT_DAYTIMEDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION, DataTypes.DT_DATETIME, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
+    public static final FunctionDefinition	FD_DATETIME_SUBTRACT_DAYTIMEDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION, DataTypes.DT_DATETIME, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
+    public static final FunctionDefinition	FD_DATETIME_SUBTRACT_YEARMONTHDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathYearMonthDuration>(XACML3.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION, DataTypes.DT_DATETIME, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
+    public static final FunctionDefinition	FD_DATETIME_SUBTRACT_YEARMONTHDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601DateTime,XPathYearMonthDuration>(XACML1.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION, DataTypes.DT_DATETIME, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
+
+    public static final FunctionDefinition	FD_DATE_ADD_YEARMONTHDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601Date,XPathYearMonthDuration>(XACML3.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION, DataTypes.DT_DATE, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
+    public static final FunctionDefinition	FD_DATE_ADD_YEARMONTHDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601Date,XPathYearMonthDuration>(XACML1.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION, DataTypes.DT_DATE, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.ADD);
+    public static final FunctionDefinition	FD_DATE_SUBTRACT_YEARMONTHDURATION				= new FunctionDefinitionDateTimeArithmetic<ISO8601Date,XPathYearMonthDuration>(XACML3.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION, DataTypes.DT_DATE, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
+    public static final FunctionDefinition	FD_DATE_SUBTRACT_YEARMONTHDURATION_VERSION1		= new FunctionDefinitionDateTimeArithmetic<ISO8601Date,XPathYearMonthDuration>(XACML1.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION, DataTypes.DT_DATE, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionDateTimeArithmetic.OPERATION.SUBTRACT);
+
+
+    /*
+     * Non Numeric Comparison Functions (See A.3.8)
+     */
+    public static final FunctionDefinition	FD_STRING_GREATER_THAN		= new FunctionDefinitionComparison<String>(XACML3.ID_FUNCTION_STRING_GREATER_THAN, DataTypes.DT_STRING, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
+    public static final FunctionDefinition	FD_STRING_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<String>(XACML3.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL, DataTypes.DT_STRING, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
+    public static final FunctionDefinition	FD_STRING_LESS_THAN		= new FunctionDefinitionComparison<String>(XACML3.ID_FUNCTION_STRING_LESS_THAN, DataTypes.DT_STRING, FunctionDefinitionComparison.OPERATION.LESS_THAN);
+    public static final FunctionDefinition	FD_STRING_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<String>(XACML3.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL, DataTypes.DT_STRING, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
+    public static final FunctionDefinition	FD_TIME_GREATER_THAN		= new FunctionDefinitionComparison<ISO8601Time>(XACML3.ID_FUNCTION_TIME_GREATER_THAN, DataTypes.DT_TIME, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
+    public static final FunctionDefinition	FD_TIME_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601Time>(XACML3.ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL, DataTypes.DT_TIME, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
+    public static final FunctionDefinition	FD_TIME_LESS_THAN		= new FunctionDefinitionComparison<ISO8601Time>(XACML3.ID_FUNCTION_TIME_LESS_THAN, DataTypes.DT_TIME, FunctionDefinitionComparison.OPERATION.LESS_THAN);
+    public static final FunctionDefinition	FD_TIME_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601Time>(XACML3.ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL, DataTypes.DT_TIME, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
+    public static final FunctionDefinition	FD_TIME_IN_RANGE		= new FunctionDefinitionTimeInRange<ISO8601Time>(XACML3.ID_FUNCTION_TIME_IN_RANGE, DataTypes.DT_TIME);
+    public static final FunctionDefinition	FD_DATE_GREATER_THAN		= new FunctionDefinitionComparison<ISO8601Date>(XACML3.ID_FUNCTION_DATE_GREATER_THAN, DataTypes.DT_DATE, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
+    public static final FunctionDefinition	FD_DATE_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601Date>(XACML3.ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL, DataTypes.DT_DATE, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
+    public static final FunctionDefinition	FD_DATE_LESS_THAN		= new FunctionDefinitionComparison<ISO8601Date>(XACML3.ID_FUNCTION_DATE_LESS_THAN, DataTypes.DT_DATE, FunctionDefinitionComparison.OPERATION.LESS_THAN);
+    public static final FunctionDefinition	FD_DATE_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601Date>(XACML3.ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL, DataTypes.DT_DATE, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
+    public static final FunctionDefinition	FD_DATETIME_GREATER_THAN		= new FunctionDefinitionComparison<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_GREATER_THAN, DataTypes.DT_DATETIME, FunctionDefinitionComparison.OPERATION.GREATER_THAN);
+    public static final FunctionDefinition	FD_DATETIME_GREATER_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL, DataTypes.DT_DATETIME, FunctionDefinitionComparison.OPERATION.GREATER_THAN_EQUAL);
+    public static final FunctionDefinition	FD_DATETIME_LESS_THAN		= new FunctionDefinitionComparison<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_LESS_THAN, DataTypes.DT_DATETIME, FunctionDefinitionComparison.OPERATION.LESS_THAN);
+    public static final FunctionDefinition	FD_DATETIME_LESS_THAN_OR_EQUAL		= new FunctionDefinitionComparison<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL, DataTypes.DT_DATETIME, FunctionDefinitionComparison.OPERATION.LESS_THAN_EQUAL);
+
+
+
+    /*
+     * String functions (See A.3.9 of xacml-3.0-core-spec-os-en.doc)
+     */
+    public static final FunctionDefinition	FD_BOOLEAN_FROM_STRING		= new FunctionDefinitionStringConversion<Boolean,String>(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_BOOLEAN		= new FunctionDefinitionStringConversion<String,Boolean>(XACML3.ID_FUNCTION_STRING_FROM_BOOLEAN, DataTypes.DT_STRING, DataTypes.DT_BOOLEAN);
+    public static final FunctionDefinition	FD_INTEGER_FROM_STRING		= new FunctionDefinitionStringConversion<BigInteger,String>(XACML3.ID_FUNCTION_INTEGER_FROM_STRING, DataTypes.DT_INTEGER, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_INTEGER		= new FunctionDefinitionStringConversion<String,BigInteger>(XACML3.ID_FUNCTION_STRING_FROM_INTEGER, DataTypes.DT_STRING, DataTypes.DT_INTEGER);
+    public static final FunctionDefinition	FD_DOUBLE_FROM_STRING		= new FunctionDefinitionStringConversion<Double,String>(XACML3.ID_FUNCTION_DOUBLE_FROM_STRING, DataTypes.DT_DOUBLE, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_DOUBLE		= new FunctionDefinitionStringConversion<String,Double>(XACML3.ID_FUNCTION_STRING_FROM_DOUBLE, DataTypes.DT_STRING, DataTypes.DT_DOUBLE);
+    public static final FunctionDefinition	FD_TIME_FROM_STRING		= new FunctionDefinitionStringConversion<ISO8601Time,String>(XACML3.ID_FUNCTION_TIME_FROM_STRING, DataTypes.DT_TIME, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_TIME		= new FunctionDefinitionStringConversion<String,ISO8601Time>(XACML3.ID_FUNCTION_STRING_FROM_TIME, DataTypes.DT_STRING, DataTypes.DT_TIME);
+    public static final FunctionDefinition	FD_DATE_FROM_STRING		= new FunctionDefinitionStringConversion<ISO8601Date,String>(XACML3.ID_FUNCTION_DATE_FROM_STRING, DataTypes.DT_DATE, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_DATE		= new FunctionDefinitionStringConversion<String,ISO8601Date>(XACML3.ID_FUNCTION_STRING_FROM_DATE, DataTypes.DT_STRING, DataTypes.DT_DATE);
+    public static final FunctionDefinition	FD_DATETIME_FROM_STRING		= new FunctionDefinitionStringConversion<ISO8601DateTime,String>(XACML3.ID_FUNCTION_DATETIME_FROM_STRING, DataTypes.DT_DATETIME, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_DATETIME		= new FunctionDefinitionStringConversion<String,ISO8601DateTime>(XACML3.ID_FUNCTION_STRING_FROM_DATETIME, DataTypes.DT_STRING, DataTypes.DT_DATETIME);
+    public static final FunctionDefinition	FD_ANYURI_FROM_STRING		= new FunctionDefinitionStringConversion<URI,String>(XACML3.ID_FUNCTION_ANYURI_FROM_STRING, DataTypes.DT_ANYURI, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_ANYURI		= new FunctionDefinitionStringConversion<String,URI>(XACML3.ID_FUNCTION_STRING_FROM_ANYURI, DataTypes.DT_STRING, DataTypes.DT_ANYURI);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_FROM_STRING		= new FunctionDefinitionStringConversion<XPathDayTimeDuration,String>(XACML3.ID_FUNCTION_DAYTIMEDURATION_FROM_STRING, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_DAYTIMEDURATION		= new FunctionDefinitionStringConversion<String,XPathDayTimeDuration>(XACML3.ID_FUNCTION_STRING_FROM_DAYTIMEDURATION, DataTypes.DT_STRING, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_FROM_STRING		= new FunctionDefinitionStringConversion<XPathYearMonthDuration,String>(XACML3.ID_FUNCTION_YEARMONTHDURATION_FROM_STRING, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_YEARMONTHDURATION		= new FunctionDefinitionStringConversion<String,XPathYearMonthDuration>(XACML3.ID_FUNCTION_STRING_FROM_YEARMONTHDURATION, DataTypes.DT_STRING, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_X500NAME_FROM_STRING		= new FunctionDefinitionStringConversion<X500Principal,String>(XACML3.ID_FUNCTION_X500NAME_FROM_STRING, DataTypes.DT_X500NAME, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_X500NAME		= new FunctionDefinitionStringConversion<String,X500Principal>(XACML3.ID_FUNCTION_STRING_FROM_X500NAME, DataTypes.DT_STRING, DataTypes.DT_X500NAME);
+    public static final FunctionDefinition	FD_RFC822NAME_FROM_STRING		= new FunctionDefinitionStringConversion<RFC822Name,String>(XACML3.ID_FUNCTION_RFC822NAME_FROM_STRING, DataTypes.DT_RFC822NAME, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_RFC822NAME		= new FunctionDefinitionStringConversion<String,RFC822Name>(XACML3.ID_FUNCTION_STRING_FROM_RFC822NAME, DataTypes.DT_STRING, DataTypes.DT_RFC822NAME);
+    public static final FunctionDefinition	FD_IPADDRESS_FROM_STRING		= new FunctionDefinitionStringConversion<IPAddress,String>(XACML3.ID_FUNCTION_IPADDRESS_FROM_STRING, DataTypes.DT_IPADDRESS, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_IPADDRESS		= new FunctionDefinitionStringConversion<String,IPAddress>(XACML3.ID_FUNCTION_STRING_FROM_IPADDRESS, DataTypes.DT_STRING, DataTypes.DT_IPADDRESS);
+    public static final FunctionDefinition	FD_DNSNAME_FROM_STRING		= new FunctionDefinitionStringConversion<RFC2396DomainName,String>(XACML3.ID_FUNCTION_DNSNAME_FROM_STRING, DataTypes.DT_DNSNAME, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_STRING_FROM_DNSNAME		= new FunctionDefinitionStringConversion<String,RFC2396DomainName>(XACML3.ID_FUNCTION_STRING_FROM_DNSNAME, DataTypes.DT_STRING, DataTypes.DT_DNSNAME);
+
+    // String Functions not converting Strings to/from DataType objects
+    public static final FunctionDefinition	FD_STRING_CONCATENATE		= new FunctionDefinitionStringFunctions<String,String>(XACML3.ID_FUNCTION_STRING_CONCATENATE, DataTypes.DT_STRING, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.CONCATENATE);
+    public static final FunctionDefinition	FD_STRING_STARTS_WITH		= new FunctionDefinitionStringFunctions<Boolean,String>(XACML3.ID_FUNCTION_STRING_STARTS_WITH, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.STARTS_WITH);
+    public static final FunctionDefinition	FD_ANYURI_STARTS_WITH		= new FunctionDefinitionStringFunctions<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_STARTS_WITH, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionStringFunctions.OPERATION.STARTS_WITH);
+    public static final FunctionDefinition	FD_STRING_ENDS_WITH		= new FunctionDefinitionStringFunctions<Boolean,String>(XACML3.ID_FUNCTION_STRING_ENDS_WITH, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.ENDS_WITH);
+    public static final FunctionDefinition	FD_ANYURI_ENDS_WITH		= new FunctionDefinitionStringFunctions<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_ENDS_WITH, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionStringFunctions.OPERATION.ENDS_WITH);
+    public static final FunctionDefinition	FD_STRING_CONTAINS		= new FunctionDefinitionStringFunctions<Boolean,String>(XACML3.ID_FUNCTION_STRING_CONTAINS, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.CONTAINS);
+    public static final FunctionDefinition	FD_ANYURI_CONTAINS		= new FunctionDefinitionStringFunctions<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_CONTAINS, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionStringFunctions.OPERATION.CONTAINS);
+    public static final FunctionDefinition	FD_STRING_SUBSTRING		= new FunctionDefinitionStringFunctions<String,String>(XACML3.ID_FUNCTION_STRING_SUBSTRING, DataTypes.DT_STRING, DataTypes.DT_STRING, FunctionDefinitionStringFunctions.OPERATION.SUBSTRING);
+    public static final FunctionDefinition	FD_ANYURI_SUBSTRING		= new FunctionDefinitionStringFunctions<String, URI>(XACML3.ID_FUNCTION_ANYURI_SUBSTRING, DataTypes.DT_STRING, DataTypes.DT_ANYURI, FunctionDefinitionStringFunctions.OPERATION.SUBSTRING);
+
+    /*
+     * Bag functions (See A.3.10)
+     */
+    public static final FunctionDefinition	FD_STRING_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<String>(XACML3.ID_FUNCTION_STRING_ONE_AND_ONLY, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_BOOLEAN_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_ONE_AND_ONLY, DataTypes.DT_BOOLEAN);
+    public static final FunctionDefinition	FD_INTEGER_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<BigInteger>(XACML3.ID_FUNCTION_INTEGER_ONE_AND_ONLY, DataTypes.DT_INTEGER);
+    public static final FunctionDefinition	FD_DOUBLE_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<Double>(XACML3.ID_FUNCTION_DOUBLE_ONE_AND_ONLY, DataTypes.DT_DOUBLE);
+    public static final FunctionDefinition	FD_TIME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<ISO8601Time>(XACML3.ID_FUNCTION_TIME_ONE_AND_ONLY, DataTypes.DT_TIME);
+    public static final FunctionDefinition	FD_DATE_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<ISO8601Date>(XACML3.ID_FUNCTION_DATE_ONE_AND_ONLY, DataTypes.DT_DATE);
+    public static final FunctionDefinition	FD_DATETIME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_ONE_AND_ONLY, DataTypes.DT_DATETIME);
+    public static final FunctionDefinition	FD_ANYURI_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<URI>(XACML3.ID_FUNCTION_ANYURI_ONE_AND_ONLY, DataTypes.DT_ANYURI);
+    public static final FunctionDefinition	FD_HEXBINARY_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_ONE_AND_ONLY, DataTypes.DT_HEXBINARY);
+    public static final FunctionDefinition	FD_BASE64BINARY_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY, DataTypes.DT_BASE64BINARY);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_ONE_AND_ONLY_VERSION1		= new FunctionDefinitionBagOneAndOnly<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_ONE_AND_ONLY_VERSION1		= new FunctionDefinitionBagOneAndOnly<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_X500NAME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<X500Principal>(XACML3.ID_FUNCTION_X500NAME_ONE_AND_ONLY, DataTypes.DT_X500NAME);
+    public static final FunctionDefinition	FD_RFC822NAME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_ONE_AND_ONLY, DataTypes.DT_RFC822NAME);
+    public static final FunctionDefinition	FD_IPADDRESS_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_ONE_AND_ONLY, DataTypes.DT_IPADDRESS);
+    public static final FunctionDefinition	FD_DNSNAME_ONE_AND_ONLY		= new FunctionDefinitionBagOneAndOnly<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_ONE_AND_ONLY, DataTypes.DT_DNSNAME);
+
+    public static final FunctionDefinition	FD_STRING_BAG_SIZE		= new FunctionDefinitionBagSize<String>(XACML3.ID_FUNCTION_STRING_BAG_SIZE, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_BOOLEAN_BAG_SIZE		= new FunctionDefinitionBagSize<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_BAG_SIZE, DataTypes.DT_BOOLEAN);
+    public static final FunctionDefinition	FD_INTEGER_BAG_SIZE		= new FunctionDefinitionBagSize<BigInteger>(XACML3.ID_FUNCTION_INTEGER_BAG_SIZE, DataTypes.DT_INTEGER);
+    public static final FunctionDefinition	FD_DOUBLE_BAG_SIZE		= new FunctionDefinitionBagSize<Double>(XACML3.ID_FUNCTION_DOUBLE_BAG_SIZE, DataTypes.DT_DOUBLE);
+    public static final FunctionDefinition	FD_TIME_BAG_SIZE			= new FunctionDefinitionBagSize<ISO8601Time>(XACML3.ID_FUNCTION_TIME_BAG_SIZE, DataTypes.DT_TIME);
+    public static final FunctionDefinition	FD_DATE_BAG_SIZE			= new FunctionDefinitionBagSize<ISO8601Date>(XACML3.ID_FUNCTION_DATE_BAG_SIZE, DataTypes.DT_DATE);
+    public static final FunctionDefinition	FD_DATETIME_BAG_SIZE		= new FunctionDefinitionBagSize<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_BAG_SIZE, DataTypes.DT_DATETIME);
+    public static final FunctionDefinition	FD_ANYURI_BAG_SIZE		= new FunctionDefinitionBagSize<URI>(XACML3.ID_FUNCTION_ANYURI_BAG_SIZE, DataTypes.DT_ANYURI);
+    public static final FunctionDefinition	FD_HEXBINARY_BAG_SIZE		= new FunctionDefinitionBagSize<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_BAG_SIZE, DataTypes.DT_HEXBINARY);
+    public static final FunctionDefinition	FD_BASE64BINARY_BAG_SIZE		= new FunctionDefinitionBagSize<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_BAG_SIZE, DataTypes.DT_BASE64BINARY);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_BAG_SIZE	= new FunctionDefinitionBagSize<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_BAG_SIZE_VERSION1		= new FunctionDefinitionBagSize<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_BAG_SIZE		= new FunctionDefinitionBagSize<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_BAG_SIZE_VERSION1		= new FunctionDefinitionBagSize<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_X500NAME_BAG_SIZE		= new FunctionDefinitionBagSize<X500Principal>(XACML3.ID_FUNCTION_X500NAME_BAG_SIZE, DataTypes.DT_X500NAME);
+    public static final FunctionDefinition	FD_RFC822NAME_BAG_SIZE		= new FunctionDefinitionBagSize<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_BAG_SIZE, DataTypes.DT_RFC822NAME);
+    public static final FunctionDefinition	FD_IPADDRESS_BAG_SIZE		= new FunctionDefinitionBagSize<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_BAG_SIZE, DataTypes.DT_IPADDRESS);
+    public static final FunctionDefinition	FD_DNSNAME_BAG_SIZE		= new FunctionDefinitionBagSize<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_BAG_SIZE, DataTypes.DT_DNSNAME);
+
+    public static final FunctionDefinition	FD_STRING_IS_IN		= new FunctionDefinitionBagIsIn<String>(XACML3.ID_FUNCTION_STRING_IS_IN, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_BOOLEAN_IS_IN		= new FunctionDefinitionBagIsIn<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_IS_IN, DataTypes.DT_BOOLEAN);
+    public static final FunctionDefinition	FD_INTEGER_IS_IN		= new FunctionDefinitionBagIsIn<BigInteger>(XACML3.ID_FUNCTION_INTEGER_IS_IN, DataTypes.DT_INTEGER);
+    public static final FunctionDefinition	FD_DOUBLE_IS_IN		= new FunctionDefinitionBagIsIn<Double>(XACML3.ID_FUNCTION_DOUBLE_IS_IN, DataTypes.DT_DOUBLE);
+    public static final FunctionDefinition	FD_TIME_IS_IN			= new FunctionDefinitionBagIsIn<ISO8601Time>(XACML3.ID_FUNCTION_TIME_IS_IN, DataTypes.DT_TIME);
+    public static final FunctionDefinition	FD_DATE_IS_IN			= new FunctionDefinitionBagIsIn<ISO8601Date>(XACML3.ID_FUNCTION_DATE_IS_IN, DataTypes.DT_DATE);
+    public static final FunctionDefinition	FD_DATETIME_IS_IN		= new FunctionDefinitionBagIsIn<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_IS_IN, DataTypes.DT_DATETIME);
+    public static final FunctionDefinition	FD_ANYURI_IS_IN		= new FunctionDefinitionBagIsIn<URI>(XACML3.ID_FUNCTION_ANYURI_IS_IN, DataTypes.DT_ANYURI);
+    public static final FunctionDefinition	FD_HEXBINARY_IS_IN		= new FunctionDefinitionBagIsIn<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_IS_IN, DataTypes.DT_HEXBINARY);
+    public static final FunctionDefinition	FD_BASE64BINARY_IS_IN		= new FunctionDefinitionBagIsIn<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_IS_IN, DataTypes.DT_BASE64BINARY);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_IS_IN	= new FunctionDefinitionBagIsIn<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_IS_IN, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_IS_IN_VERSION1		= new FunctionDefinitionBagIsIn<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_IS_IN, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_IS_IN		= new FunctionDefinitionBagIsIn<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_IS_IN, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_IS_IN_VERSION1		= new FunctionDefinitionBagIsIn<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_IS_IN, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_X500NAME_IS_IN		= new FunctionDefinitionBagIsIn<X500Principal>(XACML3.ID_FUNCTION_X500NAME_IS_IN, DataTypes.DT_X500NAME);
+    public static final FunctionDefinition	FD_RFC822NAME_IS_IN		= new FunctionDefinitionBagIsIn<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_IS_IN, DataTypes.DT_RFC822NAME);
+    public static final FunctionDefinition	FD_IPADDRESS_IS_IN		= new FunctionDefinitionBagIsIn<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_IS_IN, DataTypes.DT_IPADDRESS);
+    public static final FunctionDefinition	FD_DNSNAME_IS_IN		= new FunctionDefinitionBagIsIn<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_IS_IN, DataTypes.DT_DNSNAME);
+
+    public static final FunctionDefinition	FD_STRING_BAG		= new FunctionDefinitionBag<String>(XACML3.ID_FUNCTION_STRING_BAG, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_BOOLEAN_BAG		= new FunctionDefinitionBag<Boolean>(XACML3.ID_FUNCTION_BOOLEAN_BAG, DataTypes.DT_BOOLEAN);
+    public static final FunctionDefinition	FD_INTEGER_BAG		= new FunctionDefinitionBag<BigInteger>(XACML3.ID_FUNCTION_INTEGER_BAG, DataTypes.DT_INTEGER);
+    public static final FunctionDefinition	FD_DOUBLE_BAG		= new FunctionDefinitionBag<Double>(XACML3.ID_FUNCTION_DOUBLE_BAG, DataTypes.DT_DOUBLE);
+    public static final FunctionDefinition	FD_TIME_BAG			= new FunctionDefinitionBag<ISO8601Time>(XACML3.ID_FUNCTION_TIME_BAG, DataTypes.DT_TIME);
+    public static final FunctionDefinition	FD_DATE_BAG			= new FunctionDefinitionBag<ISO8601Date>(XACML3.ID_FUNCTION_DATE_BAG, DataTypes.DT_DATE);
+    public static final FunctionDefinition	FD_DATETIME_BAG		= new FunctionDefinitionBag<ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_BAG, DataTypes.DT_DATETIME);
+    public static final FunctionDefinition	FD_ANYURI_BAG		= new FunctionDefinitionBag<URI>(XACML3.ID_FUNCTION_ANYURI_BAG, DataTypes.DT_ANYURI);
+    public static final FunctionDefinition	FD_HEXBINARY_BAG		= new FunctionDefinitionBag<HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_BAG, DataTypes.DT_HEXBINARY);
+    public static final FunctionDefinition	FD_BASE64BINARY_BAG		= new FunctionDefinitionBag<Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_BAG, DataTypes.DT_BASE64BINARY);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_BAG	= new FunctionDefinitionBag<XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_BAG, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_BAG_VERSION1		= new FunctionDefinitionBag<XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_BAG, DataTypes.DT_DAYTIMEDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_BAG		= new FunctionDefinitionBag<XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_BAG, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_BAG_VERSION1		= new FunctionDefinitionBag<XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_BAG, DataTypes.DT_YEARMONTHDURATION);
+    public static final FunctionDefinition	FD_X500NAME_BAG		= new FunctionDefinitionBag<X500Principal>(XACML3.ID_FUNCTION_X500NAME_BAG, DataTypes.DT_X500NAME);
+    public static final FunctionDefinition	FD_RFC822NAME_BAG		= new FunctionDefinitionBag<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_BAG, DataTypes.DT_RFC822NAME);
+    public static final FunctionDefinition	FD_IPADDRESS_BAG		= new FunctionDefinitionBag<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_BAG, DataTypes.DT_IPADDRESS);
+    public static final FunctionDefinition	FD_DNSNAME_BAG		= new FunctionDefinitionBag<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_BAG, DataTypes.DT_DNSNAME);
+
+
+    /*
+     * Set Functions (See A.3.11)
+     *
+     * (According to section 10.2.8, this doesn't seem to include
+     * IPAddress or DNSName datatype). This is because Xacml 3.0 did NOT
+     * define an equality operator for these 2 types. See discussion:
+     *
+     * https://lists.oasis-open.org/archives/xacml/201104/msg00014.html
+     *
+     * Also section 10.2.8 is missing XPathExpression versions of these functions.
+     *
+     */
+    public static final FunctionDefinition	FD_STRING_INTERSECTION			= new FunctionDefinitionSet<String,String>(XACML3.ID_FUNCTION_STRING_INTERSECTION, DataTypes.DT_STRING, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_BOOLEAN_INTERSECTION			= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_INTERSECTION, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_INTEGER_INTERSECTION			= new FunctionDefinitionSet<BigInteger,BigInteger>(XACML3.ID_FUNCTION_INTEGER_INTERSECTION, DataTypes.DT_INTEGER, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_DOUBLE_INTERSECTION			= new FunctionDefinitionSet<Double,Double>(XACML3.ID_FUNCTION_DOUBLE_INTERSECTION, DataTypes.DT_DOUBLE, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_TIME_INTERSECTION			= new FunctionDefinitionSet<ISO8601Time,ISO8601Time>(XACML3.ID_FUNCTION_TIME_INTERSECTION, DataTypes.DT_TIME, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_DATE_INTERSECTION			= new FunctionDefinitionSet<ISO8601Date,ISO8601Date>(XACML3.ID_FUNCTION_DATE_INTERSECTION, DataTypes.DT_DATE, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_DATETIME_INTERSECTION		= new FunctionDefinitionSet<ISO8601DateTime, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_INTERSECTION, DataTypes.DT_DATETIME, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_ANYURI_INTERSECTION			= new FunctionDefinitionSet<URI, URI>(XACML3.ID_FUNCTION_ANYURI_INTERSECTION, DataTypes.DT_ANYURI, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_HEXBINARY_INTERSECTION		= new FunctionDefinitionSet<HexBinary,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_INTERSECTION, DataTypes.DT_HEXBINARY, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_BASE64BINARY_INTERSECTION		= new FunctionDefinitionSet<Base64Binary,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_INTERSECTION, DataTypes.DT_BASE64BINARY, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_INTERSECTION		= new FunctionDefinitionSet<XPathDayTimeDuration,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_INTERSECTION, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_INTERSECTION_VERSION1	= new FunctionDefinitionSet<XPathDayTimeDuration,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_INTERSECTION, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_INTERSECTION	= new FunctionDefinitionSet<XPathYearMonthDuration,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_INTERSECTION, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_INTERSECTION_VERSION1	= new FunctionDefinitionSet<XPathYearMonthDuration,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_INTERSECTION, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_X500NAME_INTERSECTION			= new FunctionDefinitionSet<X500Principal,X500Principal>(XACML3.ID_FUNCTION_X500NAME_INTERSECTION, DataTypes.DT_X500NAME, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.INTERSECTION);
+    public static final FunctionDefinition	FD_RFC822NAME_INTERSECTION			= new FunctionDefinitionSet<RFC822Name,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_INTERSECTION, DataTypes.DT_RFC822NAME, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.INTERSECTION);
+
+    public static final FunctionDefinition	FD_STRING_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,String>(XACML3.ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_BOOLEAN_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_INTEGER_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,BigInteger>(XACML3.ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_DOUBLE_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,Double>(XACML3.ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_TIME_AT_LEAST_ONE_MEMBER_OF			= new FunctionDefinitionSet<Boolean,ISO8601Time>(XACML3.ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_DATE_AT_LEAST_ONE_MEMBER_OF			= new FunctionDefinitionSet<Boolean,ISO8601Date>(XACML3.ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_DATETIME_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_ANYURI_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_HEXBINARY_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF_VERSION1	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF_VERSION1	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_X500NAME_AT_LEAST_ONE_MEMBER_OF			= new FunctionDefinitionSet<Boolean,X500Principal>(XACML3.ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+    public static final FunctionDefinition	FD_RFC822NAME_AT_LEAST_ONE_MEMBER_OF		= new FunctionDefinitionSet<Boolean,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF, DataTypes.DT_BOOLEAN, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.AT_LEAST_ONE_MEMBER_OF);
+
+    public static final FunctionDefinition	FD_STRING_UNION			= new FunctionDefinitionSet<String,String>(XACML3.ID_FUNCTION_STRING_UNION, DataTypes.DT_STRING, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_BOOLEAN_UNION		= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_UNION, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_INTEGER_UNION		= new FunctionDefinitionSet<BigInteger,BigInteger>(XACML3.ID_FUNCTION_INTEGER_UNION, DataTypes.DT_INTEGER, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_DOUBLE_UNION			= new FunctionDefinitionSet<Double,Double>(XACML3.ID_FUNCTION_DOUBLE_UNION, DataTypes.DT_DOUBLE, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_TIME_UNION			= new FunctionDefinitionSet<ISO8601Time,ISO8601Time>(XACML3.ID_FUNCTION_TIME_UNION, DataTypes.DT_TIME, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_DATE_UNION			= new FunctionDefinitionSet<ISO8601Date,ISO8601Date>(XACML3.ID_FUNCTION_DATE_UNION, DataTypes.DT_DATE, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_DATETIME_UNION		= new FunctionDefinitionSet<ISO8601DateTime, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_UNION, DataTypes.DT_DATETIME, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_ANYURI_UNION			= new FunctionDefinitionSet<URI, URI>(XACML3.ID_FUNCTION_ANYURI_UNION, DataTypes.DT_ANYURI, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_HEXBINARY_UNION		= new FunctionDefinitionSet<HexBinary,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_UNION, DataTypes.DT_HEXBINARY, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_BASE64BINARY_UNION		= new FunctionDefinitionSet<Base64Binary,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_UNION, DataTypes.DT_BASE64BINARY, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_UNION	= new FunctionDefinitionSet<XPathDayTimeDuration,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_UNION, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_UNION_VERSION1	= new FunctionDefinitionSet<XPathDayTimeDuration,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_UNION, DataTypes.DT_DAYTIMEDURATION, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_UNION	= new FunctionDefinitionSet<XPathYearMonthDuration,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_UNION, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_UNION_VERSION1	= new FunctionDefinitionSet<XPathYearMonthDuration,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_UNION, DataTypes.DT_YEARMONTHDURATION, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_X500NAME_UNION		= new FunctionDefinitionSet<X500Principal,X500Principal>(XACML3.ID_FUNCTION_X500NAME_UNION, DataTypes.DT_X500NAME, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.UNION);
+    public static final FunctionDefinition	FD_RFC822NAME_UNION		= new FunctionDefinitionSet<RFC822Name,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_UNION, DataTypes.DT_RFC822NAME, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.UNION);
+
+    public static final FunctionDefinition	FD_STRING_SUBSET		= new FunctionDefinitionSet<Boolean,String>(XACML3.ID_FUNCTION_STRING_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_BOOLEAN_SUBSET		= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_INTEGER_SUBSET		= new FunctionDefinitionSet<Boolean,BigInteger>(XACML3.ID_FUNCTION_INTEGER_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_DOUBLE_SUBSET		= new FunctionDefinitionSet<Boolean,Double>(XACML3.ID_FUNCTION_DOUBLE_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_TIME_SUBSET			= new FunctionDefinitionSet<Boolean,ISO8601Time>(XACML3.ID_FUNCTION_TIME_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_DATE_SUBSET			= new FunctionDefinitionSet<Boolean,ISO8601Date>(XACML3.ID_FUNCTION_DATE_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_DATETIME_SUBSET		= new FunctionDefinitionSet<Boolean, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_ANYURI_SUBSET		= new FunctionDefinitionSet<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_HEXBINARY_SUBSET		= new FunctionDefinitionSet<Boolean,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_BASE64BINARY_SUBSET		= new FunctionDefinitionSet<Boolean,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_SUBSET	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_SUBSET_VERSION1	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_SUBSET	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_SUBSET_VERSION1	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_X500NAME_SUBSET			= new FunctionDefinitionSet<Boolean,X500Principal>(XACML3.ID_FUNCTION_X500NAME_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.SUBSET);
+    public static final FunctionDefinition	FD_RFC822NAME_SUBSET		= new FunctionDefinitionSet<Boolean,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_SUBSET, DataTypes.DT_BOOLEAN, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.SUBSET);
+
+    public static final FunctionDefinition	FD_STRING_SET_EQUALS		= new FunctionDefinitionSet<Boolean,String>(XACML3.ID_FUNCTION_STRING_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_STRING, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_BOOLEAN_SET_EQUALS		= new FunctionDefinitionSet<Boolean,Boolean>(XACML3.ID_FUNCTION_BOOLEAN_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_INTEGER_SET_EQUALS		= new FunctionDefinitionSet<Boolean,BigInteger>(XACML3.ID_FUNCTION_INTEGER_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_INTEGER, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_DOUBLE_SET_EQUALS		= new FunctionDefinitionSet<Boolean,Double>(XACML3.ID_FUNCTION_DOUBLE_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DOUBLE, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_TIME_SET_EQUALS			= new FunctionDefinitionSet<Boolean,ISO8601Time>(XACML3.ID_FUNCTION_TIME_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_TIME, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_DATE_SET_EQUALS			= new FunctionDefinitionSet<Boolean,ISO8601Date>(XACML3.ID_FUNCTION_DATE_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DATE, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_DATETIME_SET_EQUALS		= new FunctionDefinitionSet<Boolean, ISO8601DateTime>(XACML3.ID_FUNCTION_DATETIME_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DATETIME, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_ANYURI_SET_EQUALS		= new FunctionDefinitionSet<Boolean, URI>(XACML3.ID_FUNCTION_ANYURI_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_HEXBINARY_SET_EQUALS		= new FunctionDefinitionSet<Boolean,HexBinary>(XACML3.ID_FUNCTION_HEXBINARY_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_HEXBINARY, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_BASE64BINARY_SET_EQUALS		= new FunctionDefinitionSet<Boolean,Base64Binary>(XACML3.ID_FUNCTION_BASE64BINARY_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_BASE64BINARY, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_SET_EQUALS	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML3.ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_DAYTIMEDURATION_SET_EQUALS_VERSION1	= new FunctionDefinitionSet<Boolean,XPathDayTimeDuration>(XACML1.ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_DAYTIMEDURATION, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_SET_EQUALS	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML3.ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_YEARMONTHDURATION_SET_EQUALS_VERSION1	= new FunctionDefinitionSet<Boolean,XPathYearMonthDuration>(XACML1.ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_YEARMONTHDURATION, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_X500NAME_SET_EQUALS			= new FunctionDefinitionSet<Boolean,X500Principal>(XACML3.ID_FUNCTION_X500NAME_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_X500NAME, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+    public static final FunctionDefinition	FD_RFC822NAME_SET_EQUALS		= new FunctionDefinitionSet<Boolean,RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_SET_EQUALS, DataTypes.DT_BOOLEAN, DataTypes.DT_RFC822NAME, FunctionDefinitionSet.OPERATION.SET_EQUALS);
+
+
+    /*
+     * Higher Order Bag functions (See A.3.12)
+     */
+    public static final FunctionDefinition	FD_ANY_OF		= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ANY_OF, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF);
+    public static final FunctionDefinition	FD_ANY_OF_VERSION1	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML1.ID_FUNCTION_ANY_OF, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF);
+    public static final FunctionDefinition	FD_ALL_OF		= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ALL_OF, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ALL_OF);
+    public static final FunctionDefinition	FD_ALL_OF_VERSION1	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML1.ID_FUNCTION_ALL_OF, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ALL_OF);
+    public static final FunctionDefinition	FD_ANY_OF_ANY	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ANY_OF_ANY, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF_ANY);
+    public static final FunctionDefinition	FD_ANY_OF_ANY_VERSION1	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML1.ID_FUNCTION_ANY_OF_ANY, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF_ANY);
+    public static final FunctionDefinition	FD_ALL_OF_ANY	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ALL_OF_ANY, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ALL_OF_ANY);
+    public static final FunctionDefinition	FD_ANY_OF_ALL	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ANY_OF_ALL, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ANY_OF_ALL);
+    public static final FunctionDefinition	FD_ALL_OF_ALL	= new FunctionDefinitionHigherOrderBag<Boolean,Object>(XACML3.ID_FUNCTION_ALL_OF_ALL, DataTypes.DT_BOOLEAN, null, FunctionDefinitionHigherOrderBag.OPERATION.ALL_OF_ALL);
+    public static final FunctionDefinition	FD_MAP			= new FunctionDefinitionHigherOrderBag<Object,Object>(XACML3.ID_FUNCTION_MAP, null, null, FunctionDefinitionHigherOrderBag.OPERATION.MAP);
+    public static final FunctionDefinition	FD_MAP_VERSION1	= new FunctionDefinitionHigherOrderBag<Object,Object>(XACML1.ID_FUNCTION_MAP, null, null, FunctionDefinitionHigherOrderBag.OPERATION.MAP);
+
+
+    /*
+     * Regular Expression functions (See A.3.13)
+     */
+    public static final FunctionDefinition	FD_STRING_REGEXP_MATCH		= new FunctionDefinitionRegexpMatch<String>(XACML3.ID_FUNCTION_STRING_REGEXP_MATCH, DataTypes.DT_STRING);
+    public static final FunctionDefinition	FD_ANYURI_REGEXP_MATCH		= new FunctionDefinitionRegexpMatch<URI>(XACML3.ID_FUNCTION_ANYURI_REGEXP_MATCH, DataTypes.DT_ANYURI);
+    public static final FunctionDefinition	FD_IPADDRESS_REGEXP_MATCH	= new FunctionDefinitionRegexpMatch<IPAddress>(XACML3.ID_FUNCTION_IPADDRESS_REGEXP_MATCH, DataTypes.DT_IPADDRESS);
+    public static final FunctionDefinition	FD_DNSNAME_REGEXP_MATCH		= new FunctionDefinitionRegexpMatch<RFC2396DomainName>(XACML3.ID_FUNCTION_DNSNAME_REGEXP_MATCH, DataTypes.DT_DNSNAME);
+    public static final FunctionDefinition	FD_RFC822NAME_REGEXP_MATCH	= new FunctionDefinitionRegexpMatch<RFC822Name>(XACML3.ID_FUNCTION_RFC822NAME_REGEXP_MATCH, DataTypes.DT_RFC822NAME);
+    public static final FunctionDefinition	FD_X500NAME_REGEXP_MATCH	= new FunctionDefinitionRegexpMatch<X500Principal>(XACML3.ID_FUNCTION_X500NAME_REGEXP_MATCH, DataTypes.DT_X500NAME);
+
+
+    /*
+     * Special Match functions (See A.3.14)
+     */
+    public static final FunctionDefinition	FD_X500NAME_MATCH	= new FunctionDefinitionX500NameMatch(XACML3.ID_FUNCTION_X500NAME_MATCH);
+    public static final FunctionDefinition	FD_RFC822NAME_MATCH	= new FunctionDefinitionRFC822NameMatch(XACML3.ID_FUNCTION_RFC822NAME_MATCH);
+
+    /*
+     * XPath based functions (See A.3.15)
+     *
+     * THESE ARE OPTIONAL
+     *
+     */
+    public static final FunctionDefinition	FD_XPATH_NODE_COUNT 			= new FunctionDefinitionXPath<BigInteger>(XACML3.ID_FUNCTION_XPATH_NODE_COUNT, DataTypes.DT_INTEGER, FunctionDefinitionXPath.OPERATION.COUNT);
 //	public static final FunctionDefinition	FD_XPATH_NODE_COUNT_VERSION1 	= new FunctionDefinitionXPath<BigInteger>(XACML1.ID_FUNCTION_XPATH_NODE_COUNT, DataTypes.DT_INTEGER, FunctionDefinitionXPath.OPERATION.COUNT);
-        public static final FunctionDefinition	FD_XPATH_NODE_EQUAL				= new FunctionDefinitionXPath<Boolean>(XACML3.ID_FUNCTION_XPATH_NODE_EQUAL, DataTypes.DT_BOOLEAN, FunctionDefinitionXPath.OPERATION.EQUAL);
+    public static final FunctionDefinition	FD_XPATH_NODE_EQUAL				= new FunctionDefinitionXPath<Boolean>(XACML3.ID_FUNCTION_XPATH_NODE_EQUAL, DataTypes.DT_BOOLEAN, FunctionDefinitionXPath.OPERATION.EQUAL);
 //	public static final FunctionDefinition	FD_XPATH_NODE_EQUAL_VERSION1	= new FunctionDefinitionXPath<Boolean>(XACML1.ID_FUNCTION_XPATH_NODE_EQUAL, DataTypes.DT_BOOLEAN, FunctionDefinitionXPath.OPERATION.EQUAL);
-        public static final FunctionDefinition	FD_XPATH_NODE_MATCH				= new FunctionDefinitionXPath<Boolean>(XACML3.ID_FUNCTION_XPATH_NODE_MATCH, DataTypes.DT_BOOLEAN, FunctionDefinitionXPath.OPERATION.MATCH);
+    public static final FunctionDefinition	FD_XPATH_NODE_MATCH				= new FunctionDefinitionXPath<Boolean>(XACML3.ID_FUNCTION_XPATH_NODE_MATCH, DataTypes.DT_BOOLEAN, FunctionDefinitionXPath.OPERATION.MATCH);
 //	public static final FunctionDefinition	FD_XPATH_NODE_MATCH_VERSION1	= new FunctionDefinitionXPath<Boolean>(XACML1.ID_FUNCTION_XPATH_NODE_MATCH, DataTypes.DT_BOOLEAN, FunctionDefinitionXPath.OPERATION.MATCH);
 
-        
-        /*
-         * Other functions (See A.3.16)
-         * 
-         * THIS ONE IS OPTIONAL
-         * 
-         */
-        public static final FunctionDefinition	FD_ACCESS_PERMITTED = new FunctionDefinitionAccessPermitted(XACML3.ID_FUNCTION_ACCESS_PERMITTED);
+
+    /*
+     * Other functions (See A.3.16)
+     *
+     * THIS ONE IS OPTIONAL
+     *
+     */
+    public static final FunctionDefinition	FD_ACCESS_PERMITTED = new FunctionDefinitionAccessPermitted(XACML3.ID_FUNCTION_ACCESS_PERMITTED);
 
 
-        /*
-         * Deprecated functions (See A.4)
-         * 
-         */
-        public static final FunctionDefinition	FD_URI_STRING_CONCATENATE = new FunctionDefinitionURIStringConcatenate(XACML2.ID_FUNCTION_URI_STRING_CONCATENATE);
+    /*
+     * Deprecated functions (See A.4)
+     *
+     */
+    public static final FunctionDefinition	FD_URI_STRING_CONCATENATE = new FunctionDefinitionURIStringConcatenate(XACML2.ID_FUNCTION_URI_STRING_CONCATENATE);
 
-        
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinder.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinder.java
index 2317405..0a6051a 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinder.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinder.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -64,330 +64,330 @@
 /**
  * StdPolicyFinder implements the {@link com.att.research.xacmlatt.pdp.policy.PolicyFinder} interface to look up policies
  * by their internal ID or an externally visible ID.
- * 
+ *
  * @author car
  * @version $Revision: 1.4 $
  */
 public class StdPolicyFinder implements PolicyFinder {
-        private static final PolicyFinderResult<PolicyDef> PFR_MULTIPLE				= new StdPolicyFinderResult<PolicyDef>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Multiple applicable root policies"));
-        private static final PolicyFinderResult<PolicyDef> PFR_NOT_FOUND			= new StdPolicyFinderResult<PolicyDef>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No matching root policy found"));
-        
-        private static final PolicyFinderResult<Policy>	PFR_POLICY_NOT_FOUND		= new StdPolicyFinderResult<Policy>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No matching policy found"));
-        private static final PolicyFinderResult<Policy>	PFR_NOT_A_POLICY			= new StdPolicyFinderResult<Policy>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Not a policy"));
-        private static final PolicyFinderResult<PolicySet> PFR_POLICYSET_NOT_FOUND	= new StdPolicyFinderResult<PolicySet>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No matching policy set found"));
-        private static final PolicyFinderResult<PolicySet> PFR_NOT_A_POLICYSET		= new StdPolicyFinderResult<PolicySet>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Not a policy set"));	
+    private static final PolicyFinderResult<PolicyDef> PFR_MULTIPLE				= new StdPolicyFinderResult<PolicyDef>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Multiple applicable root policies"));
+    private static final PolicyFinderResult<PolicyDef> PFR_NOT_FOUND			= new StdPolicyFinderResult<PolicyDef>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No matching root policy found"));
 
-        private Log logger	= LogFactory.getLog(this.getClass());
-        private List<PolicyDef> listRoots					= new ArrayList<PolicyDef>();
-        private Map<Identifier,List<PolicyDef>> mapPolicies	= new HashMap<Identifier,List<PolicyDef>>();
-        
-        public static class StdPolicyFinderException extends Exception {
-                private static final long serialVersionUID = -8969282995787463288L;
-                public StdPolicyFinderException(String msg) {
-                        super(msg);
-                }
-                public StdPolicyFinderException(String msg, Throwable cause) {
-                        super(msg, cause);
-                }
+    private static final PolicyFinderResult<Policy>	PFR_POLICY_NOT_FOUND		= new StdPolicyFinderResult<Policy>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No matching policy found"));
+    private static final PolicyFinderResult<Policy>	PFR_NOT_A_POLICY			= new StdPolicyFinderResult<Policy>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Not a policy"));
+    private static final PolicyFinderResult<PolicySet> PFR_POLICYSET_NOT_FOUND	= new StdPolicyFinderResult<PolicySet>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "No matching policy set found"));
+    private static final PolicyFinderResult<PolicySet> PFR_NOT_A_POLICYSET		= new StdPolicyFinderResult<PolicySet>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Not a policy set"));
+
+    private Log logger	= LogFactory.getLog(this.getClass());
+    private List<PolicyDef> listRoots					= new ArrayList<PolicyDef>();
+    private Map<Identifier,List<PolicyDef>> mapPolicies	= new HashMap<Identifier,List<PolicyDef>>();
+
+    public static class StdPolicyFinderException extends Exception {
+        private static final long serialVersionUID = -8969282995787463288L;
+        public StdPolicyFinderException(String msg) {
+            super(msg);
         }
-        
-        private void storeInPolicyMap(PolicyDef policyDef) {
-                List<PolicyDef> listPolicyDefs	= this.mapPolicies.get(policyDef.getIdentifier());
-                if (listPolicyDefs == null) {
-                        listPolicyDefs	= new ArrayList<PolicyDef>();
-                        this.mapPolicies.put(policyDef.getIdentifier(), listPolicyDefs);
-                }
-                listPolicyDefs.add(policyDef);
+        public StdPolicyFinderException(String msg, Throwable cause) {
+            super(msg, cause);
         }
-        
-        private <T extends PolicyDef> List<T> getFromPolicyMap(IdReferenceMatch idReferenceMatch, Class<T> classPolicyDef) {
-                /*
-                 * Get all of the PolicyDefs for the Identifier in the reference match
-                 */
-                List<PolicyDef> listPolicyDefForId	= this.mapPolicies.get(idReferenceMatch.getId());
-                if (listPolicyDefForId == null) {
-                        return null;
-                }
-                
-                /*
-                 * Iterate over all of the PolicyDefs that were found and select only the ones that match
-                 * the version request and the isPolicySet
-                 */
-                List<T> listPolicyDefMatches			= null;
-                Iterator<PolicyDef> iterPolicyDefs		= listPolicyDefForId.iterator();
-                while (iterPolicyDefs.hasNext()) {
-                        PolicyDef policyDef	= iterPolicyDefs.next();
-                        if (classPolicyDef.isInstance(policyDef) && policyDef.matches(idReferenceMatch)) {
-                                if (listPolicyDefMatches == null) {
-                                        listPolicyDefMatches	= new ArrayList<T>();
-                                }
-                                listPolicyDefMatches.add(classPolicyDef.cast(policyDef));
-                        }
-                }
-                
-                return listPolicyDefMatches;
+    }
+
+    private void storeInPolicyMap(PolicyDef policyDef) {
+        List<PolicyDef> listPolicyDefs	= this.mapPolicies.get(policyDef.getIdentifier());
+        if (listPolicyDefs == null) {
+            listPolicyDefs	= new ArrayList<PolicyDef>();
+            this.mapPolicies.put(policyDef.getIdentifier(), listPolicyDefs);
         }
-        
-        private <T extends PolicyDef> T getBestMatchN(List<T> matches) {
-                T bestMatch				= null;
-                Version bestVersion		= null;
-                Iterator<T> iterMatches	= matches.iterator();
-                
-                while (iterMatches.hasNext()) {
-                        T match	= iterMatches.next();
-                        if (bestMatch == null) {
-                                bestMatch	= match;
-                                bestVersion	= match.getVersion();
-                        } else {
-                                Version matchVersion	= match.getVersion();
-                                if (matchVersion != null) {
-                                        if (matchVersion.compareTo(bestVersion) > 0) {
-                                                bestMatch	= match;
-                                                bestVersion	= matchVersion;
-                                        }
-                                }
-                        }
-                }
-                return bestMatch;
+        listPolicyDefs.add(policyDef);
+    }
+
+    private <T extends PolicyDef> List<T> getFromPolicyMap(IdReferenceMatch idReferenceMatch, Class<T> classPolicyDef) {
+        /*
+         * Get all of the PolicyDefs for the Identifier in the reference match
+         */
+        List<PolicyDef> listPolicyDefForId	= this.mapPolicies.get(idReferenceMatch.getId());
+        if (listPolicyDefForId == null) {
+            return null;
         }
-        
-        private <T extends PolicyDef> T getBestMatch(List<T> matches) {
-                switch(matches.size()) {
-                case 0:
-                        return null;
-                case 1:
-                        return matches.get(0);
-                default:
-                        return this.getBestMatchN(matches);
+
+        /*
+         * Iterate over all of the PolicyDefs that were found and select only the ones that match
+         * the version request and the isPolicySet
+         */
+        List<T> listPolicyDefMatches			= null;
+        Iterator<PolicyDef> iterPolicyDefs		= listPolicyDefForId.iterator();
+        while (iterPolicyDefs.hasNext()) {
+            PolicyDef policyDef	= iterPolicyDefs.next();
+            if (classPolicyDef.isInstance(policyDef) && policyDef.matches(idReferenceMatch)) {
+                if (listPolicyDefMatches == null) {
+                    listPolicyDefMatches	= new ArrayList<T>();
                 }
+                listPolicyDefMatches.add(classPolicyDef.cast(policyDef));
+            }
         }
-        
-        private PolicyDef loadPolicyDefFromURI(URI uri) throws StdPolicyFinderException {
-                PolicyDef policyDef	= null;
-                InputStream inputStream	= null;
+
+        return listPolicyDefMatches;
+    }
+
+    private <T extends PolicyDef> T getBestMatchN(List<T> matches) {
+        T bestMatch				= null;
+        Version bestVersion		= null;
+        Iterator<T> iterMatches	= matches.iterator();
+
+        while (iterMatches.hasNext()) {
+            T match	= iterMatches.next();
+            if (bestMatch == null) {
+                bestMatch	= match;
+                bestVersion	= match.getVersion();
+            } else {
+                Version matchVersion	= match.getVersion();
+                if (matchVersion != null) {
+                    if (matchVersion.compareTo(bestVersion) > 0) {
+                        bestMatch	= match;
+                        bestVersion	= matchVersion;
+                    }
+                }
+            }
+        }
+        return bestMatch;
+    }
+
+    private <T extends PolicyDef> T getBestMatch(List<T> matches) {
+        switch(matches.size()) {
+        case 0:
+            return null;
+        case 1:
+            return matches.get(0);
+        default:
+            return this.getBestMatchN(matches);
+        }
+    }
+
+    private PolicyDef loadPolicyDefFromURI(URI uri) throws StdPolicyFinderException {
+        PolicyDef policyDef	= null;
+        InputStream inputStream	= null;
+        try {
+            this.logger.info("Loading policy from URI " + uri.toString());
+            URL url	= uri.toURL();
+            this.logger.debug("Loading policy from URL " + url.toString());
+
+            inputStream	= url.openStream();
+            policyDef	= DOMPolicyDef.load(inputStream);
+        } catch (MalformedURLException ex) {
+            this.logger.debug("Unknown protocol for URI " + uri.toString());
+            return null;
+        } catch (Exception ex) {
+            this.logger.error("Exception loading policy definition", ex);
+            throw new StdPolicyFinderException("Exception loading policy def from \"" + uri.toString() + "\": " + ex.getMessage(), ex);
+        } finally {
+            if (inputStream != null) {
                 try {
-                        this.logger.info("Loading policy from URI " + uri.toString());
-                        URL url	= uri.toURL();
-                        this.logger.debug("Loading policy from URL " + url.toString());
-                        
-                        inputStream	= url.openStream();
-                        policyDef	= DOMPolicyDef.load(inputStream);
-                } catch (MalformedURLException ex) {
-                        this.logger.debug("Unknown protocol for URI " + uri.toString());
-                        return null;
+                    inputStream.close();
                 } catch (Exception ex) {
-                        this.logger.error("Exception loading policy definition", ex);
-                        throw new StdPolicyFinderException("Exception loading policy def from \"" + uri.toString() + "\": " + ex.getMessage(), ex);
-                } finally {
-                        if (inputStream != null) {
-                                try {
-                                        inputStream.close();
-                                } catch (Exception ex) {
-                                        
-                                }
-                        }
-                }
-                return policyDef;
-        }
-        
-        /**
-         * Looks up the given {@link com.att.research.xacml.api.Identifier} in the map first.  If not found, and the <code>Identifier</code> contains
-         * a URL, then attempts to retrieve the document from the URL and caches it.
-         * 
-         * @param idReferenceMatch the <code>IdReferenceMatch</code> to look up
-         * @return a <code>PolicyFinderResult</code> with the requested <code>Policy</code> or an error status
-         */
-        private PolicyFinderResult<Policy> lookupPolicyByIdentifier(IdReferenceMatch idReferenceMatch) {
-                List<Policy> listCachedPolicies	= this.getFromPolicyMap(idReferenceMatch, Policy.class);
-                if (listCachedPolicies == null) {
-                        Identifier id	= idReferenceMatch.getId();
-                        if (id != null) {
-                                URI uri	= id.getUri();
-                                if (uri != null && uri.isAbsolute()) {
-                                        PolicyDef policyDef	= null;
-                                        try {
-                                                policyDef	= this.loadPolicyDefFromURI(uri);
-                                        } catch (StdPolicyFinderException ex) {
-                                                return new StdPolicyFinderResult<Policy>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
-                                        }
-                                        if (policyDef != null) {
-                                                if (policyDef instanceof Policy) {
-                                                        List<PolicyDef> listPolicyDefs	= new ArrayList<PolicyDef>();
-                                                        listPolicyDefs.add(policyDef);
-                                                        this.mapPolicies.put(id, listPolicyDefs);
-                                                        this.mapPolicies.put(policyDef.getIdentifier(), listPolicyDefs);
-                                                        return new StdPolicyFinderResult<Policy>((Policy)policyDef);
-                                                } else {
-                                                        return PFR_NOT_A_POLICY;
-                                                }
-                                        } else {
-                                                return PFR_POLICY_NOT_FOUND;
-                                        }
-                                }
-                        }
-                }
-                if (listCachedPolicies != null) {
-                        return new StdPolicyFinderResult<Policy>(this.getBestMatch(listCachedPolicies));
-                } else {
-                        return PFR_POLICY_NOT_FOUND;
-                }
-        }
-        
-        /**
-         * Looks up the given {@link com.att.research.xacml.api.Identifier} in the map first.  If not found, and the <code>Identifier</code> contains
-         * a URL, then attempts to retrieve the document from the URL and caches it.
-         * 
-         * @param idReferenceMatch the <code>IdReferenceMatch</code> to look up
-         * @return a <code>PolicyFinderResult</code> with the requested <code>PolicySet</code> or an error status
-         */
-        private PolicyFinderResult<PolicySet> lookupPolicySetByIdentifier(IdReferenceMatch idReferenceMatch) {
-                List<PolicySet> listCachedPolicySets	= this.getFromPolicyMap(idReferenceMatch, PolicySet.class);
-                if (listCachedPolicySets == null) {
-                        Identifier id	= idReferenceMatch.getId();
-                        if (id != null) {
-                                URI uri	= id.getUri();
-                                if (uri != null && uri.isAbsolute()) {
-                                        PolicyDef policyDef	= null;
-                                        try {
-                                                policyDef	= this.loadPolicyDefFromURI(uri);
-                                        } catch (StdPolicyFinderException ex) {
-                                                return new StdPolicyFinderResult<PolicySet>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
-                                        }
-                                        if (policyDef != null) {
-                                                if (policyDef instanceof PolicySet) {
-                                                        List<PolicyDef> listPolicyDefs	= new ArrayList<PolicyDef>();
-                                                        listPolicyDefs.add(policyDef);
-                                                        this.mapPolicies.put(id, listPolicyDefs);
-                                                        this.mapPolicies.put(policyDef.getIdentifier(), listPolicyDefs);
-                                                        return new StdPolicyFinderResult<PolicySet>((PolicySet)policyDef);
-                                                } else {
-                                                        return PFR_NOT_A_POLICYSET;
-                                                }
-                                        } else {
-                                                return PFR_POLICYSET_NOT_FOUND;
-                                        }
-                                }
-                        }
-                }
-                if (listCachedPolicySets != null) {
-                        return new StdPolicyFinderResult<PolicySet>(this.getBestMatch(listCachedPolicySets));
-                } else {
-                        return PFR_POLICYSET_NOT_FOUND;
-                }
-        }
-        
-        /**
-         * Adds the given <code>PolicyDef</code> to the map of loaded <code>PolicyDef</code>s and adds
-         * its child <code>PolicyDef</code>s recursively.
-         * 
-         * @param policyDef the <code>PolicyDef</code> to add
-         */
-        private void updatePolicyMap(PolicyDef policyDef) {
-                this.storeInPolicyMap(policyDef);
-                if (policyDef instanceof PolicySet) {
-                        Iterator<PolicySetChild> iterChildren	= ((PolicySet)policyDef).getChildren();
-                        if (iterChildren != null) {
-                                while (iterChildren.hasNext()) {
-                                        PolicySetChild policySetChild	= iterChildren.next();
-                                        if (policySetChild instanceof PolicyDef) {
-                                                this.updatePolicyMap((PolicyDef)policySetChild);
-                                        }
-                                }
-                        }
-                }
-        }
-        
-        public StdPolicyFinder(Collection<PolicyDef> listRootPolicies, Collection<PolicyDef> referencedPolicyDefs) {
-                if (listRootPolicies != null) {
-                        for (PolicyDef policyDef: listRootPolicies) {
-                                this.listRoots.add(policyDef);
-                                this.updatePolicyMap(policyDef);
-                        }
-                }
-                if (referencedPolicyDefs != null) {
-                        for (PolicyDef policyDef: referencedPolicyDefs) {
-                                this.storeInPolicyMap(policyDef);
-                        }
-                }
-        }
-        
-        /**
-         * Creates a new <code>StdPolicyFinder</code> with the given <code>PolicyDef</code> as the root element.
-         * 
-         * @param rootPolicyDef the <code>PolicyDef</code> acting as the root element
-         */
-        public StdPolicyFinder(PolicyDef rootPolicyDef, Collection<PolicyDef> referencedPolicyDefs) {
-                if (rootPolicyDef != null) {
-                        this.listRoots.add(rootPolicyDef);
-                        this.updatePolicyMap(rootPolicyDef);
-                }
-                
-                if (referencedPolicyDefs != null) {
-                        for (PolicyDef policyDef: referencedPolicyDefs) {
-                                this.storeInPolicyMap(policyDef);
-                        }
-                }
-        }
-        
-        public StdPolicyFinder(List<PolicyDef> rootPolicies, List<PolicyDef> referencedPolicies, Properties properties) {
-                this(rootPolicies, referencedPolicies);
-        }
 
-        @Override
-        public PolicyFinderResult<PolicyDef> getRootPolicyDef(EvaluationContext evaluationContext) {
-                PolicyDef policyDefFirstMatch			= null;
-                Iterator<PolicyDef> iterRootPolicies	= this.listRoots.iterator();
-                PolicyFinderResult<PolicyDef> firstIndeterminate	= null;
-                while (iterRootPolicies.hasNext()) {
-                        PolicyDef policyDef	= iterRootPolicies.next();
-                        MatchResult matchResult	= null;
-                        try {
-                                matchResult	= policyDef.match(evaluationContext);
-                                switch(matchResult.getMatchCode()) {
-                                case INDETERMINATE:
-                                        if (firstIndeterminate == null) {
-                                                firstIndeterminate	= new StdPolicyFinderResult<PolicyDef>(matchResult.getStatus());
-                                        }
-                                        break;
-                                case MATCH:
-                                        if (policyDefFirstMatch == null) {
-                                                policyDefFirstMatch	= policyDef;
-                                        } else {
-                                                return PFR_MULTIPLE;
-                                        }
-                                        break;
-                                case NOMATCH:
-                                        break;
-                                }
-                        } catch (EvaluationException ex) {
-                                if (firstIndeterminate == null) {
-                                        firstIndeterminate	= new StdPolicyFinderResult<PolicyDef>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
-                                }
-                        }
                 }
-                
-                if (policyDefFirstMatch == null) {
-                        if (firstIndeterminate != null) {
-                                return firstIndeterminate;
+            }
+        }
+        return policyDef;
+    }
+
+    /**
+     * Looks up the given {@link com.att.research.xacml.api.Identifier} in the map first.  If not found, and the <code>Identifier</code> contains
+     * a URL, then attempts to retrieve the document from the URL and caches it.
+     *
+     * @param idReferenceMatch the <code>IdReferenceMatch</code> to look up
+     * @return a <code>PolicyFinderResult</code> with the requested <code>Policy</code> or an error status
+     */
+    private PolicyFinderResult<Policy> lookupPolicyByIdentifier(IdReferenceMatch idReferenceMatch) {
+        List<Policy> listCachedPolicies	= this.getFromPolicyMap(idReferenceMatch, Policy.class);
+        if (listCachedPolicies == null) {
+            Identifier id	= idReferenceMatch.getId();
+            if (id != null) {
+                URI uri	= id.getUri();
+                if (uri != null && uri.isAbsolute()) {
+                    PolicyDef policyDef	= null;
+                    try {
+                        policyDef	= this.loadPolicyDefFromURI(uri);
+                    } catch (StdPolicyFinderException ex) {
+                        return new StdPolicyFinderResult<Policy>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
+                    }
+                    if (policyDef != null) {
+                        if (policyDef instanceof Policy) {
+                            List<PolicyDef> listPolicyDefs	= new ArrayList<PolicyDef>();
+                            listPolicyDefs.add(policyDef);
+                            this.mapPolicies.put(id, listPolicyDefs);
+                            this.mapPolicies.put(policyDef.getIdentifier(), listPolicyDefs);
+                            return new StdPolicyFinderResult<Policy>((Policy)policyDef);
                         } else {
-                                return PFR_NOT_FOUND;
+                            return PFR_NOT_A_POLICY;
                         }
-                } else {
-                        return new StdPolicyFinderResult<PolicyDef>(policyDefFirstMatch);
+                    } else {
+                        return PFR_POLICY_NOT_FOUND;
+                    }
                 }
+            }
         }
+        if (listCachedPolicies != null) {
+            return new StdPolicyFinderResult<Policy>(this.getBestMatch(listCachedPolicies));
+        } else {
+            return PFR_POLICY_NOT_FOUND;
+        }
+    }
 
-        @Override
-        public PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch) {
-                return this.lookupPolicyByIdentifier(idReferenceMatch);
+    /**
+     * Looks up the given {@link com.att.research.xacml.api.Identifier} in the map first.  If not found, and the <code>Identifier</code> contains
+     * a URL, then attempts to retrieve the document from the URL and caches it.
+     *
+     * @param idReferenceMatch the <code>IdReferenceMatch</code> to look up
+     * @return a <code>PolicyFinderResult</code> with the requested <code>PolicySet</code> or an error status
+     */
+    private PolicyFinderResult<PolicySet> lookupPolicySetByIdentifier(IdReferenceMatch idReferenceMatch) {
+        List<PolicySet> listCachedPolicySets	= this.getFromPolicyMap(idReferenceMatch, PolicySet.class);
+        if (listCachedPolicySets == null) {
+            Identifier id	= idReferenceMatch.getId();
+            if (id != null) {
+                URI uri	= id.getUri();
+                if (uri != null && uri.isAbsolute()) {
+                    PolicyDef policyDef	= null;
+                    try {
+                        policyDef	= this.loadPolicyDefFromURI(uri);
+                    } catch (StdPolicyFinderException ex) {
+                        return new StdPolicyFinderResult<PolicySet>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
+                    }
+                    if (policyDef != null) {
+                        if (policyDef instanceof PolicySet) {
+                            List<PolicyDef> listPolicyDefs	= new ArrayList<PolicyDef>();
+                            listPolicyDefs.add(policyDef);
+                            this.mapPolicies.put(id, listPolicyDefs);
+                            this.mapPolicies.put(policyDef.getIdentifier(), listPolicyDefs);
+                            return new StdPolicyFinderResult<PolicySet>((PolicySet)policyDef);
+                        } else {
+                            return PFR_NOT_A_POLICYSET;
+                        }
+                    } else {
+                        return PFR_POLICYSET_NOT_FOUND;
+                    }
+                }
+            }
         }
+        if (listCachedPolicySets != null) {
+            return new StdPolicyFinderResult<PolicySet>(this.getBestMatch(listCachedPolicySets));
+        } else {
+            return PFR_POLICYSET_NOT_FOUND;
+        }
+    }
 
-        @Override
-        public PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch) {
-                return this.lookupPolicySetByIdentifier(idReferenceMatch);
+    /**
+     * Adds the given <code>PolicyDef</code> to the map of loaded <code>PolicyDef</code>s and adds
+     * its child <code>PolicyDef</code>s recursively.
+     *
+     * @param policyDef the <code>PolicyDef</code> to add
+     */
+    private void updatePolicyMap(PolicyDef policyDef) {
+        this.storeInPolicyMap(policyDef);
+        if (policyDef instanceof PolicySet) {
+            Iterator<PolicySetChild> iterChildren	= ((PolicySet)policyDef).getChildren();
+            if (iterChildren != null) {
+                while (iterChildren.hasNext()) {
+                    PolicySetChild policySetChild	= iterChildren.next();
+                    if (policySetChild instanceof PolicyDef) {
+                        this.updatePolicyMap((PolicyDef)policySetChild);
+                    }
+                }
+            }
         }
-        
-        public void addReferencedPolicy(PolicyDef policyDef) {
+    }
+
+    public StdPolicyFinder(Collection<PolicyDef> listRootPolicies, Collection<PolicyDef> referencedPolicyDefs) {
+        if (listRootPolicies != null) {
+            for (PolicyDef policyDef: listRootPolicies) {
+                this.listRoots.add(policyDef);
                 this.updatePolicyMap(policyDef);
+            }
         }
+        if (referencedPolicyDefs != null) {
+            for (PolicyDef policyDef: referencedPolicyDefs) {
+                this.storeInPolicyMap(policyDef);
+            }
+        }
+    }
+
+    /**
+     * Creates a new <code>StdPolicyFinder</code> with the given <code>PolicyDef</code> as the root element.
+     *
+     * @param rootPolicyDef the <code>PolicyDef</code> acting as the root element
+     */
+    public StdPolicyFinder(PolicyDef rootPolicyDef, Collection<PolicyDef> referencedPolicyDefs) {
+        if (rootPolicyDef != null) {
+            this.listRoots.add(rootPolicyDef);
+            this.updatePolicyMap(rootPolicyDef);
+        }
+
+        if (referencedPolicyDefs != null) {
+            for (PolicyDef policyDef: referencedPolicyDefs) {
+                this.storeInPolicyMap(policyDef);
+            }
+        }
+    }
+
+    public StdPolicyFinder(List<PolicyDef> rootPolicies, List<PolicyDef> referencedPolicies, Properties properties) {
+        this(rootPolicies, referencedPolicies);
+    }
+
+    @Override
+    public PolicyFinderResult<PolicyDef> getRootPolicyDef(EvaluationContext evaluationContext) {
+        PolicyDef policyDefFirstMatch			= null;
+        Iterator<PolicyDef> iterRootPolicies	= this.listRoots.iterator();
+        PolicyFinderResult<PolicyDef> firstIndeterminate	= null;
+        while (iterRootPolicies.hasNext()) {
+            PolicyDef policyDef	= iterRootPolicies.next();
+            MatchResult matchResult	= null;
+            try {
+                matchResult	= policyDef.match(evaluationContext);
+                switch(matchResult.getMatchCode()) {
+                case INDETERMINATE:
+                    if (firstIndeterminate == null) {
+                        firstIndeterminate	= new StdPolicyFinderResult<PolicyDef>(matchResult.getStatus());
+                    }
+                    break;
+                case MATCH:
+                    if (policyDefFirstMatch == null) {
+                        policyDefFirstMatch	= policyDef;
+                    } else {
+                        return PFR_MULTIPLE;
+                    }
+                    break;
+                case NOMATCH:
+                    break;
+                }
+            } catch (EvaluationException ex) {
+                if (firstIndeterminate == null) {
+                    firstIndeterminate	= new StdPolicyFinderResult<PolicyDef>(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage()));
+                }
+            }
+        }
+
+        if (policyDefFirstMatch == null) {
+            if (firstIndeterminate != null) {
+                return firstIndeterminate;
+            } else {
+                return PFR_NOT_FOUND;
+            }
+        } else {
+            return new StdPolicyFinderResult<PolicyDef>(policyDefFirstMatch);
+        }
+    }
+
+    @Override
+    public PolicyFinderResult<Policy> getPolicy(IdReferenceMatch idReferenceMatch) {
+        return this.lookupPolicyByIdentifier(idReferenceMatch);
+    }
+
+    @Override
+    public PolicyFinderResult<PolicySet> getPolicySet(IdReferenceMatch idReferenceMatch) {
+        return this.lookupPolicySetByIdentifier(idReferenceMatch);
+    }
+
+    public void addReferencedPolicy(PolicyDef policyDef) {
+        this.updatePolicyMap(policyDef);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinderFactory.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinderFactory.java
index ee66f6c..5d1062d 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinderFactory.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinderFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -69,176 +69,176 @@
  * <code>getPolicyFinder</code> method to get a single instance of the {@link StdPolicyFinder}.  The
  * root {@link com.att.research.xacmlatt.pdp.policy.PolicyDef} is loaded from a file whose name is specified as a system property or
  * in the $java.home/lib/xacml.properties property set.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class StdPolicyFinderFactory extends PolicyFinderFactory {
-        public static final String	PROP_FILE		= ".file";
-        public static final String	PROP_URL		= ".url";
-        
-        private Log logger							= LogFactory.getLog(this.getClass());
-        private List<PolicyDef> rootPolicies;
-        private List<PolicyDef> referencedPolicies;
-        private boolean needsInit					= true;
-        
-        /**
-         * Loads the <code>PolicyDef</code> for the given <code>String</code> identifier by looking first
-         * for a ".file" property associated with the ID and using that to load from a <code>File</code> and
-         * looking for a ".url" property associated with the ID and using that to load from a <code>URL</code>.
-         * 
-         * @param policyId the <code>String</code> identifier for the policy
-         * @return a <code>PolicyDef</code> loaded from the given identifier
-         */
-        protected PolicyDef loadPolicyDef(String policyId, Properties properties) {
-                String propLocation	= properties.getProperty(policyId + PROP_FILE);
-                if (propLocation != null) {
-                        File fileLocation	= new File(propLocation);
-                        if (!fileLocation.exists()) {
-                                this.logger.error("Policy file " + fileLocation.getAbsolutePath() + " does not exist.");
-                        } else if (!fileLocation.canRead()) {
-                                this.logger.error("Policy file " + fileLocation.getAbsolutePath() + " cannot be read.");
-                        } else {
-                                try {
-                                        this.logger.info("Loading policy file " + fileLocation);
-                                        PolicyDef policyDef	= DOMPolicyDef.load(fileLocation);
-                                        if (policyDef != null) {
-                                                return policyDef;
-                                        }
-                                } catch (DOMStructureException ex) {
-                                        this.logger.error("Error loading policy file " + fileLocation.getAbsolutePath() + ": " + ex.getMessage(), ex);
-                                        return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                                }
-                        }
-                }
-                
-                if ((propLocation = properties.getProperty(policyId + PROP_URL)) != null) {
-                         InputStream is = null;
-                        try {
-                                URL url						= new URL(propLocation);
-                                URLConnection urlConnection	= url.openConnection();
-                                this.logger.info("Loading policy file " + url.toString());
-                                is = urlConnection.getInputStream();
-                                PolicyDef policyDef			= DOMPolicyDef.load(is);
-                                if (policyDef != null) {
-                                        return policyDef;
-                                }
-                        } catch (MalformedURLException ex) {
-                                this.logger.error("Invalid URL " + propLocation + ": " + ex.getMessage(), ex);
-                        } catch (IOException ex) {
-                                this.logger.error("IOException opening URL " + propLocation + ": " + ex.getMessage(), ex);
-                        } catch (DOMStructureException ex) {
-                                this.logger.error("Invalid Policy " + propLocation + ": " + ex.getMessage(), ex);
-                                return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
-                        } finally {
-                                if (is != null) {
-                                        try {
-                                                is.close();
-                                        } catch (IOException e) {
-                                                this.logger.error("Exception closing InputStream for GET of url " + propLocation + " : " + e.getMessage() + "  (May be memory leak)", e);
-                                        }
-                                }
-                        }
-                }
-                
-                this.logger.error("No known location for Policy " + policyId);
-                return null;
-        }
-        
-        /**
-         * Finds the identifiers for all of the policies referenced by the given property name in the
-         * <code>XACMLProperties</code> and loads them using the requested loading method.
-         * 
-         * @param propertyName the <code>String</code> name of the property containing the list of policy identifiers
-         * @return a <code>List</code> of <code>PolicyDef</code>s loaded from the given property name
-         */
-        protected List<PolicyDef> getPolicyDefs(String propertyName, Properties properties) {
-                String policyIds	= properties.getProperty(propertyName);
-                if (policyIds == null || policyIds.length() == 0) {
-                        return null;
-                }
-                
-                Iterable<String> policyIdArray	= Splitter.on(',').trimResults().omitEmptyStrings().split(policyIds);
-                if (policyIdArray == null) {
-                        return null;
-                }
-                
-                List<PolicyDef> listPolicyDefs	= new ArrayList<PolicyDef>();
-                for (String policyId : policyIdArray) {
-                        PolicyDef policyDef	= this.loadPolicyDef(policyId, properties);	
-                        if (policyDef != null) {
-                                listPolicyDefs.add(policyDef);
-                        }
-                }
-                return listPolicyDefs;
-        }
-        
-        protected synchronized void init(Properties properties) {
-                if (this.needsInit) {
-                        //
-                        // Check for property that combines root policies into one policyset
-                        //
-                        String combiningAlgorithm = properties.getProperty(ATTPDPProperties.PROP_POLICYFINDERFACTORY_COMBINEROOTPOLICIES);
-                        if (combiningAlgorithm != null) {
-                                try {
-                                        logger.info("Combining root policies with " + combiningAlgorithm);
-                                        //
-                                        // Find the combining algorithm
-                                        //
-                                        CombiningAlgorithm<PolicySetChild> algorithm = CombiningAlgorithmFactory.newInstance().getPolicyCombiningAlgorithm(new IdentifierImpl(combiningAlgorithm));
-                                        //
-                                        // Create our root policy
-                                        //
-                                        PolicySet root = new PolicySet();
-                                        root.setIdentifier(new IdentifierImpl(UUID.randomUUID().toString()));
-                                        root.setVersion(StdVersion.newInstance("1.0"));
-                                        root.setTarget(new Target());
-                                        //
-                                        // Set the algorithm
-                                        //
-                                        root.setPolicyCombiningAlgorithm(algorithm);
-                                        //
-                                        // Load all our root policies
-                                        //
-                                        for (PolicyDef policy : this.getPolicyDefs(XACMLProperties.PROP_ROOTPOLICIES, properties)) {
-                                                root.addChild(policy);
-                                        }
-                                        //
-                                        // Set this policy as the root
-                                        //
-                                        this.rootPolicies = new ArrayList<>();
-                                        this.rootPolicies.add(root);
-                                } catch (FactoryException | ParseException e) {
-                                        logger.error("Failed to load Combining Algorithm Factory: " + e.getLocalizedMessage());
-                                }
-                        } else {
-                                this.rootPolicies		= this.getPolicyDefs(XACMLProperties.PROP_ROOTPOLICIES, properties);
-                        }
-                        
-                        this.referencedPolicies	= this.getPolicyDefs(XACMLProperties.PROP_REFERENCEDPOLICIES, properties);
-                        this.needsInit	= false;
-                }
-        }
-        
-        public StdPolicyFinderFactory() {
-        }
+    public static final String	PROP_FILE		= ".file";
+    public static final String	PROP_URL		= ".url";
 
-        public StdPolicyFinderFactory(Properties properties) {
-        }
+    private Log logger							= LogFactory.getLog(this.getClass());
+    private List<PolicyDef> rootPolicies;
+    private List<PolicyDef> referencedPolicies;
+    private boolean needsInit					= true;
 
-        @Override
-        public PolicyFinder getPolicyFinder() throws FactoryException {
+    /**
+     * Loads the <code>PolicyDef</code> for the given <code>String</code> identifier by looking first
+     * for a ".file" property associated with the ID and using that to load from a <code>File</code> and
+     * looking for a ".url" property associated with the ID and using that to load from a <code>URL</code>.
+     *
+     * @param policyId the <code>String</code> identifier for the policy
+     * @return a <code>PolicyDef</code> loaded from the given identifier
+     */
+    protected PolicyDef loadPolicyDef(String policyId, Properties properties) {
+        String propLocation	= properties.getProperty(policyId + PROP_FILE);
+        if (propLocation != null) {
+            File fileLocation	= new File(propLocation);
+            if (!fileLocation.exists()) {
+                this.logger.error("Policy file " + fileLocation.getAbsolutePath() + " does not exist.");
+            } else if (!fileLocation.canRead()) {
+                this.logger.error("Policy file " + fileLocation.getAbsolutePath() + " cannot be read.");
+            } else {
                 try {
-                        this.init(XACMLProperties.getProperties());
-                } catch (IOException e) {
-                        throw new FactoryException(e);
+                    this.logger.info("Loading policy file " + fileLocation);
+                    PolicyDef policyDef	= DOMPolicyDef.load(fileLocation);
+                    if (policyDef != null) {
+                        return policyDef;
+                    }
+                } catch (DOMStructureException ex) {
+                    this.logger.error("Error loading policy file " + fileLocation.getAbsolutePath() + ": " + ex.getMessage(), ex);
+                    return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
                 }
-                return new StdPolicyFinder(this.rootPolicies, this.referencedPolicies);
+            }
         }
 
-        @Override
-        public PolicyFinder getPolicyFinder(Properties properties) throws FactoryException {
-                this.init(properties);
-                return new StdPolicyFinder(this.rootPolicies, this.referencedPolicies, properties);
-        }	
+        if ((propLocation = properties.getProperty(policyId + PROP_URL)) != null) {
+            InputStream is = null;
+            try {
+                URL url						= new URL(propLocation);
+                URLConnection urlConnection	= url.openConnection();
+                this.logger.info("Loading policy file " + url.toString());
+                is = urlConnection.getInputStream();
+                PolicyDef policyDef			= DOMPolicyDef.load(is);
+                if (policyDef != null) {
+                    return policyDef;
+                }
+            } catch (MalformedURLException ex) {
+                this.logger.error("Invalid URL " + propLocation + ": " + ex.getMessage(), ex);
+            } catch (IOException ex) {
+                this.logger.error("IOException opening URL " + propLocation + ": " + ex.getMessage(), ex);
+            } catch (DOMStructureException ex) {
+                this.logger.error("Invalid Policy " + propLocation + ": " + ex.getMessage(), ex);
+                return new Policy(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage());
+            } finally {
+                if (is != null) {
+                    try {
+                        is.close();
+                    } catch (IOException e) {
+                        this.logger.error("Exception closing InputStream for GET of url " + propLocation + " : " + e.getMessage() + "  (May be memory leak)", e);
+                    }
+                }
+            }
+        }
+
+        this.logger.error("No known location for Policy " + policyId);
+        return null;
+    }
+
+    /**
+     * Finds the identifiers for all of the policies referenced by the given property name in the
+     * <code>XACMLProperties</code> and loads them using the requested loading method.
+     *
+     * @param propertyName the <code>String</code> name of the property containing the list of policy identifiers
+     * @return a <code>List</code> of <code>PolicyDef</code>s loaded from the given property name
+     */
+    protected List<PolicyDef> getPolicyDefs(String propertyName, Properties properties) {
+        String policyIds	= properties.getProperty(propertyName);
+        if (policyIds == null || policyIds.length() == 0) {
+            return null;
+        }
+
+        Iterable<String> policyIdArray	= Splitter.on(',').trimResults().omitEmptyStrings().split(policyIds);
+        if (policyIdArray == null) {
+            return null;
+        }
+
+        List<PolicyDef> listPolicyDefs	= new ArrayList<PolicyDef>();
+        for (String policyId : policyIdArray) {
+            PolicyDef policyDef	= this.loadPolicyDef(policyId, properties);
+            if (policyDef != null) {
+                listPolicyDefs.add(policyDef);
+            }
+        }
+        return listPolicyDefs;
+    }
+
+    protected synchronized void init(Properties properties) {
+        if (this.needsInit) {
+            //
+            // Check for property that combines root policies into one policyset
+            //
+            String combiningAlgorithm = properties.getProperty(ATTPDPProperties.PROP_POLICYFINDERFACTORY_COMBINEROOTPOLICIES);
+            if (combiningAlgorithm != null) {
+                try {
+                    logger.info("Combining root policies with " + combiningAlgorithm);
+                    //
+                    // Find the combining algorithm
+                    //
+                    CombiningAlgorithm<PolicySetChild> algorithm = CombiningAlgorithmFactory.newInstance().getPolicyCombiningAlgorithm(new IdentifierImpl(combiningAlgorithm));
+                    //
+                    // Create our root policy
+                    //
+                    PolicySet root = new PolicySet();
+                    root.setIdentifier(new IdentifierImpl(UUID.randomUUID().toString()));
+                    root.setVersion(StdVersion.newInstance("1.0"));
+                    root.setTarget(new Target());
+                    //
+                    // Set the algorithm
+                    //
+                    root.setPolicyCombiningAlgorithm(algorithm);
+                    //
+                    // Load all our root policies
+                    //
+                    for (PolicyDef policy : this.getPolicyDefs(XACMLProperties.PROP_ROOTPOLICIES, properties)) {
+                        root.addChild(policy);
+                    }
+                    //
+                    // Set this policy as the root
+                    //
+                    this.rootPolicies = new ArrayList<>();
+                    this.rootPolicies.add(root);
+                } catch (FactoryException | ParseException e) {
+                    logger.error("Failed to load Combining Algorithm Factory: " + e.getLocalizedMessage());
+                }
+            } else {
+                this.rootPolicies		= this.getPolicyDefs(XACMLProperties.PROP_ROOTPOLICIES, properties);
+            }
+
+            this.referencedPolicies	= this.getPolicyDefs(XACMLProperties.PROP_REFERENCEDPOLICIES, properties);
+            this.needsInit	= false;
+        }
+    }
+
+    public StdPolicyFinderFactory() {
+    }
+
+    public StdPolicyFinderFactory(Properties properties) {
+    }
+
+    @Override
+    public PolicyFinder getPolicyFinder() throws FactoryException {
+        try {
+            this.init(XACMLProperties.getProperties());
+        } catch (IOException e) {
+            throw new FactoryException(e);
+        }
+        return new StdPolicyFinder(this.rootPolicies, this.referencedPolicies);
+    }
+
+    @Override
+    public PolicyFinder getPolicyFinder(Properties properties) throws FactoryException {
+        this.init(properties);
+        return new StdPolicyFinder(this.rootPolicies, this.referencedPolicies, properties);
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinderResult.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinderResult.java
index 9c9b602..28604ae 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinderResult.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdPolicyFinderResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,36 +37,36 @@
 
 /**
  * StdPolicyFinderResult implements the {@link com.att.research.xacmlatt.pdp.policy.PolicyFinderResult} interface.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  * @param <T> the java class extending {@link com.att.research.xacmlatt.pdp.policy.PolicyDef} held by the <code>StdPolicyFinderResult</code>
  */
 public class StdPolicyFinderResult<T extends PolicyDef> implements PolicyFinderResult<T> {
-        private Status status;
-        private T policyDef;
-        
-        public StdPolicyFinderResult(Status statusIn, T policyDefIn) {
-                this.status	= (statusIn == null ? StdStatus.STATUS_OK : statusIn);
-                this.policyDef	= policyDefIn;
-        }
-        
-        public StdPolicyFinderResult(Status statusIn) {
-                this(statusIn, null);
-        }
-        
-        public StdPolicyFinderResult(T policyDefIn) {
-                this(null, policyDefIn);
-        }
+    private Status status;
+    private T policyDef;
 
-        @Override
-        public Status getStatus() {
-                return this.status;
-        }
+    public StdPolicyFinderResult(Status statusIn, T policyDefIn) {
+        this.status	= (statusIn == null ? StdStatus.STATUS_OK : statusIn);
+        this.policyDef	= policyDefIn;
+    }
 
-        @Override
-        public T getPolicyDef() {
-                return this.policyDef;
-        }
+    public StdPolicyFinderResult(Status statusIn) {
+        this(statusIn, null);
+    }
+
+    public StdPolicyFinderResult(T policyDefIn) {
+        this(null, policyDefIn);
+    }
+
+    @Override
+    public Status getStatus() {
+        return this.status;
+    }
+
+    @Override
+    public T getPolicyDef() {
+        return this.policyDef;
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdProperties.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdProperties.java
index 0ba09b4..625cd82 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdProperties.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/StdProperties.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 import com.att.research.xacmlatt.pdp.util.ATTPDPProperties;
 
 public class StdProperties extends ATTPDPProperties {
-        protected StdProperties() {
-        }
+    protected StdProperties() {
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/CombinedPermitOverrides.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/CombinedPermitOverrides.java
index ec0c89f..66a916b 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/CombinedPermitOverrides.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/CombinedPermitOverrides.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,9 +43,9 @@
 
 /**
  * @author pameladragosh
- * 
+ *
  * This algorithm was created to support combining a collection of policies in which the permit's are combined into one decision. PermitOverrides
- * itself will stop once a Permit is found. However, some policy makers want every policy in a policy set to be visited by the PDP engine. 
+ * itself will stop once a Permit is found. However, some policy makers want every policy in a policy set to be visited by the PDP engine.
  * The result of all the Permits that were found are then combined and returned. If no Permits were found then the result is the same semantics as
  * the PermitOverrides combining algorithm.
  *
@@ -53,85 +53,85 @@
  */
 public class CombinedPermitOverrides<T extends com.att.research.xacmlatt.pdp.eval.Evaluatable> extends CombiningAlgorithmBase<T> {
 
-        public CombinedPermitOverrides(Identifier identifierIn) {
-                super(identifierIn);
-        }
+    public CombinedPermitOverrides(Identifier identifierIn) {
+        super(identifierIn);
+    }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext,
-                        List<CombiningElement<T>> elements,
-                        List<CombinerParameter> combinerParameters)
-                        throws EvaluationException {
-                boolean atLeastOneDeny					= false;
-                boolean atLeastOnePermit				= false;
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext,
+                                    List<CombiningElement<T>> elements,
+                                    List<CombinerParameter> combinerParameters)
+    throws EvaluationException {
+        boolean atLeastOneDeny					= false;
+        boolean atLeastOnePermit				= false;
 
-                EvaluationResult combinedResultDeny			= new EvaluationResult(Decision.DENY);
-                EvaluationResult combinedResultPermit		= new EvaluationResult(Decision.PERMIT);
-                
-                EvaluationResult firstIndeterminateD	= null;
-                EvaluationResult firstIndeterminateP	= null;
-                EvaluationResult firstIndeterminateDP	= null;
-                
-                Iterator<CombiningElement<T>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<T> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                atLeastOneDeny	= true;
-                                combinedResultDeny.merge(evaluationResultElement);
-                                break;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENYPERMIT:
-                                if (firstIndeterminateDP == null) {
-                                        firstIndeterminateDP	= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateDP.merge(evaluationResultElement);
-                                }
-                                break;
-                        case INDETERMINATE_DENY:
-                                if (firstIndeterminateD == null) {
-                                        firstIndeterminateD		= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateD.merge(evaluationResultElement);
-                                }
-                                break;
-                        case INDETERMINATE_PERMIT:
-                                if (firstIndeterminateP == null) {
-                                        firstIndeterminateP		= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateP.merge(evaluationResultElement);
-                                }
-                                break;
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                atLeastOnePermit = true;
-                                combinedResultPermit.merge(evaluationResultElement);
-                                break;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                }
-                
-                if (atLeastOnePermit) {
-                        return combinedResultPermit;
-                }
-                if (firstIndeterminateDP != null) {
-                        return firstIndeterminateDP;
-                } else if (firstIndeterminateP != null && (firstIndeterminateD != null || atLeastOneDeny)) {
-                        return new EvaluationResult(Decision.INDETERMINATE_DENYPERMIT, firstIndeterminateD.getStatus());
-                } else if (firstIndeterminateP != null) {
-                        return firstIndeterminateP;
-                } else if (atLeastOneDeny) {
-                        return combinedResultDeny;
-                } else if (firstIndeterminateD != null) {
-                        return firstIndeterminateD;
+        EvaluationResult combinedResultDeny			= new EvaluationResult(Decision.DENY);
+        EvaluationResult combinedResultPermit		= new EvaluationResult(Decision.PERMIT);
+
+        EvaluationResult firstIndeterminateD	= null;
+        EvaluationResult firstIndeterminateP	= null;
+        EvaluationResult firstIndeterminateDP	= null;
+
+        Iterator<CombiningElement<T>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<T> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                atLeastOneDeny	= true;
+                combinedResultDeny.merge(evaluationResultElement);
+                break;
+            case INDETERMINATE:
+            case INDETERMINATE_DENYPERMIT:
+                if (firstIndeterminateDP == null) {
+                    firstIndeterminateDP	= evaluationResultElement;
                 } else {
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
+                    firstIndeterminateDP.merge(evaluationResultElement);
                 }
+                break;
+            case INDETERMINATE_DENY:
+                if (firstIndeterminateD == null) {
+                    firstIndeterminateD		= evaluationResultElement;
+                } else {
+                    firstIndeterminateD.merge(evaluationResultElement);
+                }
+                break;
+            case INDETERMINATE_PERMIT:
+                if (firstIndeterminateP == null) {
+                    firstIndeterminateP		= evaluationResultElement;
+                } else {
+                    firstIndeterminateP.merge(evaluationResultElement);
+                }
+                break;
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                atLeastOnePermit = true;
+                combinedResultPermit.merge(evaluationResultElement);
+                break;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
         }
 
+        if (atLeastOnePermit) {
+            return combinedResultPermit;
+        }
+        if (firstIndeterminateDP != null) {
+            return firstIndeterminateDP;
+        } else if (firstIndeterminateP != null && (firstIndeterminateD != null || atLeastOneDeny)) {
+            return new EvaluationResult(Decision.INDETERMINATE_DENYPERMIT, firstIndeterminateD.getStatus());
+        } else if (firstIndeterminateP != null) {
+            return firstIndeterminateP;
+        } else if (atLeastOneDeny) {
+            return combinedResultDeny;
+        } else if (firstIndeterminateD != null) {
+            return firstIndeterminateD;
+        } else {
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
+        }
+    }
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/CombiningAlgorithmBase.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/CombiningAlgorithmBase.java
index c217a27..fbb1fc0 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/CombiningAlgorithmBase.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/CombiningAlgorithmBase.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,27 +34,27 @@
 import com.att.research.xacmlatt.pdp.policy.CombiningAlgorithm;
 
 public abstract class CombiningAlgorithmBase<T extends com.att.research.xacmlatt.pdp.eval.Evaluatable> implements CombiningAlgorithm<T> {
-        private Identifier id;
-        
-        public CombiningAlgorithmBase(Identifier identifierIn) {
-                this.id	= identifierIn;
-        }
+    private Identifier id;
 
-        @Override
-        public Identifier getId() {
-                return this.id;
-        }
+    public CombiningAlgorithmBase(Identifier identifierIn) {
+        this.id	= identifierIn;
+    }
 
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                Object objectToDump;
-                if ((objectToDump = this.getId()) != null) {
-                        stringBuilder.append("id=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    @Override
+    public Identifier getId() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        Object objectToDump;
+        if ((objectToDump = this.getId()) != null) {
+            stringBuilder.append("id=");
+            stringBuilder.append(objectToDump.toString());
         }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/DenyOverrides.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/DenyOverrides.java
index 308173e..80cc469 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/DenyOverrides.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/DenyOverrides.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,7 +43,7 @@
 
 /**
  * DenyOverrides implements the XACML 3.0 "deny-overrides" combining algorithm for both policies and rules.
- * 
+ *
  * @author car
  *
  * @param <T> the java class for the {@link com.att.research.xacmlatt.pdp.eval.Evaluatable}
@@ -51,75 +51,75 @@
  */
 public class DenyOverrides<T extends com.att.research.xacmlatt.pdp.eval.Evaluatable> extends CombiningAlgorithmBase<T> {
 
-        public DenyOverrides(Identifier identifierIn) {
-                super(identifierIn);
-        }
+    public DenyOverrides(Identifier identifierIn) {
+        super(identifierIn);
+    }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<T>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
-                boolean atLeastOnePermit				= false;
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<T>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
+        boolean atLeastOnePermit				= false;
 
-                EvaluationResult combinedResult			= new EvaluationResult(Decision.PERMIT);
-                
-                EvaluationResult firstIndeterminateD	= null;
-                EvaluationResult firstIndeterminateP	= null;
-                EvaluationResult firstIndeterminateDP	= null;
-                
-                Iterator<CombiningElement<T>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<T> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                return evaluationResultElement;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENYPERMIT:
-                                if (firstIndeterminateDP == null) {
-                                        firstIndeterminateDP	= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateDP.merge(evaluationResultElement);
-                                }
-                                break;
-                        case INDETERMINATE_DENY:
-                                if (firstIndeterminateD == null) {
-                                        firstIndeterminateD		= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateD.merge(evaluationResultElement);
-                                }
-                                break;
-                        case INDETERMINATE_PERMIT:
-                                if (firstIndeterminateP == null) {
-                                        firstIndeterminateP		= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateP.merge(evaluationResultElement);
-                                }
-                                break;
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                atLeastOnePermit	= true;
-                                combinedResult.merge(evaluationResultElement);
-                                break;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                }
-                
-                if (firstIndeterminateDP != null) {
-                        return firstIndeterminateDP;
-                } else if (firstIndeterminateD != null && (firstIndeterminateP != null || atLeastOnePermit)) {
-                        return new EvaluationResult(Decision.INDETERMINATE_DENYPERMIT, firstIndeterminateD.getStatus());
-                } else if (firstIndeterminateD != null) {
-                        return firstIndeterminateD;
-                } else if (atLeastOnePermit) {
-                        return combinedResult;
-                } else if (firstIndeterminateP != null) {
-                        return firstIndeterminateP;
+        EvaluationResult combinedResult			= new EvaluationResult(Decision.PERMIT);
+
+        EvaluationResult firstIndeterminateD	= null;
+        EvaluationResult firstIndeterminateP	= null;
+        EvaluationResult firstIndeterminateDP	= null;
+
+        Iterator<CombiningElement<T>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<T> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                return evaluationResultElement;
+            case INDETERMINATE:
+            case INDETERMINATE_DENYPERMIT:
+                if (firstIndeterminateDP == null) {
+                    firstIndeterminateDP	= evaluationResultElement;
                 } else {
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
+                    firstIndeterminateDP.merge(evaluationResultElement);
                 }
+                break;
+            case INDETERMINATE_DENY:
+                if (firstIndeterminateD == null) {
+                    firstIndeterminateD		= evaluationResultElement;
+                } else {
+                    firstIndeterminateD.merge(evaluationResultElement);
+                }
+                break;
+            case INDETERMINATE_PERMIT:
+                if (firstIndeterminateP == null) {
+                    firstIndeterminateP		= evaluationResultElement;
+                } else {
+                    firstIndeterminateP.merge(evaluationResultElement);
+                }
+                break;
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                atLeastOnePermit	= true;
+                combinedResult.merge(evaluationResultElement);
+                break;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
         }
 
+        if (firstIndeterminateDP != null) {
+            return firstIndeterminateDP;
+        } else if (firstIndeterminateD != null && (firstIndeterminateP != null || atLeastOnePermit)) {
+            return new EvaluationResult(Decision.INDETERMINATE_DENYPERMIT, firstIndeterminateD.getStatus());
+        } else if (firstIndeterminateD != null) {
+            return firstIndeterminateD;
+        } else if (atLeastOnePermit) {
+            return combinedResult;
+        } else if (firstIndeterminateP != null) {
+            return firstIndeterminateP;
+        } else {
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
+        }
+    }
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/DenyUnlessPermit.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/DenyUnlessPermit.java
index 4ad83e5..4f78018 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/DenyUnlessPermit.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/DenyUnlessPermit.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,7 +43,7 @@
 
 /**
  * DenyUnlessPermit implements the XACML 3.0 "deny-unless-permit" combining algorithm for both policies and rules.
- * 
+ *
  * @author car
  *
  * @param <T> the java class for the {@link com.att.research.xacmlatt.pdp.eval.Evaluatable}
@@ -51,38 +51,38 @@
  */
 public class DenyUnlessPermit<T extends com.att.research.xacmlatt.pdp.eval.Evaluatable> extends CombiningAlgorithmBase<T> {
 
-        public DenyUnlessPermit(Identifier identifierIn) {
-                super(identifierIn);
+    public DenyUnlessPermit(Identifier identifierIn) {
+        super(identifierIn);
+    }
+
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<T>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
+        EvaluationResult combinedResult			= new EvaluationResult(Decision.DENY);
+
+        Iterator<CombiningElement<T>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<T> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                combinedResult.merge(evaluationResultElement);
+                break;
+            case INDETERMINATE:
+            case INDETERMINATE_DENYPERMIT:
+            case INDETERMINATE_DENY:
+            case INDETERMINATE_PERMIT:
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                return evaluationResultElement;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
         }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<T>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
-                EvaluationResult combinedResult			= new EvaluationResult(Decision.DENY);
-                
-                Iterator<CombiningElement<T>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<T> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                combinedResult.merge(evaluationResultElement);
-                                break;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENYPERMIT:
-                        case INDETERMINATE_DENY:
-                        case INDETERMINATE_PERMIT:
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                return evaluationResultElement;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                }
-                
-                return combinedResult;
-        }
+        return combinedResult;
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/FirstApplicable.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/FirstApplicable.java
index f68fbe6..4fbea84 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/FirstApplicable.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/FirstApplicable.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,35 +44,35 @@
 /**
  * PermitOverrides extends {@link com.att.research.xacmlatt.pdp.std.combiners.CombiningAlgorithmBase} to implement the
  * XACML 1.0 "first-applicable" combining algorithm for policies and rules.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
- * 
+ *
  * @param <T> the java class of the object to be combined
  */
 public class FirstApplicable<T extends com.att.research.xacmlatt.pdp.eval.Evaluatable> extends CombiningAlgorithmBase<T> {
 
-        public FirstApplicable(Identifier identifierIn) {
-                super(identifierIn);
+    public FirstApplicable(Identifier identifierIn) {
+        super(identifierIn);
+    }
+
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext,
+                                    List<CombiningElement<T>> elements,
+                                    List<CombinerParameter> combinerParameters)
+    throws EvaluationException {
+        Iterator<CombiningElement<T>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<T> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            if (evaluationResultElement.getDecision() != Decision.NOTAPPLICABLE) {
+                return evaluationResultElement;
+            }
         }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext,
-                        List<CombiningElement<T>> elements,
-                        List<CombinerParameter> combinerParameters)
-                        throws EvaluationException {
-                Iterator<CombiningElement<T>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<T> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        if (evaluationResultElement.getDecision() != Decision.NOTAPPLICABLE) {
-                                return evaluationResultElement;
-                        }
-                }
-                
-                return new EvaluationResult(Decision.NOTAPPLICABLE);
-        }
+        return new EvaluationResult(Decision.NOTAPPLICABLE);
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyDenyOverridesPolicy.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyDenyOverridesPolicy.java
index 73fac7e..ada0e52 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyDenyOverridesPolicy.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyDenyOverridesPolicy.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,7 +45,7 @@
 
 /**
  * DenyOverrides implements the XACML 1.0 "deny-overrides" combining algorithm for policies and policy sets.
- * 
+ *
  * @author car
  *
  * @param <T> the java class for the {@link com.att.research.xacmlatt.pdp.eval.Evaluatable}
@@ -53,46 +53,46 @@
  */
 public class LegacyDenyOverridesPolicy extends CombiningAlgorithmBase<PolicySetChild> {
 
-        public LegacyDenyOverridesPolicy(Identifier identifierIn) {
-                super(identifierIn);
+    public LegacyDenyOverridesPolicy(Identifier identifierIn) {
+        super(identifierIn);
+    }
+
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<PolicySetChild>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
+        boolean atLeastOnePermit				= false;
+
+        EvaluationResult combinedResult			= new EvaluationResult(Decision.PERMIT);
+
+        Iterator<CombiningElement<PolicySetChild>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<PolicySetChild> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                return evaluationResultElement;
+            case INDETERMINATE:
+            case INDETERMINATE_DENYPERMIT:
+            case INDETERMINATE_DENY:
+            case INDETERMINATE_PERMIT:
+                return new EvaluationResult(Decision.DENY, StdStatus.STATUS_OK);
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                atLeastOnePermit	= true;
+                combinedResult.merge(evaluationResultElement);
+                break;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
         }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<PolicySetChild>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
-                boolean atLeastOnePermit				= false;
-
-                EvaluationResult combinedResult			= new EvaluationResult(Decision.PERMIT);
-                
-                Iterator<CombiningElement<PolicySetChild>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<PolicySetChild> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                return evaluationResultElement;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENYPERMIT:
-                        case INDETERMINATE_DENY:
-                        case INDETERMINATE_PERMIT:
-                                return new EvaluationResult(Decision.DENY, StdStatus.STATUS_OK);
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                atLeastOnePermit	= true;
-                                combinedResult.merge(evaluationResultElement);
-                                break;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                }
-                
-                if (atLeastOnePermit) {
-                        return combinedResult;
-                } else {
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
-                }
+        if (atLeastOnePermit) {
+            return combinedResult;
+        } else {
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
         }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyDenyOverridesRule.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyDenyOverridesRule.java
index d6fa39f..f47ff02 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyDenyOverridesRule.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyDenyOverridesRule.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,7 +45,7 @@
 
 /**
  * DenyOverrides implements the XACML 1.0 "deny-overrides" combining algorithm for rules.
- * 
+ *
  * @author car
  *
  * @param <T> the java class for the {@link com.att.research.xacmlatt.pdp.eval.Evaluatable}
@@ -53,59 +53,59 @@
  */
 public class LegacyDenyOverridesRule extends CombiningAlgorithmBase<Rule> {
 
-        public LegacyDenyOverridesRule(Identifier identifierIn) {
-                super(identifierIn);
-        }
+    public LegacyDenyOverridesRule(Identifier identifierIn) {
+        super(identifierIn);
+    }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<Rule>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
-                boolean atLeastOnePermit						= false;
-                boolean potentialDeny							= false;
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<Rule>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
+        boolean atLeastOnePermit						= false;
+        boolean potentialDeny							= false;
 
-                EvaluationResult combinedResult					= new EvaluationResult(Decision.PERMIT);
-                EvaluationResult evaluationResultIndeterminate	= null;
-                
-                Iterator<CombiningElement<Rule>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<Rule> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                return evaluationResultElement;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENYPERMIT:
-                        case INDETERMINATE_DENY:
-                        case INDETERMINATE_PERMIT:
-                                if (evaluationResultIndeterminate == null) {
-                                        evaluationResultIndeterminate	= evaluationResultElement;
-                                } else {
-                                        evaluationResultIndeterminate.merge(evaluationResultElement);
-                                }
-                                if (combiningElement.getEvaluatable().getRuleEffect() == RuleEffect.DENY) {
-                                        potentialDeny	= true;
-                                }
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                atLeastOnePermit	= true;
-                                combinedResult.merge(evaluationResultElement);
-                                break;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                }
-                
-                if (potentialDeny) {
-                        return evaluationResultIndeterminate;
-                } else if (atLeastOnePermit) {
-                        return combinedResult;
-                } else if (evaluationResultIndeterminate != null) {
-                        return evaluationResultIndeterminate;
+        EvaluationResult combinedResult					= new EvaluationResult(Decision.PERMIT);
+        EvaluationResult evaluationResultIndeterminate	= null;
+
+        Iterator<CombiningElement<Rule>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<Rule> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                return evaluationResultElement;
+            case INDETERMINATE:
+            case INDETERMINATE_DENYPERMIT:
+            case INDETERMINATE_DENY:
+            case INDETERMINATE_PERMIT:
+                if (evaluationResultIndeterminate == null) {
+                    evaluationResultIndeterminate	= evaluationResultElement;
                 } else {
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
+                    evaluationResultIndeterminate.merge(evaluationResultElement);
                 }
+                if (combiningElement.getEvaluatable().getRuleEffect() == RuleEffect.DENY) {
+                    potentialDeny	= true;
+                }
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                atLeastOnePermit	= true;
+                combinedResult.merge(evaluationResultElement);
+                break;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
         }
 
+        if (potentialDeny) {
+            return evaluationResultIndeterminate;
+        } else if (atLeastOnePermit) {
+            return combinedResult;
+        } else if (evaluationResultIndeterminate != null) {
+            return evaluationResultIndeterminate;
+        } else {
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
+        }
+    }
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyPermitOverridesPolicy.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyPermitOverridesPolicy.java
index 48bf98a..14ed774 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyPermitOverridesPolicy.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyPermitOverridesPolicy.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,61 +45,61 @@
 /**
  * LegacyPermitOverridesPolicy extends {@link com.att.research.xacmlatt.pdp.policy.combiners.CombiningAlgorithmBase} for
  * {@link com.att.research.xacmlatt.pdp.policy.PolicySetChild} elements implementing the XACML 1.0 permit-overrides policy combining algorithm.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class LegacyPermitOverridesPolicy extends CombiningAlgorithmBase<PolicySetChild> {
 
-        public LegacyPermitOverridesPolicy(Identifier identifierIn) {
-                super(identifierIn);
+    public LegacyPermitOverridesPolicy(Identifier identifierIn) {
+        super(identifierIn);
+    }
+
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<PolicySetChild>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
+        boolean atLeastOneDeny							= false;
+
+        EvaluationResult evaluationResultCombined		= new EvaluationResult(Decision.DENY);
+        EvaluationResult evaluationResultIndeterminate	= null;
+
+        Iterator<CombiningElement<PolicySetChild>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<PolicySetChild> combiningElement	= iterElements.next();
+            EvaluationResult evaluationResultElement			= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                atLeastOneDeny	= true;
+                evaluationResultCombined.merge(evaluationResultElement);
+                break;
+            case INDETERMINATE:
+            case INDETERMINATE_DENY:
+            case INDETERMINATE_DENYPERMIT:
+            case INDETERMINATE_PERMIT:
+                if (evaluationResultIndeterminate == null) {
+                    evaluationResultIndeterminate	= evaluationResultElement;
+                } else {
+                    evaluationResultIndeterminate.merge(evaluationResultElement);
+                }
+                break;
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                return evaluationResultElement;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
+
         }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<PolicySetChild>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
-                boolean atLeastOneDeny							= false;
-                
-                EvaluationResult evaluationResultCombined		= new EvaluationResult(Decision.DENY);
-                EvaluationResult evaluationResultIndeterminate	= null;
-                
-                Iterator<CombiningElement<PolicySetChild>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<PolicySetChild> combiningElement	= iterElements.next();
-                        EvaluationResult evaluationResultElement			= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                atLeastOneDeny	= true;
-                                evaluationResultCombined.merge(evaluationResultElement);
-                                break;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENY:
-                        case INDETERMINATE_DENYPERMIT:
-                        case INDETERMINATE_PERMIT:
-                                if (evaluationResultIndeterminate == null) {
-                                        evaluationResultIndeterminate	= evaluationResultElement;
-                                } else {
-                                        evaluationResultIndeterminate.merge(evaluationResultElement);
-                                }
-                                break;
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                return evaluationResultElement;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                        
-                }
-                
-                if (atLeastOneDeny) {
-                        return evaluationResultCombined;
-                } else if (evaluationResultIndeterminate != null) {
-                        return evaluationResultIndeterminate;
-                } else {
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
-                }
+        if (atLeastOneDeny) {
+            return evaluationResultCombined;
+        } else if (evaluationResultIndeterminate != null) {
+            return evaluationResultIndeterminate;
+        } else {
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
         }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyPermitOverridesRule.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyPermitOverridesRule.java
index 57f6136..6d27266 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyPermitOverridesRule.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/LegacyPermitOverridesRule.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,66 +46,66 @@
 /**
  * LegacyPermitOverridesRule extends {@link com.att.research.xacmlatt.pdp.policy.combiners.CombiningAlgorithmBase} for
  * {@link com.att.research.xacmlatt.pdp.policy.Rule}s to implement the XACML 1.0 permit-overrides rule combining algorithm.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class LegacyPermitOverridesRule extends CombiningAlgorithmBase<Rule> {
 
-        public LegacyPermitOverridesRule(Identifier identifierIn) {
-                super(identifierIn);
+    public LegacyPermitOverridesRule(Identifier identifierIn) {
+        super(identifierIn);
+    }
+
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<Rule>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
+        boolean atLeastOneDeny							= false;
+        boolean potentialPermit							= false;
+
+        EvaluationResult evaluationResultCombined		= new EvaluationResult(Decision.DENY);
+        EvaluationResult evaluationResultIndeterminate	= null;
+
+        Iterator<CombiningElement<Rule>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<Rule> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                atLeastOneDeny	= true;
+                evaluationResultCombined.merge(evaluationResultElement);
+                break;
+            case INDETERMINATE:
+            case INDETERMINATE_DENYPERMIT:
+            case INDETERMINATE_DENY:
+            case INDETERMINATE_PERMIT:
+                if (evaluationResultIndeterminate == null) {
+                    evaluationResultIndeterminate	= evaluationResultElement;
+                } else {
+                    evaluationResultIndeterminate.merge(evaluationResultElement);
+                }
+                if (combiningElement.getEvaluatable().getRuleEffect() == RuleEffect.PERMIT) {
+                    potentialPermit	= true;
+                }
+                break;
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                return evaluationResultElement;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
         }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<Rule>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
-                boolean atLeastOneDeny							= false;
-                boolean potentialPermit							= false;
-                
-                EvaluationResult evaluationResultCombined		= new EvaluationResult(Decision.DENY);
-                EvaluationResult evaluationResultIndeterminate	= null;
-                
-                Iterator<CombiningElement<Rule>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<Rule> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                atLeastOneDeny	= true;
-                                evaluationResultCombined.merge(evaluationResultElement);
-                                break;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENYPERMIT:
-                        case INDETERMINATE_DENY:
-                        case INDETERMINATE_PERMIT:
-                                if (evaluationResultIndeterminate == null) {
-                                        evaluationResultIndeterminate	= evaluationResultElement;
-                                } else {
-                                        evaluationResultIndeterminate.merge(evaluationResultElement);
-                                }
-                                if (combiningElement.getEvaluatable().getRuleEffect() == RuleEffect.PERMIT) {
-                                        potentialPermit	= true;
-                                }
-                                break;
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                return evaluationResultElement;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                }
-                
-                if (potentialPermit) {
-                        return evaluationResultIndeterminate;
-                } else if (atLeastOneDeny) {
-                        return evaluationResultCombined;
-                } else if (evaluationResultIndeterminate != null) {
-                        return evaluationResultIndeterminate;
-                } else {
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
-                }
+        if (potentialPermit) {
+            return evaluationResultIndeterminate;
+        } else if (atLeastOneDeny) {
+            return evaluationResultCombined;
+        } else if (evaluationResultIndeterminate != null) {
+            return evaluationResultIndeterminate;
+        } else {
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
         }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/OnlyOneApplicable.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/OnlyOneApplicable.java
index 5c49b5f..ca67935 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/OnlyOneApplicable.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/OnlyOneApplicable.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,51 +48,51 @@
 /**
  * OnlyOneApplicable extends {@link com.att.research.xacmlatt.pdp.std.combiners.CombiningAlgorithmBase} to implement the
  * XACML 1.0 "only-one-applicable" combining algorithm for policies and rules.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
- * 
+ *
  * @param <T> the java class of the object to be combined
  */
 public class OnlyOneApplicable extends CombiningAlgorithmBase<PolicySetChild> {
 
-        public OnlyOneApplicable(Identifier identifierIn) {
-                super(identifierIn);
+    public OnlyOneApplicable(Identifier identifierIn) {
+        super(identifierIn);
+    }
+
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext,
+                                    List<CombiningElement<PolicySetChild>> elements,
+                                    List<CombinerParameter> combinerParameters)
+    throws EvaluationException {
+        Iterator<CombiningElement<PolicySetChild>> iterElements	= elements.iterator();
+        PolicySetChild policySetChildApplicable					= null;
+        while (iterElements.hasNext()) {
+            CombiningElement<PolicySetChild> combiningElement		= iterElements.next();
+            MatchResult matchResultElement				= combiningElement.getEvaluatable().match(evaluationContext);
+
+            switch(matchResultElement.getMatchCode()) {
+            case INDETERMINATE:
+                return new EvaluationResult(Decision.INDETERMINATE, matchResultElement.getStatus());
+            case MATCH:
+                if (policySetChildApplicable == null) {
+                    policySetChildApplicable	= combiningElement.getEvaluatable();
+                } else {
+                    return new EvaluationResult(Decision.INDETERMINATE, new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "More than one applicable policy"));
+                }
+                break;
+            case NOMATCH:
+                break;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + matchResultElement.getMatchCode().toString());
+            }
         }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext,
-                        List<CombiningElement<PolicySetChild>> elements,
-                        List<CombinerParameter> combinerParameters)
-                        throws EvaluationException {
-                Iterator<CombiningElement<PolicySetChild>> iterElements	= elements.iterator();
-                PolicySetChild policySetChildApplicable					= null;
-                while (iterElements.hasNext()) {
-                        CombiningElement<PolicySetChild> combiningElement		= iterElements.next();
-                        MatchResult matchResultElement				= combiningElement.getEvaluatable().match(evaluationContext);
-                        
-                        switch(matchResultElement.getMatchCode()) {
-                        case INDETERMINATE:
-                                return new EvaluationResult(Decision.INDETERMINATE, matchResultElement.getStatus());
-                        case MATCH:
-                                if (policySetChildApplicable == null) {
-                                        policySetChildApplicable	= combiningElement.getEvaluatable();
-                                } else {
-                                        return new EvaluationResult(Decision.INDETERMINATE, new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "More than one applicable policy"));
-                                }
-                                break;
-                        case NOMATCH:
-                                break;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + matchResultElement.getMatchCode().toString());
-                        }			
-                }
-                
-                if (policySetChildApplicable != null) {
-                        return policySetChildApplicable.evaluate(evaluationContext);
-                } else {
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
-                }		
+        if (policySetChildApplicable != null) {
+            return policySetChildApplicable.evaluate(evaluationContext);
+        } else {
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
         }
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/PermitOverrides.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/PermitOverrides.java
index bcdc62f..69c1523 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/PermitOverrides.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/PermitOverrides.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,86 +44,86 @@
 /**
  * PermitOverrides extends {@link com.att.research.xacmlatt.pdp.std.combiners.CombiningAlgorithmBase} to implement the
  * XACML 3.0 Permit-overrides combining algorithm for policies and rules.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
- * 
+ *
  * @param <T> the java class of the object to be combined
  */
 public class PermitOverrides<T extends com.att.research.xacmlatt.pdp.eval.Evaluatable> extends CombiningAlgorithmBase<T> {
 
-        public PermitOverrides(Identifier identifierIn) {
-                super(identifierIn);
-        }
+    public PermitOverrides(Identifier identifierIn) {
+        super(identifierIn);
+    }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext,
-                        List<CombiningElement<T>> elements,
-                        List<CombinerParameter> combinerParameters)
-                        throws EvaluationException {
-                boolean atLeastOneDeny					= false;
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext,
+                                    List<CombiningElement<T>> elements,
+                                    List<CombinerParameter> combinerParameters)
+    throws EvaluationException {
+        boolean atLeastOneDeny					= false;
 
-                EvaluationResult combinedResult			= new EvaluationResult(Decision.DENY);
-                
-                EvaluationResult firstIndeterminateD	= null;
-                EvaluationResult firstIndeterminateP	= null;
-                EvaluationResult firstIndeterminateDP	= null;
-                
-                Iterator<CombiningElement<T>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<T> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                atLeastOneDeny	= true;
-                                combinedResult.merge(evaluationResultElement);
-                                break;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENYPERMIT:
-                                if (firstIndeterminateDP == null) {
-                                        firstIndeterminateDP	= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateDP.merge(evaluationResultElement);
-                                }
-                                break;
-                        case INDETERMINATE_DENY:
-                                if (firstIndeterminateD == null) {
-                                        firstIndeterminateD		= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateD.merge(evaluationResultElement);
-                                }
-                                break;
-                        case INDETERMINATE_PERMIT:
-                                if (firstIndeterminateP == null) {
-                                        firstIndeterminateP		= evaluationResultElement;
-                                } else {
-                                        firstIndeterminateP.merge(evaluationResultElement);
-                                }
-                                break;
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                return evaluationResultElement;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                }
-                
-                if (firstIndeterminateDP != null) {
-                        return firstIndeterminateDP;
-                } else if (firstIndeterminateP != null && (firstIndeterminateD != null || atLeastOneDeny)) {
-                        return new EvaluationResult(Decision.INDETERMINATE_DENYPERMIT, firstIndeterminateD.getStatus());
-                } else if (firstIndeterminateP != null) {
-                        return firstIndeterminateP;
-                } else if (atLeastOneDeny) {
-                        return combinedResult;
-                } else if (firstIndeterminateD != null) {
-                        return firstIndeterminateD;
+        EvaluationResult combinedResult			= new EvaluationResult(Decision.DENY);
+
+        EvaluationResult firstIndeterminateD	= null;
+        EvaluationResult firstIndeterminateP	= null;
+        EvaluationResult firstIndeterminateDP	= null;
+
+        Iterator<CombiningElement<T>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<T> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                atLeastOneDeny	= true;
+                combinedResult.merge(evaluationResultElement);
+                break;
+            case INDETERMINATE:
+            case INDETERMINATE_DENYPERMIT:
+                if (firstIndeterminateDP == null) {
+                    firstIndeterminateDP	= evaluationResultElement;
                 } else {
-                        return new EvaluationResult(Decision.NOTAPPLICABLE);
+                    firstIndeterminateDP.merge(evaluationResultElement);
                 }
+                break;
+            case INDETERMINATE_DENY:
+                if (firstIndeterminateD == null) {
+                    firstIndeterminateD		= evaluationResultElement;
+                } else {
+                    firstIndeterminateD.merge(evaluationResultElement);
+                }
+                break;
+            case INDETERMINATE_PERMIT:
+                if (firstIndeterminateP == null) {
+                    firstIndeterminateP		= evaluationResultElement;
+                } else {
+                    firstIndeterminateP.merge(evaluationResultElement);
+                }
+                break;
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                return evaluationResultElement;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
         }
 
+        if (firstIndeterminateDP != null) {
+            return firstIndeterminateDP;
+        } else if (firstIndeterminateP != null && (firstIndeterminateD != null || atLeastOneDeny)) {
+            return new EvaluationResult(Decision.INDETERMINATE_DENYPERMIT, firstIndeterminateD.getStatus());
+        } else if (firstIndeterminateP != null) {
+            return firstIndeterminateP;
+        } else if (atLeastOneDeny) {
+            return combinedResult;
+        } else if (firstIndeterminateD != null) {
+            return firstIndeterminateD;
+        } else {
+            return new EvaluationResult(Decision.NOTAPPLICABLE);
+        }
+    }
+
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/PermitUnlessDeny.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/PermitUnlessDeny.java
index 6960bc9..e55e2ae 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/PermitUnlessDeny.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/PermitUnlessDeny.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,7 +43,7 @@
 
 /**
  * PermitUnlessDeny implements the XACML 3.0 "permit-unless-deny" combining algorithm for both policies and rules.
- * 
+ *
  * @author car
  *
  * @param <T> the java class for the {@link com.att.research.xacmlatt.pdp.eval.Evaluatable}
@@ -51,39 +51,39 @@
  */
 public class PermitUnlessDeny<T extends com.att.research.xacmlatt.pdp.eval.Evaluatable> extends CombiningAlgorithmBase<T> {
 
-        public PermitUnlessDeny(Identifier identifierIn) {
-                super(identifierIn);
+    public PermitUnlessDeny(Identifier identifierIn) {
+        super(identifierIn);
+    }
+
+    @Override
+    public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<T>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
+        EvaluationResult combinedResult			= new EvaluationResult(Decision.PERMIT);
+
+        Iterator<CombiningElement<T>> iterElements	= elements.iterator();
+        while (iterElements.hasNext()) {
+            CombiningElement<T> combiningElement		= iterElements.next();
+            EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
+
+            assert(evaluationResultElement != null);
+            switch(evaluationResultElement.getDecision()) {
+            case DENY:
+                return evaluationResultElement;
+            case INDETERMINATE:
+            case INDETERMINATE_DENYPERMIT:
+            case INDETERMINATE_DENY:
+            case INDETERMINATE_PERMIT:
+                break;
+            case NOTAPPLICABLE:
+                break;
+            case PERMIT:
+                combinedResult.merge(evaluationResultElement);
+                break;
+            default:
+                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
+            }
         }
 
-        @Override
-        public EvaluationResult combine(EvaluationContext evaluationContext, List<CombiningElement<T>> elements, List<CombinerParameter> combinerParameters) throws EvaluationException {
-                EvaluationResult combinedResult			= new EvaluationResult(Decision.PERMIT);
-                
-                Iterator<CombiningElement<T>> iterElements	= elements.iterator();
-                while (iterElements.hasNext()) {
-                        CombiningElement<T> combiningElement		= iterElements.next();
-                        EvaluationResult evaluationResultElement	= combiningElement.evaluate(evaluationContext);
-                        
-                        assert(evaluationResultElement != null);
-                        switch(evaluationResultElement.getDecision()) {
-                        case DENY:
-                                return evaluationResultElement;
-                        case INDETERMINATE:
-                        case INDETERMINATE_DENYPERMIT:
-                        case INDETERMINATE_DENY:
-                        case INDETERMINATE_PERMIT:
-                                break;
-                        case NOTAPPLICABLE:
-                                break;
-                        case PERMIT:
-                                combinedResult.merge(evaluationResultElement);
-                                break;
-                        default:
-                                throw new EvaluationException("Illegal Decision: \"" + evaluationResultElement.getDecision().toString());
-                        }
-                }
-                
-                return combinedResult;
-        }
+        return combinedResult;
+    }
 
 }
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/package-info.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/package-info.java
index d264be9..53896fc 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/package-info.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/combiners/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacmlatt.pdp.std.combiners contains implementations of the {@link com.att.research.xacmlatt.pdp.policy.CombiningAlgorithm}
  * interface.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/ConvertedArgument.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/ConvertedArgument.java
index a087aba..36b9be0 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/ConvertedArgument.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/ConvertedArgument.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -54,171 +54,171 @@
  * An object containing the value of the FunctionArgument processed by validateArguments.

  * This object will only exist if status.isOk() (or the isOk() method in this class that calls status.isOk()) is true.

  * </UL>

- * 

- * 

+ *

+ *

  * @author glenngriffin

  *

  */

 public class ConvertedArgument<I> {

 

-        // When status != Status.OK, the value is null

-        private Status status;

-        

-        // This is non-null when status == Status.OK

-        private I value = null;

-        

-        /**

-         * Constructor ensures we have a non-null status, though value will be null if status is not ok.

-         * 

-         * @param s

-         * @param v

-         */

-        public ConvertedArgument(Status s, I v) {

-                status = s;

-                if (s == null) {

-                        throw new IllegalArgumentException("Status of argument cannot be null");

-                }

-                if (s.isOk()) {

-                        // only set value if status is ok

-                        value = v;

-                }

-        }

-        

-        /**

-         * Get the Status object

-         * 

-         * @return

-         */

-        public Status getStatus() {

-                return status;

-        }

-        

-        

-        /**

-         * Convenience method that directly returns the isOk() state from the status object.

-         * 

-         * @return

-         */

-        public boolean isOk() {

-                return status.isOk();

-        }

-        

-        

-        /**

-         * Get the value object.  This may be a Bag.

-         * 

-         * @return

-         */

-        public I getValue() {

-                return value;

-        }

-        

-        

-        /**

-         * Get the value as a Bag. (convenience method)

-         * 

-         * @return

-         */

-        public Bag getBag() {

-                return (Bag)value;

-        }

-        

-        

-        /**

-         * Returns a shortened version of the given DataType Id, primarily for use with error messages to prevent them from becoming too long.

-         * This is a simple convenience method to reduce code bloat.

-         * 

-         * @param identifier expected to have '#' in it, and if no '#' should have ":data-type:"

-         * @return

-         */

-        public String getShortDataTypeId(Identifier identifier) {

-                String idString = identifier.stringValue();

-                int index = idString.indexOf("#");

-                if (index < 0) {

-                        index = idString.indexOf(":data-type:");

-                        if (index < 0) {

-                                return idString;

-                        } else {

-                                return idString.substring(index + 11);

-                        }

-                } else {

-                        return idString.substring(index+1);

-                }

-        }

-        

-        

-        

-        /**

-         * Evaluates the given <code>FunctionArgument</code> and validates that it has the correct <code>DataType</code>.

-         * The returned object will be either:

-         * <UL>

-         * <LI>

-         * A Status Object indicating an error condition, or

-         * <LI>

-         * An Object of the appropriate type containing the value of the function. 

-         * In this case the caller should assume that the Status is Status.OK.

-         * Note that the object may be a bag if that is what the caller expected.

-         * </UL>

-         * 

-         * 

-         * @param listFunctionArguments the <code>List</code> of <code>FunctionArgument</code>s to validate

-         * @param convertedValues the <code>List</code> of <code>U</code> that the converted value is added to.

-         * @return a {@link com.att.research.xacml.api.Status} indication with an error if the arguments are not valid,

-         * 			or an object of the correct DataType containing the value.

-         */

-        @SuppressWarnings("unchecked")	// to suppress warning on bag conversion

-        public ConvertedArgument(FunctionArgument functionArgument, DataType<I> expectedDataType, boolean expectBag) {

+    // When status != Status.OK, the value is null

+    private Status status;

 

-                if (functionArgument == null ) {

-                        status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Got null argument");

-                        return;

-                }

-                if ( ! functionArgument.isOk()) {

-                        status = functionArgument.getStatus();

-                        return;

-                }

-                

-                // bags are valid arguments for some functions

-                if (expectBag) {

-                        if ( ! functionArgument.isBag()) {

-                                status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Expected a bag, saw a simple value");

-                                return;

-                        }

+    // This is non-null when status == Status.OK

+    private I value = null;

 

-                        Bag bag = functionArgument.getBag();

-                        value = (I) bag;

-                        status = StdStatus.STATUS_OK;

-                        return;

-                }

-                

-                // argument should not be a bag

-                if (functionArgument.isBag()) {

-                        status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Expected a simple value, saw a bag");

-                        return;

-                }

-                AttributeValue<?> attributeValue	= functionArgument.getValue();

-                if (attributeValue == null || attributeValue.getValue() == null) {

-                        status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Got null attribute");

-                        return;

-                }

-                if ( ! attributeValue.getDataTypeId().equals(expectedDataType.getId())) {

-                        status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Expected data type '" + 

-                                        getShortDataTypeId(expectedDataType.getId()) + "' saw '" + getShortDataTypeId(attributeValue.getDataTypeId()) + "'");

-                        return;

-                }

-                

-                try {

-                        value = expectedDataType.convert(attributeValue.getValue());

-                        status = StdStatus.STATUS_OK;

-                } catch (Exception e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, message);

-                }

+    /**

+     * Constructor ensures we have a non-null status, though value will be null if status is not ok.

+     *

+     * @param s

+     * @param v

+     */

+    public ConvertedArgument(Status s, I v) {

+        status = s;

+        if (s == null) {

+            throw new IllegalArgumentException("Status of argument cannot be null");

         }

-        

-        

-        

+        if (s.isOk()) {

+            // only set value if status is ok

+            value = v;

+        }

+    }

+

+    /**

+     * Get the Status object

+     *

+     * @return

+     */

+    public Status getStatus() {

+        return status;

+    }

+

+

+    /**

+     * Convenience method that directly returns the isOk() state from the status object.

+     *

+     * @return

+     */

+    public boolean isOk() {

+        return status.isOk();

+    }

+

+

+    /**

+     * Get the value object.  This may be a Bag.

+     *

+     * @return

+     */

+    public I getValue() {

+        return value;

+    }

+

+

+    /**

+     * Get the value as a Bag. (convenience method)

+     *

+     * @return

+     */

+    public Bag getBag() {

+        return (Bag)value;

+    }

+

+

+    /**

+     * Returns a shortened version of the given DataType Id, primarily for use with error messages to prevent them from becoming too long.

+     * This is a simple convenience method to reduce code bloat.

+     *

+     * @param identifier expected to have '#' in it, and if no '#' should have ":data-type:"

+     * @return

+     */

+    public String getShortDataTypeId(Identifier identifier) {

+        String idString = identifier.stringValue();

+        int index = idString.indexOf("#");

+        if (index < 0) {

+            index = idString.indexOf(":data-type:");

+            if (index < 0) {

+                return idString;

+            } else {

+                return idString.substring(index + 11);

+            }

+        } else {

+            return idString.substring(index+1);

+        }

+    }

+

+

+

+    /**

+     * Evaluates the given <code>FunctionArgument</code> and validates that it has the correct <code>DataType</code>.

+     * The returned object will be either:

+     * <UL>

+     * <LI>

+     * A Status Object indicating an error condition, or

+     * <LI>

+     * An Object of the appropriate type containing the value of the function.

+     * In this case the caller should assume that the Status is Status.OK.

+     * Note that the object may be a bag if that is what the caller expected.

+     * </UL>

+     *

+     *

+     * @param listFunctionArguments the <code>List</code> of <code>FunctionArgument</code>s to validate

+     * @param convertedValues the <code>List</code> of <code>U</code> that the converted value is added to.

+     * @return a {@link com.att.research.xacml.api.Status} indication with an error if the arguments are not valid,

+     * 			or an object of the correct DataType containing the value.

+     */

+    @SuppressWarnings("unchecked")	// to suppress warning on bag conversion

+    public ConvertedArgument(FunctionArgument functionArgument, DataType<I> expectedDataType, boolean expectBag) {

+

+        if (functionArgument == null ) {

+            status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Got null argument");

+            return;

+        }

+        if ( ! functionArgument.isOk()) {

+            status = functionArgument.getStatus();

+            return;

+        }

+

+        // bags are valid arguments for some functions

+        if (expectBag) {

+            if ( ! functionArgument.isBag()) {

+                status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Expected a bag, saw a simple value");

+                return;

+            }

+

+            Bag bag = functionArgument.getBag();

+            value = (I) bag;

+            status = StdStatus.STATUS_OK;

+            return;

+        }

+

+        // argument should not be a bag

+        if (functionArgument.isBag()) {

+            status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Expected a simple value, saw a bag");

+            return;

+        }

+        AttributeValue<?> attributeValue	= functionArgument.getValue();

+        if (attributeValue == null || attributeValue.getValue() == null) {

+            status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Got null attribute");

+            return;

+        }

+        if ( ! attributeValue.getDataTypeId().equals(expectedDataType.getId())) {

+            status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Expected data type '" +

+                                   getShortDataTypeId(expectedDataType.getId()) + "' saw '" + getShortDataTypeId(attributeValue.getDataTypeId()) + "'");

+            return;

+        }

+

+        try {

+            value = expectedDataType.convert(attributeValue.getValue());

+            status = StdStatus.STATUS_OK;

+        } catch (Exception e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            status = new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, message);

+        }

+    }

+

+

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionAccessPermitted.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionAccessPermitted.java
index 40d94e9..1617f5a 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionAccessPermitted.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionAccessPermitted.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -56,86 +56,86 @@
 /**

  * FunctionDefinitionAccessPermitted implements {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} to

  * implement the XACML access-permitted predicate.

- * 

- * WARNING: This code is unfinished.  Initially we did not complete the implementation because we did not understand how to handle XML Namespaces 

+ *

+ * WARNING: This code is unfinished.  Initially we did not complete the implementation because we did not understand how to handle XML Namespaces

  * (from the &lt;Request&gt; or &lt;Policy&gt;).

  * 	Later we understood that any Namespaces used within this function must be explicitly listed in &lt;Content&gt; XML elemement passed to this function.

  *  However, it is not clear that anyone needs this function.

  *  The only use anyone has mentioned is in a recursive operation which requires a loop counter of some kind, which we do not have implemented.

  *  Therefore we have chosen to leave this unimplemented for now.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		access-permitted

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  */

 public class FunctionDefinitionAccessPermitted extends FunctionDefinitionBase<Boolean, URI> {

 

 

-        

-        

-        /**

-         * Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionAccessPermitted(Identifier idIn) {

-                super(idIn, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, false);

+

+

+    /**

+     * Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionAccessPermitted(Identifier idIn) {

+        super(idIn, DataTypes.DT_BOOLEAN, DataTypes.DT_ANYURI, false);

+    }

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        if (arguments == null ||  arguments.size() != 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Expected 2 arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

         }

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                if (arguments == null ||  arguments.size() != 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                        " Expected 2 arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

-                // first arg is URI

-                FunctionArgument functionArgument = arguments.get(0);

-                ConvertedArgument<URI> convertedArgument0 = new ConvertedArgument<URI>(functionArgument, DataTypes.DT_ANYURI, false);

-                if ( ! convertedArgument0.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedArgument0.getStatus()));

-                }

-                URI attributesURI = convertedArgument0.getValue();

-                // this must be a urn of an attribute category

-                if ( ! attributesURI.toString().startsWith("urn:") ||  ! attributesURI.toString().contains(":attribute-category:")) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() + 

-                                        " First argument must be a urn for an attribute-category, not '" + attributesURI.toString() ));

-                }

-                

-                // second argument is of input type

-                functionArgument = arguments.get(1);

-                ConvertedArgument<String> convertedArgument1 = new ConvertedArgument<String>(functionArgument, DataTypes.DT_STRING, false);

-                if ( ! convertedArgument1.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedArgument1.getStatus()));

-                }

-                // get the Duration object from the argument which includes all fields, even if the incoming argument does not include them all

-                String xmlContent = convertedArgument1.getValue();

-                

-                // The spec is fuzzy on whether this string includes the "<Content>" tags or not, so handle it either way

-                if ( ! xmlContent.trim().toLowerCase().startsWith("<content>") ) {

-                        // incomming is not surrounded by <content> tags, so ad them

-                        xmlContent = "<Content>" + xmlContent + "</Content>";

-                }

-                

-//TODO - the next block needs to be uncommented and fixed		

+        // first arg is URI

+        FunctionArgument functionArgument = arguments.get(0);

+        ConvertedArgument<URI> convertedArgument0 = new ConvertedArgument<URI>(functionArgument, DataTypes.DT_ANYURI, false);

+        if ( ! convertedArgument0.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedArgument0.getStatus()));

+        }

+        URI attributesURI = convertedArgument0.getValue();

+        // this must be a urn of an attribute category

+        if ( ! attributesURI.toString().startsWith("urn:") ||  ! attributesURI.toString().contains(":attribute-category:")) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

+                                             " First argument must be a urn for an attribute-category, not '" + attributesURI.toString() ));

+        }

+

+        // second argument is of input type

+        functionArgument = arguments.get(1);

+        ConvertedArgument<String> convertedArgument1 = new ConvertedArgument<String>(functionArgument, DataTypes.DT_STRING, false);

+        if ( ! convertedArgument1.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedArgument1.getStatus()));

+        }

+        // get the Duration object from the argument which includes all fields, even if the incoming argument does not include them all

+        String xmlContent = convertedArgument1.getValue();

+

+        // The spec is fuzzy on whether this string includes the "<Content>" tags or not, so handle it either way

+        if ( ! xmlContent.trim().toLowerCase().startsWith("<content>") ) {

+            // incomming is not surrounded by <content> tags, so ad them

+            xmlContent = "<Content>" + xmlContent + "</Content>";

+        }

+

+//TODO - the next block needs to be uncommented and fixed

 //Request req = evaluationContext.getRequest();

 //List<String> xmlAttrList = req.getRequestXMLAttributes();

 //String attrString = " ";

 //for (String attr : xmlAttrList) {

 //	attrString += " " + attr;

 //}

-//		

+//

 //		// add the Attributes XML element

 //		xmlContent = "<Attributes Category=\"" + attributesURI + "\" " + attrString + " >" + xmlContent + "</Attributes>";

-                

+

 //java.util.Iterator<RequestAttributes> rait = req.getRequestAttributes();

 //while (rait.hasNext()) {

 //	RequestAttributes ra = rait.next();

@@ -144,75 +144,75 @@
 

 

 

-                // convert the xmlContent into XML Nodes

-                Node newContentNode = null;

+        // convert the xmlContent into XML Nodes

+        Node newContentNode = null;

 //TODO - need to get Namespace info from original Request?  How can I recover the original Namespace from the EvaluationContext?

-                try (InputStream is = new ByteArrayInputStream(xmlContent.getBytes())) {

-                        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();

-                        docBuilderFactory.setNamespaceAware(true);

+        try (InputStream is = new ByteArrayInputStream(xmlContent.getBytes())) {

+            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();

+            docBuilderFactory.setNamespaceAware(true);

 

-                        newContentNode =  docBuilderFactory

-                                    .newDocumentBuilder()

-                                    .parse(is)

-                                    .getDocumentElement();

-                } catch (Exception e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() + 

-                                        " Parsing of XML string failed.  Cause='" + message + "'" ));

-                }

-                // convert the XML Node into a RequestAttributes object

-//TODO - If this code is ever completed, the following variable will be used.  The annotation is to avoid warnings.

-@SuppressWarnings("unused")

-                RequestAttributes newRequestAttributes = null;

-                try {

-                        newRequestAttributes = DOMRequestAttributes.newInstance(newContentNode);

-                } catch (DOMStructureException e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() + 

-                                        " Conversion of XML to RequestAttributes failed.  Cause='" + message + "'" ));

-                }

-

-                

-                // check the evaluationContext and Request for null

-                if (evaluationContext == null) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

-                                        " Got null EvaluationContext"));

-                }

-                if (evaluationContext.getRequest() == null) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

-                                        " Got null Request in EvaluationContext"));

-                }

-                

-                // Create a new Request by:

-                //		- copying the current request, 

-                //		- Dropping the Attributes section identified by the attributesURI argument

-                //		- adding a new Attributes section identified by the attributesURI arg and with a Content section containing the xmlContent argument

-                Request originalRequest = evaluationContext.getRequest();

-                

-//TODO - If this code is ever completed, the following variable will be used.  The annotation is to avoid warnings.

-@SuppressWarnings("unused")

-                Request newRequest = new StdRequest(originalRequest);

-                

-

-                

-//	???? nameingContext????

-                

-                // Now create a new EvaluationContext matching the one passed to this method except for the Request

-//TODO

-                

-                // Run the PDP on the new EvaluationContext

-//TODO

-                

-                

-return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

-                " Not Implemented"));

-

+            newContentNode =  docBuilderFactory

+                              .newDocumentBuilder()

+                              .parse(is)

+                              .getDocumentElement();

+        } catch (Exception e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

+                                             " Parsing of XML string failed.  Cause='" + message + "'" ));

         }

-        

+        // convert the XML Node into a RequestAttributes object

+//TODO - If this code is ever completed, the following variable will be used.  The annotation is to avoid warnings.

+        @SuppressWarnings("unused")

+        RequestAttributes newRequestAttributes = null;

+        try {

+            newRequestAttributes = DOMRequestAttributes.newInstance(newContentNode);

+        } catch (DOMStructureException e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

+                                             " Conversion of XML to RequestAttributes failed.  Cause='" + message + "'" ));

+        }

+

+

+        // check the evaluationContext and Request for null

+        if (evaluationContext == null) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Got null EvaluationContext"));

+        }

+        if (evaluationContext.getRequest() == null) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Got null Request in EvaluationContext"));

+        }

+

+        // Create a new Request by:

+        //		- copying the current request,

+        //		- Dropping the Attributes section identified by the attributesURI argument

+        //		- adding a new Attributes section identified by the attributesURI arg and with a Content section containing the xmlContent argument

+        Request originalRequest = evaluationContext.getRequest();

+

+//TODO - If this code is ever completed, the following variable will be used.  The annotation is to avoid warnings.

+        @SuppressWarnings("unused")

+        Request newRequest = new StdRequest(originalRequest);

+

+

+

+//	???? nameingContext????

+

+        // Now create a new EvaluationContext matching the one passed to this method except for the Request

+//TODO

+

+        // Run the PDP on the new EvaluationContext

+//TODO

+

+

+        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                         " Not Implemented"));

+

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionArithmetic.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionArithmetic.java
index 13acebc..9957eaf 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionArithmetic.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionArithmetic.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -50,9 +50,9 @@
 /**

  * FunctionDefinitionArithmetic extends {@link com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionHomogeneousSimple} to

  * implement the XACML Arithmetic predicates as functions taking one or two arguments of the same data type and returning a single value of the same type.

- * 

+ *

  * In Java there is no way to do arithmetic operations generically, so we need to have individual code for each operation on each class within this class.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -69,148 +69,148 @@
  * 		double-abs

  * 		round

  * 		floor

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <T> the java class for the data type of the function arguments

  */

 public class FunctionDefinitionArithmetic<T extends Number> extends FunctionDefinitionHomogeneousSimple<T,T> {

-        

-        /**

-         * List of arithmetic operations.

-         * 

-         * @author glenngriffin

-         *

-         */

-        public enum OPERATION {ADD, SUBTRACT, MULTIPLY, DIVIDE, MOD, ABS, ROUND, FLOOR };

-        

-        // operation to be used in this instance of the Arightmetic class

-        private final OPERATION operation;

-        

-        // result variables used by all functions, one for each type

-        private AttributeValue<BigInteger>	integerResult;

-        private AttributeValue<Double>	doubleResult;

 

-        /**

-         * Constructor

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         * @param op

+    /**

+     * List of arithmetic operations.

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {ADD, SUBTRACT, MULTIPLY, DIVIDE, MOD, ABS, ROUND, FLOOR };

+

+    // operation to be used in this instance of the Arightmetic class

+    private final OPERATION operation;

+

+    // result variables used by all functions, one for each type

+    private AttributeValue<BigInteger>	integerResult;

+    private AttributeValue<Double>	doubleResult;

+

+    /**

+     * Constructor

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     * @param op

+     */

+    public FunctionDefinitionArithmetic(Identifier idIn, DataType<T> dataTypeArgsIn, OPERATION op, int nArgs) {

+        // for Arithmetic functions, the output type is the same as the input type (no mixing of Ints and Doubles!)

+        super(idIn, dataTypeArgsIn, dataTypeArgsIn, nArgs);

+

+        // save the operation to be used in this instance

+        operation = op;

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        List<T> convertedArguments	= new ArrayList<T>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

          */

-        public FunctionDefinitionArithmetic(Identifier idIn, DataType<T> dataTypeArgsIn, OPERATION op, int nArgs) {

-                // for Arithmetic functions, the output type is the same as the input type (no mixing of Ints and Doubles!)

-                super(idIn, dataTypeArgsIn, dataTypeArgsIn, nArgs);

-                

-                // save the operation to be used in this instance

-                operation = op;

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

         }

 

+        /*

+         * Now perform the requested operation.

+         */

+        ExpressionResult expressionResult = null;

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                List<T> convertedArguments	= new ArrayList<T>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

-                

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

+        try {

+            switch (operation) {

+            case ADD:

+                if (this.getDataType() == DataTypes.DT_INTEGER) {

+                    integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).add( (BigInteger)convertedArguments.get(1)) );

+                    expressionResult = ExpressionResult.newSingle(integerResult);

+                } else {

+                    doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (Double)convertedArguments.get(0) + (Double)convertedArguments.get(1));

+                    expressionResult = ExpressionResult.newSingle(doubleResult);

                 }

-                

-                /*

-                 * Now perform the requested operation.

-                 */

-                ExpressionResult expressionResult = null;

-                

-                try {

-                        switch (operation) {

-                        case ADD:

-                                if (this.getDataType() == DataTypes.DT_INTEGER) {

-                                        integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).add( (BigInteger)convertedArguments.get(1)) );

-                                        expressionResult = ExpressionResult.newSingle(integerResult);

-                                } else {

-                                        doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (Double)convertedArguments.get(0) + (Double)convertedArguments.get(1));

-                                        expressionResult = ExpressionResult.newSingle(doubleResult);

-                                }

-                                break;

-                        case SUBTRACT:

-                                if (this.getDataType() == DataTypes.DT_INTEGER) {

-                                        integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).subtract( (BigInteger)convertedArguments.get(1)) );

-                                        expressionResult = ExpressionResult.newSingle(integerResult);

-                                } else {

-                                        doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (Double)convertedArguments.get(0) - (Double)convertedArguments.get(1));

-                                        expressionResult = ExpressionResult.newSingle(doubleResult);

-                                }

-                                break;

-                        case MULTIPLY:

-                                if (this.getDataType() == DataTypes.DT_INTEGER) {

-                                        integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).multiply((BigInteger)convertedArguments.get(1)) );

-                                        expressionResult = ExpressionResult.newSingle(integerResult);

-                                } else {

-                                        doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (Double)convertedArguments.get(0) * (Double)convertedArguments.get(1));

-                                        expressionResult = ExpressionResult.newSingle(doubleResult);

-                                }

-                                break;

-                        case DIVIDE:

-                                if (this.getDataType() == DataTypes.DT_INTEGER) {

-                                        if ( ((BigInteger)convertedArguments.get(1)).equals(new BigInteger("0")) ) {

-                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +" Divide by 0 error: "+

-                                                                arguments.get(0).getValue().getValue().toString() + ", " + arguments.get(1).getValue().getValue().toString()));

-                                        }

-                                        integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).divide((BigInteger)convertedArguments.get(1)) );

-                                        expressionResult = ExpressionResult.newSingle(integerResult);

-                                } else {

-                                        if ((Double)convertedArguments.get(1) == 0) {

-                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +" Divide by 0 error: "+

-                                                                arguments.get(0).getValue().getValue().toString() + ", " + arguments.get(1).getValue().getValue().toString()));

-                                        }

-                                        doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (Double)convertedArguments.get(0) / (Double)convertedArguments.get(1));

-                                        expressionResult = ExpressionResult.newSingle(doubleResult);

-                                }

-                                break;

-                        case MOD:

-                                if ( ((BigInteger)convertedArguments.get(1)).equals(new BigInteger("0")) ) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +" Divide by 0 error: "+

-                                                        arguments.get(0).getValue().getValue().toString() + ", " + arguments.get(1).getValue().getValue().toString()));

-                                }

-                                integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).remainder((BigInteger)convertedArguments.get(1)) );

-                                expressionResult = ExpressionResult.newSingle(integerResult);

-                                break;

-                        case ABS:

-                                if (this.getDataType() == DataTypes.DT_INTEGER) {

-                                        integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).abs() );

-                                        expressionResult = ExpressionResult.newSingle(integerResult);

-                                } else {

-                                        doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, Math.abs((Double)convertedArguments.get(0)));

-                                        expressionResult = ExpressionResult.newSingle(doubleResult);

-                                }

-                                break;

-                        case ROUND:

-                                doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (double)(Math.round((Double)convertedArguments.get(0))) );

-                                expressionResult = ExpressionResult.newSingle(doubleResult);

-                                break;

-                        case FLOOR:

-                                doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, Math.floor((Double)convertedArguments.get(0)));

-                                expressionResult = ExpressionResult.newSingle(doubleResult);

-                                break;

-                        }

-                } catch (Exception e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        String args = arguments.get(0).getValue().toString();

-                        if (arguments.size() > 1) {

-                                args += ", " + arguments.get(1).getValue().toString();

-                        }

-                        expressionResult = ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message +

-                                        " args: " + args + " " + e.getMessage() ));

+                break;

+            case SUBTRACT:

+                if (this.getDataType() == DataTypes.DT_INTEGER) {

+                    integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).subtract( (BigInteger)convertedArguments.get(1)) );

+                    expressionResult = ExpressionResult.newSingle(integerResult);

+                } else {

+                    doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (Double)convertedArguments.get(0) - (Double)convertedArguments.get(1));

+                    expressionResult = ExpressionResult.newSingle(doubleResult);

                 }

-                

-                return expressionResult;

+                break;

+            case MULTIPLY:

+                if (this.getDataType() == DataTypes.DT_INTEGER) {

+                    integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).multiply((BigInteger)convertedArguments.get(1)) );

+                    expressionResult = ExpressionResult.newSingle(integerResult);

+                } else {

+                    doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (Double)convertedArguments.get(0) * (Double)convertedArguments.get(1));

+                    expressionResult = ExpressionResult.newSingle(doubleResult);

+                }

+                break;

+            case DIVIDE:

+                if (this.getDataType() == DataTypes.DT_INTEGER) {

+                    if ( ((BigInteger)convertedArguments.get(1)).equals(new BigInteger("0")) ) {

+                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +" Divide by 0 error: "+

+                                                         arguments.get(0).getValue().getValue().toString() + ", " + arguments.get(1).getValue().getValue().toString()));

+                    }

+                    integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).divide((BigInteger)convertedArguments.get(1)) );

+                    expressionResult = ExpressionResult.newSingle(integerResult);

+                } else {

+                    if ((Double)convertedArguments.get(1) == 0) {

+                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +" Divide by 0 error: "+

+                                                         arguments.get(0).getValue().getValue().toString() + ", " + arguments.get(1).getValue().getValue().toString()));

+                    }

+                    doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (Double)convertedArguments.get(0) / (Double)convertedArguments.get(1));

+                    expressionResult = ExpressionResult.newSingle(doubleResult);

+                }

+                break;

+            case MOD:

+                if ( ((BigInteger)convertedArguments.get(1)).equals(new BigInteger("0")) ) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +" Divide by 0 error: "+

+                                                     arguments.get(0).getValue().getValue().toString() + ", " + arguments.get(1).getValue().getValue().toString()));

+                }

+                integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).remainder((BigInteger)convertedArguments.get(1)) );

+                expressionResult = ExpressionResult.newSingle(integerResult);

+                break;

+            case ABS:

+                if (this.getDataType() == DataTypes.DT_INTEGER) {

+                    integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, ((BigInteger)convertedArguments.get(0)).abs() );

+                    expressionResult = ExpressionResult.newSingle(integerResult);

+                } else {

+                    doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, Math.abs((Double)convertedArguments.get(0)));

+                    expressionResult = ExpressionResult.newSingle(doubleResult);

+                }

+                break;

+            case ROUND:

+                doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, (double)(Math.round((Double)convertedArguments.get(0))) );

+                expressionResult = ExpressionResult.newSingle(doubleResult);

+                break;

+            case FLOOR:

+                doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE, Math.floor((Double)convertedArguments.get(0)));

+                expressionResult = ExpressionResult.newSingle(doubleResult);

+                break;

+            }

+        } catch (Exception e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            String args = arguments.get(0).getValue().toString();

+            if (arguments.size() > 1) {

+                args += ", " + arguments.get(1).getValue().toString();

+            }

+            expressionResult = ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message +

+                               " args: " + args + " " + e.getMessage() ));

         }

 

+        return expressionResult;

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBag.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBag.java
index 102a139..f8e6d93 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBag.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBag.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -42,7 +42,7 @@
 /**

  * FunctionDefinitionBag implements {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} to

  * implement the XACML 'type'-bag predicates as functions taking 0, 1 or multiple arguments of the same data type and returning a <code>Bag</code>.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -62,66 +62,66 @@
  * 		rfc822Name-bag

  * 		ipAddress-bag

  * 		dnsName-bag

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments,

  * 		which is also the "type" of the returned bag

  */

 public class FunctionDefinitionBag<I> extends FunctionDefinitionBase<I, I> {

 

-        

-        /**

-         * Constructor - need dataType input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionBag(Identifier idIn, DataType<I> dataTypeArgsIn) {

-                super(idIn, dataTypeArgsIn, dataTypeArgsIn, true);

-        }

 

-        /**

-         * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s.

-         * 

-         * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation

-         * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation

-         * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call

-         */

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+    /**

+     * Constructor - need dataType input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionBag(Identifier idIn, DataType<I> dataTypeArgsIn) {

+        super(idIn, dataTypeArgsIn, dataTypeArgsIn, true);

+    }

 

-                // create a list to put the values into

-                Bag elementBag	= new Bag();

-                

-                // see if we have arguments

-                if (arguments != null && arguments.size() > 0) {

-        

-                        // for each arg, evaluate it, check type, and put on the list

-                        for (FunctionArgument argument : arguments) {

-                                // get the argument, evaluate it and check status

-                                ConvertedArgument<I> convertedArgument = new ConvertedArgument<I>(argument, this.getDataTypeArgs(), false);

-                                

-                                // check the status

-                                if ( ! convertedArgument.isOk()) {

-                                        return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

-                                }

-                                

-                                // Special case: Most methods want the value contained in the AttributeValue object inside the FunctionArgument.

-                                // This one wants the AttributeValue itself.

-                                // We use the ConvertedArgument constructor to validate that the argument is ok, then use the AttributeValue

-                                // from the FunctionArgument.

-                                elementBag.add(argument.getValue());

-                        }

+    /**

+     * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s.

+     *

+     * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation

+     * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation

+     * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call

+     */

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        // create a list to put the values into

+        Bag elementBag	= new Bag();

+

+        // see if we have arguments

+        if (arguments != null && arguments.size() > 0) {

+

+            // for each arg, evaluate it, check type, and put on the list

+            for (FunctionArgument argument : arguments) {

+                // get the argument, evaluate it and check status

+                ConvertedArgument<I> convertedArgument = new ConvertedArgument<I>(argument, this.getDataTypeArgs(), false);

+

+                // check the status

+                if ( ! convertedArgument.isOk()) {

+                    return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

                 }

-                

-                // return it

-                return ExpressionResult.newBag(elementBag);

+

+                // Special case: Most methods want the value contained in the AttributeValue object inside the FunctionArgument.

+                // This one wants the AttributeValue itself.

+                // We use the ConvertedArgument constructor to validate that the argument is ok, then use the AttributeValue

+                // from the FunctionArgument.

+                elementBag.add(argument.getValue());

+            }

         }

 

-        

-        

+        // return it

+        return ExpressionResult.newBag(elementBag);

+    }

+

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagIsIn.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagIsIn.java
index 8e1de83..94c347b 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagIsIn.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagIsIn.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -48,7 +48,7 @@
  * FunctionDefinitionBagIsIn implements {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} to

  * implement the XACML 'type'-is-in predicates as functions taking two arguments, the first of <code>type</code> and the second of type <code>Bag</code>,

  * and returning a <code>Boolean</code> for whether the first argument is contained in the second.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -68,85 +68,85 @@
  * 		rfc822Name-is-in

  * 		ipAddress-is-in

  * 		dnsName-is-in

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the elements in the Input argument Bag

- * 

+ *

  * The Output for these functions is always a Boolean.

  */

 public class FunctionDefinitionBagIsIn<I> extends FunctionDefinitionBase<Boolean, I> {

 

-        

-        /**

-         * Constructor - need dataType input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionBagIsIn(Identifier idIn, DataType<I> dataTypeArgsIn) {

-                super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, false);

 

+    /**

+     * Constructor - need dataType input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionBagIsIn(Identifier idIn, DataType<I> dataTypeArgsIn) {

+        super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, false);

+

+    }

+

+    /**

+     * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s.

+     *

+     * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation

+     * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation

+     * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call

+     */

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        if (arguments == null || arguments.size() != 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 2 arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

         }

 

-        /**

-         * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s.

-         * 

-         * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation

-         * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation

-         * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call

-         */

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        // get the thing to look for in the bag

+        FunctionArgument elementArgument = arguments.get(0);

 

-                if (arguments == null || arguments.size() != 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 2 arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

-                // get the thing to look for in the bag

-                FunctionArgument elementArgument = arguments.get(0);

-

-                ConvertedArgument<I> convertedTargetArgument = new ConvertedArgument<I>(elementArgument, this.getDataTypeArgs(), false);

-                if ( ! convertedTargetArgument.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedTargetArgument.getStatus()));

-                }

-                

-                // Special case: Most methods want the value contained in the AttributeValue object inside the FunctionArgument.

-                // This one wants the AttributeValue itself.

-                // We use the ConvertedArgument constructor to validate that the argument is ok, then use the AttributeValue

-                // from the FunctionArgument.

-                AttributeValue<?> attributeValueElement	= elementArgument.getValue();

-

-                // now get the bag

-                FunctionArgument bagArgument = arguments.get(1);

-                ConvertedArgument<Bag> convertedBagArgument = new ConvertedArgument<Bag>(bagArgument, null, true);

-

-                if ( ! convertedBagArgument.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedBagArgument.getStatus()));

-                }

-        

-                Bag bag = convertedBagArgument.getBag();

-

-                Iterator<AttributeValue<?>> iterBagContents	= bag.getAttributeValues();

-                while (iterBagContents.hasNext()) {

-                        AttributeValue<?> attributeValueBagContents	= iterBagContents.next();

-                        

-                        /*

-                         * Should we be checking the type of the bag contents and returning an error if the bag contents are not of the

-                         * right type?  The spec does not say this, so we just use the AttributeValue.equals() method for now.

-                         */

-                        if (attributeValueElement.equals(attributeValueBagContents)) {

-                                return ER_TRUE;

-                        }

-                }

-                

-                return ER_FALSE;

+        ConvertedArgument<I> convertedTargetArgument = new ConvertedArgument<I>(elementArgument, this.getDataTypeArgs(), false);

+        if ( ! convertedTargetArgument.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedTargetArgument.getStatus()));

         }

 

-        

-        

+        // Special case: Most methods want the value contained in the AttributeValue object inside the FunctionArgument.

+        // This one wants the AttributeValue itself.

+        // We use the ConvertedArgument constructor to validate that the argument is ok, then use the AttributeValue

+        // from the FunctionArgument.

+        AttributeValue<?> attributeValueElement	= elementArgument.getValue();

+

+        // now get the bag

+        FunctionArgument bagArgument = arguments.get(1);

+        ConvertedArgument<Bag> convertedBagArgument = new ConvertedArgument<Bag>(bagArgument, null, true);

+

+        if ( ! convertedBagArgument.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedBagArgument.getStatus()));

+        }

+

+        Bag bag = convertedBagArgument.getBag();

+

+        Iterator<AttributeValue<?>> iterBagContents	= bag.getAttributeValues();

+        while (iterBagContents.hasNext()) {

+            AttributeValue<?> attributeValueBagContents	= iterBagContents.next();

+

+            /*

+             * Should we be checking the type of the bag contents and returning an error if the bag contents are not of the

+             * right type?  The spec does not say this, so we just use the AttributeValue.equals() method for now.

+             */

+            if (attributeValueElement.equals(attributeValueBagContents)) {

+                return ER_TRUE;

+            }

+        }

+

+        return ER_FALSE;

+    }

+

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagOneAndOnly.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagOneAndOnly.java
index c68a276..5fd2e11 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagOneAndOnly.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagOneAndOnly.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -45,7 +45,7 @@
 /**

  * FunctionDefinitionBagOneAndOnly implements {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} to

  * implement the XACML 'type'-one-and-only predicates as functions taking one <code>Bag</code> argument and returning the single element in that bag of the 'type'.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -65,73 +65,73 @@
  * 		rfc822Name-one-and-only

  * 		ipAddress-one-and-only

  * 		dnsName-one-and-only

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

- * @param <I> the java class for the data type of the elements in the bag handed to this as the Input argument, 

+ *

+ * @param <I> the java class for the data type of the elements in the bag handed to this as the Input argument,

  * 	which is also the type of the return value

- * 

+ *

  */

 public class FunctionDefinitionBagOneAndOnly<I> extends FunctionDefinitionBase<I,I> {

 

-        

-        /**

-         * Constructor - need dataType input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionBagOneAndOnly(Identifier idIn, DataType<I> dataTypeArgsIn) {

-                super(idIn, dataTypeArgsIn, dataTypeArgsIn, false);

+

+    /**

+     * Constructor - need dataType input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionBagOneAndOnly(Identifier idIn, DataType<I> dataTypeArgsIn) {

+        super(idIn, dataTypeArgsIn, dataTypeArgsIn, false);

+    }

+

+    /**

+     * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s.

+     *

+     * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation

+     * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation

+     * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call

+     */

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        if (arguments == null || arguments.size() != 1) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + " Expected 1 argument, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

         }

 

-        /**

-         * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s.

-         * 

-         * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation

-         * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation

-         * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call

-         */

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        FunctionArgument argument = arguments.get(0);

+        ConvertedArgument<Bag> convertedArgument = new ConvertedArgument<Bag>(argument, null, true);

 

-                if (arguments == null || arguments.size() != 1) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + " Expected 1 argument, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

-                FunctionArgument argument = arguments.get(0);

-                ConvertedArgument<Bag> convertedArgument = new ConvertedArgument<Bag>(argument, null, true);

-

-                if ( ! convertedArgument.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

-                }

-                

-                Bag bag = convertedArgument.getBag();

-                

-                if (bag.size() != 1) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + 

-                                        " Expected 1 but Bag has " + bag.size() + " elements"));

-                }

-

-                // get the single value from the bag

-                AttributeValue<?> attributeValueOneAndOnly	= bag.getAttributeValues().next();

-                assert(attributeValueOneAndOnly != null);

-                

-                // make sure it has the right type

-                //

-                if (!this.getDataTypeId().equals(attributeValueOneAndOnly.getDataTypeId())) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + 

-                                        " Element in bag of wrong type. Expected " + 

-                                        this.getShortDataTypeId(this.getDataTypeId()) + " got " + this.getShortDataTypeId(attributeValueOneAndOnly.getDataTypeId())));			

-                }

-                return ExpressionResult.newSingle(attributeValueOneAndOnly);

+        if ( ! convertedArgument.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

         }

 

+        Bag bag = convertedArgument.getBag();

 

-        

-        

+        if (bag.size() != 1) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() +

+                                             " Expected 1 but Bag has " + bag.size() + " elements"));

+        }

+

+        // get the single value from the bag

+        AttributeValue<?> attributeValueOneAndOnly	= bag.getAttributeValues().next();

+        assert(attributeValueOneAndOnly != null);

+

+        // make sure it has the right type

+        //

+        if (!this.getDataTypeId().equals(attributeValueOneAndOnly.getDataTypeId())) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() +

+                                             " Element in bag of wrong type. Expected " +

+                                             this.getShortDataTypeId(this.getDataTypeId()) + " got " + this.getShortDataTypeId(attributeValueOneAndOnly.getDataTypeId())));

+        }

+        return ExpressionResult.newSingle(attributeValueOneAndOnly);

+    }

+

+

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagSize.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagSize.java
index f58c2f4..11c53b2 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagSize.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagSize.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -48,9 +48,9 @@
 

 /**

  * FunctionDefinitionBagSize implements {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} to

- * implement the XACML 'type'-bag-size predicates as functions taking one <code>Bag</code> argument and returning an <code>Integer</code> 

+ * implement the XACML 'type'-bag-size predicates as functions taking one <code>Bag</code> argument and returning an <code>Integer</code>

  * representing the number of elements in the bag.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -70,61 +70,61 @@
  * 		rfc822Name-bag-size

  * 		ipAddress-bag-size

  * 		dnsName-bag-size

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments

  */

 public class FunctionDefinitionBagSize<I> extends FunctionDefinitionBase<BigInteger, I> {

 

 

-        /**

-         * Constructor - need dataType input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionBagSize(Identifier idIn, DataType<I> dataTypeArgsIn) {

-                super(idIn, DataTypes.DT_INTEGER, dataTypeArgsIn, false);

+    /**

+     * Constructor - need dataType input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionBagSize(Identifier idIn, DataType<I> dataTypeArgsIn) {

+        super(idIn, DataTypes.DT_INTEGER, dataTypeArgsIn, false);

+    }

+

+    /**

+     * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s.

+     *

+     * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation

+     * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation

+     * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call

+     */

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        if (arguments == null || arguments.size() != 1) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 1 argument, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

         }

 

-        /**

-         * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s.

-         * 

-         * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation

-         * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation

-         * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call

-         */

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        FunctionArgument argument = arguments.get(0);

+        ConvertedArgument<Bag> convertedArgument = new ConvertedArgument<Bag>(argument, null, true);

 

-                if (arguments == null || arguments.size() != 1) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 1 argument, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

-                FunctionArgument argument = arguments.get(0);

-                ConvertedArgument<Bag> convertedArgument = new ConvertedArgument<Bag>(argument, null, true);

-

-                if ( ! convertedArgument.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

-                }

-                

-                Bag bag = convertedArgument.getBag();

-                

-                if (bag == null) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Bag is null" ));

-

-                }

-

-

-                // type is correct, so create a wrapper and return it

-                AttributeValue<BigInteger> resultAttributeValue = new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, BigInteger.valueOf(bag.size()));

-                return ExpressionResult.newSingle(resultAttributeValue);

+        if ( ! convertedArgument.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

         }

 

-        

+        Bag bag = convertedArgument.getBag();

+

+        if (bag == null) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Bag is null" ));

+

+        }

+

+

+        // type is correct, so create a wrapper and return it

+        AttributeValue<BigInteger> resultAttributeValue = new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, BigInteger.valueOf(bag.size()));

+        return ExpressionResult.newSingle(resultAttributeValue);

+    }

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBase.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBase.java
index 1e92440..c20efce 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBase.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBase.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -52,134 +52,134 @@
  * This base class contains the following components:

  * <UL>

  * <LI> The Identity for this function.

- * <LI> The DataType of the data returned from this function.  

+ * <LI> The DataType of the data returned from this function.

  * 	For Bags this means the DataType of the elements in the bag, or null if that is ambiguous.

  * <LI> Commonly-used values.

  * </UL>

- * 

+ *

  * @author glenngriffin

- * 

+ *

  * @param <O> the java class for the Output data type returned by the <code>FunctionDefinition</code>

- * @param <I> the java class for the Input data type expected in the arguments to the <code>FunctionDefinition</code>.  

+ * @param <I> the java class for the Input data type expected in the arguments to the <code>FunctionDefinition</code>.

  * 		Some functions have non-homogeneous arguments but may still have a main 'type'.

  */

 public abstract class FunctionDefinitionBase<O,I> implements FunctionDefinition {

-        

-        // The XACML identifier string for this particular function

-        private Identifier	id;

-        

-        // each function derived from this returns a single non-bag data value of the following type, or a Bag containing elements of this type

-        private DataType<O>	dataTypeReturn;

-        

-        // All functions have input arguments and expect them to be of a given type.

-        // In some instances the argument gets multiple values of different types, but when the function has a 'type' associated with it's name

-        // specific ones of the input must be of this type.

-        // When an argument Input to the function is a Bag, the elements in that bag will be of this type.

-        // This corresponds most closely to the 'type' in the function name (as in 'type'-bag or 'type'-equals).

-        private DataType<I> dataTypeArgs;

-        

-        // true = the return value from this function is a bag; false = return value is a single-value DataType object

-        private boolean returnsBag;

-        

-        /*

-         * For functions that return a Boolean result we create a single instance of the True/False return values that they can share

-         */

-        protected static final ExpressionResult			ER_TRUE		= ExpressionResult.newSingle(DataTypeBoolean.AV_TRUE);

-        protected static final ExpressionResult			ER_FALSE	= ExpressionResult.newSingle(DataTypeBoolean.AV_FALSE);

-        

-        /**

-         * Creates a new <code>FunctionDefinitionBase</code> with the {@link com.att.research.xacml.api.Identifier} <code>idIn</code> as

-         * the function id.

-         * 

-         * @param idIn the <code>Identifier</code> for this <code>FunctionDefinitionBase</code>

-         */

-        protected FunctionDefinitionBase(Identifier idIn, DataType<O> returnDataTypeIn, DataType<I> argumentDataTypeIn, boolean returnsBagIn) {

-                this.id			= idIn;

-                this.dataTypeReturn = returnDataTypeIn;

-                this.dataTypeArgs = argumentDataTypeIn;

-                this.returnsBag = returnsBagIn;

+

+    // The XACML identifier string for this particular function

+    private Identifier	id;

+

+    // each function derived from this returns a single non-bag data value of the following type, or a Bag containing elements of this type

+    private DataType<O>	dataTypeReturn;

+

+    // All functions have input arguments and expect them to be of a given type.

+    // In some instances the argument gets multiple values of different types, but when the function has a 'type' associated with it's name

+    // specific ones of the input must be of this type.

+    // When an argument Input to the function is a Bag, the elements in that bag will be of this type.

+    // This corresponds most closely to the 'type' in the function name (as in 'type'-bag or 'type'-equals).

+    private DataType<I> dataTypeArgs;

+

+    // true = the return value from this function is a bag; false = return value is a single-value DataType object

+    private boolean returnsBag;

+

+    /*

+     * For functions that return a Boolean result we create a single instance of the True/False return values that they can share

+     */

+    protected static final ExpressionResult			ER_TRUE		= ExpressionResult.newSingle(DataTypeBoolean.AV_TRUE);

+    protected static final ExpressionResult			ER_FALSE	= ExpressionResult.newSingle(DataTypeBoolean.AV_FALSE);

+

+    /**

+     * Creates a new <code>FunctionDefinitionBase</code> with the {@link com.att.research.xacml.api.Identifier} <code>idIn</code> as

+     * the function id.

+     *

+     * @param idIn the <code>Identifier</code> for this <code>FunctionDefinitionBase</code>

+     */

+    protected FunctionDefinitionBase(Identifier idIn, DataType<O> returnDataTypeIn, DataType<I> argumentDataTypeIn, boolean returnsBagIn) {

+        this.id			= idIn;

+        this.dataTypeReturn = returnDataTypeIn;

+        this.dataTypeArgs = argumentDataTypeIn;

+        this.returnsBag = returnsBagIn;

+    }

+

+    /**

+     * Returns a shortened version of the Id for this function, primarilly for use with error messages to prevent them from becoming too long.

+     * This is a simple convenience method to reduce code bloat.

+     *

+     * @return

+     */

+    public String getShortFunctionId() {

+        return this.getId().getUri().toString().substring(this.getId().getUri().toString().indexOf("function:"));

+    }

+

+    /**

+     * Returns a shortened version of the given DataType Id, primarily for use with error messages to prevent them from becoming too long.

+     * This is a simple convenience method to reduce code bloat.

+     *

+     * @param identifier expected to have '#' in it, and if no '#' should have ":data-type:"

+     * @return

+     */

+    public String getShortDataTypeId(Identifier identifier) {

+        String idString = identifier.stringValue();

+        int index = idString.indexOf("#");

+        if (index < 0) {

+            index = idString.indexOf(":data-type:");

+            if (index < 0) {

+                return idString;

+            } else {

+                return idString.substring(index + 11);

+            }

+        } else {

+            return idString.substring(index+1);

         }

-        

-        /**

-         * Returns a shortened version of the Id for this function, primarilly for use with error messages to prevent them from becoming too long.

-         * This is a simple convenience method to reduce code bloat.

-         * 

-         * @return

-         */

-        public String getShortFunctionId() {

-                return this.getId().getUri().toString().substring(this.getId().getUri().toString().indexOf("function:"));

+    }

+

+    /**

+     * Return a new Status that includes the name of this function in front of the original status' message.

+     * This is a convenience method to reduce code bloat.

+     *

+     * @param originalStatu

+     * @return

+     */

+    public Status getFunctionStatus(Status originalStatus) {

+        return new StdStatus(originalStatus.getStatusCode(), getShortFunctionId() + " " + originalStatus.getStatusMessage());

+    }

+

+

+    //

+    // Getters for the internal variables

+    //

+

+    @Override

+    public Identifier getId() {

+        return this.id;

+    }

+

+    @Override

+    public Identifier getDataTypeId() {

+        if (this.dataTypeReturn == null) {

+            return null;

+        } else {

+            return this.dataTypeReturn.getId();

         }

-        

-        /**

-         * Returns a shortened version of the given DataType Id, primarily for use with error messages to prevent them from becoming too long.

-         * This is a simple convenience method to reduce code bloat.

-         * 

-         * @param identifier expected to have '#' in it, and if no '#' should have ":data-type:"

-         * @return

-         */

-        public String getShortDataTypeId(Identifier identifier) {

-                String idString = identifier.stringValue();

-                int index = idString.indexOf("#");

-                if (index < 0) {

-                        index = idString.indexOf(":data-type:");

-                        if (index < 0) {

-                                return idString;

-                        } else {

-                                return idString.substring(index + 11);

-                        }

-                } else {

-                        return idString.substring(index+1);

-                }

-        }

-        

-        /**

-         * Return a new Status that includes the name of this function in front of the original status' message.

-         * This is a convenience method to reduce code bloat.

-         * 

-         * @param originalStatu

-         * @return

-         */

-        public Status getFunctionStatus(Status originalStatus) {

-                return new StdStatus(originalStatus.getStatusCode(), getShortFunctionId() + " " + originalStatus.getStatusMessage());

-        }

-        

-        

-        //

-        // Getters for the internal variables

-        //

-        

-        @Override

-        public Identifier getId() {

-                return this.id;

-        }

-        

-        @Override

-        public Identifier getDataTypeId() {

-                if (this.dataTypeReturn == null) {

-                        return null;

-                } else {

-                        return this.dataTypeReturn.getId();

-                }

-        }

-        

-        public DataType<O> getDataType() {

-                return this.dataTypeReturn;

-        }

-        

-        /**

-         * Return the Identifier for the Input Argument(s) DataType.

-         * 

-         * @return

-         */

-        public DataType<I> getDataTypeArgs() {

-                return this.dataTypeArgs;

-        }

-        

-        @Override

-        public boolean returnsBag() {

-                return returnsBag;

-        }

-        

-        

-        

+    }

+

+    public DataType<O> getDataType() {

+        return this.dataTypeReturn;

+    }

+

+    /**

+     * Return the Identifier for the Input Argument(s) DataType.

+     *

+     * @return

+     */

+    public DataType<I> getDataTypeArgs() {

+        return this.dataTypeArgs;

+    }

+

+    @Override

+    public boolean returnsBag() {

+        return returnsBag;

+    }

+

+

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionComparison.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionComparison.java
index 1ad23a8..d0ba85a 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionComparison.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionComparison.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -47,110 +47,110 @@
  * FunctionDefinitionComparison implements {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} to

  * implement the XACML comparison predicates as functions taking two arguments of the same type

  * and returning a <code>Boolean</code>.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		integer-greater-than

  * 		integer-greater-than-or-equal

  * 		integer-less-than

- * 		integer-less-than-or-equal	

+ * 		integer-less-than-or-equal

  * 		double-greater-than

  * 		double-greater-than-or-equal

  * 		double-less-than

- * 		double-less-than-or-equal 

- * 

- * 

+ * 		double-less-than-or-equal

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments

  */

 public class FunctionDefinitionComparison<I extends Comparable<I>> extends FunctionDefinitionHomogeneousSimple<Boolean, I> {

 

-        /**

-         * List of comparison operations.

-         * 

-         * @author glenngriffin

-         *

+    /**

+     * List of comparison operations.

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {GREATER_THAN, GREATER_THAN_EQUAL, LESS_THAN, LESS_THAN_EQUAL };

+

+    // the operation for this instance of the class

+    private OPERATION operation;

+

+

+    /**

+     * Constructor - need dataType input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionComparison(Identifier idIn, DataType<I> dataTypeArgsIn, OPERATION opIn) {

+        super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, 2);

+        operation = opIn;

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        List<I> convertedArguments	= new ArrayList<I>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

          */

-        public enum OPERATION {GREATER_THAN, GREATER_THAN_EQUAL, LESS_THAN, LESS_THAN_EQUAL };

-        

-        // the operation for this instance of the class

-        private OPERATION operation;

-        

-        

-        /**

-         * Constructor - need dataType input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionComparison(Identifier idIn, DataType<I> dataTypeArgsIn, OPERATION opIn) {

-                super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, 2);

-                operation = opIn;

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

         }

 

-

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-

-                List<I> convertedArguments	= new ArrayList<I>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

-                

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

-                }

-                

-                int compareResult;

-                try {

-                        compareResult = ((I)convertedArguments.get(0)).compareTo((I)convertedArguments.get(1));

-                } catch (Exception e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

-                }

-

-                switch (operation) {

-                case GREATER_THAN:

-                        if (compareResult > 0) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                        

-                case GREATER_THAN_EQUAL:

-                        if (compareResult > -1) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                        

-                case LESS_THAN:

-                        if (compareResult < 0) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                        

-                case LESS_THAN_EQUAL:

-                        if (compareResult < 1) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                }

-        

-                // switch on enum should handle everything - should never get here

-                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " ENUM did not cover case of " + operation));

-

+        int compareResult;

+        try {

+            compareResult = ((I)convertedArguments.get(0)).compareTo((I)convertedArguments.get(1));

+        } catch (Exception e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

         }

 

+        switch (operation) {

+        case GREATER_THAN:

+            if (compareResult > 0) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+

+        case GREATER_THAN_EQUAL:

+            if (compareResult > -1) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+

+        case LESS_THAN:

+            if (compareResult < 0) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+

+        case LESS_THAN_EQUAL:

+            if (compareResult < 1) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+        }

+

+        // switch on enum should handle everything - should never get here

+        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " ENUM did not cover case of " + operation));

+

+    }

+

 

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionDateTimeArithmetic.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionDateTimeArithmetic.java
index 52142e5..bd0557e 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionDateTimeArithmetic.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionDateTimeArithmetic.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -47,7 +47,7 @@
 /**

  * FunctionDefinitionDateTimeArithmetic implements {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} to

  * implement the XACML Date and Time Arithmetic predicates.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -57,11 +57,11 @@
  * 		dateTime-subtract-yearMonthDuration

  * 		date-add-yearMonthDuration

  * 		date-subtract-yearMonthDuration

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments;

  * 		SPECIAL CASE: this applies ONLY to the 2nd argument.

  * @param <O> the java class for the data type of the function Output;

@@ -69,77 +69,77 @@
  */

 public class FunctionDefinitionDateTimeArithmetic<O extends IDateTime<O>, I extends ISO8601Duration> extends FunctionDefinitionBase<O, I> {

 

-        /**

-         * List of Date and Time Arithmetic operations.

-         * 

-         * @author glenngriffin

-         *

-         */

-        public enum OPERATION {ADD, SUBTRACT};

-        

-        // operation to be used in this instance of the class

-        private final OPERATION operation;

+    /**

+     * List of Date and Time Arithmetic operations.

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {ADD, SUBTRACT};

 

-        

-        

-        /**

-         * Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionDateTimeArithmetic(Identifier idIn, DataType<O> dataTypeIn, DataType<I> dataTypeArgsIn, OPERATION op) {

-                super(idIn, dataTypeIn, dataTypeArgsIn, false);

-                this.operation = op;

+    // operation to be used in this instance of the class

+    private final OPERATION operation;

+

+

+

+    /**

+     * Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionDateTimeArithmetic(Identifier idIn, DataType<O> dataTypeIn, DataType<I> dataTypeArgsIn, OPERATION op) {

+        super(idIn, dataTypeIn, dataTypeArgsIn, false);

+        this.operation = op;

+    }

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        if (arguments == null ||  arguments.size() != 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Expected 2 arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

         }

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                if (arguments == null ||  arguments.size() != 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                        " Expected 2 arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

-                // first arg has same type as function output

-                FunctionArgument functionArgument = arguments.get(0);

-                ConvertedArgument<O> convertedArgument0 = new ConvertedArgument<O>(functionArgument, this.getDataType(), false);

-                if ( ! convertedArgument0.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedArgument0.getStatus()));

-                }

-                O idateOrig	= convertedArgument0.getValue();

-                

-                // second argument is of input type

-                functionArgument = arguments.get(1);

-                ConvertedArgument<I> convertedArgument1 = new ConvertedArgument<I>(functionArgument, this.getDataTypeArgs(), false);

-                if ( ! convertedArgument1.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedArgument1.getStatus()));

-                }

-                // get the Duration object from the argument which includes all fields, even if the incoming argument does not include them all

-                ISO8601Duration duration = convertedArgument1.getValue();

-                

-                // add/subtract the duration to the input argument

-                //

-                O idateResult	= null;

-                switch(this.operation) {

-                case ADD:

-                        idateResult	= idateOrig.add(duration);

-                        break;

-                case SUBTRACT:

-                        idateResult	= idateOrig.sub(duration);

-                        break;

-                }

-                ExpressionResult expressionResult	= null;

-                try {

-                        expressionResult	= ExpressionResult.newSingle(this.getDataType().createAttributeValue(idateResult)); 

-                } catch (DataTypeException e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));			

-                }

-                return expressionResult; 

+        // first arg has same type as function output

+        FunctionArgument functionArgument = arguments.get(0);

+        ConvertedArgument<O> convertedArgument0 = new ConvertedArgument<O>(functionArgument, this.getDataType(), false);

+        if ( ! convertedArgument0.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedArgument0.getStatus()));

         }

-        

+        O idateOrig	= convertedArgument0.getValue();

+

+        // second argument is of input type

+        functionArgument = arguments.get(1);

+        ConvertedArgument<I> convertedArgument1 = new ConvertedArgument<I>(functionArgument, this.getDataTypeArgs(), false);

+        if ( ! convertedArgument1.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedArgument1.getStatus()));

+        }

+        // get the Duration object from the argument which includes all fields, even if the incoming argument does not include them all

+        ISO8601Duration duration = convertedArgument1.getValue();

+

+        // add/subtract the duration to the input argument

+        //

+        O idateResult	= null;

+        switch(this.operation) {

+        case ADD:

+            idateResult	= idateOrig.add(duration);

+            break;

+        case SUBTRACT:

+            idateResult	= idateOrig.sub(duration);

+            break;

+        }

+        ExpressionResult expressionResult	= null;

+        try {

+            expressionResult	= ExpressionResult.newSingle(this.getDataType().createAttributeValue(idateResult));

+        } catch (DataTypeException e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

+        }

+        return expressionResult;

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionEquality.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionEquality.java
index c3358ce..3b3ab4b 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionEquality.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionEquality.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -45,7 +45,7 @@
 /**

  * FunctionDefinitionEquality extends {@link com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionHomogeneousSimple} to

  * implement the XACML Equality predicates as functions taking two arguments of the same data type and returning a <code>Boolean</code>.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -59,50 +59,50 @@
  * 		dayTimeDuration-equal

  * 		yearMonthDuration-equal

  * 		anyURI-equal

- * 

+ *

  * @author car

  * @version $Revision: 1.2 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments

  */

 public class FunctionDefinitionEquality<I> extends FunctionDefinitionHomogeneousSimple<Boolean, I> {

-        

-        /**

-         * Determines if the two <code>T</code> values are equal using the java <code>equals</code> method.  Derived classes

-         * may override this if the <code>equals</code> method is not sufficient.

-         * 

-         * @param v1 the first object to compare

-         * @param v2 the second object to compare

-         * @return true if the two objects are the same, else false

+

+    /**

+     * Determines if the two <code>T</code> values are equal using the java <code>equals</code> method.  Derived classes

+     * may override this if the <code>equals</code> method is not sufficient.

+     *

+     * @param v1 the first object to compare

+     * @param v2 the second object to compare

+     * @return true if the two objects are the same, else false

+     */

+    protected boolean isEqual(I v1, I v2) {

+        return v1.equals(v2);

+    }

+

+    public FunctionDefinitionEquality(Identifier idIn, DataType<I> dataTypeArgsIn) {

+        super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, 2);

+    }

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        List<I> convertedArguments	= new ArrayList<I>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

          */

-        protected boolean isEqual(I v1, I v2) {

-                return v1.equals(v2);

-        }

-        

-        public FunctionDefinitionEquality(Identifier idIn, DataType<I> dataTypeArgsIn) {

-                super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, 2);

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

         }

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                List<I> convertedArguments	= new ArrayList<I>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

-                

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

-                }

-                

-                /*

-                 * Now just perform the equality operation.

-                 */

-                if (this.isEqual(convertedArguments.get(0), convertedArguments.get(1))) {

-                        return ER_TRUE;

-                } else {

-                        return ER_FALSE;

-                }

+        /*

+         * Now just perform the equality operation.

+         */

+        if (this.isEqual(convertedArguments.get(0), convertedArguments.get(1))) {

+            return ER_TRUE;

+        } else {

+            return ER_FALSE;

         }

+    }

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHigherOrderBag.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHigherOrderBag.java
index 5c3c553..c7c2020 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHigherOrderBag.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHigherOrderBag.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -56,7 +56,7 @@
  * and returning either a <code>Boolean</code> or a <code>Bag</code> of the same primitive type.

  * <P>

  * The ipAddress, dnsName and xPathExpression do not have set functions defined for them in section 10.2.8 of the Release 3 XACML spec.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -74,470 +74,470 @@
  * 		yearMonthDuration-bag (version 1 and 3)

  * 		x500Name-bag

  * 		rfc822Name-bag

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments

  * @param <O> the java class for the data type of the function Output

  */

 public class FunctionDefinitionHigherOrderBag<O,I> extends FunctionDefinitionBase<O, I> {

 

-        /**

-         * List of comparison operations.

-         * 

-         * @author glenngriffin

-         *

-         */

-        public enum OPERATION {ANY_OF, ALL_OF, ANY_OF_ANY, ALL_OF_ANY, ANY_OF_ALL, ALL_OF_ALL, MAP  };

-        

-        // the operation for this instance of the class

-        private OPERATION operation;

-        

-        

-        /**

-         * Constructor - need dataType input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionHigherOrderBag(Identifier idIn, DataType<O> dataTypeIn, DataType<I> dataTypeArgsIn, OPERATION opIn) {

-                super(idIn, dataTypeIn, dataTypeArgsIn, ((opIn == OPERATION.MAP) ? true : false) );

-                operation = opIn;

+    /**

+     * List of comparison operations.

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {ANY_OF, ALL_OF, ANY_OF_ANY, ALL_OF_ANY, ANY_OF_ALL, ALL_OF_ALL, MAP  };

+

+    // the operation for this instance of the class

+    private OPERATION operation;

+

+

+    /**

+     * Constructor - need dataType input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionHigherOrderBag(Identifier idIn, DataType<O> dataTypeIn, DataType<I> dataTypeArgsIn, OPERATION opIn) {

+        super(idIn, dataTypeIn, dataTypeArgsIn, ((opIn == OPERATION.MAP) ? true : false) );

+        operation = opIn;

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        // simple argument check

+        if (arguments == null || arguments.size() < 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Expected at least 2 arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

+        }

+

+        // three functions have some things known about the arguments

+        if (operation == OPERATION.ALL_OF_ANY || operation == OPERATION.ANY_OF_ALL || operation == OPERATION.ALL_OF_ALL) {

+            if (arguments.size() != 3) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                 " Expected 3 arguments, got " + arguments.size()) );

+            }

+            // the 2nd & 3rd arguments must both be bags

+            if ( arguments.get(1) == null || ! arguments.get(1).isBag() ) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                 " 2nd argument must be bag, got '" + ((arguments.get(1) == null) ? "null" : this.getShortDataTypeId(arguments.get(1).getValue().getDataTypeId())) + "'" ));

+            }

+            if (arguments.get(2) == null || ! arguments.get(2).isBag() ) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                 " 3rd argument must be bag, got '" + ((arguments.get(2) == null) ? "null" : this.getShortDataTypeId(arguments.get(2).getValue().getDataTypeId())) + "'" ));

+            }

+        }

+

+        // first argument is supposed to be a Function ID passed to us as an AnyURI

+        FunctionArgument functionIdArgument = arguments.get(0);

+        if (functionIdArgument == null || functionIdArgument.getValue() == null) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Predicate Function (first argument) was null"));

+        }

+        if ( ! functionIdArgument.getValue().getDataTypeId().equals(DataTypes.DT_ANYURI.getId())) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " First argument expected URI, got " + functionIdArgument.getValue().getDataTypeId() ) );

+        }

+        Identifier functionId = new IdentifierImpl((URI) functionIdArgument.getValue().getValue());

+

+        // look up the actual function definition based on that ID

+        StdFunctionDefinitionFactory fdf = new StdFunctionDefinitionFactory();

+

+        FunctionDefinition predicate = fdf.getFunctionDefinition(functionId);

+

+        if (predicate == null) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " First argument was not URI of a function, got '" + functionId + "'") );

+        }

+        // in all cases except MAP, the predicate must return True/False

+        if (operation != OPERATION.MAP) {

+            if ( ! predicate.getDataTypeId().equals(DataTypes.DT_BOOLEAN.getId())) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                 " Predicate Function must return boolean, but '" + predicate.getId() + "' returns '" + this.getShortDataTypeId(predicate.getDataTypeId()) ));

+            }

         }

 

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

 

-                // simple argument check

-                if (arguments == null || arguments.size() < 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                        " Expected at least 2 arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

-                // three functions have some things known about the arguments

-                if (operation == OPERATION.ALL_OF_ANY || operation == OPERATION.ANY_OF_ALL || operation == OPERATION.ALL_OF_ALL) {

-                        if (arguments.size() != 3) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                        " Expected 3 arguments, got " + arguments.size()) );

-                        }

-                        // the 2nd & 3rd arguments must both be bags

-                        if ( arguments.get(1) == null || ! arguments.get(1).isBag() ) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                " 2nd argument must be bag, got '" + ((arguments.get(1) == null) ? "null" : this.getShortDataTypeId(arguments.get(1).getValue().getDataTypeId())) + "'" ));

-                        }

-                        if (arguments.get(2) == null || ! arguments.get(2).isBag() ) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                " 3rd argument must be bag, got '" + ((arguments.get(2) == null) ? "null" : this.getShortDataTypeId(arguments.get(2).getValue().getDataTypeId())) + "'" ));

-                        }

-                }

-                

-                // first argument is supposed to be a Function ID passed to us as an AnyURI

-                FunctionArgument functionIdArgument = arguments.get(0);

-                if (functionIdArgument == null || functionIdArgument.getValue() == null) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                        " Predicate Function (first argument) was null"));

-                }

-                if ( ! functionIdArgument.getValue().getDataTypeId().equals(DataTypes.DT_ANYURI.getId())) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                        " First argument expected URI, got " + functionIdArgument.getValue().getDataTypeId() ) );

-                }

-                Identifier functionId = new IdentifierImpl((URI) functionIdArgument.getValue().getValue());

-                

-                // look up the actual function definition based on that ID

-                StdFunctionDefinitionFactory fdf = new StdFunctionDefinitionFactory();

-                

-                FunctionDefinition predicate = fdf.getFunctionDefinition(functionId);

-                

-                if (predicate == null) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                        " First argument was not URI of a function, got '" + functionId + "'") );

-                }

-                // in all cases except MAP, the predicate must return True/False

-                if (operation != OPERATION.MAP) {

-                        if ( ! predicate.getDataTypeId().equals(DataTypes.DT_BOOLEAN.getId())) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                " Predicate Function must return boolean, but '" + predicate.getId() + "' returns '" + this.getShortDataTypeId(predicate.getDataTypeId()) ));

-                        }

-                }

-                

-                

-                

-                // The remaining arguments may be either bags or primitive types.

-                // We do not know what the primitive types will be, and do not concern ourselves about that here 

-                // (the predicate function we just got and will call later will complain if they do not match its expectations).

-                // The predicate function will want things as FunctionAttributes, so we do not need to unwrap anything.

-                boolean bagSeen = false;

-                for (int i = 1; i < arguments.size(); i++) {

-                        FunctionArgument argument = arguments.get(i);

-                        if (argument == null) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                " Got null argument at index " + i) );

-                        }

-                        // force evaluation and check status

-                        if ( ! argument.getStatus().isOk()) {

-                                return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

-                        }

+        // The remaining arguments may be either bags or primitive types.

+        // We do not know what the primitive types will be, and do not concern ourselves about that here

+        // (the predicate function we just got and will call later will complain if they do not match its expectations).

+        // The predicate function will want things as FunctionAttributes, so we do not need to unwrap anything.

+        boolean bagSeen = false;

+        for (int i = 1; i < arguments.size(); i++) {

+            FunctionArgument argument = arguments.get(i);

+            if (argument == null) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                 " Got null argument at index " + i) );

+            }

+            // force evaluation and check status

+            if ( ! argument.getStatus().isOk()) {

+                return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

+            }

 

-                        // for bags, remember that we saw one; for non-bag primitives, check that the primitive value is not null

-                        if (argument.isBag()) {

-                                bagSeen = true;

-                        } else {

-                                if (argument.getValue() == null || argument.getValue().getValue() == null) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                        " Got null attribute at index " + i) );

-                                }

-                        }

+            // for bags, remember that we saw one; for non-bag primitives, check that the primitive value is not null

+            if (argument.isBag()) {

+                bagSeen = true;

+            } else {

+                if (argument.getValue() == null || argument.getValue().getValue() == null) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                     " Got null attribute at index " + i) );

                 }

+            }

+        }

 

-                // all functions require at least one bag

-                if ( ! bagSeen && operation != OPERATION.ANY_OF_ANY) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                        " Did not get any Bag argument; must have at least 1") );

+        // all functions require at least one bag

+        if ( ! bagSeen && operation != OPERATION.ANY_OF_ANY) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Did not get any Bag argument; must have at least 1") );

+        }

+

+

+        // arguments are ready for use

+

+        // list of arguments for passing to the predicate

+        List<FunctionArgument> predicateArguments = new ArrayList<FunctionArgument>();

+

+        // for functions that take a single bag, which index is that bag at

+        int indexOfBagInOriginalArgs = -1;

+

+        // bag iterator

+        Iterator<AttributeValue<?>> bagIterator1;

+        Iterator<AttributeValue<?>> bagIterator2;

+

+

+

+

+        switch (operation) {

+

+        case ANY_OF:

+            // Copy the primitive arguments to the list for passing to the predicate,

+            // putting a place-holder in for the value from the (single) bag

+            for (int i = 1; i < arguments.size(); i++) {

+                predicateArguments.add(arguments.get(i));

+                if (arguments.get(i).isBag()) {

+                    if (indexOfBagInOriginalArgs == -1) {

+                        indexOfBagInOriginalArgs = i ;

+                    } else {

+                        // bag already found - we should have only one

+                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                         " must have only 1 bag; found one at index " + indexOfBagInOriginalArgs + " and another at " + i) );

+                    }

                 }

-                

-                

-                // arguments are ready for use

-                

-                // list of arguments for passing to the predicate

-                List<FunctionArgument> predicateArguments = new ArrayList<FunctionArgument>();

+            }

 

-                // for functions that take a single bag, which index is that bag at

-                int indexOfBagInOriginalArgs = -1;

-                

-                // bag iterator

-                Iterator<AttributeValue<?>> bagIterator1;

-                Iterator<AttributeValue<?>> bagIterator2;

+            // get each primitive value in turn

+            bagIterator1 = arguments.get(indexOfBagInOriginalArgs).getBag().getAttributeValues();

+            while (bagIterator1.hasNext()) {

+                // all of the predicate arguments have been created except that the one from the bag needs to replace the place-holder in the list

+                predicateArguments.set(indexOfBagInOriginalArgs - 1, new FunctionArgumentAttributeValue(bagIterator1.next()));

+                ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

+                if ( ! res.isOk()) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                     " Predicate error: " + res.getStatus().getStatusMessage()) );

+                }

+                if ( (Boolean)(res.getValue().getValue()) == true) {

+                    return ER_TRUE;

+                }

+            }

 

-                

-                

-                

-                switch (operation) {

-                

-                case ANY_OF:

-                        // Copy the primitive arguments to the list for passing to the predicate,

-                        // putting a place-holder in for the value from the (single) bag

-                        for (int i = 1; i < arguments.size(); i++) {

-                                predicateArguments.add(arguments.get(i));

-                                if (arguments.get(i).isBag()) {

-                                        if (indexOfBagInOriginalArgs == -1) {

-                                                indexOfBagInOriginalArgs = i ;

-                                        } else {

-                                                // bag already found - we should have only one

-                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                                " must have only 1 bag; found one at index " + indexOfBagInOriginalArgs + " and another at " + i) );

-                                        }

-                                }

-                        }

-                        

-                        // get each primitive value in turn

-                        bagIterator1 = arguments.get(indexOfBagInOriginalArgs).getBag().getAttributeValues();

-                        while (bagIterator1.hasNext()) {

-                                // all of the predicate arguments have been created except that the one from the bag needs to replace the place-holder in the list

-                                predicateArguments.set(indexOfBagInOriginalArgs - 1, new FunctionArgumentAttributeValue(bagIterator1.next()));

-                                ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

-                                if ( ! res.isOk()) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                        " Predicate error: " + res.getStatus().getStatusMessage()) );

-                                }

-                                if ( (Boolean)(res.getValue().getValue()) == true) {

-                                        return ER_TRUE;

-                                }

-                        }

+            return ER_FALSE;

 

-                        return ER_FALSE;

-                        

-                        

-                        

-                case ALL_OF:

-                        // Copy the primitive arguments to the list for passing to the predicate,

-                        // putting a place-holder in for the value from the (single) bag

-                        for (int i = 1; i < arguments.size(); i++) {

-                                predicateArguments.add(arguments.get(i));

-                                if (arguments.get(i).isBag()) {

-                                        if (indexOfBagInOriginalArgs == -1) {

-                                                indexOfBagInOriginalArgs = i ;

-                                        } else {

-                                                // bag already found - we should have only one

-                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                                " must have only 1 bag; found one at index " + indexOfBagInOriginalArgs + " and another at " + i) );

-                                        }

-                                }

-                        }

-                        

-                        // get each primitive value in turn

-                        bagIterator1 = arguments.get(indexOfBagInOriginalArgs).getBag().getAttributeValues();

-                        while (bagIterator1.hasNext()) {

-                                // all of the predicate arguments have been created except that the one from the bag needs to replace the place-holder in the list

-                                predicateArguments.set(indexOfBagInOriginalArgs - 1, new FunctionArgumentAttributeValue(bagIterator1.next()));

-                                ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

-                                if ( ! res.isOk()) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                        " Predicate error: " + res.getStatus().getStatusMessage()) );

-                                }

-                                if ( (Boolean)(res.getValue().getValue()) == false) {

-                                        return ER_FALSE;

-                                }

-                        }

-                        return ER_TRUE;

-                

-                        

-                case ANY_OF_ANY:

-                        // empty bags can give odd error messages, so check here and return something that makes more sense

-                        for (int i = 1; i < arguments.size(); i++) {

-                                if (arguments.get(i).isBag() && arguments.get(i).getBag().size() == 0) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                        " Bag is empty at index " + i ));

-                                }

-                        }

-                        // This is different from all the other Higher-order bag functions because it can take an unbounded number of arguments any/all of which may be bags.

-                        // (The others take either an unbounded number of args of which exactly 1 is a bag, or they take exactly 2 bags)

-                        // To handle the possibility of multiple bags without knowing a priori how many there might be,

-                        // we first create all possible lists of arguments to be passed to the predicate.

-                        // This is done using a depth-first search of the total argument space.

-                        List<List<FunctionArgument>> listOfPredicateLists = new ArrayList<List<FunctionArgument>>();		

-                        

-                        /*

-                         * Start the recursive append process

-                         */

-                        appendCrossProduct(new ArrayList<FunctionArgument>(), arguments.subList(1, arguments.size()), 0, listOfPredicateLists);

-                        

-                        // we now have all possible argument lists for the predicate to work on, so do the ANY operation now

-                        for (List<FunctionArgument> predicateArgumentList : listOfPredicateLists) {

-                                // all of the predicate arguments have been created except that the one from the bag needs to replace the place-holder in the list

-                                ExpressionResult res = predicate.evaluate(evaluationContext, predicateArgumentList);

-                                if ( ! res.isOk()) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                        " Predicate error: " + res.getStatus().getStatusMessage()) );

-                                }

-                                if ( (Boolean)(res.getValue().getValue()) == true) {

-                                        return ER_TRUE;

-                                }

-                        }

-                        

-                        // if we get here then none of the combinations gave a TRUE result

-                        return ER_FALSE;

-                

-                        

-                        

-                case ALL_OF_ANY:

+

+

+        case ALL_OF:

+            // Copy the primitive arguments to the list for passing to the predicate,

+            // putting a place-holder in for the value from the (single) bag

+            for (int i = 1; i < arguments.size(); i++) {

+                predicateArguments.add(arguments.get(i));

+                if (arguments.get(i).isBag()) {

+                    if (indexOfBagInOriginalArgs == -1) {

+                        indexOfBagInOriginalArgs = i ;

+                    } else {

+                        // bag already found - we should have only one

+                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                         " must have only 1 bag; found one at index " + indexOfBagInOriginalArgs + " and another at " + i) );

+                    }

+                }

+            }

+

+            // get each primitive value in turn

+            bagIterator1 = arguments.get(indexOfBagInOriginalArgs).getBag().getAttributeValues();

+            while (bagIterator1.hasNext()) {

+                // all of the predicate arguments have been created except that the one from the bag needs to replace the place-holder in the list

+                predicateArguments.set(indexOfBagInOriginalArgs - 1, new FunctionArgumentAttributeValue(bagIterator1.next()));

+                ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

+                if ( ! res.isOk()) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                     " Predicate error: " + res.getStatus().getStatusMessage()) );

+                }

+                if ( (Boolean)(res.getValue().getValue()) == false) {

+                    return ER_FALSE;

+                }

+            }

+            return ER_TRUE;

+

+

+        case ANY_OF_ANY:

+            // empty bags can give odd error messages, so check here and return something that makes more sense

+            for (int i = 1; i < arguments.size(); i++) {

+                if (arguments.get(i).isBag() && arguments.get(i).getBag().size() == 0) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                     " Bag is empty at index " + i ));

+                }

+            }

+            // This is different from all the other Higher-order bag functions because it can take an unbounded number of arguments any/all of which may be bags.

+            // (The others take either an unbounded number of args of which exactly 1 is a bag, or they take exactly 2 bags)

+            // To handle the possibility of multiple bags without knowing a priori how many there might be,

+            // we first create all possible lists of arguments to be passed to the predicate.

+            // This is done using a depth-first search of the total argument space.

+            List<List<FunctionArgument>> listOfPredicateLists = new ArrayList<List<FunctionArgument>>();

+

+            /*

+             * Start the recursive append process

+             */

+            appendCrossProduct(new ArrayList<FunctionArgument>(), arguments.subList(1, arguments.size()), 0, listOfPredicateLists);

+

+            // we now have all possible argument lists for the predicate to work on, so do the ANY operation now

+            for (List<FunctionArgument> predicateArgumentList : listOfPredicateLists) {

+                // all of the predicate arguments have been created except that the one from the bag needs to replace the place-holder in the list

+                ExpressionResult res = predicate.evaluate(evaluationContext, predicateArgumentList);

+                if ( ! res.isOk()) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                     " Predicate error: " + res.getStatus().getStatusMessage()) );

+                }

+                if ( (Boolean)(res.getValue().getValue()) == true) {

+                    return ER_TRUE;

+                }

+            }

+

+            // if we get here then none of the combinations gave a TRUE result

+            return ER_FALSE;

+

+

+

+        case ALL_OF_ANY:

 //TODO - it might be more efficient to extract all the attributes from the first bag and convert them to FunctionArguments just once, then use that list each time

-                        

-                        // get the element from the 2nd bag that we want to check all elements from the 1st bag against

-                        bagIterator2 = arguments.get(2).getBag().getAttributeValues();

-                        while (bagIterator2.hasNext()) {

-                                FunctionArgument predicateArgument2 = new FunctionArgumentAttributeValue(bagIterator2.next());

-                                boolean allMatch = true;

-                                

-                                // now look at every value of the first bag operating with the selected value from the 2nd

-                                bagIterator1 = arguments.get(1).getBag().getAttributeValues();

-                                while (bagIterator1.hasNext()) {

 

-                                        predicateArguments.clear();

-                                        predicateArguments.add(new FunctionArgumentAttributeValue(bagIterator1.next()));

-                                        predicateArguments.add(predicateArgument2);

-                                        

-                                        ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

-                                        if ( ! res.isOk()) {

-                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                                " Predicate error: " + res.getStatus().getStatusMessage()) );

-                                        }

-                                        if ( (Boolean)(res.getValue().getValue()) == false) {

-                                                allMatch = false;

-                                                break;

-                                        }

-                                }

-                                if (allMatch) {

-                                        // wee found one value in bag2 that works (is TRUE) for all values in bag1

-                                        return ER_TRUE;

-                                }

-                                // this value from bag2 did not work, so get the next one

-                        }

-                        

-                        // no value in bag2 worked for all values of bag1

-                        return ER_FALSE;

+            // get the element from the 2nd bag that we want to check all elements from the 1st bag against

+            bagIterator2 = arguments.get(2).getBag().getAttributeValues();

+            while (bagIterator2.hasNext()) {

+                FunctionArgument predicateArgument2 = new FunctionArgumentAttributeValue(bagIterator2.next());

+                boolean allMatch = true;

 

-                        

-                        

-                case ANY_OF_ALL:

-//TODO - it might be more efficient to extract all the attributes from the 2nd bag and convert them to FunctionArguments just once, then use that list each time

-                        

-                        // get the element from the 1st bag that we want to check all elements from the 1st bag against

-                        bagIterator1 = arguments.get(1).getBag().getAttributeValues();

-                        while (bagIterator1.hasNext()) {

-                                FunctionArgument predicateArgument1 = new FunctionArgumentAttributeValue(bagIterator1.next());

-                                boolean allMatch = true;

-                                

-                                // now look at every value of the 2nd bag operating with the selected value from the first

-                                bagIterator2 = arguments.get(2).getBag().getAttributeValues();

-                                while (bagIterator2.hasNext()) {

-                                        predicateArguments.clear();

-                                        predicateArguments.add(predicateArgument1);

-                                        predicateArguments.add(new FunctionArgumentAttributeValue(bagIterator2.next()));

-                                        

-                                        ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

-                                        if ( ! res.isOk()) {

-                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                                " Predicate error: " + res.getStatus().getStatusMessage()) );

-                                        }

-                                        if ( (Boolean)(res.getValue().getValue()) == false) {

-                                                allMatch = false;

-                                                break;

-                                        }

-                                }

-                                if (allMatch) {

-                                        // wee found one value in bag1 that works (is TRUE) for all values in bag2

-                                        return ER_TRUE;

-                                }

-                                // this value from bag1 did not work, so get the next one

-                        }

-                        

-                        // no value in bag1 worked for all values of bag2

-                        return ER_FALSE;

-                        

-                        

-                        

-                case ALL_OF_ALL:

-//TODO - it might be more efficient to extract all the attributes from the 2nd bag and convert them to FunctionArguments just once, then use that list each time

+                // now look at every value of the first bag operating with the selected value from the 2nd

+                bagIterator1 = arguments.get(1).getBag().getAttributeValues();

+                while (bagIterator1.hasNext()) {

 

-                        // get the element from the 1st bag that we want to check all elements from the 1st bag against

-                        bagIterator1 = arguments.get(1).getBag().getAttributeValues();

-                        while (bagIterator1.hasNext()) {

-                                FunctionArgument predicateArgument1 = new FunctionArgumentAttributeValue(bagIterator1.next());

+                    predicateArguments.clear();

+                    predicateArguments.add(new FunctionArgumentAttributeValue(bagIterator1.next()));

+                    predicateArguments.add(predicateArgument2);

 

-                                // now look at every value of the 2nd bag operating with the selected value from the first

-                                bagIterator2 = arguments.get(2).getBag().getAttributeValues();

-                                while (bagIterator2.hasNext()) {

-                                        predicateArguments.clear();

-                                        predicateArguments.add(predicateArgument1);

-                                        predicateArguments.add(new FunctionArgumentAttributeValue(bagIterator2.next()));

-

-                                        ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

-                                        if ( ! res.isOk()) {

-                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                                " Predicate error: " + res.getStatus().getStatusMessage()) );

-                                        }

-

-                                        if ( (Boolean)(res.getValue().getValue()) == false) {

-                                                return ER_FALSE;

-                                        }

-                                }

-                                // this value did not fail, so try the next

-                        }

-                        

-                        // everything in bag1 worked (was true) for everything in bag 2

-                        return ER_TRUE;

-                        

-                        

-                        

-                case MAP:

-                        // Copy the primitive arguments to the list for passing to the predicate,

-                        // putting a place-holder in for the value from the (single) bag

-                        for (int i = 1; i < arguments.size(); i++) {

-                                predicateArguments.add(arguments.get(i));

-                                if (arguments.get(i).isBag()) {

-                                        if (indexOfBagInOriginalArgs == -1) {

-                                                indexOfBagInOriginalArgs = i ;

-                                        } else {

-                                                // bag already found - we should have only one

-                                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                                " must have only 1 bag; found one at index " + indexOfBagInOriginalArgs + " and another at " + i) );

-                                        }

-                                }

-                        }

-                        

-                        Bag outputBag = new Bag();

-                        

-                        // get each primitive value in turn

-                        bagIterator1 = arguments.get(indexOfBagInOriginalArgs).getBag().getAttributeValues();

-                        while (bagIterator1.hasNext()) {

-                                // all of the predicate arguments have been created except that the one from the bag needs to replace the place-holder in the list

-                                predicateArguments.set(indexOfBagInOriginalArgs - 1, new FunctionArgumentAttributeValue(bagIterator1.next()));

-                                ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

-                                if ( ! res.isOk()) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                        " Predicate error: " + res.getStatus().getStatusMessage()) );

-                                }

-                                if (res.isBag()) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + 

-                                                        " Cannot put bag inside bag; predicate was '" + predicate.getId() + "'"));

-                                }

-                                outputBag.add(res.getValue());

-                        }

-                        

-                        

-                        return ExpressionResult.newBag(outputBag);

-                        

+                    ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

+                    if ( ! res.isOk()) {

+                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                         " Predicate error: " + res.getStatus().getStatusMessage()) );

+                    }

+                    if ( (Boolean)(res.getValue().getValue()) == false) {

+                        allMatch = false;

+                        break;

+                    }

                 }

-        

-                // all cases should have been covered by above - should never get here

-                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Could not evaluate Higher-Order Bag function " + operation));

+                if (allMatch) {

+                    // wee found one value in bag2 that works (is TRUE) for all values in bag1

+                    return ER_TRUE;

+                }

+                // this value from bag2 did not work, so get the next one

+            }

+

+            // no value in bag2 worked for all values of bag1

+            return ER_FALSE;

+

+

+

+        case ANY_OF_ALL:

+//TODO - it might be more efficient to extract all the attributes from the 2nd bag and convert them to FunctionArguments just once, then use that list each time

+

+            // get the element from the 1st bag that we want to check all elements from the 1st bag against

+            bagIterator1 = arguments.get(1).getBag().getAttributeValues();

+            while (bagIterator1.hasNext()) {

+                FunctionArgument predicateArgument1 = new FunctionArgumentAttributeValue(bagIterator1.next());

+                boolean allMatch = true;

+

+                // now look at every value of the 2nd bag operating with the selected value from the first

+                bagIterator2 = arguments.get(2).getBag().getAttributeValues();

+                while (bagIterator2.hasNext()) {

+                    predicateArguments.clear();

+                    predicateArguments.add(predicateArgument1);

+                    predicateArguments.add(new FunctionArgumentAttributeValue(bagIterator2.next()));

+

+                    ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

+                    if ( ! res.isOk()) {

+                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                         " Predicate error: " + res.getStatus().getStatusMessage()) );

+                    }

+                    if ( (Boolean)(res.getValue().getValue()) == false) {

+                        allMatch = false;

+                        break;

+                    }

+                }

+                if (allMatch) {

+                    // wee found one value in bag1 that works (is TRUE) for all values in bag2

+                    return ER_TRUE;

+                }

+                // this value from bag1 did not work, so get the next one

+            }

+

+            // no value in bag1 worked for all values of bag2

+            return ER_FALSE;

+

+

+

+        case ALL_OF_ALL:

+//TODO - it might be more efficient to extract all the attributes from the 2nd bag and convert them to FunctionArguments just once, then use that list each time

+

+            // get the element from the 1st bag that we want to check all elements from the 1st bag against

+            bagIterator1 = arguments.get(1).getBag().getAttributeValues();

+            while (bagIterator1.hasNext()) {

+                FunctionArgument predicateArgument1 = new FunctionArgumentAttributeValue(bagIterator1.next());

+

+                // now look at every value of the 2nd bag operating with the selected value from the first

+                bagIterator2 = arguments.get(2).getBag().getAttributeValues();

+                while (bagIterator2.hasNext()) {

+                    predicateArguments.clear();

+                    predicateArguments.add(predicateArgument1);

+                    predicateArguments.add(new FunctionArgumentAttributeValue(bagIterator2.next()));

+

+                    ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

+                    if ( ! res.isOk()) {

+                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                         " Predicate error: " + res.getStatus().getStatusMessage()) );

+                    }

+

+                    if ( (Boolean)(res.getValue().getValue()) == false) {

+                        return ER_FALSE;

+                    }

+                }

+                // this value did not fail, so try the next

+            }

+

+            // everything in bag1 worked (was true) for everything in bag 2

+            return ER_TRUE;

+

+

+

+        case MAP:

+            // Copy the primitive arguments to the list for passing to the predicate,

+            // putting a place-holder in for the value from the (single) bag

+            for (int i = 1; i < arguments.size(); i++) {

+                predicateArguments.add(arguments.get(i));

+                if (arguments.get(i).isBag()) {

+                    if (indexOfBagInOriginalArgs == -1) {

+                        indexOfBagInOriginalArgs = i ;

+                    } else {

+                        // bag already found - we should have only one

+                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                         " must have only 1 bag; found one at index " + indexOfBagInOriginalArgs + " and another at " + i) );

+                    }

+                }

+            }

+

+            Bag outputBag = new Bag();

+

+            // get each primitive value in turn

+            bagIterator1 = arguments.get(indexOfBagInOriginalArgs).getBag().getAttributeValues();

+            while (bagIterator1.hasNext()) {

+                // all of the predicate arguments have been created except that the one from the bag needs to replace the place-holder in the list

+                predicateArguments.set(indexOfBagInOriginalArgs - 1, new FunctionArgumentAttributeValue(bagIterator1.next()));

+                ExpressionResult res = predicate.evaluate(evaluationContext, predicateArguments);

+                if ( ! res.isOk()) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                     " Predicate error: " + res.getStatus().getStatusMessage()) );

+                }

+                if (res.isBag()) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                     " Cannot put bag inside bag; predicate was '" + predicate.getId() + "'"));

+                }

+                outputBag.add(res.getValue());

+            }

+

+

+            return ExpressionResult.newBag(outputBag);

 

         }

 

+        // all cases should have been covered by above - should never get here

+        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Could not evaluate Higher-Order Bag function " + operation));

 

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        /**

-         * Performs the depth-first walk to generate argument lists.  Needed by any-of-any because of the variable number of bags it might get.

-         * 

-         * This code was salvaged from the R2 version of the product and adjusted to fit the new way of doing business.

-         * 

-         * @param argListInProgress the current argument list being generated in this pass

-         * @param valueList the list of expression result values 

-         * @param nPosition the position within the expression result values to use to append to the base argument list

-         * @param listArgLists the <code>List</code> where final argument lists are appended

+    }

+

+

+

+

+

+

+

+

+

+

+

+

+    /**

+     * Performs the depth-first walk to generate argument lists.  Needed by any-of-any because of the variable number of bags it might get.

+     *

+     * This code was salvaged from the R2 version of the product and adjusted to fit the new way of doing business.

+     *

+     * @param argListInProgress the current argument list being generated in this pass

+     * @param valueList the list of expression result values

+     * @param nPosition the position within the expression result values to use to append to the base argument list

+     * @param listArgLists the <code>List</code> where final argument lists are appended

+     */

+    private static void appendCrossProduct(List<FunctionArgument> argListInProgress, List<FunctionArgument> valueList, int nPosition, List<List<FunctionArgument>> listArgLists) {

+        /*

+         * Have we hit a leaf?

          */

-        private static void appendCrossProduct(List<FunctionArgument> argListInProgress, List<FunctionArgument> valueList, int nPosition, List<List<FunctionArgument>> listArgLists) {

-                /*

-                 * Have we hit a leaf?

-                 */

-                if (nPosition >= valueList.size()) {

-                        List<FunctionArgument>	copy	= new ArrayList<FunctionArgument>();

-                        copy.addAll(argListInProgress);

-                        listArgLists.add(copy);

-                        return;

-                }

-                

-                /*

-                 * Check to see if the value at the current position is a primitive or a bag

-                 */

-                FunctionArgument	FunctionArgument	= valueList.get(nPosition);

-                if (FunctionArgument.isBag() && FunctionArgument.getBag().getAttributeValues() != null && FunctionArgument.getBag().size() > 0) {

-                        Iterator<AttributeValue<?>>	iterBagValues	= FunctionArgument.getBag().getAttributeValues();

-                        while (iterBagValues.hasNext()) {

-                                AttributeValue<?>	attributeValue	= iterBagValues.next();

-                                FunctionArgument	functionArgument	= new FunctionArgumentAttributeValue(attributeValue);

-                                argListInProgress.add(functionArgument);

-                                appendCrossProduct(argListInProgress, valueList, nPosition+1, listArgLists);

-                                argListInProgress.remove(argListInProgress.size()-1);

-                        }

-                } else {

-                        /*

-                         * This is a simple value, so we can just append to the argListInProgress and continue the recursion

-                         */

-                        argListInProgress.add(FunctionArgument);

-                        appendCrossProduct(argListInProgress, valueList, nPosition+1, listArgLists);

-                        argListInProgress.remove(argListInProgress.size()-1);

-                }

+        if (nPosition >= valueList.size()) {

+            List<FunctionArgument>	copy	= new ArrayList<FunctionArgument>();

+            copy.addAll(argListInProgress);

+            listArgLists.add(copy);

+            return;

         }

-        

-        

-        

-        

-        

-        

-        

+

+        /*

+         * Check to see if the value at the current position is a primitive or a bag

+         */

+        FunctionArgument	FunctionArgument	= valueList.get(nPosition);

+        if (FunctionArgument.isBag() && FunctionArgument.getBag().getAttributeValues() != null && FunctionArgument.getBag().size() > 0) {

+            Iterator<AttributeValue<?>>	iterBagValues	= FunctionArgument.getBag().getAttributeValues();

+            while (iterBagValues.hasNext()) {

+                AttributeValue<?>	attributeValue	= iterBagValues.next();

+                FunctionArgument	functionArgument	= new FunctionArgumentAttributeValue(attributeValue);

+                argListInProgress.add(functionArgument);

+                appendCrossProduct(argListInProgress, valueList, nPosition+1, listArgLists);

+                argListInProgress.remove(argListInProgress.size()-1);

+            }

+        } else {

+            /*

+             * This is a simple value, so we can just append to the argListInProgress and continue the recursion

+             */

+            argListInProgress.add(FunctionArgument);

+            appendCrossProduct(argListInProgress, valueList, nPosition+1, listArgLists);

+            argListInProgress.remove(argListInProgress.size()-1);

+        }

+    }

+

+

+

+

+

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHomogeneousSimple.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHomogeneousSimple.java
index 1e9d16d..17c31d5 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHomogeneousSimple.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHomogeneousSimple.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -44,7 +44,7 @@
  * with utility methods for ensuring the types of the arguments passed in the <code>evaluate</code> method matches the parameterized

  * type, and the number of arguments is correct.

  * When evaluated the resulting arguments must be simple data types, not bags.

- * 

+ *

  * The various functions have the following needs with respect to their arguments:

  * <UL>

  * <LI>

@@ -56,7 +56,7 @@
  * </UL>

  * To support those needs this class includes methods for checking the list size and evaluating a single argument as well as

  * combining those operations in a single method to make it simpler for the calling function.

- * 

+ *

  * @author car

  * @version $Revision: 1.3 $

  *

@@ -64,99 +64,99 @@
  * @param <I> the java class for the value of the Input {@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s in the <code>evaluate</code> method

  */

 public abstract class FunctionDefinitionHomogeneousSimple<O,I> extends FunctionDefinitionBase<O,I> {

-        

 

-        // null means that number of arguments is variable

-        private Integer			numArgs;

-        

-        /**

-         * Constructor

-         * 

-         * @param idIn

-         * @param dataTypeReturnIn

-         * @param dataTypeArgsIn

-         * @param nArgs

-         */

-        public FunctionDefinitionHomogeneousSimple(Identifier idIn, DataType<O> dataTypeReturnIn, DataType<I> dataTypeArgsIn, Integer nArgs) {

-                super(idIn, dataTypeReturnIn, dataTypeArgsIn, false);

-                this.numArgs		= nArgs;

-        }

-        

 

-        /**

-         * Gets the number of arguments expected to this <code>FunctionDefinition</code>.

-         * For functions without a pre-defined number of arguments this is not used.

-         * 

-         * @return the number of arguments expected to this <code>FunctionDefinition</code>.

+    // null means that number of arguments is variable

+    private Integer			numArgs;

+

+    /**

+     * Constructor

+     *

+     * @param idIn

+     * @param dataTypeReturnIn

+     * @param dataTypeArgsIn

+     * @param nArgs

+     */

+    public FunctionDefinitionHomogeneousSimple(Identifier idIn, DataType<O> dataTypeReturnIn, DataType<I> dataTypeArgsIn, Integer nArgs) {

+        super(idIn, dataTypeReturnIn, dataTypeArgsIn, false);

+        this.numArgs		= nArgs;

+    }

+

+

+    /**

+     * Gets the number of arguments expected to this <code>FunctionDefinition</code>.

+     * For functions without a pre-defined number of arguments this is not used.

+     *

+     * @return the number of arguments expected to this <code>FunctionDefinition</code>.

+     */

+    public Integer getNumArgs() {

+        return this.numArgs;

+    }

+

+

+    /**

+     * Validates the given <code>List</code> of <code>FunctionArgument</code>s has the correct count and <code>DataType</code> and evaluates expressions.

+     * This combines both the argument list length check and the evaluation of all arguments on that list.

+     *

+     * @param listFunctionArguments the <code>List</code> of <code>FunctionArgument</code>s to validate

+     * @return a {@link com.att.research.xacml.api.Status} indication with an error if the arguments are not valid

+     */

+    public Status validateArguments(List<FunctionArgument> listFunctionArguments, List<I> convertedValues) {

+        /*

+         * See if we have to validate the number of arguments

          */

-        public Integer getNumArgs() {

-                return this.numArgs;

+        Status listLengthStatus = validateArgumentListLength(listFunctionArguments);

+        if ( ! listLengthStatus.isOk()) {

+            return listLengthStatus;

         }

-        

-        

-        /**

-         * Validates the given <code>List</code> of <code>FunctionArgument</code>s has the correct count and <code>DataType</code> and evaluates expressions.

-         * This combines both the argument list length check and the evaluation of all arguments on that list.

-         * 

-         * @param listFunctionArguments the <code>List</code> of <code>FunctionArgument</code>s to validate

-         * @return a {@link com.att.research.xacml.api.Status} indication with an error if the arguments are not valid

+

+

+        /*

+         * Now validate the types of the arguments

          */

-        public Status validateArguments(List<FunctionArgument> listFunctionArguments, List<I> convertedValues) {

-                /*

-                 * See if we have to validate the number of arguments

-                 */

-                Status listLengthStatus = validateArgumentListLength(listFunctionArguments);

-                if ( ! listLengthStatus.isOk()) {

-                        return listLengthStatus;

-                }

-                

-                

-                /*

-                 * Now validate the types of the arguments

-                 */

-                for (int i = 0; i < listFunctionArguments.size(); i++) {

-                        FunctionArgument functionArgument = listFunctionArguments.get(i);

-                        ConvertedArgument<I> argument = new ConvertedArgument<I>(functionArgument, getDataTypeArgs(), false);

-                        if ( ! argument.isOk()) {

-                                // when a Status is returned that indicates an error, tell caller which arg had problem

-                                Status decoratedStatus = new StdStatus(argument.getStatus().getStatusCode(), argument.getStatus().getStatusMessage() + " at arg index " + i  );

-                                return decoratedStatus;

-                        }

-                        if (convertedValues != null) {

-                                convertedValues.add(argument.getValue());

-                        }

-                }

-                

-                /*

-                 * Everything passed the data type test, so we are good to go

-                 */

-                return StdStatus.STATUS_OK;

+        for (int i = 0; i < listFunctionArguments.size(); i++) {

+            FunctionArgument functionArgument = listFunctionArguments.get(i);

+            ConvertedArgument<I> argument = new ConvertedArgument<I>(functionArgument, getDataTypeArgs(), false);

+            if ( ! argument.isOk()) {

+                // when a Status is returned that indicates an error, tell caller which arg had problem

+                Status decoratedStatus = new StdStatus(argument.getStatus().getStatusCode(), argument.getStatus().getStatusMessage() + " at arg index " + i  );

+                return decoratedStatus;

+            }

+            if (convertedValues != null) {

+                convertedValues.add(argument.getValue());

+            }

         }

-        

-        

-        /**

-         * Validates the given <code>List</code> of <code>FunctionArgument</code>s has the correct count.

-         * 

-         * @param listFunctionArguments the <code>List</code> of <code>FunctionArgument</code>s to validate

-         * @return a {@link com.att.research.xacml.api.Status} indication with an error if the arguments are not valid

+

+        /*

+         * Everything passed the data type test, so we are good to go

          */

-        public Status validateArgumentListLength(List<FunctionArgument> listFunctionArguments) {

-                /*

-                 * See if we have to validate the number of arguments

-                 */

-                if ((listFunctionArguments == null && this.numArgs > 0 ) ||

-                                (listFunctionArguments != null && this.numArgs != listFunctionArguments.size()) ) {

-                        return new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Expected " + this.numArgs + " arguments, got " + 

-                                ((listFunctionArguments == null) ? 0 : listFunctionArguments.size())  );

-                }

-                

-                /*

-                 * Everything passed the data type test, so we are good to go

-                 */

-                return StdStatus.STATUS_OK;

+        return StdStatus.STATUS_OK;

+    }

+

+

+    /**

+     * Validates the given <code>List</code> of <code>FunctionArgument</code>s has the correct count.

+     *

+     * @param listFunctionArguments the <code>List</code> of <code>FunctionArgument</code>s to validate

+     * @return a {@link com.att.research.xacml.api.Status} indication with an error if the arguments are not valid

+     */

+    public Status validateArgumentListLength(List<FunctionArgument> listFunctionArguments) {

+        /*

+         * See if we have to validate the number of arguments

+         */

+        if ((listFunctionArguments == null && this.numArgs > 0 ) ||

+                (listFunctionArguments != null && this.numArgs != listFunctionArguments.size()) ) {

+            return new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Expected " + this.numArgs + " arguments, got " +

+                                 ((listFunctionArguments == null) ? 0 : listFunctionArguments.size())  );

         }

-        

-        

-        

+

+        /*

+         * Everything passed the data type test, so we are good to go

+         */

+        return StdStatus.STATUS_OK;

+    }

+

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionLogical.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionLogical.java
index f9b924a..3d22bce 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionLogical.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionLogical.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -44,7 +44,7 @@
 /**

  * FunctionDefinitionLogical extends {@link com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionHomogeneousSimple} to

  * implement the XACML Logic predicates as functions taking zero, one, or multiple arguments of type <code>Boolean</code> and returning a <code>Boolean</code>.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -52,188 +52,188 @@
  * 		and

  * 		n-of

  * 		not

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  */

 public class FunctionDefinitionLogical extends FunctionDefinitionHomogeneousSimple<Boolean,Boolean> {

-        

-        /**

-         * List of Logical Operations types

-         * 

-         * @author glenngriffin

-         *

-         */

-        public enum OPERATION {OR, AND, N_OF, NOT}

-        

-        // the operation that this instance is being asked to do

-        private final OPERATION operation;

-        

-        

-        public FunctionDefinitionLogical(Identifier idIn, OPERATION op) {

-                super(idIn, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, null);

-                operation = op;

-        }

 

-        

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                

-                switch (operation) {

-                case OR:

-                        if (arguments == null || arguments.size() == 0) {

-                                return ER_FALSE;

-                        }

-                        try {

-                                // evaluate the arguments one at a time and abort on the first true

-                                for (int i = 0; i < arguments.size(); i++) {

-                                        ConvertedArgument<Boolean> argument = new ConvertedArgument<Boolean>(arguments.get(i), this.getDataTypeArgs(), false);

-                                        if ( ! argument.isOk()) {

-                                                // return a decorated message

-                                                return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

-                                        }

-                                        if (argument.getValue() == true) {

-                                                return ER_TRUE;

-                                        }

-                                }

-                        } catch (Exception e) {

-                                String message = e.getMessage();

-                                if (e.getCause() != null) {

-                                        message = e.getCause().getMessage();

-                                }

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

-                        }

-                        return ER_FALSE;

+    /**

+     * List of Logical Operations types

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {OR, AND, N_OF, NOT}

 

-                        

-                case AND:

-                        if (arguments == null || arguments.size() == 0) {

-                                return ER_TRUE;

-                        }

-                        try {

-                                // evaluate the arguments one at a time and abort on the first false

-                                for (int i = 0; i < arguments.size(); i++) {

-                                        ConvertedArgument<Boolean> argument = new ConvertedArgument<Boolean>(arguments.get(i), this.getDataTypeArgs(), false);

-                                        if ( ! argument.isOk()) {

-                                                return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

-                                        }

-                                        if (argument.getValue() == false) {

-                                                return ER_FALSE;

-                                        }

-                                }

+    // the operation that this instance is being asked to do

+    private final OPERATION operation;

 

-                        } catch (Exception e) {

-                                String message = e.getMessage();

-                                if (e.getCause() != null) {

-                                        message = e.getCause().getMessage();

-                                }

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

-                        }

+

+    public FunctionDefinitionLogical(Identifier idIn, OPERATION op) {

+        super(idIn, DataTypes.DT_BOOLEAN, DataTypes.DT_BOOLEAN, null);

+        operation = op;

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        switch (operation) {

+        case OR:

+            if (arguments == null || arguments.size() == 0) {

+                return ER_FALSE;

+            }

+            try {

+                // evaluate the arguments one at a time and abort on the first true

+                for (int i = 0; i < arguments.size(); i++) {

+                    ConvertedArgument<Boolean> argument = new ConvertedArgument<Boolean>(arguments.get(i), this.getDataTypeArgs(), false);

+                    if ( ! argument.isOk()) {

+                        // return a decorated message

+                        return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

+                    }

+                    if (argument.getValue() == true) {

                         return ER_TRUE;

-                        

-                        

-                case N_OF:

-                        Integer argumentCountNeeded;

-                        int trueArgumentsSeen = 0;

-                        if (arguments == null || arguments.size() == 0) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 1 argument, got 0"));

-                        }

-                        try {

-                                //

-                                // Special case:

-                                //	The first argument in the list (an Integer) is not homogeneous with the rest of the arguments (Booleans).

-                                //	While this is technically not a FunctionDefinitionHomogeneousSimple type of object, we derive from that class anyway

-                                //	so that we can take advantage of the validateArgument() method in that class.

-                                //	Unfortunately we cannot re-use that same code (because of generics - it gets messy) for the Integer argument.

-                                //	The following code essentially does the same job as validateArgument() on the first argument in the list.

-                                //

-                                

-                                // first arg is the number of remaining arguments that must be TRUE

-                                if (arguments.get(0) == null) {

-                                        return ER_TRUE;

-                                }

-                                if ( ! arguments.get(0).getStatus().isOk()) {

-                                        return ExpressionResult.newError(getFunctionStatus(arguments.get(0).getStatus()));

-                                }

-                                if (arguments.get(0).isBag()) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected a simple value, saw a bag"));

-                                }

-                                AttributeValue<?> attributeValue = arguments.get(0).getValue();

-                                if (attributeValue == null) {

-                                        // assume this is the same as "first argument is 0"

-                                        return ER_TRUE;

-                                }

-

-                                argumentCountNeeded = DataTypes.DT_INTEGER.convert(attributeValue.getValue()).intValue();

-                                if (argumentCountNeeded == 0) {

-                                        return ER_TRUE;

-                                }

-                                if (arguments.size() - 1 < argumentCountNeeded) {

-                                        // return a non-OK status to signal indeterminate

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

-                                                        " Expected " + argumentCountNeeded + " arguments but only " +

-                                                        (arguments.size() - 1) + " arguments in list after the count"));

-                                }

-                                for (int i = 1; i < arguments.size(); i++) {

-                                        ConvertedArgument<Boolean> argument = new ConvertedArgument<Boolean>(arguments.get(i), this.getDataTypeArgs(), false);

-                                        if ( ! argument.isOk()) {

-                                                return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

-                                        }

-                                        if ((argument.getValue()) == true) {

-                                                trueArgumentsSeen++;

-                                                if (trueArgumentsSeen >= argumentCountNeeded) {

-                                                        return ER_TRUE;

-                                                }

-                                        }

-                                        // if we cannot reach the goal, stop now.

-                                        // remaining entries to be looked at = list size - i - 1, which is the most additional TRUEs that we could get.

-                                        if ( (arguments.size() - i - 1) + trueArgumentsSeen < argumentCountNeeded) {

-                                                // do not evaluate remaining entries

-                                                return ER_FALSE;

-                                        }

-                                }

-                                // did not reach our goal

-                                return ER_FALSE;

-                                

-                        } catch (Exception e) {

-                                String message = e.getMessage();

-                                if (e.getCause() != null) {

-                                        message = e.getCause().getMessage();

-                                }

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

-                        }

-                        

-                        

-                case NOT:

-                        if (arguments == null || arguments.size() != 1) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 1 argument, got " +

-                                                ((arguments == null) ? "null" : arguments.size()) ) );

-                        }

-                        try {

-                                ConvertedArgument<Boolean> argument = new ConvertedArgument<Boolean>(arguments.get(0), this.getDataTypeArgs(), false);

-                                if ( ! argument.isOk()) {

-                                        return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

-                                }

-                                if (argument.getValue() == true) {

-                                        return ER_FALSE;

-                                } else {

-                                        return ER_TRUE;

-                                }

-                        } catch (Exception e) {

-                                String message = e.getMessage();

-                                if (e.getCause() != null) {

-                                        message = e.getCause().getMessage();

-                                }

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

-                        }

+                    }

                 }

-                

-                // all cases should have been covered by above - should never get here

-                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Could not evaluate Logical function " + operation));

+            } catch (Exception e) {

+                String message = e.getMessage();

+                if (e.getCause() != null) {

+                    message = e.getCause().getMessage();

+                }

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

+            }

+            return ER_FALSE;

 

+

+        case AND:

+            if (arguments == null || arguments.size() == 0) {

+                return ER_TRUE;

+            }

+            try {

+                // evaluate the arguments one at a time and abort on the first false

+                for (int i = 0; i < arguments.size(); i++) {

+                    ConvertedArgument<Boolean> argument = new ConvertedArgument<Boolean>(arguments.get(i), this.getDataTypeArgs(), false);

+                    if ( ! argument.isOk()) {

+                        return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

+                    }

+                    if (argument.getValue() == false) {

+                        return ER_FALSE;

+                    }

+                }

+

+            } catch (Exception e) {

+                String message = e.getMessage();

+                if (e.getCause() != null) {

+                    message = e.getCause().getMessage();

+                }

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

+            }

+            return ER_TRUE;

+

+

+        case N_OF:

+            Integer argumentCountNeeded;

+            int trueArgumentsSeen = 0;

+            if (arguments == null || arguments.size() == 0) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 1 argument, got 0"));

+            }

+            try {

+                //

+                // Special case:

+                //	The first argument in the list (an Integer) is not homogeneous with the rest of the arguments (Booleans).

+                //	While this is technically not a FunctionDefinitionHomogeneousSimple type of object, we derive from that class anyway

+                //	so that we can take advantage of the validateArgument() method in that class.

+                //	Unfortunately we cannot re-use that same code (because of generics - it gets messy) for the Integer argument.

+                //	The following code essentially does the same job as validateArgument() on the first argument in the list.

+                //

+

+                // first arg is the number of remaining arguments that must be TRUE

+                if (arguments.get(0) == null) {

+                    return ER_TRUE;

+                }

+                if ( ! arguments.get(0).getStatus().isOk()) {

+                    return ExpressionResult.newError(getFunctionStatus(arguments.get(0).getStatus()));

+                }

+                if (arguments.get(0).isBag()) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected a simple value, saw a bag"));

+                }

+                AttributeValue<?> attributeValue = arguments.get(0).getValue();

+                if (attributeValue == null) {

+                    // assume this is the same as "first argument is 0"

+                    return ER_TRUE;

+                }

+

+                argumentCountNeeded = DataTypes.DT_INTEGER.convert(attributeValue.getValue()).intValue();

+                if (argumentCountNeeded == 0) {

+                    return ER_TRUE;

+                }

+                if (arguments.size() - 1 < argumentCountNeeded) {

+                    // return a non-OK status to signal indeterminate

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                     " Expected " + argumentCountNeeded + " arguments but only " +

+                                                     (arguments.size() - 1) + " arguments in list after the count"));

+                }

+                for (int i = 1; i < arguments.size(); i++) {

+                    ConvertedArgument<Boolean> argument = new ConvertedArgument<Boolean>(arguments.get(i), this.getDataTypeArgs(), false);

+                    if ( ! argument.isOk()) {

+                        return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

+                    }

+                    if ((argument.getValue()) == true) {

+                        trueArgumentsSeen++;

+                        if (trueArgumentsSeen >= argumentCountNeeded) {

+                            return ER_TRUE;

+                        }

+                    }

+                    // if we cannot reach the goal, stop now.

+                    // remaining entries to be looked at = list size - i - 1, which is the most additional TRUEs that we could get.

+                    if ( (arguments.size() - i - 1) + trueArgumentsSeen < argumentCountNeeded) {

+                        // do not evaluate remaining entries

+                        return ER_FALSE;

+                    }

+                }

+                // did not reach our goal

+                return ER_FALSE;

+

+            } catch (Exception e) {

+                String message = e.getMessage();

+                if (e.getCause() != null) {

+                    message = e.getCause().getMessage();

+                }

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

+            }

+

+

+        case NOT:

+            if (arguments == null || arguments.size() != 1) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 1 argument, got " +

+                                                 ((arguments == null) ? "null" : arguments.size()) ) );

+            }

+            try {

+                ConvertedArgument<Boolean> argument = new ConvertedArgument<Boolean>(arguments.get(0), this.getDataTypeArgs(), false);

+                if ( ! argument.isOk()) {

+                    return ExpressionResult.newError(getFunctionStatus(argument.getStatus()));

+                }

+                if (argument.getValue() == true) {

+                    return ER_FALSE;

+                } else {

+                    return ER_TRUE;

+                }

+            } catch (Exception e) {

+                String message = e.getMessage();

+                if (e.getCause() != null) {

+                    message = e.getCause().getMessage();

+                }

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

+            }

         }

 

-        

+        // all cases should have been covered by above - should never get here

+        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Could not evaluate Logical function " + operation));

+

+    }

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionNumberTypeConversion.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionNumberTypeConversion.java
index a280c9d..cc1c045 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionNumberTypeConversion.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionNumberTypeConversion.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -49,62 +49,62 @@
 /**

  * FunctionDefinitionNumberTypeConversion extends {@link FunctionDefinitionHomogeneousSimple} to

  * implement the XACML predicates foc converting <code>Double</code> to <code>Integer</code> and vice versa.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		double-to-integer

  * 		integer-to-double

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <O> the java class for the data type of the function Output

  * @param <I> the java class for the data type of the function Input argument

  */

 public class FunctionDefinitionNumberTypeConversion<O extends Number, I extends Number> extends FunctionDefinitionHomogeneousSimple<O, I> {

 

 

-        public FunctionDefinitionNumberTypeConversion(Identifier idIn, DataType<O> outputType, DataType<I> argType) {

-                super(idIn, outputType, argType, 1);

-                

+    public FunctionDefinitionNumberTypeConversion(Identifier idIn, DataType<O> outputType, DataType<I> argType) {

+        super(idIn, outputType, argType, 1);

+

+    }

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        List<I> convertedArguments	= new ArrayList<I>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

+         */

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

         }

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                List<I> convertedArguments	= new ArrayList<I>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

-

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

-                }

-                

-                /*

-                 * Numeric operations cannot be operated on generically in java, so we have to check the types and handle separately.

-                 * Whichever type the argument is, convert it to the other

-                 */

-                ExpressionResult expressionResult;

-                try {

-                        if (convertedArguments.get(0).getClass() == BigInteger.class) {

-                                AttributeValue<Double>	doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE,

-                                                new Double(  ((BigInteger)convertedArguments.get(0)).toString()  ) );

-                                expressionResult = ExpressionResult.newSingle(doubleResult);

-                        } else {

-                                AttributeValue<BigInteger>	integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, BigInteger.valueOf(((Double)convertedArguments.get(0)).intValue()) );

-                                expressionResult = ExpressionResult.newSingle(integerResult);

-                        }

-                } catch (Exception e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

-                }

-                

-                return expressionResult;

+        /*

+         * Numeric operations cannot be operated on generically in java, so we have to check the types and handle separately.

+         * Whichever type the argument is, convert it to the other

+         */

+        ExpressionResult expressionResult;

+        try {

+            if (convertedArguments.get(0).getClass() == BigInteger.class) {

+                AttributeValue<Double>	doubleResult	= new StdAttributeValue<Double>(XACML.ID_DATATYPE_DOUBLE,

+                        new Double(  ((BigInteger)convertedArguments.get(0)).toString()  ) );

+                expressionResult = ExpressionResult.newSingle(doubleResult);

+            } else {

+                AttributeValue<BigInteger>	integerResult	= new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, BigInteger.valueOf(((Double)convertedArguments.get(0)).intValue()) );

+                expressionResult = ExpressionResult.newSingle(integerResult);

+            }

+        } catch (Exception e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

         }

 

+        return expressionResult;

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRFC822NameMatch.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRFC822NameMatch.java
index 7705f79..c6f18ef 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRFC822NameMatch.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRFC822NameMatch.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -46,116 +46,116 @@
  * FunctionDefinitionRFC822NameMatch extends {@link com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionHomogeneousSimple} to

  * implement the XACML RFC822Name match predicate as functions taking one <code>String</code> and one <code>RFC822Name</code> arguments

  * and returning a single <code>Boolean</code> value.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		rfc822Name-match

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  */

 public class FunctionDefinitionRFC822NameMatch extends FunctionDefinitionBase<Boolean, RFC822Name> {

-        

 

-        /**

-         * Constructor

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         * @param op

+

+    /**

+     * Constructor

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     * @param op

+     */

+    public FunctionDefinitionRFC822NameMatch(Identifier idIn) {

+        super(idIn, DataTypes.DT_BOOLEAN, DataTypes.DT_RFC822NAME, false);

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        if (arguments == null || arguments.size() != 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + " Expected 2 arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

+        }

+

+        // get the string to search for

+        ConvertedArgument<String> stringArgument = new ConvertedArgument<String>(arguments.get(0), DataTypes.DT_STRING, false);

+        if ( ! stringArgument.isOk()) {

+            Status decoratedStatus = new StdStatus(stringArgument.getStatus().getStatusCode(), stringArgument.getStatus().getStatusMessage() + " at arg index 0"  );

+            return ExpressionResult.newError(getFunctionStatus(decoratedStatus));

+        }

+        String searchTermString = stringArgument.getValue();

+

+        // get the RFC822Name to match with

+        ConvertedArgument<RFC822Name> rfc822Argument = new ConvertedArgument<RFC822Name>(arguments.get(1), DataTypes.DT_RFC822NAME, false);

+        if ( ! rfc822Argument.isOk()) {

+            Status decoratedStatus = new StdStatus(rfc822Argument.getStatus().getStatusCode(), rfc822Argument.getStatus().getStatusMessage() + " at arg index 1"  );

+            return ExpressionResult.newError(getFunctionStatus(decoratedStatus));

+        }

+

+        RFC822Name rfc822Name = rfc822Argument.getValue();

+

+

+        /*

+         * Now perform the match.

          */

-        public FunctionDefinitionRFC822NameMatch(Identifier idIn) {

-                super(idIn, DataTypes.DT_BOOLEAN, DataTypes.DT_RFC822NAME, false);

+

+        /*

+         * According to the spec the string must be one of the following 3 things:

+         * 	- a name with an '@' in it = a full name that must exactly match the whole RFC name (domain part is ignore case)

+         * 	- a domain name (without an '@' and not starting with a '.') = must match whole RFC domain name (ignore case)

+         * 	- a partial domain name (without an '@') starting with a '.' = the last part of the RFC domain name (ignore case)

+         */

+

+        String[] searchTerms = searchTermString.split("@");

+

+        if (searchTerms.length > 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() +

+                                             " String contained more than 1 '@' in '" + searchTermString + "'" ));

         }

 

+        if (searchTerms.length == 2 || searchTermString.endsWith("@")) {

+            // this is an exact match

+            if (searchTerms[0] == null || searchTerms[0].length() == 0) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() +

+                                                 " String missing local part in '" + searchTermString + "'" ));

+            }

+            if (searchTerms.length < 2 || searchTerms[1] == null || searchTerms[1].length() == 0) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() +

+                                                 " String missing domain part in '" + searchTermString + "'" ));

+            }

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                

-                if (arguments == null || arguments.size() != 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + " Expected 2 arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-

-                // get the string to search for

-                ConvertedArgument<String> stringArgument = new ConvertedArgument<String>(arguments.get(0), DataTypes.DT_STRING, false);

-                if ( ! stringArgument.isOk()) {

-                        Status decoratedStatus = new StdStatus(stringArgument.getStatus().getStatusCode(), stringArgument.getStatus().getStatusMessage() + " at arg index 0"  );

-                        return ExpressionResult.newError(getFunctionStatus(decoratedStatus));

-                }

-                String searchTermString = stringArgument.getValue();

-                

-                // get the RFC822Name to match with

-                ConvertedArgument<RFC822Name> rfc822Argument = new ConvertedArgument<RFC822Name>(arguments.get(1), DataTypes.DT_RFC822NAME, false);

-                if ( ! rfc822Argument.isOk()) {

-                        Status decoratedStatus = new StdStatus(rfc822Argument.getStatus().getStatusCode(), rfc822Argument.getStatus().getStatusMessage() + " at arg index 1"  );

-                        return ExpressionResult.newError(getFunctionStatus(decoratedStatus));

-                }

-                

-                RFC822Name rfc822Name = rfc822Argument.getValue();

-                

-                

-                /*

-                 * Now perform the match.

-                 */

-                

-                /*

-                 * According to the spec the string must be one of the following 3 things:

-                 * 	- a name with an '@' in it = a full name that must exactly match the whole RFC name (domain part is ignore case)

-                 * 	- a domain name (without an '@' and not starting with a '.') = must match whole RFC domain name (ignore case)

-                 * 	- a partial domain name (without an '@') starting with a '.' = the last part of the RFC domain name (ignore case)

-                 */

-

-                String[] searchTerms = searchTermString.split("@");

-                

-                if (searchTerms.length > 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + 

-                                        " String contained more than 1 '@' in '" + searchTermString + "'" ));

-                }

-

-                if (searchTerms.length == 2 || searchTermString.endsWith("@")) {

-                        // this is an exact match

-                        if (searchTerms[0] == null || searchTerms[0].length() == 0) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + 

-                                                " String missing local part in '" + searchTermString + "'" ));

-                        }

-                        if (searchTerms.length < 2 || searchTerms[1] == null || searchTerms[1].length() == 0) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + 

-                                                " String missing domain part in '" + searchTermString + "'" ));

-                        }

-                        

-                        // args are ok, so check both against RFC name

-                        if (searchTerms[0].equals(rfc822Name.getLocalName()) && 

-                                        searchTerms[1].toLowerCase().equals(rfc822Name.getCanonicalDomainName())) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }			

-                }

-                

-                // we have only a domain name, which may be whole or partial

-                

-                // make it match the canonical version

-                searchTerms[0] = searchTerms[0].toLowerCase();

-                

-                if (searchTerms[0].charAt(0) == '.') {

-                        // name is partial - must match the end

-                        if (rfc822Name.getCanonicalDomainName().endsWith(searchTerms[0])) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                } else {

-                        // name is whole domain - must match exactly

-                        if (rfc822Name.getCanonicalDomainName().equals(searchTerms[0])) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                }

-

+            // args are ok, so check both against RFC name

+            if (searchTerms[0].equals(rfc822Name.getLocalName()) &&

+                    searchTerms[1].toLowerCase().equals(rfc822Name.getCanonicalDomainName())) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

         }

 

+        // we have only a domain name, which may be whole or partial

+

+        // make it match the canonical version

+        searchTerms[0] = searchTerms[0].toLowerCase();

+

+        if (searchTerms[0].charAt(0) == '.') {

+            // name is partial - must match the end

+            if (rfc822Name.getCanonicalDomainName().endsWith(searchTerms[0])) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+        } else {

+            // name is whole domain - must match exactly

+            if (rfc822Name.getCanonicalDomainName().equals(searchTerms[0])) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+        }

+

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRegexpMatch.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRegexpMatch.java
index b278dc2..ede9481 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRegexpMatch.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRegexpMatch.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -48,7 +48,7 @@
  * implement the XACML 'type'-regex-match predicates as functions taking two arguments, the first of <code>String</code>,

  * representing a regular expression, and the second of the type for that specific predicate,

  * and returning a <code>Boolean</code> for whether the regular expression matches the string representation of the second argument.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -58,80 +58,80 @@
  * 		rfc822Name-regexp-match (in sub-class {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition.FunctionDefinitionRegexpMatchRFC822} )

  * 		ipAddress-regexp-match

  * 		dnsName-regexp-match

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments

  */

 public class FunctionDefinitionRegexpMatch<I> extends FunctionDefinitionBase<Boolean, I> {

 

-        

-        /**

-         * Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionRegexpMatch(Identifier idIn, DataType<I> dataTypeArgsIn) {

-                super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, false);

+

+    /**

+     * Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionRegexpMatch(Identifier idIn, DataType<I> dataTypeArgsIn) {

+        super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, false);

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        if (arguments == null || arguments.size() != 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 2 arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

         }

 

+        // get the regular expression

+        FunctionArgument regexpArgument = arguments.get(0);

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-

-                if (arguments == null || arguments.size() != 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 2 arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

-                // get the regular expression

-                FunctionArgument regexpArgument = arguments.get(0);

-

-                ConvertedArgument<String> convertedArgument = new ConvertedArgument<String>(regexpArgument, DataTypes.DT_STRING, false);

-                if ( ! convertedArgument.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

-                }

-                

-                // String regexpValue = (String)regexpArgument.getValue().getValue();

-                String regexpValue	= convertedArgument.getValue();

-

-                

-                // now get the element to match

-                FunctionArgument elementArgument = arguments.get(1);

-                

-                ConvertedArgument<I> convertedElement = new ConvertedArgument<I>(elementArgument, this.getDataTypeArgs(), false);

-                if ( ! convertedElement.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedElement.getStatus()));

-                }

-                

-                I elementValueObject = convertedElement.getValue();

-

-                String elementValueString;

-                try {

-                        elementValueString = this.getDataTypeArgs().toStringValue(elementValueObject);

-                } catch (DataTypeException e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

-                }

-                

-                // ConvertedArgument checks for null value, so do not need to do again here

-

-                if (elementValueString.matches(regexpValue)) {

-                        return ER_TRUE;

-                } else {

-                        return ER_FALSE;

-                }

-

+        ConvertedArgument<String> convertedArgument = new ConvertedArgument<String>(regexpArgument, DataTypes.DT_STRING, false);

+        if ( ! convertedArgument.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

         }

 

+        // String regexpValue = (String)regexpArgument.getValue().getValue();

+        String regexpValue	= convertedArgument.getValue();

 

-        

-        

+

+        // now get the element to match

+        FunctionArgument elementArgument = arguments.get(1);

+

+        ConvertedArgument<I> convertedElement = new ConvertedArgument<I>(elementArgument, this.getDataTypeArgs(), false);

+        if ( ! convertedElement.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedElement.getStatus()));

+        }

+

+        I elementValueObject = convertedElement.getValue();

+

+        String elementValueString;

+        try {

+            elementValueString = this.getDataTypeArgs().toStringValue(elementValueObject);

+        } catch (DataTypeException e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

+        }

+

+        // ConvertedArgument checks for null value, so do not need to do again here

+

+        if (elementValueString.matches(regexpValue)) {

+            return ER_TRUE;

+        } else {

+            return ER_FALSE;

+        }

+

+    }

+

+

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSet.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSet.java
index cc082d8..9b8e7dd 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSet.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSet.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -49,7 +49,7 @@
  * and returning either a <code>Boolean</code> or a <code>Bag</code> of the same primitive type.

  * <P>

  * The ipAddress, dnsName and xPathExpression do not have set functions defined for them in section 10.2.8 of the Release 3 XACML spec.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -67,184 +67,184 @@
  * 		yearMonthDuration-bag (version 1 and 3)

  * 		x500Name-bag

  * 		rfc822Name-bag

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments

  * @param <O> the java class for the data type of the function Output

  */

 public class FunctionDefinitionSet<O,I> extends FunctionDefinitionBase<O, I> {

 

-        /**

-         * List of comparison operations.

-         * 

-         * @author glenngriffin

-         *

-         */

-        public enum OPERATION {INTERSECTION, AT_LEAST_ONE_MEMBER_OF, UNION, SUBSET, SET_EQUALS };

-        

-        // the operation for this instance of the class

-        private OPERATION operation;

-        

-        

-        /**

-         * Constructor - need dataType input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionSet(Identifier idIn, DataType<O> dataTypeIn, DataType<I> dataTypeArgsIn, OPERATION opIn) {

-                super(idIn, dataTypeIn, dataTypeArgsIn, ((opIn == OPERATION.INTERSECTION || opIn == OPERATION.UNION) ? true : false) );

-                operation = opIn;

+    /**

+     * List of comparison operations.

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {INTERSECTION, AT_LEAST_ONE_MEMBER_OF, UNION, SUBSET, SET_EQUALS };

+

+    // the operation for this instance of the class

+    private OPERATION operation;

+

+

+    /**

+     * Constructor - need dataType input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionSet(Identifier idIn, DataType<O> dataTypeIn, DataType<I> dataTypeArgsIn, OPERATION opIn) {

+        super(idIn, dataTypeIn, dataTypeArgsIn, ((opIn == OPERATION.INTERSECTION || opIn == OPERATION.UNION) ? true : false) );

+        operation = opIn;

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        if (arguments == null || arguments.size() != 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 2 arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

         }

 

+        // get first bag

+        FunctionArgument bagArgument = arguments.get(0);

+        ConvertedArgument<Bag> convertedBagArgument = new ConvertedArgument<Bag>(bagArgument, null, true);

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-

-                if (arguments == null || arguments.size() != 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected 2 arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

-                // get first bag

-                FunctionArgument bagArgument = arguments.get(0);

-                ConvertedArgument<Bag> convertedBagArgument = new ConvertedArgument<Bag>(bagArgument, null, true);

-

-                if ( ! convertedBagArgument.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedBagArgument.getStatus()));

-                }

-        

-                Bag bag1 = convertedBagArgument.getBag();

-                List<AttributeValue<?>> list1 = (List<AttributeValue<?>>) bag1.getAttributeValueList();

-                

-                // get second bag

-                bagArgument = arguments.get(1);

-                convertedBagArgument = new ConvertedArgument<Bag>(bagArgument, null, true);

-

-                if ( ! convertedBagArgument.isOk()) {

-                        return ExpressionResult.newError(getFunctionStatus(convertedBagArgument.getStatus()));

-                }

-        

-                Bag bag2 = convertedBagArgument.getBag();

-                List<AttributeValue<?>> list2 = (List<AttributeValue<?>>) bag2.getAttributeValueList();

-

-                // arguments are ready BUT they have NOT had duplicates removed

-                

-                ExpressionResult expressionResult = null;

-                

-                // some functions return a bag rather than boolean

-                Bag outBag;

-                List<AttributeValue<?>> outList;

-                

-                

-                switch (operation) {

-                case INTERSECTION:

-                        outList = new ArrayList<AttributeValue<?>>();

-                        

-                        for (AttributeValue<?> element : list1) {

-                                if (outList.contains(element)) {

-                                        continue;

-                                }

-                                if (list2.contains(element)) {

-                                        outList.add(element);

-                                }

-                        }

-                        

-                        // now have the intersection; put it in a bag

-                        

-                        outBag = new Bag();

-                        

-                        for (AttributeValue<?> element : outList) {

-                                        outBag.add(element);

-                        }

-

-                        expressionResult = ExpressionResult.newBag(outBag);

-                        return expressionResult;

-                        

-                        

-                case AT_LEAST_ONE_MEMBER_OF:

-                        // look for elements from the first list in the second.

-                        // duplicates do not matter because if the element is not there it does not matter that we look for it again,

-                        // and if it is there we stop the first time we see it.

-                        // If the first bag is empty, this should fail because no element from the first set can be found in the second set 

-                        // (because there IS no element in first set).

-                        for (AttributeValue<?> element : list1) {

-                                if (list2.contains(element)) {

-                                        return ER_TRUE;

-                                }

-                        }

-                        // did not find any element from list 1 in list 2

-                        return ER_FALSE;

-                        

-                case UNION:

-                        outList = new ArrayList<AttributeValue<?>>();

-                        

-                        for (AttributeValue<?> element : list1) {

-                                if (outList.contains(element)) {

-                                        continue;

-                                }

-                                outList.add((AttributeValue<?>) element);

-                        }

-                        for (AttributeValue<?> element : list2) {

-                                if (outList.contains(element)) {

-                                        continue;

-                                }

-                                outList.add((AttributeValue<?>) element);

-                        }

-                        

-                        // now have the intersection; put it in a bag

-                        

-                        outBag = new Bag();

-                        

-                        for (AttributeValue<?> element : outList) {

-                                outBag.add(element);

-                        }

-

-                        expressionResult = ExpressionResult.newBag(outBag);

-                        return expressionResult;

-                        

-                        

-                case SUBSET:

-                        // all elements from list 1 must exist in list 2.

-                        // duplicates do not matter because if an element is not found the first time we stop immediately,

-                        // and if it is found the first time it will also be found for the duplicate.

-                        // If the first set is empty we return TRUE because all elements (i.e. none) in the first set are in the second.

-                        for (AttributeValue<?> element : list1) {

-                                if ( ! list2.contains(element)) {

-                                        return ER_FALSE;

-                                }

-                        }

-                        // all elements in list1 were found

-                        return ER_TRUE;

-                        

-                        

-                case SET_EQUALS:

-                        // we cannot do a direct one-to-one compare because the lists may contain duplicates.  Also they may not be ordered the same.

-                        // So we ask:

-                        //		are all elements in list 1 in list 2 (ignoring duplicates)

-                        //		are all elements in list 2 in list 1 (ignoring duplicates)

-                        for (AttributeValue<?> element : list1) {

-                                if ( ! list2.contains(element)) {

-                                        return ER_FALSE;

-                                }

-                        }

-                        for (AttributeValue<?> element : list2) {

-                                if ( ! list1.contains(element)) {

-                                        return ER_FALSE;

-                                }

-                        }

-                        // all elements in each are part of the other

-                        return ER_TRUE;

-                }

-        

-                // all cases should have been covered by above - should never get here

-                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Could not evaluate Set function " + operation));

-

+        if ( ! convertedBagArgument.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedBagArgument.getStatus()));

         }

 

+        Bag bag1 = convertedBagArgument.getBag();

+        List<AttributeValue<?>> list1 = (List<AttributeValue<?>>) bag1.getAttributeValueList();

+

+        // get second bag

+        bagArgument = arguments.get(1);

+        convertedBagArgument = new ConvertedArgument<Bag>(bagArgument, null, true);

+

+        if ( ! convertedBagArgument.isOk()) {

+            return ExpressionResult.newError(getFunctionStatus(convertedBagArgument.getStatus()));

+        }

+

+        Bag bag2 = convertedBagArgument.getBag();

+        List<AttributeValue<?>> list2 = (List<AttributeValue<?>>) bag2.getAttributeValueList();

+

+        // arguments are ready BUT they have NOT had duplicates removed

+

+        ExpressionResult expressionResult = null;

+

+        // some functions return a bag rather than boolean

+        Bag outBag;

+        List<AttributeValue<?>> outList;

+

+

+        switch (operation) {

+        case INTERSECTION:

+            outList = new ArrayList<AttributeValue<?>>();

+

+            for (AttributeValue<?> element : list1) {

+                if (outList.contains(element)) {

+                    continue;

+                }

+                if (list2.contains(element)) {

+                    outList.add(element);

+                }

+            }

+

+            // now have the intersection; put it in a bag

+

+            outBag = new Bag();

+

+            for (AttributeValue<?> element : outList) {

+                outBag.add(element);

+            }

+

+            expressionResult = ExpressionResult.newBag(outBag);

+            return expressionResult;

+

+

+        case AT_LEAST_ONE_MEMBER_OF:

+            // look for elements from the first list in the second.

+            // duplicates do not matter because if the element is not there it does not matter that we look for it again,

+            // and if it is there we stop the first time we see it.

+            // If the first bag is empty, this should fail because no element from the first set can be found in the second set

+            // (because there IS no element in first set).

+            for (AttributeValue<?> element : list1) {

+                if (list2.contains(element)) {

+                    return ER_TRUE;

+                }

+            }

+            // did not find any element from list 1 in list 2

+            return ER_FALSE;

+

+        case UNION:

+            outList = new ArrayList<AttributeValue<?>>();

+

+            for (AttributeValue<?> element : list1) {

+                if (outList.contains(element)) {

+                    continue;

+                }

+                outList.add((AttributeValue<?>) element);

+            }

+            for (AttributeValue<?> element : list2) {

+                if (outList.contains(element)) {

+                    continue;

+                }

+                outList.add((AttributeValue<?>) element);

+            }

+

+            // now have the intersection; put it in a bag

+

+            outBag = new Bag();

+

+            for (AttributeValue<?> element : outList) {

+                outBag.add(element);

+            }

+

+            expressionResult = ExpressionResult.newBag(outBag);

+            return expressionResult;

+

+

+        case SUBSET:

+            // all elements from list 1 must exist in list 2.

+            // duplicates do not matter because if an element is not found the first time we stop immediately,

+            // and if it is found the first time it will also be found for the duplicate.

+            // If the first set is empty we return TRUE because all elements (i.e. none) in the first set are in the second.

+            for (AttributeValue<?> element : list1) {

+                if ( ! list2.contains(element)) {

+                    return ER_FALSE;

+                }

+            }

+            // all elements in list1 were found

+            return ER_TRUE;

+

+

+        case SET_EQUALS:

+            // we cannot do a direct one-to-one compare because the lists may contain duplicates.  Also they may not be ordered the same.

+            // So we ask:

+            //		are all elements in list 1 in list 2 (ignoring duplicates)

+            //		are all elements in list 2 in list 1 (ignoring duplicates)

+            for (AttributeValue<?> element : list1) {

+                if ( ! list2.contains(element)) {

+                    return ER_FALSE;

+                }

+            }

+            for (AttributeValue<?> element : list2) {

+                if ( ! list1.contains(element)) {

+                    return ER_FALSE;

+                }

+            }

+            // all elements in each are part of the other

+            return ER_TRUE;

+        }

+

+        // all cases should have been covered by above - should never get here

+        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Could not evaluate Set function " + operation));

+

+    }

+

 

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringConversion.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringConversion.java
index 9bb4edd..ea1f715 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringConversion.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringConversion.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -47,7 +47,7 @@
 /**

  * FunctionDefinitionNumberTypeConversion extends {@link com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionHomogeneousSimple} to

  * implement the XACML predicates for converting <code>String</code> to <code>DataType<?></code> and vice versa.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -77,61 +77,61 @@
  * 		string-from-ipAddress

  * 		dnsName-from-string

  * 		string-from-dnsName

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <O> the java class for the data type of the function Output

  * @param <I> the java class for the data type of the function Input argument

  */

 public class FunctionDefinitionStringConversion<O,I> extends FunctionDefinitionHomogeneousSimple<O, I> {

 

-        public FunctionDefinitionStringConversion(Identifier idIn, DataType<O> outputType, DataType<I> argType) {

-                super(idIn, outputType, argType, 1);

+    public FunctionDefinitionStringConversion(Identifier idIn, DataType<O> outputType, DataType<I> argType) {

+        super(idIn, outputType, argType, 1);

+    }

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        List<I> convertedArguments	= new ArrayList<I>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

+         */

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

         }

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                List<I> convertedArguments	= new ArrayList<I>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

-

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

+        /*

+         * Do different conversion depending on which way we are going (to/from String)

+         */

+        if (this.getDataTypeId().equals(DataTypes.DT_STRING.getId())) {

+            // converting TO String

+            try {

+                String output = this.getDataTypeArgs().toStringValue(convertedArguments.get(0));

+                return ExpressionResult.newSingle(new StdAttributeValue<String>(this.getDataTypeId(), output));

+            } catch (Exception e) {

+                String message = e.getMessage();

+                if (e.getCause() != null) {

+                    message = e.getCause().getMessage();

                 }

-                

-                /*

-                 * Do different conversion depending on which way we are going (to/from String)

-                 */

-                if (this.getDataTypeId().equals(DataTypes.DT_STRING.getId())) {

-                        // converting TO String

-                        try {

-                                String output = this.getDataTypeArgs().toStringValue(convertedArguments.get(0));

-                                return ExpressionResult.newSingle(new StdAttributeValue<String>(this.getDataTypeId(), output));

-                        } catch (Exception e) {

-                                String message = e.getMessage();

-                                if (e.getCause() != null) {

-                                        message = e.getCause().getMessage();

-                                }

-                                // untested - not clear how this could happen

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +  " " + message));

-                        }

-                } else {

-                        // converting FROM String to object of DataType

-                        try {

-                                O output = this.getDataType().convert(convertedArguments.get(0));

-                                return ExpressionResult.newSingle(new StdAttributeValue<O>(this.getDataTypeId(), output));

-                        } catch (Exception e) {

-                                String message = e.getMessage();

-                                if (e.getCause() != null) {

-                                        message = e.getCause().getMessage();

-                                }

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() + " " + message ));

-                        }

+                // untested - not clear how this could happen

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +  " " + message));

+            }

+        } else {

+            // converting FROM String to object of DataType

+            try {

+                O output = this.getDataType().convert(convertedArguments.get(0));

+                return ExpressionResult.newSingle(new StdAttributeValue<O>(this.getDataTypeId(), output));

+            } catch (Exception e) {

+                String message = e.getMessage();

+                if (e.getCause() != null) {

+                    message = e.getCause().getMessage();

                 }

-                

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() + " " + message ));

+            }

         }

 

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringEqualIgnoreCase.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringEqualIgnoreCase.java
index 174be30..5127625 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringEqualIgnoreCase.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringEqualIgnoreCase.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -36,40 +36,40 @@
 /**

  * FunctionDefinitionStringEqualIgnoreCase extends {@link FunctionDefinitionEquality} for

  * <code>String</code> arguments by testing for equality without regard to case.

- * 

+ *

  * The specification actually says that the strings are first converted to lower case using the string-normalize-to-lower-case function.

  * This code ASSUMES that

  * <UL>

  * <LI>	the normalize function just calls the Java toLowerCase() function, and

  * <LI>	the Java VM is consistent in that equalsIgnoreCase provides the same result as calling toLowerCase on each string and doing a compare.

  * </UL>

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		string-equal-ignore-case

- * 

- * 

+ *

+ *

  * @author car

  * @version $Revision: 1.2 $

  */

 public class FunctionDefinitionStringEqualIgnoreCase extends FunctionDefinitionEquality<String> {

 

-        /**

-         * ASSUMES that equalsIgnoreCase provides the same result as calling string-normalize-to-lower-case on both strings and then comparing.

-         */

-        @Override

-        protected boolean isEqual(String s1, String s2) {

-                return s1.equalsIgnoreCase(s2);

-        }

-        

-        /**

-         * Creates a new <code>FunctionDefinitionStringEqualIgnoreCase</code> with the given <code>Identifier</code>.

-         * 

-         * @param idIn the <code>Identifier</code> for the new <code>FunctionDefinitionStringEqualIgnoreCase</code>

-         */

-        public FunctionDefinitionStringEqualIgnoreCase(Identifier idIn) {

-                super(idIn, DataTypes.DT_STRING);

-        }

+    /**

+     * ASSUMES that equalsIgnoreCase provides the same result as calling string-normalize-to-lower-case on both strings and then comparing.

+     */

+    @Override

+    protected boolean isEqual(String s1, String s2) {

+        return s1.equalsIgnoreCase(s2);

+    }

+

+    /**

+     * Creates a new <code>FunctionDefinitionStringEqualIgnoreCase</code> with the given <code>Identifier</code>.

+     *

+     * @param idIn the <code>Identifier</code> for the new <code>FunctionDefinitionStringEqualIgnoreCase</code>

+     */

+    public FunctionDefinitionStringEqualIgnoreCase(Identifier idIn) {

+        super(idIn, DataTypes.DT_STRING);

+    }

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringFunctions.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringFunctions.java
index bdd7bd8..b43973a 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringFunctions.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringFunctions.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -53,7 +53,7 @@
  * which are contained in <code>FunctionDefinitionStringConversion</code>.

  * The functions in this file do not have a lot in common except that the return data type is known and the input argument types are

  * either known or of the generic type.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -66,211 +66,211 @@
  * 		anyURI-contains

  * 		string-substring

  * 		anyURI-substring

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <I> the java class for the data type of the function Input arguments

  * @param <O> the java class for the data type of the function Output -

  * 		needed because different functions within this class have different output types

  */

 public class FunctionDefinitionStringFunctions<O, I> extends FunctionDefinitionBase<O, I> {

 

-        /**

-         * List of String operations.

-         * 

-         * @author glenngriffin

-         *

-         */

-        public enum OPERATION {CONCATENATE, STARTS_WITH, ENDS_WITH, CONTAINS, SUBSTRING };

-        

-        // operation to be used in this instance of the StringFunctions class

-        private final OPERATION operation;

-        

-        

-        /**

-         * Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         */

-        public FunctionDefinitionStringFunctions(Identifier idIn, DataType<O> dataTypeIn, DataType<I> dataTypeArgsIn, OPERATION op) {

-                super(idIn, dataTypeIn, dataTypeArgsIn, false);

-                this.operation = op;

+    /**

+     * List of String operations.

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {CONCATENATE, STARTS_WITH, ENDS_WITH, CONTAINS, SUBSTRING };

+

+    // operation to be used in this instance of the StringFunctions class

+    private final OPERATION operation;

+

+

+    /**

+     * Constructor - need dataTypeArgs input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionStringFunctions(Identifier idIn, DataType<O> dataTypeIn, DataType<I> dataTypeArgsIn, OPERATION op) {

+        super(idIn, dataTypeIn, dataTypeArgsIn, false);

+        this.operation = op;

+    }

+

+

+    @SuppressWarnings("incomplete-switch")

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        if (arguments == null ||

+                (operation == OPERATION.CONCATENATE && arguments.size() < 2) ||

+                (operation == OPERATION.SUBSTRING && arguments.size() != 3) ||

+                (operation != OPERATION.SUBSTRING && operation != OPERATION.CONCATENATE && arguments.size() != 2) ) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected " +

+                                             ((operation == OPERATION.SUBSTRING) ? 3 : (operation == OPERATION.CONCATENATE ? "2 or more " : 2)) + " arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

         }

 

 

-        @SuppressWarnings("incomplete-switch")

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

 

-                if (arguments == null || 

-                                (operation == OPERATION.CONCATENATE && arguments.size() < 2) ||

-                                (operation == OPERATION.SUBSTRING && arguments.size() != 3) ||

-                                (operation != OPERATION.SUBSTRING && operation != OPERATION.CONCATENATE && arguments.size() != 2) ) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Expected " +

-                                ((operation == OPERATION.SUBSTRING) ? 3 : (operation == OPERATION.CONCATENATE ? "2 or more " : 2)) + " arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-                

+        ExpressionResult expressionResult = null;

 

-                

-                ExpressionResult expressionResult = null;

-                

-                String firstArgumentAsString = null;

-                String secondArgumentAsString = null;

-                

-                Integer secondArgumentAsInteger = null;

-                Integer thirdArgumentAsInteger = null;

-                

-                // most of the functions take 2  args, but SUBSTRING takes 3 AND concatenate takes 2 or more

-                if (operation == OPERATION.CONCATENATE) {

-                        StringBuilder builder = new StringBuilder();

-                        for (int i = 0; i < arguments.size(); i++) {

-                                FunctionArgument functionArgument = arguments.get(i);

-                                ConvertedArgument<I> convertedArgument = new ConvertedArgument<I>(functionArgument, this.getDataTypeArgs(), false);

-                                if ( ! convertedArgument.isOk()) {

-                                        return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

-                                }

-                                try {

-                                        String argumentAsString = this.getDataTypeArgs().toStringValue( convertedArgument.getValue());

-                                        builder.append(argumentAsString);

-                                } catch (DataTypeException e) {

-                                        String message = e.getMessage();

-                                        if (e.getCause() != null) {

-                                                message = e.getCause().getMessage();

-                                        }

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message ));

-                                }

-                        }

-                        AttributeValue<String> stringResult =  new StdAttributeValue<String>(XACML.ID_DATATYPE_STRING, 

-                                        builder.toString() );

-                        expressionResult = ExpressionResult.newSingle(stringResult);

-                        return expressionResult;

-                        

-                } else if (operation == OPERATION.SUBSTRING) {

-                        // first arg is of generic type

-                        FunctionArgument functionArgument = arguments.get(0);

-                        ConvertedArgument<I> convertedArgument0 = new ConvertedArgument<I>(functionArgument, this.getDataTypeArgs(), false);

-                        if ( ! convertedArgument0.isOk()) {

-                                return ExpressionResult.newError(getFunctionStatus(convertedArgument0.getStatus()));

-                        }

-                        try {

-                                firstArgumentAsString = this.getDataTypeArgs().toStringValue( convertedArgument0.getValue());

-                        } catch (DataTypeException e) {

-                                String message = e.getMessage();

-                                if (e.getCause() != null) {

-                                        message = e.getCause().getMessage();

-                                }

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message ));

-                        }

-                        

-                        functionArgument = arguments.get(1);

-                        ConvertedArgument<BigInteger> convertedArgumentInt = new ConvertedArgument<BigInteger>(functionArgument, DataTypes.DT_INTEGER, false);

-                        if ( ! convertedArgumentInt.isOk()) {

-                                return ExpressionResult.newError(getFunctionStatus(convertedArgumentInt.getStatus()));

-                        }

-                        secondArgumentAsInteger = convertedArgumentInt.getValue().intValue();

-                        if (secondArgumentAsInteger < 0 || secondArgumentAsInteger > firstArgumentAsString.length()) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " +

-                                                "Start point '" + secondArgumentAsInteger + "' out of range 0-" + firstArgumentAsString.length() +

-                                                " for string='" + firstArgumentAsString + "'"));

-                        }

-                        

-                        

-                        functionArgument = arguments.get(2);

-                        convertedArgumentInt = new ConvertedArgument<BigInteger>(functionArgument, DataTypes.DT_INTEGER, false);

-                        if ( ! convertedArgumentInt.isOk()) {

-                                return ExpressionResult.newError(getFunctionStatus(convertedArgumentInt.getStatus()));

-                        }

-                        thirdArgumentAsInteger = convertedArgumentInt.getValue().intValue();

-                        // special case: -1 means "to end of string"

-                        if (thirdArgumentAsInteger < -1 || thirdArgumentAsInteger > firstArgumentAsString.length()) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " +

-                                                "End point '" + thirdArgumentAsInteger + "' out of range 0-" + firstArgumentAsString.length() +

-                                                " for string='" + firstArgumentAsString + "'"));

-                        }

-                        if (thirdArgumentAsInteger != -1 && thirdArgumentAsInteger < secondArgumentAsInteger) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " +

-                                                "End point '" + thirdArgumentAsInteger + "' less than start point '" + secondArgumentAsString + "'" +

-                                                " for string='" + firstArgumentAsString + "'"));

-                        }

-                        

-                } else {

-                        // expect 2 args, one String and one of Generic type

-                        FunctionArgument functionArgument = arguments.get(0);

-                        ConvertedArgument<String> convertedArgument0 = new ConvertedArgument<String>(functionArgument, DataTypes.DT_STRING, false);

-                        if ( ! convertedArgument0.isOk()) {

-                                return ExpressionResult.newError(getFunctionStatus(convertedArgument0.getStatus()));

-                        }

-                        firstArgumentAsString = convertedArgument0.getValue();

-                        

-                        

-                        functionArgument = arguments.get(1);

-                        ConvertedArgument<I> convertedArgument1 = new ConvertedArgument<I>(functionArgument, this.getDataTypeArgs(), false);

-                        if ( ! convertedArgument1.isOk()) {

-                                return ExpressionResult.newError(getFunctionStatus(convertedArgument1.getStatus()));

-                        }

-                        try {

-                                secondArgumentAsString = this.getDataTypeArgs().toStringValue( convertedArgument1.getValue());

-                        } catch (DataTypeException e) {

-                                String message = e.getMessage();

-                                if (e.getCause() != null) {

-                                        message = e.getCause().getMessage();

-                                }

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message +

-                                                " " + message ));

-                        }

-                

-                        

+        String firstArgumentAsString = null;

+        String secondArgumentAsString = null;

+

+        Integer secondArgumentAsInteger = null;

+        Integer thirdArgumentAsInteger = null;

+

+        // most of the functions take 2  args, but SUBSTRING takes 3 AND concatenate takes 2 or more

+        if (operation == OPERATION.CONCATENATE) {

+            StringBuilder builder = new StringBuilder();

+            for (int i = 0; i < arguments.size(); i++) {

+                FunctionArgument functionArgument = arguments.get(i);

+                ConvertedArgument<I> convertedArgument = new ConvertedArgument<I>(functionArgument, this.getDataTypeArgs(), false);

+                if ( ! convertedArgument.isOk()) {

+                    return ExpressionResult.newError(getFunctionStatus(convertedArgument.getStatus()));

                 }

-                

-                // arguments are ready - do the operation

-                

-                switch (operation) {

-                case STARTS_WITH:

-                        if (secondArgumentAsString.startsWith(firstArgumentAsString)) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                        

-                        

-                case ENDS_WITH:

-                        if (secondArgumentAsString.endsWith(firstArgumentAsString)) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                        

-                case CONTAINS:

-                        if (secondArgumentAsString.contains(firstArgumentAsString)) {

-                                return ER_TRUE;

-                        } else {

-                                return ER_FALSE;

-                        }

-                        

-                case SUBSTRING:

-                        String substring = null;

-                        if (thirdArgumentAsInteger == -1) {

-                                // from start point to end of string

-                                substring = firstArgumentAsString.substring(secondArgumentAsInteger);

-                        } else {

-                                substring = firstArgumentAsString.substring(secondArgumentAsInteger, thirdArgumentAsInteger);

-                        }

-                        AttributeValue<String> stringResult =  new StdAttributeValue<String>(XACML.ID_DATATYPE_STRING, substring);

-                        expressionResult = ExpressionResult.newSingle(stringResult);

-                        break;

+                try {

+                    String argumentAsString = this.getDataTypeArgs().toStringValue( convertedArgument.getValue());

+                    builder.append(argumentAsString);

+                } catch (DataTypeException e) {

+                    String message = e.getMessage();

+                    if (e.getCause() != null) {

+                        message = e.getCause().getMessage();

+                    }

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message ));

                 }

-                

-                

-                return expressionResult;

+            }

+            AttributeValue<String> stringResult =  new StdAttributeValue<String>(XACML.ID_DATATYPE_STRING,

+                    builder.toString() );

+            expressionResult = ExpressionResult.newSingle(stringResult);

+            return expressionResult;

+

+        } else if (operation == OPERATION.SUBSTRING) {

+            // first arg is of generic type

+            FunctionArgument functionArgument = arguments.get(0);

+            ConvertedArgument<I> convertedArgument0 = new ConvertedArgument<I>(functionArgument, this.getDataTypeArgs(), false);

+            if ( ! convertedArgument0.isOk()) {

+                return ExpressionResult.newError(getFunctionStatus(convertedArgument0.getStatus()));

+            }

+            try {

+                firstArgumentAsString = this.getDataTypeArgs().toStringValue( convertedArgument0.getValue());

+            } catch (DataTypeException e) {

+                String message = e.getMessage();

+                if (e.getCause() != null) {

+                    message = e.getCause().getMessage();

+                }

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message ));

+            }

+

+            functionArgument = arguments.get(1);

+            ConvertedArgument<BigInteger> convertedArgumentInt = new ConvertedArgument<BigInteger>(functionArgument, DataTypes.DT_INTEGER, false);

+            if ( ! convertedArgumentInt.isOk()) {

+                return ExpressionResult.newError(getFunctionStatus(convertedArgumentInt.getStatus()));

+            }

+            secondArgumentAsInteger = convertedArgumentInt.getValue().intValue();

+            if (secondArgumentAsInteger < 0 || secondArgumentAsInteger > firstArgumentAsString.length()) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " +

+                                                 "Start point '" + secondArgumentAsInteger + "' out of range 0-" + firstArgumentAsString.length() +

+                                                 " for string='" + firstArgumentAsString + "'"));

+            }

+

+

+            functionArgument = arguments.get(2);

+            convertedArgumentInt = new ConvertedArgument<BigInteger>(functionArgument, DataTypes.DT_INTEGER, false);

+            if ( ! convertedArgumentInt.isOk()) {

+                return ExpressionResult.newError(getFunctionStatus(convertedArgumentInt.getStatus()));

+            }

+            thirdArgumentAsInteger = convertedArgumentInt.getValue().intValue();

+            // special case: -1 means "to end of string"

+            if (thirdArgumentAsInteger < -1 || thirdArgumentAsInteger > firstArgumentAsString.length()) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " +

+                                                 "End point '" + thirdArgumentAsInteger + "' out of range 0-" + firstArgumentAsString.length() +

+                                                 " for string='" + firstArgumentAsString + "'"));

+            }

+            if (thirdArgumentAsInteger != -1 && thirdArgumentAsInteger < secondArgumentAsInteger) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " +

+                                                 "End point '" + thirdArgumentAsInteger + "' less than start point '" + secondArgumentAsString + "'" +

+                                                 " for string='" + firstArgumentAsString + "'"));

+            }

+

+        } else {

+            // expect 2 args, one String and one of Generic type

+            FunctionArgument functionArgument = arguments.get(0);

+            ConvertedArgument<String> convertedArgument0 = new ConvertedArgument<String>(functionArgument, DataTypes.DT_STRING, false);

+            if ( ! convertedArgument0.isOk()) {

+                return ExpressionResult.newError(getFunctionStatus(convertedArgument0.getStatus()));

+            }

+            firstArgumentAsString = convertedArgument0.getValue();

+

+

+            functionArgument = arguments.get(1);

+            ConvertedArgument<I> convertedArgument1 = new ConvertedArgument<I>(functionArgument, this.getDataTypeArgs(), false);

+            if ( ! convertedArgument1.isOk()) {

+                return ExpressionResult.newError(getFunctionStatus(convertedArgument1.getStatus()));

+            }

+            try {

+                secondArgumentAsString = this.getDataTypeArgs().toStringValue( convertedArgument1.getValue());

+            } catch (DataTypeException e) {

+                String message = e.getMessage();

+                if (e.getCause() != null) {

+                    message = e.getCause().getMessage();

+                }

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message +

+                                                 " " + message ));

+            }

+

 

         }

 

+        // arguments are ready - do the operation

 

-        

-        

+        switch (operation) {

+        case STARTS_WITH:

+            if (secondArgumentAsString.startsWith(firstArgumentAsString)) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+

+

+        case ENDS_WITH:

+            if (secondArgumentAsString.endsWith(firstArgumentAsString)) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+

+        case CONTAINS:

+            if (secondArgumentAsString.contains(firstArgumentAsString)) {

+                return ER_TRUE;

+            } else {

+                return ER_FALSE;

+            }

+

+        case SUBSTRING:

+            String substring = null;

+            if (thirdArgumentAsInteger == -1) {

+                // from start point to end of string

+                substring = firstArgumentAsString.substring(secondArgumentAsInteger);

+            } else {

+                substring = firstArgumentAsString.substring(secondArgumentAsInteger, thirdArgumentAsInteger);

+            }

+            AttributeValue<String> stringResult =  new StdAttributeValue<String>(XACML.ID_DATATYPE_STRING, substring);

+            expressionResult = ExpressionResult.newSingle(stringResult);

+            break;

+        }

+

+

+        return expressionResult;

+

+    }

+

+

+

+

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringNormalize.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringNormalize.java
index f4beeca..0e85444 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringNormalize.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringNormalize.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -48,81 +48,81 @@
 /**

  * FunctionDefinitionStringNormalize extends {@link com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionHomogeneousSimple} to

  * implement the XACML String normalization predicates as functions taking one <code>String</code> arg and returning a single value of the same type.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		string-normalize-space

  * 		string-normalize-to-lower-case

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  */

 public class FunctionDefinitionStringNormalize extends FunctionDefinitionHomogeneousSimple<String, String> {

-        

-        /**

-         * List of string normalization operations.

-         * 

-         * @author glenngriffin

-         *

+

+    /**

+     * List of string normalization operations.

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {SPACE, LOWER_CASE };

+

+    // operation to be used in this instance of the Arightmetic class

+    private final OPERATION operation;

+

+

+    // result variables used by all functions

+    AttributeValue<String>	result;

+

+

+    /**

+     * Constructor

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     * @param op

+     */

+    public FunctionDefinitionStringNormalize(Identifier idIn,  OPERATION op) {

+        // for Arithmetic functions, the output type is the same as the input type (no mixing of Ints and Doubles!)

+        super(idIn, DataTypes.DT_STRING, DataTypeString.newInstance(), 1);

+

+        // save the operation and data type to be used in this instance

+        operation = op;

+

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        List<String> convertedArguments	= new ArrayList<String>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

          */

-        public enum OPERATION {SPACE, LOWER_CASE };

-        

-        // operation to be used in this instance of the Arightmetic class

-        private final OPERATION operation;

-        

-        

-        // result variables used by all functions

-        AttributeValue<String>	result;

-

-

-        /**

-         * Constructor

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         * @param op

-         */

-        public FunctionDefinitionStringNormalize(Identifier idIn,  OPERATION op) {

-                // for Arithmetic functions, the output type is the same as the input type (no mixing of Ints and Doubles!)

-                super(idIn, DataTypes.DT_STRING, DataTypeString.newInstance(), 1);

-                

-                // save the operation and data type to be used in this instance

-                operation = op;

-

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

         }

 

+        /*

+         * Now perform the requested operation.

+         */

+        ExpressionResult expressionResult = null;

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                List<String> convertedArguments	= new ArrayList<String>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

-                

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

-                }

-                

-                /*

-                 * Now perform the requested operation.

-                 */

-                ExpressionResult expressionResult = null;

-                

-                switch (operation) {

-                case SPACE:

-                        result	= new StdAttributeValue<String>(XACML.ID_DATATYPE_STRING, convertedArguments.get(0).trim() );

-                        break;

-                case LOWER_CASE:

-                        result	= new StdAttributeValue<String>(XACML.ID_DATATYPE_STRING, convertedArguments.get(0).toLowerCase() );

-                        break;

-                }

-                

-                expressionResult = ExpressionResult.newSingle(result);

-

-                return expressionResult;

+        switch (operation) {

+        case SPACE:

+            result	= new StdAttributeValue<String>(XACML.ID_DATATYPE_STRING, convertedArguments.get(0).trim() );

+            break;

+        case LOWER_CASE:

+            result	= new StdAttributeValue<String>(XACML.ID_DATATYPE_STRING, convertedArguments.get(0).toLowerCase() );

+            break;

         }

 

+        expressionResult = ExpressionResult.newSingle(result);

+

+        return expressionResult;

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionTimeInRange.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionTimeInRange.java
index 3ad4b5e..3ef60d8 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionTimeInRange.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionTimeInRange.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -48,69 +48,69 @@
  * FunctionDefinitionTimeInRange implements {@link com.att.research.xacmlatt.pdp.policy.FunctionDefinition} to

  * implement the XACML time-in-range predicates as a function taking three arguments of type <code>Time</code>

  * and returning a <code>Boolean</code>.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		time-in-range

- * 

- * 

+ *

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

- * @param <I> the java class for the data type of the function Input arguments.  

+ *

+ * @param <I> the java class for the data type of the function Input arguments.

  */

 public class FunctionDefinitionTimeInRange<I> extends FunctionDefinitionHomogeneousSimple<Boolean, I> {

 

 

-        

-        

-        /**

-         * Constructor - need dataType input because of java Generic type-erasure during compilation.

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

+

+

+    /**

+     * Constructor - need dataType input because of java Generic type-erasure during compilation.

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     */

+    public FunctionDefinitionTimeInRange(Identifier idIn, DataType<I> dataTypeArgsIn) {

+        super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, 3);

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        List<I> convertedArguments	= new ArrayList<I>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

          */

-        public FunctionDefinitionTimeInRange(Identifier idIn, DataType<I> dataTypeArgsIn) {

-                super(idIn, DataTypes.DT_BOOLEAN, dataTypeArgsIn, 3);

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

         }

 

+        int compareResultLow;

+        int compareResultHigh;

+        try {

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-

-                List<I> convertedArguments	= new ArrayList<I>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

-                

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

-                }

-                

-                int compareResultLow;

-                int compareResultHigh;

-                try {

-

-                        compareResultLow = ((ISO8601Time) convertedArguments.get(1)).compareTo((ISO8601Time)convertedArguments.get(0));

-                        compareResultHigh = ((ISO8601Time)convertedArguments.get(2)).compareTo((ISO8601Time)convertedArguments.get(0));

-                } catch (Exception e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

-                }

-

-                // is arg 0 within the inclusive range of the other two?

-                if (compareResultLow <=0 && compareResultHigh >= 0) {

-                        return ER_TRUE;

-                } else {

-                        return ER_FALSE;

-                }

+            compareResultLow = ((ISO8601Time) convertedArguments.get(1)).compareTo((ISO8601Time)convertedArguments.get(0));

+            compareResultHigh = ((ISO8601Time)convertedArguments.get(2)).compareTo((ISO8601Time)convertedArguments.get(0));

+        } catch (Exception e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " " + message));

         }

 

+        // is arg 0 within the inclusive range of the other two?

+        if (compareResultLow <=0 && compareResultHigh >= 0) {

+            return ER_TRUE;

+        } else {

+            return ER_FALSE;

+        }

+    }

+

 

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionURIStringConcatenate.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionURIStringConcatenate.java
index b667fcc..a47236b 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionURIStringConcatenate.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionURIStringConcatenate.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -49,86 +49,86 @@
  * FunctionDefinitionURIStringConcatenate extends {@link FunctionDefinitionHomogeneousSimple} to

  * implement the XACML uri-string-concatenate predicate as a function taking one <code>URI</code> and one or more <code>String</code> arguments

  * and returning a single <code>URI</code> value.

- * 

+ *

  * THIS FUNCTION IS DEPRECATED IN 3.0 BUT NOT REMOVED.

  * To provide backward compatibility for previously built XACML policies we include it in our R3 version.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		uri-string-concatenate

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  */

 @Deprecated

 public class FunctionDefinitionURIStringConcatenate extends FunctionDefinitionBase<URI, URI> {

-        

 

-        /**

-         * Constructor

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         * @param op

-         */

-        public FunctionDefinitionURIStringConcatenate(Identifier idIn) {

-                super(idIn, DataTypes.DT_ANYURI, DataTypes.DT_ANYURI, false);

+

+    /**

+     * Constructor

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     * @param op

+     */

+    public FunctionDefinitionURIStringConcatenate(Identifier idIn) {

+        super(idIn, DataTypes.DT_ANYURI, DataTypes.DT_ANYURI, false);

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        if (arguments == null || arguments.size() < 2) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + " Expected 2 or more arguments, got " +

+                                             ((arguments == null) ? "null" : arguments.size()) ));

+        }

+

+        // get the string to search for

+        ConvertedArgument<URI> uriArgument = new ConvertedArgument<URI>(arguments.get(0), DataTypes.DT_ANYURI, false);

+        if ( ! uriArgument.isOk()) {

+            Status decoratedStatus = new StdStatus(uriArgument.getStatus().getStatusCode(), uriArgument.getStatus().getStatusMessage() + " at arg index 0"  );

+            return ExpressionResult.newError(getFunctionStatus(decoratedStatus));

+        }

+        String uriString = uriArgument.getValue().toString();

+

+        // remaining arguments are strings

+        String[] stringValues = new String[arguments.size() - 1];

+

+        for (int i = 1; i < arguments.size(); i++) {

+

+            ConvertedArgument<String> stringArgument = new ConvertedArgument<String>(arguments.get(i), DataTypes.DT_STRING, false);

+            if ( ! stringArgument.isOk()) {

+                Status decoratedStatus = new StdStatus(stringArgument.getStatus().getStatusCode(), stringArgument.getStatus().getStatusMessage() + " at arg index " + i );

+                return ExpressionResult.newError(getFunctionStatus(decoratedStatus));

+            }

+

+            stringValues[i-1] = stringArgument.getValue();

+

         }

 

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                

-                if (arguments == null || arguments.size() < 2) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, getShortFunctionId() + " Expected 2 or more arguments, got " + 

-                                        ((arguments == null) ? "null" : arguments.size()) ));

-                }

-

-                // get the string to search for

-                ConvertedArgument<URI> uriArgument = new ConvertedArgument<URI>(arguments.get(0), DataTypes.DT_ANYURI, false);

-                if ( ! uriArgument.isOk()) {

-                        Status decoratedStatus = new StdStatus(uriArgument.getStatus().getStatusCode(), uriArgument.getStatus().getStatusMessage() + " at arg index 0"  );

-                        return ExpressionResult.newError(getFunctionStatus(decoratedStatus));

-                }

-                String uriString = uriArgument.getValue().toString();

-                

-                // remaining arguments are strings

-                String[] stringValues = new String[arguments.size() - 1];

-                

-                for (int i = 1; i < arguments.size(); i++) {

-

-                        ConvertedArgument<String> stringArgument = new ConvertedArgument<String>(arguments.get(i), DataTypes.DT_STRING, false);

-                        if ( ! stringArgument.isOk()) {

-                                Status decoratedStatus = new StdStatus(stringArgument.getStatus().getStatusCode(), stringArgument.getStatus().getStatusMessage() + " at arg index " + i );

-                                return ExpressionResult.newError(getFunctionStatus(decoratedStatus));

-                        }

-                        

-                        stringValues[i-1] = stringArgument.getValue();

-                

-                }

-                

-                

-                // add each of the strings onto the URI

-                for (int i = 0; i < stringValues.length; i++) {

-                        uriString += stringValues[i];

-                }

-                

-                URI resultURI = null;

-                try {

-                        resultURI = DataTypes.DT_ANYURI.convert(uriString);

-                } catch (DataTypeException e) {

-                        String message = e.getMessage();

-                        if (e.getCause() != null) {

-                                message = e.getCause().getMessage();

-                        }

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, getShortFunctionId() + 

-                                        " Final string '" + uriString + "' not URI, " + message));

-                }

-                

-                return ExpressionResult.newSingle(new StdAttributeValue<URI>(XACML.ID_DATATYPE_ANYURI, resultURI));

-

+        // add each of the strings onto the URI

+        for (int i = 0; i < stringValues.length; i++) {

+            uriString += stringValues[i];

         }

 

+        URI resultURI = null;

+        try {

+            resultURI = DataTypes.DT_ANYURI.convert(uriString);

+        } catch (DataTypeException e) {

+            String message = e.getMessage();

+            if (e.getCause() != null) {

+                message = e.getCause().getMessage();

+            }

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, getShortFunctionId() +

+                                             " Final string '" + uriString + "' not URI, " + message));

+        }

+

+        return ExpressionResult.newSingle(new StdAttributeValue<URI>(XACML.ID_DATATYPE_ANYURI, resultURI));

+

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionX500NameMatch.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionX500NameMatch.java
index 643d168..2cf9aad 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionX500NameMatch.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionX500NameMatch.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -46,73 +46,73 @@
 /**

  * FunctionDefinitionX500NameMatch extends {@link com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionHomogeneousSimple} to

  * implement the XACML X500Name match predicate as functions taking two <code>X500Name</code> arguments and returning a single <code>Boolean</code> value.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		x500Name-match

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  */

 public class FunctionDefinitionX500NameMatch extends FunctionDefinitionHomogeneousSimple<Boolean, X500Principal> {

-        

 

-        /**

-         * Constructor

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         * @param op

+

+    /**

+     * Constructor

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     * @param op

+     */

+    public FunctionDefinitionX500NameMatch(Identifier idIn) {

+        super(idIn, DataTypes.DT_BOOLEAN, DataTypes.DT_X500NAME, 2);

+    }

+

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        List<X500Principal> convertedArguments	= new ArrayList<X500Principal>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

          */

-        public FunctionDefinitionX500NameMatch(Identifier idIn) {

-                super(idIn, DataTypes.DT_BOOLEAN, DataTypes.DT_X500NAME, 2);

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

+        }

+

+        /*

+         * Now perform the match.

+         */

+

+        /*

+         * The spec writer's comments at:

+         * https://lists.oasis-open.org/archives/xacml/200906/msg00019.html

+         * say that the first sequence must exactly match the END of the second sequence.

+         */

+

+        String[] searchFor = convertedArguments.get(0).getName().split(",");

+        String[] searchIn = convertedArguments.get(1).getName().split(",");

+

+        // if first is bigger than 2nd there is no way we can match

+        if (searchFor.length > searchIn.length) {

+            return ER_FALSE;

+        }

+

+        // start from back-end of both lists - everything should match up to the length of the input

+        for (int i = 0; i < searchFor.length; i++) {

+            String searchForTerm = searchFor[searchFor.length - i - 1];

+            String searchInTerm = searchIn[searchIn.length - i - 1];

+            if (searchForTerm == null || searchInTerm == null ||

+                    ! searchForTerm.trim().equals(searchInTerm.trim())) {

+                return ER_FALSE;

+            }

         }

 

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

-                List<X500Principal> convertedArguments	= new ArrayList<X500Principal>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

-                

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

-                }

-                

-                /*

-                 * Now perform the match.

-                 */

-                

-                /*

-                 * The spec writer's comments at:

-                 * https://lists.oasis-open.org/archives/xacml/200906/msg00019.html

-                 * say that the first sequence must exactly match the END of the second sequence.

-                 */

-                

-                String[] searchFor = convertedArguments.get(0).getName().split(",");

-                String[] searchIn = convertedArguments.get(1).getName().split(",");

-

-                // if first is bigger than 2nd there is no way we can match

-                if (searchFor.length > searchIn.length) {

-                        return ER_FALSE;

-                }

-                

-                // start from back-end of both lists - everything should match up to the length of the input

-                for (int i = 0; i < searchFor.length; i++) {

-                        String searchForTerm = searchFor[searchFor.length - i - 1];

-                        String searchInTerm = searchIn[searchIn.length - i - 1];

-                        if (searchForTerm == null || searchInTerm == null || 

-                                        ! searchForTerm.trim().equals(searchInTerm.trim())) {

-                                return ER_FALSE;

-                        }

-                }

-

-

-                return ER_TRUE;

-        }

+        return ER_TRUE;

+    }

 

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionXPath.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionXPath.java
index 62054ec..14e5523 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionXPath.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionXPath.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -57,213 +57,213 @@
 

 /**

  * FunctionDefinitionXPath extends {@link com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionHomogeneousSimple} to

- * implement the XACML XPath predicates as functions taking one or two <code>XPathExpression</code> arguments and returning 

+ * implement the XACML XPath predicates as functions taking one or two <code>XPathExpression</code> arguments and returning

  * either an <code>Integer</code> or a <code>Boolean</code>.

- * 

+ *

  * XACML version 1.0 and 2.0 used <code>String</code> data type as input.

  * We do NOT support those functions because of ambiguity in the meaning of those Strings.

  * The root of the XPath changed from the Request level in 2.0 to the Content level in 3.0.

  * Also the 2.0 Requests contain only one Content, located in the resources category, while 3.0 allows Requests to contain Content in multiple categories.

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		xpath-node-count

  * 		xpath-node-equals

  * 		xpath-node-match

- * 

+ *

  * @author glenngriffin

  * @version $Revision: 1.1 $

- * 

+ *

  * @param <O> the java class for the data type of the function Output

 

- * 

+ *

  */

 public class FunctionDefinitionXPath<O> extends FunctionDefinitionHomogeneousSimple<O, XPathExpressionWrapper> {

-        

-        /**

-         * List of string normalization operations.

-         * 

-         * @author glenngriffin

-         *

+

+    /**

+     * List of string normalization operations.

+     *

+     * @author glenngriffin

+     *

+     */

+    public enum OPERATION {COUNT, EQUAL, MATCH };

+

+    // operation to be used in this instance of the Arightmetic class

+    private final OPERATION operation;

+

+

+    // result variables used by all functions

+    AttributeValue<String>	result;

+

+

+    /**

+     * Constructor

+     *

+     * @param idIn

+     * @param dataTypeArgsIn

+     * @param op

+     */

+    public FunctionDefinitionXPath(Identifier idIn, DataType<O> dataTypeIn, OPERATION op) {

+        super(idIn, dataTypeIn, DataTypes.DT_XPATHEXPRESSION, ( (op == OPERATION.COUNT) ? 1 : 2 ) );

+        // save the operation and data type to be used in this instance

+        operation = op;

+

+    }

+

+    @Override

+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+

+        List<NodeList> nodeListList = new ArrayList<NodeList>();

+

+        List<XPathExpressionWrapper> convertedArguments	= new ArrayList<XPathExpressionWrapper>();

+        Status status				= this.validateArguments(arguments, convertedArguments);

+

+        /*

+         * If the function arguments are not correct, just return an error status immediately

          */

-        public enum OPERATION {COUNT, EQUAL, MATCH };

-        

-        // operation to be used in this instance of the Arightmetic class

-        private final OPERATION operation;

-        

-        

-        // result variables used by all functions

-        AttributeValue<String>	result;

-

-

-        /**

-         * Constructor

-         * 

-         * @param idIn

-         * @param dataTypeArgsIn

-         * @param op

-         */

-        public FunctionDefinitionXPath(Identifier idIn, DataType<O> dataTypeIn, OPERATION op) {

-                super(idIn, dataTypeIn, DataTypes.DT_XPATHEXPRESSION, ( (op == OPERATION.COUNT) ? 1 : 2 ) );

-                // save the operation and data type to be used in this instance

-                operation = op;

-

+        if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

+            return ExpressionResult.newError(getFunctionStatus(status));

         }

 

-        @Override

-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {

+        // check the evaluationContext and Request for null

+        if (evaluationContext == null) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Got null EvaluationContext"));

+        }

+        if (evaluationContext.getRequest() == null) {

+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                             " Got null Request in EvaluationContext"));

+        }

 

-                List<NodeList> nodeListList = new ArrayList<NodeList>();

 

-                List<XPathExpressionWrapper> convertedArguments	= new ArrayList<XPathExpressionWrapper>();

-                Status status				= this.validateArguments(arguments, convertedArguments);

+        // each argument is an XPath that needs to be evaluated against the Content part of some Category (specified in the argument)

+        for (int i = 0; i < arguments.size(); i++) {

+            FunctionArgument functionArgument = arguments.get(i);

+            if (functionArgument.isBag()) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Got bag at index " + i));

+            }

+            AttributeValue<?> attributeValueFunctionArgument	= functionArgument.getValue();

+            if (attributeValueFunctionArgument == null) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Got null value at index " + i));

+            }

+            Identifier xpathCategory = attributeValueFunctionArgument.getXPathCategory();

+            if (xpathCategory == null) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

+                                                 " Got null Category at index " + i));

+            }

 

-                /*

-                 * If the function arguments are not correct, just return an error status immediately

-                 */

-                if (!status.getStatusCode().equals(StdStatusCode.STATUS_CODE_OK)) {

-                        return ExpressionResult.newError(getFunctionStatus(status));

+            Iterator<RequestAttributes> it = evaluationContext.getRequest().getRequestAttributes(xpathCategory);

+            if (it == null) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

+                                                 " Got null Iterator at index " + i));

+            }

+

+            NodeList nodeList = null;

+

+            while (it.hasNext()) {

+                if (nodeList != null) {

+                    // the request has more than one Content entry for the same Category - error

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

+                                                     " More than one Content section for id '" + xpathCategory + "'" ));

                 }

-                

-                // check the evaluationContext and Request for null

-                if (evaluationContext == null) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

-                                        " Got null EvaluationContext"));

-                }

-                if (evaluationContext.getRequest() == null) {

-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

-                                        " Got null Request in EvaluationContext"));

-                }

-                

-                

-                // each argument is an XPath that needs to be evaluated against the Content part of some Category (specified in the argument)

-                for (int i = 0; i < arguments.size(); i++) {

-                        FunctionArgument functionArgument = arguments.get(i);

-                        if (functionArgument.isBag()) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Got bag at index " + i));

-                        }

-                        AttributeValue<?> attributeValueFunctionArgument	= functionArgument.getValue();

-                        if (attributeValueFunctionArgument == null) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() + " Got null value at index " + i));

-                        }

-                        Identifier xpathCategory = attributeValueFunctionArgument.getXPathCategory();

-                        if (xpathCategory == null) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

-                                                " Got null Category at index " + i));

-                        }

-                        

-                        Iterator<RequestAttributes> it = evaluationContext.getRequest().getRequestAttributes(xpathCategory);

-                        if (it == null) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

-                                                " Got null Iterator at index " + i));

-                        }

-                        

-                        NodeList nodeList = null;

+                RequestAttributes requestAttributes = it.next();

 

-                        while (it.hasNext()) {

-                                if (nodeList != null) {

-                                        // the request has more than one Content entry for the same Category - error

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

-                                                        " More than one Content section for id '" + xpathCategory + "'" ));

-                                }

-                                RequestAttributes requestAttributes = it.next();

-                                

-                                // if there is no Content section then we return either 0 or FALSE

-                                if (requestAttributes.getContentRoot() == null) {

-                                        if (operation == OPERATION.COUNT){

-                                                return ExpressionResult.newSingle(new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, new BigInteger("0") ));

-                                        } else {

-                                                return ER_FALSE;

-                                        }

-                                }

-

-                                try {

-                                        XPathExpression xPathExpression = convertedArguments.get(i).getXpathExpressionWrapped();

-                                        nodeList    = requestAttributes.getContentNodeListByXpathExpression(xPathExpression);

-                                } catch (Exception e) {

-                                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

-                                                        " XPath produces null result at '" + convertedArguments.get(i).getPath() + "' at index " + i ));

-                                }

-

-

-                        }

-                        

-                        if (nodeList == null) {

-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

-                                                " XPathExpression returned null at index " + i));

-                        }

-                        

-                        // add this nodeList to the list of lists

-                        nodeListList.add(nodeList);

-                }

-                

-                

-                /*

-                 * Now perform the requested operation.

-                 */

-                ExpressionResult expressionResult = null;

-                

-                switch (operation) {

-                case COUNT:

-                        Integer listLength = new Integer(nodeListList.get(0).getLength());

-                        expressionResult = ExpressionResult.newSingle(new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER,

-                                        new BigInteger(listLength.toString()) ));

-                        return expressionResult;

-                        

-                        

-                case EQUAL:

-                        // true if any node in first list equals any node in second set.

-                        // The spec says: "Two nodes are considered equal if they have the same identity."

-                        // we use the isSameNode method in Node to determine that.

-                        for (int index0 = 0; index0 < nodeListList.get(0).getLength(); index0++) {

-                                for (int index1 = 0; index1 < nodeListList.get(1).getLength(); index1++)  {

-                                        if (nodeListList.get(0).item(index0).isSameNode(nodeListList.get(1).item(index1))) {

-                                                return ER_TRUE;

-                                        }

-                                }

-                        }

-                        // none from the first list found in the second

+                // if there is no Content section then we return either 0 or FALSE

+                if (requestAttributes.getContentRoot() == null) {

+                    if (operation == OPERATION.COUNT) {

+                        return ExpressionResult.newSingle(new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER, new BigInteger("0") ));

+                    } else {

                         return ER_FALSE;

-                        

-                        

-                case MATCH:

-                        // this is looking to see if any of the nodes in the second set are children of (or equal to) the nodes in the first set

-                        // Call recursive check for that.

-                        expressionResult = nodeListMatch(nodeListList.get(0), nodeListList.get(1));

-                        return expressionResult;

+                    }

                 }

-                

-                expressionResult = ExpressionResult.newSingle(result);

 

-                return expressionResult;

+                try {

+                    XPathExpression xPathExpression = convertedArguments.get(i).getXpathExpressionWrapped();

+                    nodeList    = requestAttributes.getContentNodeListByXpathExpression(xPathExpression);

+                } catch (Exception e) {

+                    return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, this.getShortFunctionId() +

+                                                     " XPath produces null result at '" + convertedArguments.get(i).getPath() + "' at index " + i ));

+                }

+

+

+            }

+

+            if (nodeList == null) {

+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, this.getShortFunctionId() +

+                                                 " XPathExpression returned null at index " + i));

+            }

+

+            // add this nodeList to the list of lists

+            nodeListList.add(nodeList);

         }

-        

-        /**

-         * Recursive method checking to see if anything in list 2 equals anything in list 1 OR list 1's child nodes

-         * @param list1

-         * @param list2

-         * @return

+

+

+        /*

+         * Now perform the requested operation.

          */

-        private ExpressionResult nodeListMatch(NodeList list1, NodeList list2) {

-                // look for match with current contents of list 1

-                for (int index1 = 0; index1 < list1.getLength(); index1++) {

-                        for (int index2 = 0; index2 < list2.getLength(); index2++)  {

-                                if (list1.item(index1).isSameNode(list2.item(index2))) {

-                                        return ER_TRUE;

-                                }

-                        }

+        ExpressionResult expressionResult = null;

+

+        switch (operation) {

+        case COUNT:

+            Integer listLength = new Integer(nodeListList.get(0).getLength());

+            expressionResult = ExpressionResult.newSingle(new StdAttributeValue<BigInteger>(XACML.ID_DATATYPE_INTEGER,

+                               new BigInteger(listLength.toString()) ));

+            return expressionResult;

+

+

+        case EQUAL:

+            // true if any node in first list equals any node in second set.

+            // The spec says: "Two nodes are considered equal if they have the same identity."

+            // we use the isSameNode method in Node to determine that.

+            for (int index0 = 0; index0 < nodeListList.get(0).getLength(); index0++) {

+                for (int index1 = 0; index1 < nodeListList.get(1).getLength(); index1++)  {

+                    if (nodeListList.get(0).item(index0).isSameNode(nodeListList.get(1).item(index1))) {

+                        return ER_TRUE;

+                    }

                 }

-                // look for match with children of list 1

-                for (int index1 = 0; index1 < list1.getLength(); index1++) {

-                        if (nodeListMatch(list1.item(index1).getChildNodes(), list2) == ER_TRUE) {

-                                return ER_TRUE;

-                        }

-                        // this one had no children that matched, so check the next element in list1

-                }

-                

-                // no match anywhere

-                return ER_FALSE;

+            }

+            // none from the first list found in the second

+            return ER_FALSE;

+

+

+        case MATCH:

+            // this is looking to see if any of the nodes in the second set are children of (or equal to) the nodes in the first set

+            // Call recursive check for that.

+            expressionResult = nodeListMatch(nodeListList.get(0), nodeListList.get(1));

+            return expressionResult;

         }

 

+        expressionResult = ExpressionResult.newSingle(result);

+

+        return expressionResult;

+    }

+

+    /**

+     * Recursive method checking to see if anything in list 2 equals anything in list 1 OR list 1's child nodes

+     * @param list1

+     * @param list2

+     * @return

+     */

+    private ExpressionResult nodeListMatch(NodeList list1, NodeList list2) {

+        // look for match with current contents of list 1

+        for (int index1 = 0; index1 < list1.getLength(); index1++) {

+            for (int index2 = 0; index2 < list2.getLength(); index2++)  {

+                if (list1.item(index1).isSameNode(list2.item(index2))) {

+                    return ER_TRUE;

+                }

+            }

+        }

+        // look for match with children of list 1

+        for (int index1 = 0; index1 < list1.getLength(); index1++) {

+            if (nodeListMatch(list1.item(index1).getChildNodes(), list2) == ER_TRUE) {

+                return ER_TRUE;

+            }

+            // this one had no children that matched, so check the next element in list1

+        }

+

+        // no match anywhere

+        return ER_FALSE;

+    }

+

 }

diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/package-info.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/package-info.java
index 8faad55..ba89c43 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/package-info.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/functions/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacmlatt.pdp.policy.expressions contains class definitions that represent specific XACML function
  * implementations for target and condition evaluation and variable definitions.
- *  
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/package-info.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/package-info.java
index dd43775..b17500c 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/package-info.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/std/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacmlatt.pdp.std contains classes that provide reference implementations of various extensible components
  * in the PDP implementation.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/util/ATTPDPProperties.java b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/util/ATTPDPProperties.java
index 6d43d64..9883d02 100644
--- a/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/util/ATTPDPProperties.java
+++ b/openaz-xacml-pdp/src/main/java/com/att/research/xacmlatt/pdp/util/ATTPDPProperties.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,15 +35,15 @@
 import com.att.research.xacml.util.XACMLProperties;
 
 public class ATTPDPProperties extends XACMLProperties {
-        public static final String PROP_EVALUATIONCONTEXTFACTORY	= "xacml.att.evaluationContextFactory";
-        public static final String PROP_COMBININGALGORITHMFACTORY	= "xacml.att.combiningAlgorithmFactory";
-        public static final String PROP_FUNCTIONDEFINITIONFACTORY	= "xacml.att.functionDefinitionFactory";
-        public static final String PROP_POLICYFINDERFACTORY			= "xacml.att.policyFinderFactory";
-        public static final String PROP_POLICYFINDERFACTORY_COMBINEROOTPOLICIES = "xacml.att.policyFinderFactory.combineRootPolicies";
-        
-        public static final Identifier ID_POLICY_COMBINEDPERMITOVERRIDES = new IdentifierImpl("urn:com:att:xacml:3.0:policy-combining-algorithm:combined-permit-overrides");
-        
-        protected ATTPDPProperties() {
-        }
+    public static final String PROP_EVALUATIONCONTEXTFACTORY	= "xacml.att.evaluationContextFactory";
+    public static final String PROP_COMBININGALGORITHMFACTORY	= "xacml.att.combiningAlgorithmFactory";
+    public static final String PROP_FUNCTIONDEFINITIONFACTORY	= "xacml.att.functionDefinitionFactory";
+    public static final String PROP_POLICYFINDERFACTORY			= "xacml.att.policyFinderFactory";
+    public static final String PROP_POLICYFINDERFACTORY_COMBINEROOTPOLICIES = "xacml.att.policyFinderFactory.combineRootPolicies";
+
+    public static final Identifier ID_POLICY_COMBINEDPERMITOVERRIDES = new IdentifierImpl("urn:com:att:xacml:3.0:policy-combining-algorithm:combined-permit-overrides");
+
+    protected ATTPDPProperties() {
+    }
 
 }
diff --git a/openaz-xacml-rest/src/main/java/com/att/research/xacml/rest/XACMLRest.java b/openaz-xacml-rest/src/main/java/com/att/research/xacml/rest/XACMLRest.java
index f2ade8c..1858205 100644
--- a/openaz-xacml-rest/src/main/java/com/att/research/xacml/rest/XACMLRest.java
+++ b/openaz-xacml-rest/src/main/java/com/att/research/xacml/rest/XACMLRest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,175 +47,175 @@
 /**
  * This static class is used by both the PDP and PAP servlet's. It contains some common
  * static functions and objects used by both the servlet's.
- * 
+ *
  * @author pameladragosh
  *
  */
 public class XACMLRest {
-        private static final Log logger	= LogFactory.getLog(XACMLRest.class);
-        private static Properties restProperties = new Properties();
-        
-        /**
-         * This must be called during servlet initialization. It sets up the xacml.?.properties
-         * file as a system property. If the System property is already set, then it does not
-         * do anything. This allows the developer to specify their own xacml.properties file to be
-         * used. They can 1) modify the default properties that comes with the project, or 2) change
-         * the WebInitParam annotation, or 3) specify an alternative path in the web.xml, or 4) set
-         * the Java System property to point to their xacml.properties file.
-         * 
-         * The recommended way of overriding the default xacml.properties file is using a Java System
-         * property:
-         * 
-         * -Dxacml.properties=/opt/app/xacml/etc/xacml.admin.properties
-         * 
-         * This way one does not change any actual code or files in the project and can leave the 
-         * defaults alone.
-         * 
-         * @param config - The servlet config file passed from the javax servlet init() function
-         */
-        public static void xacmlInit(ServletConfig config) {
+    private static final Log logger	= LogFactory.getLog(XACMLRest.class);
+    private static Properties restProperties = new Properties();
+
+    /**
+     * This must be called during servlet initialization. It sets up the xacml.?.properties
+     * file as a system property. If the System property is already set, then it does not
+     * do anything. This allows the developer to specify their own xacml.properties file to be
+     * used. They can 1) modify the default properties that comes with the project, or 2) change
+     * the WebInitParam annotation, or 3) specify an alternative path in the web.xml, or 4) set
+     * the Java System property to point to their xacml.properties file.
+     *
+     * The recommended way of overriding the default xacml.properties file is using a Java System
+     * property:
+     *
+     * -Dxacml.properties=/opt/app/xacml/etc/xacml.admin.properties
+     *
+     * This way one does not change any actual code or files in the project and can leave the
+     * defaults alone.
+     *
+     * @param config - The servlet config file passed from the javax servlet init() function
+     */
+    public static void xacmlInit(ServletConfig config) {
+        //
+        // Get the XACML Properties File parameter first
+        //
+        String propFile = config.getInitParameter("XACML_PROPERTIES_NAME");
+        if (propFile != null) {
+            //
+            // Look for system override
+            //
+            String xacmlPropertiesName = System.getProperty(XACMLProperties.XACML_PROPERTIES_NAME);
+            if (xacmlPropertiesName == null) {
                 //
-                // Get the XACML Properties File parameter first
+                // Set it to our servlet default
                 //
-                String propFile = config.getInitParameter("XACML_PROPERTIES_NAME");
-                if (propFile != null) {
-                        //
-                        // Look for system override
-                        //
-                        String xacmlPropertiesName = System.getProperty(XACMLProperties.XACML_PROPERTIES_NAME);
-                        if (xacmlPropertiesName == null) {
-                                //
-                                // Set it to our servlet default
-                                //
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("Using Servlet Config Property for XACML_PROPERTIES_NAME:" + propFile);
-                                }
-                                System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME, propFile);
-                        } else {
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("Using System Property for XACML_PROPERTIES_NAME:" + xacmlPropertiesName);
-                                }
-                        }
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Using Servlet Config Property for XACML_PROPERTIES_NAME:" + propFile);
                 }
-                //
-                // Setup the remaining properties
-                //
-                Enumeration<String> params = config.getInitParameterNames();
-                while (params.hasMoreElements()) {
-                        String param = params.nextElement();
-                        if (! param.equals("XACML_PROPERTIES_NAME")) {
-                                String value = config.getInitParameter(param);
-                                logger.info(param + "=" + config.getInitParameter(param));
-                                restProperties.setProperty(param, value);
-                        }
+                System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME, propFile);
+            } else {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Using System Property for XACML_PROPERTIES_NAME:" + xacmlPropertiesName);
                 }
+            }
         }
-        
-        /**
-         * Reset's the XACMLProperties internal properties object so we start
-         * in a fresh environment. Then adds back in our Servlet init properties that were
-         * passed in the javax Servlet init() call.
-         * 
-         * This function is primarily used when a new configuration is passed in and the
-         * PDP servlet needs to load a new PDP engine instance.
-         * 
-         * @param pipProperties - PIP configuration properties
-         * @param policyProperties  - Policy configuration properties
-         */
-        public static void loadXacmlProperties(Properties policyProperties, Properties pipProperties) {
+        //
+        // Setup the remaining properties
+        //
+        Enumeration<String> params = config.getInitParameterNames();
+        while (params.hasMoreElements()) {
+            String param = params.nextElement();
+            if (! param.equals("XACML_PROPERTIES_NAME")) {
+                String value = config.getInitParameter(param);
+                logger.info(param + "=" + config.getInitParameter(param));
+                restProperties.setProperty(param, value);
+            }
+        }
+    }
+
+    /**
+     * Reset's the XACMLProperties internal properties object so we start
+     * in a fresh environment. Then adds back in our Servlet init properties that were
+     * passed in the javax Servlet init() call.
+     *
+     * This function is primarily used when a new configuration is passed in and the
+     * PDP servlet needs to load a new PDP engine instance.
+     *
+     * @param pipProperties - PIP configuration properties
+     * @param policyProperties  - Policy configuration properties
+     */
+    public static void loadXacmlProperties(Properties policyProperties, Properties pipProperties) {
+        try {
+            //
+            // Start fresh
+            //
+            XACMLProperties.reloadProperties();
+            //
+            // Now load our init properties
+            //
+            XACMLProperties.getProperties().putAll(XACMLRest.restProperties);
+            //
+            // Load our policy properties
+            //
+            if (policyProperties != null) {
+                XACMLProperties.getProperties().putAll(policyProperties);
+            }
+            //
+            // Load our pip config properties
+            //
+            if (pipProperties != null) {
+                XACMLProperties.getProperties().putAll(pipProperties);
+            }
+        } catch (IOException e) {
+            logger.error("Failed to put init properties into Xacml properties", e);
+        }
+        //
+        // Dump them
+        //
+        if (logger.isDebugEnabled()) {
+            try {
+                logger.debug(XACMLProperties.getProperties().toString());
+            } catch (IOException e) {
+                logger.error("Cannot dump properties", e);
+            }
+        }
+    }
+
+    /**
+     * Helper routine to dump the HTTP servlet request being serviced. Primarily for debugging.
+     *
+     * @param request - Servlet request (from a POST/GET/PUT/etc.)
+     */
+    public static void dumpRequest(HttpServletRequest request) {
+        if (logger.isDebugEnabled()) {
+            // special-case for receiving heartbeat - don't need to repeatedly output all of the information in multiple lines
+            if (request.getMethod().equals("GET") && "hb".equals(request.getParameter("type"))  ) {
+                logger.debug("GET type=hb : heartbeat received");
+                return;
+            }
+            logger.debug(request.getMethod() + ":" + request.getRemoteAddr() + " " + request.getRemoteHost() + " " + request.getRemotePort());
+            logger.debug(request.getLocalAddr() + " " + request.getLocalName() + " " + request.getLocalPort());
+            Enumeration<String> en = request.getHeaderNames();
+            logger.debug("Headers:");
+            while (en.hasMoreElements()) {
+                String element = en.nextElement();
+                Enumeration<String> values = request.getHeaders(element);
+                while (values.hasMoreElements()) {
+                    String value = values.nextElement();
+                    logger.debug(element + ":" + value);
+                }
+            }
+            logger.debug("Attributes:");
+            en = request.getAttributeNames();
+            while (en.hasMoreElements()) {
+                String element = en.nextElement();
+                logger.debug(element + ":" + request.getAttribute(element));
+            }
+            logger.debug("ContextPath: " + request.getContextPath());
+            if (request.getMethod().equals("PUT") || request.getMethod().equals("POST")) {
+                // POST and PUT are allowed to have parameters in the content, but in our usage the parameters are always in the Query string.
+                // More importantly, there are cases where the POST and PUT content is NOT parameters (e.g. it might contain a Policy file).
+                // Unfortunately the request.getParameterMap method reads the content to see if there are any parameters,
+                // and once the content is read it cannot be read again.
+                // Thus for PUT and POST we must avoid reading the content here so that the main code can read it.
+                logger.debug("Query String:" + request.getQueryString());
                 try {
-                        //
-                        // Start fresh
-                        //
-                        XACMLProperties.reloadProperties();
-                        //
-                        // Now load our init properties
-                        //
-                        XACMLProperties.getProperties().putAll(XACMLRest.restProperties);
-                        //
-                        // Load our policy properties
-                        //
-                        if (policyProperties != null) {
-                                XACMLProperties.getProperties().putAll(policyProperties);
-                        }
-                        //
-                        // Load our pip config properties
-                        //
-                        if (pipProperties != null) {
-                                XACMLProperties.getProperties().putAll(pipProperties);
-                        }
-                } catch (IOException e) {
-                        logger.error("Failed to put init properties into Xacml properties", e);
+                    if (request.getInputStream() == null) {
+                        logger.debug("Content: No content inputStream");
+                    } else {
+                        logger.debug("Content available: " + request.getInputStream().available());
+                    }
+                } catch (Exception e) {
+                    logger.debug("Content: inputStream exception: " + e.getMessage() + ";  (May not be relevant)");
                 }
-                //
-                // Dump them
-                //
-                if (logger.isDebugEnabled()) {
-                        try {
-                                logger.debug(XACMLProperties.getProperties().toString());
-                        } catch (IOException e) {
-                                logger.error("Cannot dump properties", e);
-                        }
+            } else {
+                logger.debug("Parameters:");
+                Map<String, String[]> params = request.getParameterMap();
+                Set<String> keys = params.keySet();
+                for (String key : keys) {
+                    String[] values = params.get(key);
+                    logger.debug(key + "(" + values.length + "): " + (values.length > 0 ? values[0] : ""));
                 }
+            }
+            logger.debug("Request URL:" + request.getRequestURL());
         }
-        
-        /**
-         * Helper routine to dump the HTTP servlet request being serviced. Primarily for debugging.
-         * 
-         * @param request - Servlet request (from a POST/GET/PUT/etc.)
-         */
-        public static void dumpRequest(HttpServletRequest request) {
-                if (logger.isDebugEnabled()) {
-                        // special-case for receiving heartbeat - don't need to repeatedly output all of the information in multiple lines
-                        if (request.getMethod().equals("GET") && "hb".equals(request.getParameter("type"))  ) {
-                                logger.debug("GET type=hb : heartbeat received");
-                                return;
-                        }
-                        logger.debug(request.getMethod() + ":" + request.getRemoteAddr() + " " + request.getRemoteHost() + " " + request.getRemotePort());
-                        logger.debug(request.getLocalAddr() + " " + request.getLocalName() + " " + request.getLocalPort());
-                        Enumeration<String> en = request.getHeaderNames();
-                        logger.debug("Headers:");
-                        while (en.hasMoreElements()) {
-                                String element = en.nextElement();
-                                Enumeration<String> values = request.getHeaders(element);
-                                while (values.hasMoreElements()) {
-                                        String value = values.nextElement();
-                                        logger.debug(element + ":" + value);
-                                }
-                        }
-                        logger.debug("Attributes:");
-                        en = request.getAttributeNames();
-                        while (en.hasMoreElements()) {
-                                String element = en.nextElement();
-                                logger.debug(element + ":" + request.getAttribute(element));
-                        }
-                        logger.debug("ContextPath: " + request.getContextPath());
-                        if (request.getMethod().equals("PUT") || request.getMethod().equals("POST")) {
-                                // POST and PUT are allowed to have parameters in the content, but in our usage the parameters are always in the Query string.
-                                // More importantly, there are cases where the POST and PUT content is NOT parameters (e.g. it might contain a Policy file).
-                                // Unfortunately the request.getParameterMap method reads the content to see if there are any parameters,
-                                // and once the content is read it cannot be read again.
-                                // Thus for PUT and POST we must avoid reading the content here so that the main code can read it.
-                                logger.debug("Query String:" + request.getQueryString());
-                                try {
-                                        if (request.getInputStream() == null) {
-                                                logger.debug("Content: No content inputStream");
-                                        } else {
-                                                logger.debug("Content available: " + request.getInputStream().available());
-                                        }
-                                } catch (Exception e) {
-                                        logger.debug("Content: inputStream exception: " + e.getMessage() + ";  (May not be relevant)");
-                                }
-                        } else {
-                                logger.debug("Parameters:");
-                                Map<String, String[]> params = request.getParameterMap();
-                                Set<String> keys = params.keySet();
-                                for (String key : keys) {
-                                        String[] values = params.get(key);
-                                        logger.debug(key + "(" + values.length + "): " + (values.length > 0 ? values[0] : ""));
-                                }
-                        }
-                        logger.debug("Request URL:" + request.getRequestURL());
-                }
-        }
+    }
 }
diff --git a/openaz-xacml-rest/src/main/java/com/att/research/xacml/rest/XACMLRestProperties.java b/openaz-xacml-rest/src/main/java/com/att/research/xacml/rest/XACMLRestProperties.java
index a259351..74ec0fc 100644
--- a/openaz-xacml-rest/src/main/java/com/att/research/xacml/rest/XACMLRestProperties.java
+++ b/openaz-xacml-rest/src/main/java/com/att/research/xacml/rest/XACMLRestProperties.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,123 +35,123 @@
 /**
  * These are XACML Properties that are relevant to the RESTful API interface for
  * the PDP, PAP and AC interfaces.
- * 
- *  
+ *
+ *
  * @author pameladragosh
  *
  */
 public class XACMLRestProperties extends XACMLProperties {
-        /**
-         * A unique identifier for the PDP servlet instance. Usually set to the URL
-         * it is running as in the J2EE container.
-         * 
-         * Eg. http://localhost:8080/pdp/
-         */
-        public static final String	PROP_PDP_ID	= "xacml.rest.pdp.id";
-        /**
-         * A PDP servlet's configuration directory. Holds the pip and policy configuration
-         * data as well as the local policy cache.
-         * 
-         * Eg: /opt/app/xacml/config
-         */
-        public static final String	PROP_PDP_CONFIG = "xacml.rest.pdp.config";
-        /**
-         * Set this property to true or false if the PDP servlet should register itself upon
-         * startup with the PAP servlet.
-         */
-        public static final String	PROP_PDP_REGISTER = "xacml.rest.pdp.register";
-        /**
-         * Number of seconds the PDP will sleep while retrying registration with the PAP. 
-         * This value must be greater or equal to 5.
-         */
-        public static final String	PROP_PDP_REGISTER_SLEEP = "xacml.rest.pdp.register.sleep";
-        /**
-         * Number of retry attempts at registration with the PAP. A value of -1 indicates infinite retries.
-         */
-        public static final String	PROP_PDP_REGISTER_RETRIES = "xacml.rest.pdp.register.retries";
-        /**
-         * Max content length accepted for an incoming POST XML/JSON request. Default is 32767 bytes.
-         */
-        public static final String	PROP_PDP_MAX_CONTENT = "xacml.rest.pdp.maxcontent";
-        /**
-         * Custom HTTP header used by PDP to send the value of the PROP_PDP_ID
-         */
-        public static final String	PROP_PDP_HTTP_HEADER_ID = "X-XACML-PDP-ID";
-        /**
-         * Custom HHTP header used by PDP to send its heartbeat value.
-         */
-        public static final String	PROP_PDP_HTTP_HEADER_HB = "X-XACML-PDP-HB";
-        /**
-         * The URL of the PAP servlet. Used by PDP servlet's to communicate. Because administrators
-         * can set whatever context they want to run the PAP servlet, it isn't easy to determine a return
-         * URL for the PAP servlet. This is especially true upon initialization.
-         */
-        public static final String	PROP_PAP_URL = "xacml.rest.pap.url";
-        /**
-         * Upon startup, have the PAP servlet send latest configuration information to all
-         * the PDP nodes it knows about.
-         */
-        public static final String PROP_PAP_INITIATE_PDP_CONFIG = "xacml.rest.pap.initiate.pdp";
-        /**
-         * The interval the PAP servlet uses to send heartbeat requests to the PDP nodes.
-         */
-        public static final String	PROP_PAP_HEARTBEAT_INTERVAL = "xacml.rest.pap.heartbeat.interval";
-        /**
-         * Timeout value used by the PAP servlet when trying to check the heartbeat of a PDP node.
-         */
-        public static final String	PROP_PAP_HEARTBEAT_TIMEOUT = "xacml.rest.pap.heartbeat.timeout";
-        /*
-         * Local path to  where the GIT repository exists.
-         * 
-         * Eg. /opt/app/xacml/repository
-         */
-        public static final String PROP_ADMIN_REPOSITORY = "xacml.rest.admin.repository";
-        /*
-         * Local path to where user workspaces exist. The user workspace contains temporary files, the
-         * user's clone of the GIT repository, anything specific to the user, etc.
-         */
-        public static final String PROP_ADMIN_WORKSPACE = "xacml.rest.admin.workspace";
-        /*
-         * This is the domain you can setup for your organization, it should be a URI.
-         * 
-         * Eg. com:sample:foo
-         */
-        public static final String PROP_ADMIN_DOMAIN = "xacml.rest.admin.domain";
-        /**
-         * PROP_ADMIN_USER_NAME is simply a name for the logged in user.
-         * 
-         * AC authentication is out the scope of the web application itself. It is up to the
-         * developer to setup authentication as they please in the J2EE container used to run
-         * the web application. Whatever authentication mechanism they use, they should then set
-         * the attribute into the HttpSession object. The Admin Console will be able to read that
-         * value (default to "guest") in. 
-         * 
-         * ((HttpServletRequest) request).getSession().setAttribute("xacml.rest.admin.user.name", "Homer");
-         * 
-         */
-        public static final String	PROP_ADMIN_USER_NAME = "xacml.rest.admin.user.name";
-        /**
-         * 
-         * PROP_ADMIN_USER_ID is an id for the logged in user.
-         * 
-         * Eg. hs1234
-         *
-         * @see #PROP_ADMIN_USER_NAME for more information.
-         */
-        public static final String	PROP_ADMIN_USER_ID = "xacml.rest.admin.user.id";
-        /**
-         * 
-         * PROP_ADMIN_USER_EMAIL is a user's email address.
-         * 
-         * @see #PROP_ADMIN_USER_NAME for more information.
-         */
-        public static final String	PROP_ADMIN_USER_EMAIL = "xacml.rest.admin.user.email";
-        /**
-         * Directory path containing sub-directories where the Subscriber servlet puts files sent through data feeds.
-         */
-        public static final String	PROP_SUBSCRIBER_INCOMING = "xacml.subscriber.incoming";
-        /**
-         * The specific data feed name for the Subscriber servlet to register for.
-         */
-        public static final String	PROP_SUBSCRIBER_FEED = "xacml.subscriber.feed";
+    /**
+     * A unique identifier for the PDP servlet instance. Usually set to the URL
+     * it is running as in the J2EE container.
+     *
+     * Eg. http://localhost:8080/pdp/
+     */
+    public static final String	PROP_PDP_ID	= "xacml.rest.pdp.id";
+    /**
+     * A PDP servlet's configuration directory. Holds the pip and policy configuration
+     * data as well as the local policy cache.
+     *
+     * Eg: /opt/app/xacml/config
+     */
+    public static final String	PROP_PDP_CONFIG = "xacml.rest.pdp.config";
+    /**
+     * Set this property to true or false if the PDP servlet should register itself upon
+     * startup with the PAP servlet.
+     */
+    public static final String	PROP_PDP_REGISTER = "xacml.rest.pdp.register";
+    /**
+     * Number of seconds the PDP will sleep while retrying registration with the PAP.
+     * This value must be greater or equal to 5.
+     */
+    public static final String	PROP_PDP_REGISTER_SLEEP = "xacml.rest.pdp.register.sleep";
+    /**
+     * Number of retry attempts at registration with the PAP. A value of -1 indicates infinite retries.
+     */
+    public static final String	PROP_PDP_REGISTER_RETRIES = "xacml.rest.pdp.register.retries";
+    /**
+     * Max content length accepted for an incoming POST XML/JSON request. Default is 32767 bytes.
+     */
+    public static final String	PROP_PDP_MAX_CONTENT = "xacml.rest.pdp.maxcontent";
+    /**
+     * Custom HTTP header used by PDP to send the value of the PROP_PDP_ID
+     */
+    public static final String	PROP_PDP_HTTP_HEADER_ID = "X-XACML-PDP-ID";
+    /**
+     * Custom HHTP header used by PDP to send its heartbeat value.
+     */
+    public static final String	PROP_PDP_HTTP_HEADER_HB = "X-XACML-PDP-HB";
+    /**
+     * The URL of the PAP servlet. Used by PDP servlet's to communicate. Because administrators
+     * can set whatever context they want to run the PAP servlet, it isn't easy to determine a return
+     * URL for the PAP servlet. This is especially true upon initialization.
+     */
+    public static final String	PROP_PAP_URL = "xacml.rest.pap.url";
+    /**
+     * Upon startup, have the PAP servlet send latest configuration information to all
+     * the PDP nodes it knows about.
+     */
+    public static final String PROP_PAP_INITIATE_PDP_CONFIG = "xacml.rest.pap.initiate.pdp";
+    /**
+     * The interval the PAP servlet uses to send heartbeat requests to the PDP nodes.
+     */
+    public static final String	PROP_PAP_HEARTBEAT_INTERVAL = "xacml.rest.pap.heartbeat.interval";
+    /**
+     * Timeout value used by the PAP servlet when trying to check the heartbeat of a PDP node.
+     */
+    public static final String	PROP_PAP_HEARTBEAT_TIMEOUT = "xacml.rest.pap.heartbeat.timeout";
+    /*
+     * Local path to  where the GIT repository exists.
+     *
+     * Eg. /opt/app/xacml/repository
+     */
+    public static final String PROP_ADMIN_REPOSITORY = "xacml.rest.admin.repository";
+    /*
+     * Local path to where user workspaces exist. The user workspace contains temporary files, the
+     * user's clone of the GIT repository, anything specific to the user, etc.
+     */
+    public static final String PROP_ADMIN_WORKSPACE = "xacml.rest.admin.workspace";
+    /*
+     * This is the domain you can setup for your organization, it should be a URI.
+     *
+     * Eg. com:sample:foo
+     */
+    public static final String PROP_ADMIN_DOMAIN = "xacml.rest.admin.domain";
+    /**
+     * PROP_ADMIN_USER_NAME is simply a name for the logged in user.
+     *
+     * AC authentication is out the scope of the web application itself. It is up to the
+     * developer to setup authentication as they please in the J2EE container used to run
+     * the web application. Whatever authentication mechanism they use, they should then set
+     * the attribute into the HttpSession object. The Admin Console will be able to read that
+     * value (default to "guest") in.
+     *
+     * ((HttpServletRequest) request).getSession().setAttribute("xacml.rest.admin.user.name", "Homer");
+     *
+     */
+    public static final String	PROP_ADMIN_USER_NAME = "xacml.rest.admin.user.name";
+    /**
+     *
+     * PROP_ADMIN_USER_ID is an id for the logged in user.
+     *
+     * Eg. hs1234
+     *
+     * @see #PROP_ADMIN_USER_NAME for more information.
+     */
+    public static final String	PROP_ADMIN_USER_ID = "xacml.rest.admin.user.id";
+    /**
+     *
+     * PROP_ADMIN_USER_EMAIL is a user's email address.
+     *
+     * @see #PROP_ADMIN_USER_NAME for more information.
+     */
+    public static final String	PROP_ADMIN_USER_EMAIL = "xacml.rest.admin.user.email";
+    /**
+     * Directory path containing sub-directories where the Subscriber servlet puts files sent through data feeds.
+     */
+    public static final String	PROP_SUBSCRIBER_INCOMING = "xacml.subscriber.incoming";
+    /**
+     * The specific data feed name for the Subscriber servlet to register for.
+     */
+    public static final String	PROP_SUBSCRIBER_FEED = "xacml.subscriber.feed";
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/dom/DOMResponseConformanceTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/dom/DOMResponseConformanceTest.java
index 48ce677..66df8fd 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/dom/DOMResponseConformanceTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/dom/DOMResponseConformanceTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -45,103 +45,103 @@
 

 /**

  * Tests for handling the XML version of the XACML Response object.

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * Normally the Response is generated by the PDP and returned through the RESTful interface as JSON.

  * Testing of the XML interface is minimal and not complete.

- * 

- * 

- * 

+ *

+ *

+ *

  * @author glenngriffin

  *

  */

 public class DOMResponseConformanceTest {

-        

-        // where to find the conformance test XML files

-        private final String CONFORMANCE_DIRECTORY_PATH = "testsets/conformance/xacml3.0-ct-v.0.4";

-        

-        // The request object output from each test conversion from JSON string

-        Response response;

 

-        

-        

-        // Load the Conformance test responses into Response objects, generate the output XML for that Response and compare with the original files.

-        @Test

-        public void testDOMResponse() {

-                List<File> filesInDirectory = null;

-                

-                File conformanceDirectory = null;

-                

-                File currentFile = null;

-                

-                try {

-                        conformanceDirectory = new File(CONFORMANCE_DIRECTORY_PATH);

-                        filesInDirectory = getRequestsInDirectory(conformanceDirectory);

-                } catch (Exception e) {

-                        fail("Unable to set up Conformance tests for dir '" + conformanceDirectory.getAbsolutePath()+"' e="+ e);

-                }

-                

-                // run through each XML file

-                //	- load the file from XML into an internal Response object

-                //	- generate the XML representation from that Response object

-                // 	- reload the file into a String

-                //	- compare the 2 XML strings

-                Response xmlResponse = null;

-                try {

-                        for (File f : filesInDirectory) {

-                                currentFile = f;

+    // where to find the conformance test XML files

+    private final String CONFORMANCE_DIRECTORY_PATH = "testsets/conformance/xacml3.0-ct-v.0.4";

+

+    // The request object output from each test conversion from JSON string

+    Response response;

+

+

+

+    // Load the Conformance test responses into Response objects, generate the output XML for that Response and compare with the original files.

+    @Test

+    public void testDOMResponse() {

+        List<File> filesInDirectory = null;

+

+        File conformanceDirectory = null;

+

+        File currentFile = null;

+

+        try {

+            conformanceDirectory = new File(CONFORMANCE_DIRECTORY_PATH);

+            filesInDirectory = getRequestsInDirectory(conformanceDirectory);

+        } catch (Exception e) {

+            fail("Unable to set up Conformance tests for dir '" + conformanceDirectory.getAbsolutePath()+"' e="+ e);

+        }

+

+        // run through each XML file

+        //	- load the file from XML into an internal Response object

+        //	- generate the XML representation from that Response object

+        // 	- reload the file into a String

+        //	- compare the 2 XML strings

+        Response xmlResponse = null;

+        try {

+            for (File f : filesInDirectory) {

+                currentFile = f;

 

 //// This is a simple way to select just one file for debugging - comment out when not being used

 //if ( ! f.getName().equals("IID302Response.xml")) {   continue;  }

 

 // during debugging it is helpful to know what file it is starting to work on

 //				System.out.println("starting file="+currentFile.getName());

-                                

-                                

-                                BufferedReader br = new BufferedReader(new FileReader(f));

-                                StringBuffer sb = new StringBuffer();

-                                String line;

-                                while ((line = br.readLine()) != null) {

-                                        sb.append(line + "\n");

-                                }

-                                br.close();

-                                

-                                String xmlFromFile = sb.toString();

-                                

-                                try {

-                                        // load XML into a Response object

-                                        xmlResponse = DOMResponse.load(xmlFromFile);

-                                } catch (Exception e) {

-                                        // if XML does not load, just note it and continue with next file

-                                        System.out.println("XML file did not load: '" + f.getName() + "  e=" + e);

-                                        continue;

-                                }

-//System.out.println(xmlFromFile);				

-                                

-                                // create String version from the Response object

-                                String xmlResponseString = DOMResponse.toString(xmlResponse, false);

-                                

-                                // Comparing the string directly to the String from the file is difficult.

-                                // We can minimize the problems with newlines and whitespace, but we have other issues with how various object values are represented.

-                                // For instance, and input double of "23.50" is output as "23.5" which is the same value but not identical strings.

-                                // Therefore we take the XML output and use it to create a new Response object, then compare the two objects.

 

-//System.out.println(xmlResponseString);			

-                                Response reGeneratedResponse = DOMResponse.load(xmlResponseString);

-                                

-                                if ( ! xmlResponse.equals(reGeneratedResponse)) {

-                                        String normalizedFromFile = xmlFromFile.replaceAll("\\r|\\n", "");

-                                        normalizedFromFile = normalizedFromFile.replaceAll("\\s+", " ");

-                                        normalizedFromFile = normalizedFromFile.replaceAll(">\\s*<", "><");

-                                        System.out.println("File="+normalizedFromFile);

-                                        System.out.println("Gend="+ xmlResponseString);

-                                        

-                                        System.out.println(DOMResponse.toString(xmlResponse, true));

-                                

-                                        fail("Output string did not re-generate eqivilent object.");

-                                }

+

+                BufferedReader br = new BufferedReader(new FileReader(f));

+                StringBuffer sb = new StringBuffer();

+                String line;

+                while ((line = br.readLine()) != null) {

+                    sb.append(line + "\n");

+                }

+                br.close();

+

+                String xmlFromFile = sb.toString();

+

+                try {

+                    // load XML into a Response object

+                    xmlResponse = DOMResponse.load(xmlFromFile);

+                } catch (Exception e) {

+                    // if XML does not load, just note it and continue with next file

+                    System.out.println("XML file did not load: '" + f.getName() + "  e=" + e);

+                    continue;

+                }

+//System.out.println(xmlFromFile);

+

+                // create String version from the Response object

+                String xmlResponseString = DOMResponse.toString(xmlResponse, false);

+

+                // Comparing the string directly to the String from the file is difficult.

+                // We can minimize the problems with newlines and whitespace, but we have other issues with how various object values are represented.

+                // For instance, and input double of "23.50" is output as "23.5" which is the same value but not identical strings.

+                // Therefore we take the XML output and use it to create a new Response object, then compare the two objects.

+

+//System.out.println(xmlResponseString);

+                Response reGeneratedResponse = DOMResponse.load(xmlResponseString);

+

+                if ( ! xmlResponse.equals(reGeneratedResponse)) {

+                    String normalizedFromFile = xmlFromFile.replaceAll("\\r|\\n", "");

+                    normalizedFromFile = normalizedFromFile.replaceAll("\\s+", " ");

+                    normalizedFromFile = normalizedFromFile.replaceAll(">\\s*<", "><");

+                    System.out.println("File="+normalizedFromFile);

+                    System.out.println("Gend="+ xmlResponseString);

+

+                    System.out.println(DOMResponse.toString(xmlResponse, true));

+

+                    fail("Output string did not re-generate eqivilent object.");

+                }

 

 //				// Normally whitespace is significant in XML.

 //				// However in this case we are generating an XML string for output and comparing it to a hand-made file.

@@ -151,46 +151,46 @@
 //				String normalizedFromFile = xmlFromFile.replaceAll("\\r|\\n", "");

 //				normalizedFromFile = normalizedFromFile.replaceAll("\\s+", " ");

 //				normalizedFromFile = normalizedFromFile.replaceAll(">\\s*<", "><");

-//			

+//

 //				if ( ! xmlResponseString.equals(normalizedFromFile)) {

 //					System.out.println("file="+normalizedFromFile+"\ngend="+xmlResponseString);

 //					fail("file not same as generated string: " + f.getName()+ "\nFile="+xmlFromFile + "\nString="+xmlResponseString);

 //				}

 

 

-                        }			

+            }

 

-                } catch (Exception e) {

-                        fail ("Failed test with '" + currentFile.getName() + "', e=" + e);

-                }

+        } catch (Exception e) {

+            fail ("Failed test with '" + currentFile.getName() + "', e=" + e);

+        }

 

-                

+

+    }

+

+

+

+    //

+    // HELPER to get list of all Request files in the given directory

+    //

+

+    private List<File> getRequestsInDirectory(File directory) {

+        List<File> fileList = new ArrayList<File>();

+

+        File[] fileArray = directory.listFiles();

+        for (File f : fileArray) {

+            if (f.isDirectory()) {

+                List<File> subDirList = getRequestsInDirectory(f);

+                fileList.addAll(subDirList);

+            }

+            if (f.getName().endsWith("Response.xml")) {

+                fileList.add(f);

+            }

         }

-        

-        

-        

-        //

-        // HELPER to get list of all Request files in the given directory

-        //

-        

-        private List<File> getRequestsInDirectory(File directory) {

-                List<File> fileList = new ArrayList<File>();

-                

-                File[] fileArray = directory.listFiles();

-                for (File f : fileArray) {

-                        if (f.isDirectory()) {

-                                List<File> subDirList = getRequestsInDirectory(f);

-                                fileList.addAll(subDirList);

-                        }

-                        if (f.getName().endsWith("Response.xml")) {

-                                fileList.add(f);

-                        }

-                }

-                return fileList;

-                

-        }

-        

-        

+        return fileList;

+

+    }

+

+

 }

 

 

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/dom/DOMResponseTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/dom/DOMResponseTest.java
index 5d7151c..28f1d50 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/dom/DOMResponseTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/dom/DOMResponseTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -50,10 +50,10 @@
 

 /**

  * Test DOM XML Responses

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * This class was copied from the JSON tests.  At this time only the first two methods have been revised to work with XML.

  * The second method includes multiple instances of all possible fields and has been manually verified.

  * The remaining methods have not been converted because:

@@ -61,901 +61,903 @@
  * 	- the replacement would consist of copying the XML from the JUnit output and doing a String replace

  * 	- there would be little examination of the (long) XML strings, so their validity would be questionable

  * so the benefit for the cost of doing that work is not clear.

- * 

+ *

  * @author glenngriffin

  *

  */

 public class DOMResponseTest {

 

-        String xmlResponse;

-        

-        StdMutableResponse response;

-        

-        StdMutableResult result;

-        

-        StdMutableStatus status;

-        

-        

-        // Note: Initially test responses without Obligations, Associated Advice, Attributes, or PolicyIdentifier

-        

-        

-        @Test

-        public void testEmptyAndDecisions() {

-                // null response

-                try {

-                        xmlResponse = DOMResponse.toString(null, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // empty response (no Result object)

-                response = new StdMutableResponse();

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                

-                // just decision, no status

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // just status (empty), no decision

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();		

-                result.setStatus(status);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // just status (non-empty), no decision

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

-                result.setStatus(status);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                

-                // test other decisions without Status

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.DENY);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Deny</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.NOTAPPLICABLE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>NotApplicable</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{D}</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{DP}</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{P}</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+    String xmlResponse;

 

-                

-                // test Multiple Decisions - success

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                StdMutableResult result2 = new StdMutableResult();

-                result2.setDecision(Decision.DENY);

-                response.add(result2);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision></Result><Result><Decision>Deny</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // test Multiple Decisions - one success and one error

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                result2 = new StdMutableResult();

-                result2.setDecision(Decision.INDETERMINATE);

-                response.add(result2);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision></Result><Result><Decision>Indeterminate</Decision></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+    StdMutableResponse response;

+

+    StdMutableResult result;

+

+    StdMutableStatus status;

+

+

+    // Note: Initially test responses without Obligations, Associated Advice, Attributes, or PolicyIdentifier

+

+

+    @Test

+    public void testEmptyAndDecisions() {

+        // null response

+        try {

+            xmlResponse = DOMResponse.toString(null, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

         }

-                

 

-        

-        

-        // Test with every field filled in with multiple values where appropriate

-        @Test

-        public void testAllFieldsResponse() {	

-                

-                // fully-loaded multiple response

-                

-                StdMutableResponse response = new StdMutableResponse();

-                // create a Status object

-                StdMutableStatus status = new StdMutableStatus(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                status.setStatusMessage("some status message");

-                StdMutableStatusDetail statusDetailIn = new StdMutableStatusDetail();

-                StdMutableMissingAttributeDetail mad = new StdMutableMissingAttributeDetail();

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "doh"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_INTEGER.getId(), "5432"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                mad.setAttributeId(XACML3.ID_ACTION_PURPOSE);

-                mad.setCategory(XACML3.ID_ATTRIBUTE_CATEGORY_ACTION);

-                mad.setDataTypeId(XACML3.ID_DATATYPE_STRING);

-                mad.setIssuer("an Issuer");

-                statusDetailIn.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetailIn);

-                // create a single result object

-                StdMutableResult result = new StdMutableResult(status);

-                // set the decision

-                result.setDecision(Decision.INDETERMINATE);

-                // put the Result into the Response

-                response.add(result);

+        // empty response (no Result object)

+        response = new StdMutableResponse();

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

 

-                

-                // create a new Result with a different Decision

-                status = new StdMutableStatus(StdStatusCode.STATUS_CODE_OK);

-                result = new StdMutableResult(status);

-                result.setDecision(Decision.DENY);

-                

-                StdMutableObligation obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer2", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Ned")));

-                result.addObligation(obligation);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_SUBJECT_CATEGORY_INTERMEDIARY_SUBJECT);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer3", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer4", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Homer")));

-                result.addObligation(obligation);

-                

-                

-                StdMutableAdvice advice = new StdMutableAdvice();

-                advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu")));

-                advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                null, 

-                                XACML3.ID_SUBJECT, 

-                                "advice-issuerNoCategory", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Crusty")));

-                result.addAdvice(advice);

-                

-                

-                response.add(result);

-                

-                

-                // create a new Result with a different Decision

-                // add Child/minor status codes within the main status

-                StdStatusCode childChildChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildChildStatusCode"));

-                StdStatusCode childChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildStatusCode"), childChildChildStatusCode);

-                StdStatusCode child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"), childChildStatusCode);

-                StdStatusCode statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

-                

-                status = new StdMutableStatus(statusCode);

-                

-                

-                result = new StdMutableResult(status);

-                result.setDecision(Decision.PERMIT);

-                

-                

-                

-                

-                // add attribute list in result

-                Identifier categoryIdentifier = new IdentifierImpl("firstCategory");

-                Attribute[] attrList = {

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", false),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "EIssue", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrNoIssuer"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), null, true) };

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(attrList)));

-                categoryIdentifier = new IdentifierImpl("secondCategory");

-                Attribute[] secondAttrList = {

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent12"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu2"), "AIssue2", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent22"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Abc2"), "BIssue2", false),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent32"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Der2"), "CIssue2", true) };

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(secondAttrList)));

-                

-                

-                // add PolicyIdentifierList to result

-                StdIdReference policyIdentifier1 = null;

-                StdIdReference policyIdentifier2 = null;

-                StdIdReference policySetIdentifier1 = null;

-                StdIdReference policySetIdentifier2 = null;

-                try {

-                        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

-                        policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

-                        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

-                        policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

-                } catch (ParseException e1) {

-                        fail("creating policyIds, e="+e1);

-                }

-                

-                result.addPolicyIdentifier(policyIdentifier1);

-                result.addPolicyIdentifier(policyIdentifier2);

-        

-                result.addPolicySetIdentifier(policySetIdentifier1);

-                result.addPolicySetIdentifier(policySetIdentifier2);

-                

-                response.add(result);

-        

-                // convert Response to XML

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

+

+        // just decision, no status

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // just status (empty), no decision

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        result.setStatus(status);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // just status (non-empty), no decision

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

+        result.setStatus(status);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+

+        // test other decisions without Status

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.DENY);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Deny</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.NOTAPPLICABLE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>NotApplicable</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{D}</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{DP}</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{P}</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // test Multiple Decisions - success

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        StdMutableResult result2 = new StdMutableResult();

+        result2.setDecision(Decision.DENY);

+        response.add(result2);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision></Result><Result><Decision>Deny</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // test Multiple Decisions - one success and one error

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        result2 = new StdMutableResult();

+        result2.setDecision(Decision.INDETERMINATE);

+        response.add(result2);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision></Result><Result><Decision>Indeterminate</Decision></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+    }

+

+

+

+

+    // Test with every field filled in with multiple values where appropriate

+    @Test

+    public void testAllFieldsResponse() {

+

+        // fully-loaded multiple response

+

+        StdMutableResponse response = new StdMutableResponse();

+        // create a Status object

+        StdMutableStatus status = new StdMutableStatus(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        status.setStatusMessage("some status message");

+        StdMutableStatusDetail statusDetailIn = new StdMutableStatusDetail();

+        StdMutableMissingAttributeDetail mad = new StdMutableMissingAttributeDetail();

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "doh"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_INTEGER.getId(), "5432"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        mad.setAttributeId(XACML3.ID_ACTION_PURPOSE);

+        mad.setCategory(XACML3.ID_ATTRIBUTE_CATEGORY_ACTION);

+        mad.setDataTypeId(XACML3.ID_DATATYPE_STRING);

+        mad.setIssuer("an Issuer");

+        statusDetailIn.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetailIn);

+        // create a single result object

+        StdMutableResult result = new StdMutableResult(status);

+        // set the decision

+        result.setDecision(Decision.INDETERMINATE);

+        // put the Result into the Response

+        response.add(result);

+

+

+        // create a new Result with a different Decision

+        status = new StdMutableStatus(StdStatusCode.STATUS_CODE_OK);

+        result = new StdMutableResult(status);

+        result.setDecision(Decision.DENY);

+

+        StdMutableObligation obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer2",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Ned")));

+        result.addObligation(obligation);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_SUBJECT_CATEGORY_INTERMEDIARY_SUBJECT);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer3",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer4",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Homer")));

+        result.addObligation(obligation);

+

+

+        StdMutableAdvice advice = new StdMutableAdvice();

+        advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu")));

+        advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          null,

+                                          XACML3.ID_SUBJECT,

+                                          "advice-issuerNoCategory",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Crusty")));

+        result.addAdvice(advice);

+

+

+        response.add(result);

+

+

+        // create a new Result with a different Decision

+        // add Child/minor status codes within the main status

+        StdStatusCode childChildChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildChildStatusCode"));

+        StdStatusCode childChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildStatusCode"), childChildChildStatusCode);

+        StdStatusCode child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"), childChildStatusCode);

+        StdStatusCode statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

+

+        status = new StdMutableStatus(statusCode);

+

+

+        result = new StdMutableResult(status);

+        result.setDecision(Decision.PERMIT);

+

+

+

+

+        // add attribute list in result

+        Identifier categoryIdentifier = new IdentifierImpl("firstCategory");

+        Attribute[] attrList = {

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", false),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "EIssue", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrNoIssuer"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), null, true)

+        };

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(attrList)));

+        categoryIdentifier = new IdentifierImpl("secondCategory");

+        Attribute[] secondAttrList = {

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent12"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu2"), "AIssue2", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent22"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Abc2"), "BIssue2", false),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent32"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Der2"), "CIssue2", true)

+        };

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(secondAttrList)));

+

+

+        // add PolicyIdentifierList to result

+        StdIdReference policyIdentifier1 = null;

+        StdIdReference policyIdentifier2 = null;

+        StdIdReference policySetIdentifier1 = null;

+        StdIdReference policySetIdentifier2 = null;

+        try {

+            policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

+            policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

+            policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

+            policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

+        } catch (ParseException e1) {

+            fail("creating policyIds, e="+e1);

+        }

+

+        result.addPolicyIdentifier(policyIdentifier1);

+        result.addPolicyIdentifier(policyIdentifier2);

+

+        result.addPolicySetIdentifier(policySetIdentifier1);

+        result.addPolicySetIdentifier(policySetIdentifier2);

+

+        response.add(result);

+

+        // convert Response to XML

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

 //System.out.println(xmlResponse);

 //System.out.println(DOMResponse.toString(response, true));

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusMessage>some status message</StatusMessage><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:action:purpose\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\" Issuer=\"an Issuer\"><AttributeValue>doh</AttributeValue><AttributeValue>5432</AttributeValue><AttributeValue>meh</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result><Result><Decision>Deny</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/></Status><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Ned</AttributeAssignment></Obligation><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Maggie</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Homer</AttributeAssignment></Obligation></Obligations><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Crusty</AttributeAssignment></Advice></AssociatedAdvice></Result><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"><StatusCode Value=\"child1StatusCode\"><StatusCode Value=\"childChildStatusCode\"><StatusCode Value=\"childChildChildStatusCode\"/></StatusCode></StatusCode></StatusCode></Status><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent3\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent4\" Issuer=\"DIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent5\" Issuer=\"EIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrNoIssuer\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes><Attributes Category=\"secondCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent12\" Issuer=\"AIssue2\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu2</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent32\" Issuer=\"CIssue2\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Der2</AttributeValue></Attribute></Attributes><PolicyIdentifierList><PolicyIdReference Version=\"1.2.3\">idRef1</PolicyIdReference><PolicyIdReference>idRef2_NoVersion</PolicyIdReference><PolicySetIdReference Version=\"4.5.6.7.8.9.0\">idSetRef1</PolicySetIdReference><PolicySetIdReference>idSetRef2_NoVersion</PolicySetIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusMessage>some status message</StatusMessage><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:action:purpose\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\" Issuer=\"an Issuer\"><AttributeValue>doh</AttributeValue><AttributeValue>5432</AttributeValue><AttributeValue>meh</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result><Result><Decision>Deny</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/></Status><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Ned</AttributeAssignment></Obligation><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Maggie</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Homer</AttributeAssignment></Obligation></Obligations><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Crusty</AttributeAssignment></Advice></AssociatedAdvice></Result><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"><StatusCode Value=\"child1StatusCode\"><StatusCode Value=\"childChildStatusCode\"><StatusCode Value=\"childChildChildStatusCode\"/></StatusCode></StatusCode></StatusCode></Status><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent3\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent4\" Issuer=\"DIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent5\" Issuer=\"EIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrNoIssuer\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes><Attributes Category=\"secondCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent12\" Issuer=\"AIssue2\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu2</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent32\" Issuer=\"CIssue2\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Der2</AttributeValue></Attribute></Attributes><PolicyIdentifierList><PolicyIdReference Version=\"1.2.3\">idRef1</PolicyIdReference><PolicyIdReference>idRef2_NoVersion</PolicyIdReference><PolicySetIdReference Version=\"4.5.6.7.8.9.0\">idSetRef1</PolicySetIdReference><PolicySetIdReference>idSetRef2_NoVersion</PolicySetIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

         }

-        

-        

-        

-        

-        // combinations of Status values with Decision values

-        @Test

-        public void testDecisionStatusMatch() {

-                // the tests in this method use different values and do not change structures, so we can re-use the objects

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                result.setStatus(status);

-                response.add(result);

-                

-                // StatusCode = OK

-                status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

-                result.setDecision(Decision.PERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.DENY);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Deny</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.NOTAPPLICABLE);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>NotApplicable</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                

-                

-                

-                

-                

-                // StatusCode = SyntaxError

-                status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

-                result.setDecision(Decision.PERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.DENY);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.NOTAPPLICABLE);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{D}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{DP}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{P}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // StatusCode = ProcessingError

-                status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

-                result.setDecision(Decision.PERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.DENY);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.NOTAPPLICABLE);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{D}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{DP}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{P}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-                // StatusCode = MissingAttribute

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                result.setDecision(Decision.PERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.DENY);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.NOTAPPLICABLE);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{D}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{DP}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{P}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+    }

+

+

+

+

+    // combinations of Status values with Decision values

+    @Test

+    public void testDecisionStatusMatch() {

+        // the tests in this method use different values and do not change structures, so we can re-use the objects

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        result.setStatus(status);

+        response.add(result);

+

+        // StatusCode = OK

+        status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

+        result.setDecision(Decision.PERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.DENY);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Deny</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.NOTAPPLICABLE);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>NotApplicable</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

         }

 

-        

-        

 

-        // tests related to Status and its components

-        @Test

-        public void testStatus() {

-                // Status with no StatusCode - error

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // Status with StatusMessage when OK

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with StatusDetail when OK

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

-                StdMutableStatusDetail statusDetail = new StdMutableStatusDetail();

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // Status with StatusMessage when SyntaxError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with empty StatusDetail when SyntaxError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

-                statusDetail = new StdMutableStatusDetail();

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                

-                // Status with StatusMessage when ProcessingError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with empty StatusDetail when ProcessingError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

-                statusDetail = new StdMutableStatusDetail();

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

 

-                

-                // Status with StatusMessage when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with empty StatusDetail when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail></StatusDetail></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-                // Status with StatusDetail with empty detail when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                StdMutableMissingAttributeDetail mad = new StdMutableMissingAttributeDetail();

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // Status with StatusDetail with valid detail with no value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with StatusDetail with valid detail with value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"><AttributeValue>meh</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with StatusDetail with array valid detail with value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"><AttributeValue>meh</AttributeValue><AttributeValue>nu?</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // Status with StatusDetail with valid detail with Integer value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"><AttributeValue>1111</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with StatusDetail with array valid detail with Integer value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111));

-                mad.addAttributeValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 2222));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"><AttributeValue>1111</AttributeValue><AttributeValue>2222</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

+

+

+

+        // StatusCode = SyntaxError

+        status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

+        result.setDecision(Decision.PERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.DENY);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.NOTAPPLICABLE);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{D}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{DP}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{P}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // StatusCode = ProcessingError

+        status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

+        result.setDecision(Decision.PERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.DENY);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.NOTAPPLICABLE);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{D}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{DP}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{P}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+        // StatusCode = MissingAttribute

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        result.setDecision(Decision.PERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.DENY);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.NOTAPPLICABLE);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{D}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{DP}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate{P}</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+    }

+

+

+

+

+    // tests related to Status and its components

+    @Test

+    public void testStatus() {

+        // Status with no StatusCode - error

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // Status with StatusMessage when OK

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"/><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with StatusDetail when OK

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

+        StdMutableStatusDetail statusDetail = new StdMutableStatusDetail();

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // Status with StatusMessage when SyntaxError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"/><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with empty StatusDetail when SyntaxError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

+        statusDetail = new StdMutableStatusDetail();

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+

+        // Status with StatusMessage when ProcessingError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"/><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with empty StatusDetail when ProcessingError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

+        statusDetail = new StdMutableStatusDetail();

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+

+        // Status with StatusMessage when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with empty StatusDetail when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail></StatusDetail></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+        // Status with StatusDetail with empty detail when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        StdMutableMissingAttributeDetail mad = new StdMutableMissingAttributeDetail();

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // Status with StatusDetail with valid detail with no value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with StatusDetail with valid detail with value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"><AttributeValue>meh</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with StatusDetail with array valid detail with value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"><AttributeValue>meh</AttributeValue><AttributeValue>nu?</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // Status with StatusDetail with valid detail with Integer value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"><AttributeValue>1111</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with StatusDetail with array valid detail with Integer value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111));

+        mad.addAttributeValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 2222));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Indeterminate</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"/><StatusDetail><MissingAttributeDetail Category=\"urn:oasis:names:tc:xacml:1.0:action\" AttributeId=\"mad\" DataTypeId=\"http://www.w3.org/2001/XMLSchema#string\"><AttributeValue>1111</AttributeValue><AttributeValue>2222</AttributeValue></MissingAttributeDetail></StatusDetail></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

 //		StringNamespaceContext snc = new StringNamespaceContext();

 //		try {

 //			snc.add("defaultURI");

@@ -975,7 +977,7 @@
 //		mad = new StdMutableMissingAttributeDetail();

 //		mad.setAttributeId(new IdentifierImpl("mad"));

 //		mad.setCategory(XACML3.ID_ACTION);

-//		mad.setDataTypeId(DataTypes.DT_STRING.getId());	

+//		mad.setDataTypeId(DataTypes.DT_STRING.getId());

 //		mad.addAttributeValue(new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategoryId")));

 //		statusDetail.addMissingAttributeDetail(mad);

 //		status.setStatusDetail(statusDetail);

@@ -988,7 +990,7 @@
 //		} catch (Exception e) {

 //			fail("operation failed, e="+e);

 //		}

-//		

+//

 //		// Status with StatusDetail with array valid detail with XPathExpression value when MissingAttribute

 //		response = new StdMutableResponse();

 //		result = new StdMutableResult();

@@ -998,7 +1000,7 @@
 //		mad = new StdMutableMissingAttributeDetail();

 //		mad.setAttributeId(new IdentifierImpl("mad"));

 //		mad.setCategory(XACML3.ID_ACTION);

-//		mad.setDataTypeId(DataTypes.DT_STRING.getId());	

+//		mad.setDataTypeId(DataTypes.DT_STRING.getId());

 //		mad.addAttributeValue(new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategoryId1")));

 //		mad.addAttributeValue(new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategoryId2")));

 //		statusDetail.addMissingAttributeDetail(mad);

@@ -1012,1271 +1014,1272 @@
 //		} catch (Exception e) {

 //			fail("operation failed, e="+e);

 //		}

-                

-//TODO - try with other data types, esp XPathExpression		

-                

-                // Status with StatusDetail with array valid detail with value when SyntaxError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // Status with StatusDetail with array valid detail with value when ProcessingError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                

-                

-                // Status with nested child StatusCodes (child status containing child status containing...)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                StdStatusCode child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"));

-                StdStatusCode statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

-                status = new StdMutableStatus(statusCode);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"><StatusCode Value=\"child1StatusCode\"/></StatusCode><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                StdStatusCode childChildChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildChildStatusCode"));

-                StdStatusCode childChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildStatusCode"), childChildChildStatusCode);

-                child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"), childChildStatusCode);

-                statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

-                status = new StdMutableStatus(statusCode);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"><StatusCode Value=\"child1StatusCode\"><StatusCode Value=\"childChildStatusCode\"><StatusCode Value=\"childChildChildStatusCode\"/></StatusCode></StatusCode></StatusCode><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

 

+//TODO - try with other data types, esp XPathExpression

+

+        // Status with StatusDetail with array valid detail with value when SyntaxError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // Status with StatusDetail with array valid detail with value when ProcessingError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

         }

 

 

-        

-        @Test

-        public void testObligations() {

-                

-                // create an XPathExpression for use later

-                StringNamespaceContext snc = new StringNamespaceContext();

-                try {

-                        snc.add("defaultURI");

-                        snc.add("md", "referenceForMD");

-                } catch (Exception e) {

-                        fail("unable to create NamespaceContext e="+e);

-                }

-                XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

-                XPathExpressionWrapper xpathExpressionWrapper2 = new XPathExpressionWrapper(snc, "//md:hospital");

-                

-                StdMutableObligation obligation;

 

-                // test Obligation single decision no attributes

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // obligation missing Id

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                

-                

-                //	AttributeAssignment	- with AttributeId, Value,  Category, DataType, Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                //	AttributeAssignment	- with AttributeId, Value, no Category, DataType, Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                null, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                //	AttributeAssignment	- Missing AttributeId

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                null, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                //	AttributeAssignment	- Missing Value

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                null));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // AttributeAssignment - missing required DataType (Different than JSON where DataType is optional with default String)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(null, "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // AttributeAssignment - missing issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // AttributeAssignment - Integer type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111)));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">1111</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // AttributeAssignment - XPathExpression type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:record</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-

-                //

-                // Technically arrays cannot occur in Obligations and Advice elements.  The XML spec boils down to the following definition:

-                //		<Obligation (attributes of the obligation) >

-                //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

-                //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

-                //			:

-                //		</Obligation

-                //	which means that there may be multiple AttributeAssignments but each one has only one value.

-                //	This differs from the Attributes section in which each <Attribute> may have multiple <AttributeValue> elements.

-                // For Obligations and Advice we can simulate an array by having multiple AttributeAssignment elements with the same Category, Id and Issuer.

-                //

-

-                

-                //	AttributeAssignment	- Multiple values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Lisa")));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Lisa</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Maggie</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                //	AttributeAssignment	- Multiple Integer values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111)));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 2222)));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 3333)));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">1111</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">2222</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">3333</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // Multiple XPathExpression values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper2, new IdentifierImpl("SimpleXPathCategory"))));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:record</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:hospital</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }	

-                

+        // Status with nested child StatusCodes (child status containing child status containing...)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        StdStatusCode child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"));

+        StdStatusCode statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

+        status = new StdMutableStatus(statusCode);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"><StatusCode Value=\"child1StatusCode\"/></StatusCode><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

         }

-        

-        

-        

-        

-        @Test

-        public void testAdvice() {

-                

-                // create an XPathExpression for use later

-                StringNamespaceContext snc = new StringNamespaceContext();

-                try {

-                        snc.add("defaultURI");

-                        snc.add("md", "referenceForMD");

-                } catch (Exception e) {

-                        fail("unable to create NamespaceContext e="+e);

-                }

-                XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

-                XPathExpressionWrapper xpathExpressionWrapper2 = new XPathExpressionWrapper(snc, "//md:hospital");

-                

-                StdMutableAdvice Advice;

-

-                // test Advice single decision no attributes

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Advice missing Id

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                

-                

-                //	AttributeAssignment	- with AttributeId, Value,  Category, DataType, Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                //	AttributeAssignment	- with AttributeId, Value, no Category, DataType, Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                null, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                //	AttributeAssignment	- Missing AttributeId

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                null, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                //	AttributeAssignment	- Missing Value

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                null));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // AttributeAssignment - missing Required DataType (Different than JSON where DataType is optional with default String)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(null, "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // AttributeAssignment - missing issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // AttributeAssignment - Integer type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111)));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">1111</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // AttributeAssignment - XPathExpression type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:record</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-

-                //

-                // Technically arrays cannot occur in Obligations and Advice elements.  The XML spec boils down to the following definition:

-                //		<Obligation (attributes of the obligation) >

-                //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

-                //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

-                //			:

-                //		</Obligation

-                //	which means that there may be multiple AttributeAssignments but each one has only one value.

-                //	This differs from the Attributes section in which each <Attribute> may have multiple <AttributeValue> elements.

-                // For Obligations and Advice we can simulate an array by having multiple AttributeAssignment elements with the same Category, Id and Issuer.

-                //

-                

-                //	AttributeAssignment	- Multiple values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Lisa")));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Lisa</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Maggie</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                //	AttributeAssignment	- Multiple Integer values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111)));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 2222)));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 3333)));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">1111</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">2222</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">3333</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // Multiple XPathExpression values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper2, new IdentifierImpl("SimpleXPathCategory"))));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:record</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:hospital</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        StdStatusCode childChildChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildChildStatusCode"));

+        StdStatusCode childChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildStatusCode"), childChildChildStatusCode);

+        child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"), childChildStatusCode);

+        statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

+        status = new StdMutableStatus(statusCode);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Status><StatusCode Value=\"urn:oasis:names:tc:xacml:1.0:status:ok\"><StatusCode Value=\"child1StatusCode\"><StatusCode Value=\"childChildStatusCode\"><StatusCode Value=\"childChildChildStatusCode\"/></StatusCode></StatusCode></StatusCode><StatusMessage>I'm ok, you're ok</StatusMessage></Status></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

         }

-        

-        

-        

-        

-        

 

-        

-        

+    }

 

-        

-        // Attributes tests

-        @Test

-        public void testAttributes() {

-                

-                // create an XPathExpression for use later

-                StringNamespaceContext snc = new StringNamespaceContext();

-                try {

-                        snc.add("defaultURI");

-                        snc.add("md", "referenceForMD");

-                } catch (Exception e) {

-                        fail("unable to create NamespaceContext e="+e);

-                }

-                XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

-                

-                

-                Identifier categoryIdentifier;

-                List<Attribute> attrList = new ArrayList<Attribute>();

-                StdMutableAttribute mutableAttribute;

-                

-                // Attr list with no entries

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // one Attribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // multiple attributes

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "EIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent2\" Issuer=\"BIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">P10Y4M</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent3\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent4\" Issuer=\"DIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent5\" Issuer=\"EIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // IncludeInResult=false/true

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", false));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Missing AttributeId (mandatory)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, null, new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // Missing mandatory Value

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), null), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // Missing optional Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), null, true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // missing required DataType (different from JSON where DataType is optional and assumed to be String)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(null, "Apu"), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // same id, same type different issuer

-                // (This is not an array of values because Issuer is different)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"), "BIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Simpson"), "CIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"BIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Simpson</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // same id, same type same issuer

-                // (This is an array of values)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Simpson"), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Simpson</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // same Id, different types, same issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">P10Y4M</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // same Id, different types, different issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "EIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), null, true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"BIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">P10Y4M</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"DIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"EIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

 

-                // different Id, different types, same issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "AIssue"), "BIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent2\" Issuer=\"BIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">AIssue</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent3\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent4\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent5\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // one Attribute of type XPathExpression (the only complex data type)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategory")), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" XPathCategory=\"xpathCategory\">//md:record</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // multiple sets of values

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", false));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "EIssue", true));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrNoIssuer"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), null, true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                categoryIdentifier = new IdentifierImpl("secondCategory");

-                Attribute[] secondAttrList = {

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent12"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu2"), "AIssue2", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent22"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Abc2"), "BIssue2", false),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent32"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Der2"), "CIssue2", true) };

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(secondAttrList)));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent3\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent4\" Issuer=\"DIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent5\" Issuer=\"EIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrNoIssuer\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes><Attributes Category=\"secondCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent12\" Issuer=\"AIssue2\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu2</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent32\" Issuer=\"CIssue2\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Der2</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // array of values - same type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                attrList.clear();

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

 

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"));

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"));

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Homer"));

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Ned"));

-                        

-                attrList.add(mutableAttribute);

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Homer</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Ned</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // array of values - compatible different types

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                attrList.clear();

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

+    @Test

+    public void testObligations() {

 

-                        mutableAttribute.addValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567));

-                        mutableAttribute.addValue(new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432));

-                        mutableAttribute.addValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567));

-                attrList.add(mutableAttribute);

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // array of values - incompatible different types (Different from JSON because these are not part of an array in XML, just separate values)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                attrList.clear();

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

-

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"));

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"));

-                        mutableAttribute.addValue(new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432));

-                        mutableAttribute.addValue(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true));

-                        mutableAttribute.addValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567));

-                        mutableAttribute.addValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567));

-                attrList.add(mutableAttribute);

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">P10Y4M</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

+        // create an XPathExpression for use later

+        StringNamespaceContext snc = new StringNamespaceContext();

+        try {

+            snc.add("defaultURI");

+            snc.add("md", "referenceForMD");

+        } catch (Exception e) {

+            fail("unable to create NamespaceContext e="+e);

         }

-        

-        

-        

-        

-        

-        // PolicyIdentifier tests

-        @Test

-        public void testPolicyIdentifier() {

-                

-                StdIdReference policyIdentifier1 = null;

-                StdIdReference policyIdentifier2 = null;

-                StdIdReference policySetIdentifier1 = null;

-                StdIdReference policySetIdentifier2 = null;

-                

-                // multiple PolicyIdentifiers of both types

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                try {

-                        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

-                        policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

-                        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

-                        policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

-                } catch (ParseException e1) {

-                        fail("creating policyIds, e="+e1);

-                }

-                result.addPolicyIdentifier(policyIdentifier1);

-                result.addPolicyIdentifier(policyIdentifier2);

-                result.addPolicySetIdentifier(policySetIdentifier1);

-                result.addPolicySetIdentifier(policySetIdentifier2);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><PolicyIdentifierList><PolicyIdReference Version=\"1.2.3\">idRef1</PolicyIdReference><PolicyIdReference>idRef2_NoVersion</PolicyIdReference><PolicySetIdReference Version=\"4.5.6.7.8.9.0\">idSetRef1</PolicySetIdReference><PolicySetIdReference>idSetRef2_NoVersion</PolicySetIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // PolicyIdentifier exists but has no IdReferences

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                policyIdentifier1 = null;

-                result.addPolicyIdentifier(policyIdentifier1);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // PolicySetIdentifier exists but has not IdReferences

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                policySetIdentifier1 = null;

-                result.addPolicyIdentifier(policySetIdentifier1);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (DOMStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from object to XML: " + e);

-                }

-                

-                // PolicyIdentifier with PolicyIdReference and no PolicySetIdReference

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                try {

-                        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

-                } catch (ParseException e1) {

-                        fail("creating policyIds, e="+e1);

-                }

-                result.addPolicyIdentifier(policyIdentifier1);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><PolicyIdentifierList><PolicyIdReference Version=\"1.2.3\">idRef1</PolicyIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-                // PolicyIdentifier with no PolicyIdReference and with PolicySetIdReference

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                try {

-                        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

-                } catch (ParseException e1) {

-                        fail("creating policyIds, e="+e1);

-                }

-                result.addPolicySetIdentifier(policySetIdentifier1);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><PolicyIdentifierList><PolicySetIdReference Version=\"4.5.6.7.8.9.0\">idSetRef1</PolicySetIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // IdReferences without version

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

+        XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

+        XPathExpressionWrapper xpathExpressionWrapper2 = new XPathExpressionWrapper(snc, "//md:hospital");

 

-                        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), null);

-                        policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

-                        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"));

-                        policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

+        StdMutableObligation obligation;

 

-                result.addPolicyIdentifier(policyIdentifier1);

-                result.addPolicyIdentifier(policyIdentifier2);

-                result.addPolicySetIdentifier(policySetIdentifier1);

-                result.addPolicySetIdentifier(policySetIdentifier2);

-                response.add(result);

-                try {

-                        xmlResponse = DOMResponse.toString(response, false);

-                        assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><PolicyIdentifierList><PolicyIdReference>idRef1</PolicyIdReference><PolicyIdReference>idRef2_NoVersion</PolicyIdReference><PolicySetIdReference>idSetRef1</PolicySetIdReference><PolicySetIdReference>idSetRef2_NoVersion</PolicySetIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+        // test Obligation single decision no attributes

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

         }

 

+        // obligation missing Id

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+

+

+        //	AttributeAssignment	- with AttributeId, Value,  Category, DataType, Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        //	AttributeAssignment	- with AttributeId, Value, no Category, DataType, Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              null,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        //	AttributeAssignment	- Missing AttributeId

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              null,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        //	AttributeAssignment	- Missing Value

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              null));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // AttributeAssignment - missing required DataType (Different than JSON where DataType is optional with default String)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(null, "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // AttributeAssignment - missing issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // AttributeAssignment - Integer type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111)));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">1111</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // AttributeAssignment - XPathExpression type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:record</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+

+        //

+        // Technically arrays cannot occur in Obligations and Advice elements.  The XML spec boils down to the following definition:

+        //		<Obligation (attributes of the obligation) >

+        //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

+        //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

+        //			:

+        //		</Obligation

+        //	which means that there may be multiple AttributeAssignments but each one has only one value.

+        //	This differs from the Attributes section in which each <Attribute> may have multiple <AttributeValue> elements.

+        // For Obligations and Advice we can simulate an array by having multiple AttributeAssignment elements with the same Category, Id and Issuer.

+        //

+

+

+        //	AttributeAssignment	- Multiple values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Lisa")));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Lisa</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Maggie</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        //	AttributeAssignment	- Multiple Integer values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111)));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 2222)));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 3333)));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">1111</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">2222</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">3333</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // Multiple XPathExpression values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper2, new IdentifierImpl("SimpleXPathCategory"))));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Obligations><Obligation ObligationId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:record</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:hospital</AttributeAssignment></Obligation></Obligations></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+    }

+

+

+

+

+    @Test

+    public void testAdvice() {

+

+        // create an XPathExpression for use later

+        StringNamespaceContext snc = new StringNamespaceContext();

+        try {

+            snc.add("defaultURI");

+            snc.add("md", "referenceForMD");

+        } catch (Exception e) {

+            fail("unable to create NamespaceContext e="+e);

+        }

+        XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

+        XPathExpressionWrapper xpathExpressionWrapper2 = new XPathExpressionWrapper(snc, "//md:hospital");

+

+        StdMutableAdvice Advice;

+

+        // test Advice single decision no attributes

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Advice missing Id

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+

+

+        //	AttributeAssignment	- with AttributeId, Value,  Category, DataType, Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        //	AttributeAssignment	- with AttributeId, Value, no Category, DataType, Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          null,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        //	AttributeAssignment	- Missing AttributeId

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          null,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        //	AttributeAssignment	- Missing Value

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          null));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // AttributeAssignment - missing Required DataType (Different than JSON where DataType is optional with default String)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(null, "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // AttributeAssignment - missing issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // AttributeAssignment - Integer type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111)));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">1111</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // AttributeAssignment - XPathExpression type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:record</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+

+        //

+        // Technically arrays cannot occur in Obligations and Advice elements.  The XML spec boils down to the following definition:

+        //		<Obligation (attributes of the obligation) >

+        //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

+        //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

+        //			:

+        //		</Obligation

+        //	which means that there may be multiple AttributeAssignments but each one has only one value.

+        //	This differs from the Attributes section in which each <Attribute> may have multiple <AttributeValue> elements.

+        // For Obligations and Advice we can simulate an array by having multiple AttributeAssignment elements with the same Category, Id and Issuer.

+        //

+

+        //	AttributeAssignment	- Multiple values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Lisa")));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Lisa</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#string\">Maggie</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        //	AttributeAssignment	- Multiple Integer values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 1111)));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 2222)));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 3333)));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">1111</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">2222</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\">3333</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // Multiple XPathExpression values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper2, new IdentifierImpl("SimpleXPathCategory"))));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><AssociatedAdvice><Advice AdviceId=\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:record</AttributeAssignment><AttributeAssignment AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject\" DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" xmlns:md=\"referenceForMD\" xmlns=\"defaultURI\">//md:hospital</AttributeAssignment></Advice></AssociatedAdvice></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+    }

+

+

+

+

+

+

+

+

+

+

+    // Attributes tests

+    @Test

+    public void testAttributes() {

+

+        // create an XPathExpression for use later

+        StringNamespaceContext snc = new StringNamespaceContext();

+        try {

+            snc.add("defaultURI");

+            snc.add("md", "referenceForMD");

+        } catch (Exception e) {

+            fail("unable to create NamespaceContext e="+e);

+        }

+        XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

+

+

+        Identifier categoryIdentifier;

+        List<Attribute> attrList = new ArrayList<Attribute>();

+        StdMutableAttribute mutableAttribute;

+

+        // Attr list with no entries

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // one Attribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // multiple attributes

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "EIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent2\" Issuer=\"BIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">P10Y4M</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent3\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent4\" Issuer=\"DIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent5\" Issuer=\"EIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // IncludeInResult=false/true

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", false));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Missing AttributeId (mandatory)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, null, new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // Missing mandatory Value

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), null), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // Missing optional Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), null, true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // missing required DataType (different from JSON where DataType is optional and assumed to be String)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(null, "Apu"), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // same id, same type different issuer

+        // (This is not an array of values because Issuer is different)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"), "BIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Simpson"), "CIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"BIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Simpson</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // same id, same type same issuer

+        // (This is an array of values)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Simpson"), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Simpson</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // same Id, different types, same issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">P10Y4M</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // same Id, different types, different issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "EIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), null, true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"BIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">P10Y4M</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"DIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"EIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // different Id, different types, same issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "AIssue"), "BIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent2\" Issuer=\"BIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">AIssue</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent3\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent4\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent5\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // one Attribute of type XPathExpression (the only complex data type)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategory")), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\" XPathCategory=\"xpathCategory\">//md:record</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // multiple sets of values

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", false));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), "EIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrNoIssuer"), new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567), null, true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        categoryIdentifier = new IdentifierImpl("secondCategory");

+        Attribute[] secondAttrList = {

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent12"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu2"), "AIssue2", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent22"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Abc2"), "BIssue2", false),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent32"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Der2"), "CIssue2", true)

+        };

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(secondAttrList)));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent3\" Issuer=\"CIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent4\" Issuer=\"DIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent5\" Issuer=\"EIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrNoIssuer\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes><Attributes Category=\"secondCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent12\" Issuer=\"AIssue2\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu2</AttributeValue></Attribute><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent32\" Issuer=\"CIssue2\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Der2</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // array of values - same type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        attrList.clear();

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

+

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"));

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"));

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Homer"));

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Ned"));

+

+        attrList.add(mutableAttribute);

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Bart</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Homer</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Ned</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // array of values - compatible different types

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        attrList.clear();

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

+

+        mutableAttribute.addValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567));

+        mutableAttribute.addValue(new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432));

+        mutableAttribute.addValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567));

+        attrList.add(mutableAttribute);

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // array of values - incompatible different types (Different from JSON because these are not part of an array in XML, just separate values)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        attrList.clear();

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

+

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"));

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"));

+        mutableAttribute.addValue(new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432));

+        mutableAttribute.addValue(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true));

+        mutableAttribute.addValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567));

+        mutableAttribute.addValue(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), 4567));

+        attrList.add(mutableAttribute);

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><Attributes Category=\"firstCategory\"><Attribute IncludeInResult=\"true\" AttributeId=\"attrIdent1\" Issuer=\"AIssue\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Apu</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\">P10Y4M</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#double\">765.432</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#boolean\">true</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">4567</AttributeValue></Attribute></Attributes></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+    }

+

+

+

+

+

+    // PolicyIdentifier tests

+    @Test

+    public void testPolicyIdentifier() {

+

+        StdIdReference policyIdentifier1 = null;

+        StdIdReference policyIdentifier2 = null;

+        StdIdReference policySetIdentifier1 = null;

+        StdIdReference policySetIdentifier2 = null;

+

+        // multiple PolicyIdentifiers of both types

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        try {

+            policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

+            policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

+            policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

+            policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

+        } catch (ParseException e1) {

+            fail("creating policyIds, e="+e1);

+        }

+        result.addPolicyIdentifier(policyIdentifier1);

+        result.addPolicyIdentifier(policyIdentifier2);

+        result.addPolicySetIdentifier(policySetIdentifier1);

+        result.addPolicySetIdentifier(policySetIdentifier2);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><PolicyIdentifierList><PolicyIdReference Version=\"1.2.3\">idRef1</PolicyIdReference><PolicyIdReference>idRef2_NoVersion</PolicyIdReference><PolicySetIdReference Version=\"4.5.6.7.8.9.0\">idSetRef1</PolicySetIdReference><PolicySetIdReference>idSetRef2_NoVersion</PolicySetIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // PolicyIdentifier exists but has no IdReferences

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        policyIdentifier1 = null;

+        result.addPolicyIdentifier(policyIdentifier1);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // PolicySetIdentifier exists but has not IdReferences

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        policySetIdentifier1 = null;

+        result.addPolicyIdentifier(policySetIdentifier1);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (DOMStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from object to XML: " + e);

+        }

+

+        // PolicyIdentifier with PolicyIdReference and no PolicySetIdReference

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        try {

+            policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

+        } catch (ParseException e1) {

+            fail("creating policyIds, e="+e1);

+        }

+        result.addPolicyIdentifier(policyIdentifier1);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><PolicyIdentifierList><PolicyIdReference Version=\"1.2.3\">idRef1</PolicyIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+        // PolicyIdentifier with no PolicyIdReference and with PolicySetIdReference

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        try {

+            policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

+        } catch (ParseException e1) {

+            fail("creating policyIds, e="+e1);

+        }

+        result.addPolicySetIdentifier(policySetIdentifier1);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><PolicyIdentifierList><PolicySetIdReference Version=\"4.5.6.7.8.9.0\">idSetRef1</PolicySetIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // IdReferences without version

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+

+        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), null);

+        policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

+        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"));

+        policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

+

+        result.addPolicyIdentifier(policyIdentifier1);

+        result.addPolicyIdentifier(policyIdentifier2);

+        result.addPolicySetIdentifier(policySetIdentifier1);

+        result.addPolicySetIdentifier(policySetIdentifier2);

+        response.add(result);

+        try {

+            xmlResponse = DOMResponse.toString(response, false);

+            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"><Result><Decision>Permit</Decision><PolicyIdentifierList><PolicyIdReference>idRef1</PolicyIdReference><PolicyIdReference>idRef2_NoVersion</PolicyIdReference><PolicySetIdReference>idSetRef1</PolicySetIdReference><PolicySetIdReference>idSetRef2_NoVersion</PolicySetIdReference></PolicyIdentifierList></Result></Response>", xmlResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+    }

+

 

 //TODO - the XML spec implies that the Result Attributes may include the Content (It is part of the UML)

-        

-        

-        // test indentation???

-        

-        

+

+

+    // test indentation???

+

+

 }

 

 

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionAccessPermittedTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionAccessPermittedTest.java
index 3357930..b08b02b 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionAccessPermittedTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionAccessPermittedTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import com.att.research.xacml.api.Request;

@@ -45,473 +45,477 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * NOT IMPLEMENTED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  * This function is not yet implemented so these tests intentionally fail.

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionAccessPermittedTest {

-        

-        //

-        // Strings for the Request contents

-        //

-        

-        String reqStrMainStart = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" 

-                        + "<Request xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" 

-                        + " http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"" 

-                        + " ReturnPolicyIdList=\"false\""

-                        + " CombinedDecision=\"false\""

-                        + " xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\""

-                        + " xmlns:md=\"http://www.medico.com/schemas/record\""

-                        + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"

-                        + "	<Attributes Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\">"

-                        + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">"

-                        + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Julius Hibbert</AttributeValue>"

-                        + "		</Attribute>"

-                        + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:conformance-test:test-attr\">"

-                        + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">   This  is IT!  </AttributeValue>"

-                        + "		</Attribute>"

-                        + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:conformance-test:test-attr\">"

-                        + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">   This  is IT!  </AttributeValue>"

-                        + "		</Attribute>"

-                        + "</Attributes>";

-              

-        String reqStrResourceStart =   "<Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">";

 

-        String reqStrMdRecordSimpson =

-                        "<md:record>" +

-                "<md:hospital_info>" +

-                   "<md:name>ABC Hospital</md:name>" +

-                    "<md:department>Surgery</md:department>" +

-                "</md:hospital_info>" +

-                "<md:patient_info>" +

-                    "<md:name>Bart Simpson</md:name>" +

-                    "<md:age>60</md:age>" +

-                    "<md:sex>male</md:sex>" +

-                    "<md:health_insurance>123456</md:health_insurance>" +

-                "</md:patient_info>" +

-                "<md:diagnosis_info>" +

-                    "<md:diagnosis>" +

-                        "<md:item type=\"primary\">Gastric Cancer</md:item>" +

-                        "<md:item type=\"secondary\">Hyper tension</md:item>" +

-                    "</md:diagnosis>" +

-                    "<md:pathological_diagnosis>" +

-                        "<md:diagnosis>" +

-                            "<md:item type=\"primary\">Well differentiated adeno carcinoma</md:item>" +

-                        "</md:diagnosis>" +

-                        "<md:date>2000-10-05</md:date>" +

-                        "<md:malignancy type=\"yes\"/>" +

-                    "</md:pathological_diagnosis>" +

-                "</md:diagnosis_info>" +             

-           " </md:record>";

-        String reqStrContentMdRecordSimpson = "<Content>" + reqStrMdRecordSimpson + "</Content>";

-        String reqStrMalformedContent = 

-                        " <Content>" +

-                                        "<md:record>" +

-                                "<md:hospital_info>" +

-                                   "<md:name>ABC Hospital</md:name>" +

-                                        "<md:malignancy type=\"yes\"/>" +

-                    "</Content>";

-        String reqStrMdRecordSpringer =

-                                "<md:record>" +

-                        "<md:hospital_info>" +

-                           "<md:name>XYZ Hospital</md:name>" +

-                            "<md:department>Surgery</md:department>" +

-                        "</md:hospital_info>" +

-                        "<md:patient_info>" +

-                            "<md:name>Jerry Springer</md:name>" +

-                            "<md:age>65</md:age>" +

-                            "<md:sex>male</md:sex>" +

-                            "<md:health_insurance>765432</md:health_insurance>" +

-                        "</md:patient_info>" +

-                        "<md:diagnosis_info>" +

-                            "<md:diagnosis>" +

-                                "<md:item type=\"primary\">Hyatal Hernia</md:item>" +

-                                "<md:item type=\"secondary\">Diabetes</md:item>" +

-                                "<md:item type=\"tertiary\">Neuronal Collapse</md:item>" +

-                            "</md:diagnosis>" +

-                            "<md:pathological_diagnosis>" +

-                                "<md:diagnosis>" +

-                                    "<md:item type=\"primary\">We have no idea</md:item>" +

-                                "</md:diagnosis>" +

-                                "<md:date>2012-07-22</md:date>" +

-                                "<md:malignancy type=\"no\"/>" +

-                            "</md:pathological_diagnosis>" +

-                        "</md:diagnosis_info>" +             

-                   " </md:record>";

-        String reqStrContentMdRecordSpringer =

-                        "<Content>" + reqStrMdRecordSpringer + "</Content>";

-        

-        String reqStrResourceEnd = "    <Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:resource:resource-id\">"

-                        + "		<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#anyURI\">http://medico.com/record/patient/BartSimpson</AttributeValue>"

-                        + "  </Attribute>"

-                        + "</Attributes> ";

-        String reqStrActionStart =   "<Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\">";

+    //

+    // Strings for the Request contents

+    //

 

-        String reqStrActionEnd = "<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">"

-                        + "<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">read</AttributeValue>"

-                        + "</Attribute>"

-                        + "</Attributes> ";

-        String reqStrEnvironmentStartEnd = "  <Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\" />";

-        String reqStrMainEnd = " </Request>";

+    String reqStrMainStart = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"

+                             + "<Request xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"

+                             + " http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\""

+                             + " ReturnPolicyIdList=\"false\""

+                             + " CombinedDecision=\"false\""

+                             + " xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\""

+                             + " xmlns:md=\"http://www.medico.com/schemas/record\""

+                             + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"

+                             + "	<Attributes Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\">"

+                             + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">"

+                             + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Julius Hibbert</AttributeValue>"

+                             + "		</Attribute>"

+                             + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:conformance-test:test-attr\">"

+                             + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">   This  is IT!  </AttributeValue>"

+                             + "		</Attribute>"

+                             + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:conformance-test:test-attr\">"

+                             + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">   This  is IT!  </AttributeValue>"

+                             + "		</Attribute>"

+                             + "</Attributes>";

 

-        

-        // combined strings for convenience

-        String reqStrMainResourceStart = reqStrMainStart + reqStrResourceStart;

-        String reqStrResourceAllEnd = reqStrResourceEnd + reqStrActionStart + reqStrActionEnd + reqStrEnvironmentStartEnd + reqStrMainEnd;

-        

-        

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        

-        // Name Spaces used in the XML as part of these examples - needed for compiling XPaths

-        NamespaceContext nameSpaceContext = new NamespaceContext() {

-            @Override

-            public Iterator<?> getPrefixes(String arg0) { return null;}

+    String reqStrResourceStart =   "<Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">";

 

-            @Override

-            public String getPrefix(String arg0) {return null;}

+    String reqStrMdRecordSimpson =

+        "<md:record>" +

+        "<md:hospital_info>" +

+        "<md:name>ABC Hospital</md:name>" +

+        "<md:department>Surgery</md:department>" +

+        "</md:hospital_info>" +

+        "<md:patient_info>" +

+        "<md:name>Bart Simpson</md:name>" +

+        "<md:age>60</md:age>" +

+        "<md:sex>male</md:sex>" +

+        "<md:health_insurance>123456</md:health_insurance>" +

+        "</md:patient_info>" +

+        "<md:diagnosis_info>" +

+        "<md:diagnosis>" +

+        "<md:item type=\"primary\">Gastric Cancer</md:item>" +

+        "<md:item type=\"secondary\">Hyper tension</md:item>" +

+        "</md:diagnosis>" +

+        "<md:pathological_diagnosis>" +

+        "<md:diagnosis>" +

+        "<md:item type=\"primary\">Well differentiated adeno carcinoma</md:item>" +

+        "</md:diagnosis>" +

+        "<md:date>2000-10-05</md:date>" +

+        "<md:malignancy type=\"yes\"/>" +

+        "</md:pathological_diagnosis>" +

+        "</md:diagnosis_info>" +

+        " </md:record>";

+    String reqStrContentMdRecordSimpson = "<Content>" + reqStrMdRecordSimpson + "</Content>";

+    String reqStrMalformedContent =

+        " <Content>" +

+        "<md:record>" +

+        "<md:hospital_info>" +

+        "<md:name>ABC Hospital</md:name>" +

+        "<md:malignancy type=\"yes\"/>" +

+        "</Content>";

+    String reqStrMdRecordSpringer =

+        "<md:record>" +

+        "<md:hospital_info>" +

+        "<md:name>XYZ Hospital</md:name>" +

+        "<md:department>Surgery</md:department>" +

+        "</md:hospital_info>" +

+        "<md:patient_info>" +

+        "<md:name>Jerry Springer</md:name>" +

+        "<md:age>65</md:age>" +

+        "<md:sex>male</md:sex>" +

+        "<md:health_insurance>765432</md:health_insurance>" +

+        "</md:patient_info>" +

+        "<md:diagnosis_info>" +

+        "<md:diagnosis>" +

+        "<md:item type=\"primary\">Hyatal Hernia</md:item>" +

+        "<md:item type=\"secondary\">Diabetes</md:item>" +

+        "<md:item type=\"tertiary\">Neuronal Collapse</md:item>" +

+        "</md:diagnosis>" +

+        "<md:pathological_diagnosis>" +

+        "<md:diagnosis>" +

+        "<md:item type=\"primary\">We have no idea</md:item>" +

+        "</md:diagnosis>" +

+        "<md:date>2012-07-22</md:date>" +

+        "<md:malignancy type=\"no\"/>" +

+        "</md:pathological_diagnosis>" +

+        "</md:diagnosis_info>" +

+        " </md:record>";

+    String reqStrContentMdRecordSpringer =

+        "<Content>" + reqStrMdRecordSpringer + "</Content>";

 

-            @Override

-            public String getNamespaceURI(String arg0) {

-                if("md".equals(arg0)) {

-                    return "http://www.medico.com/schemas/record";

-                } else if ("xacml-context".equals(arg0)) {

-                        return "urn:oasis:names:tc:xacml:3.0:context:schema:os";

-                } else if ("xsi".equals(arg0)) {

-                        return "http://www.w3.org/2001/XMLSchema-instance";

-                }

-                return null;

+    String reqStrResourceEnd = "    <Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:resource:resource-id\">"

+                               + "		<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#anyURI\">http://medico.com/record/patient/BartSimpson</AttributeValue>"

+                               + "  </Attribute>"

+                               + "</Attributes> ";

+    String reqStrActionStart =   "<Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\">";

+

+    String reqStrActionEnd = "<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">"

+                             + "<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">read</AttributeValue>"

+                             + "</Attribute>"

+                             + "</Attributes> ";

+    String reqStrEnvironmentStartEnd = "  <Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\" />";

+    String reqStrMainEnd = " </Request>";

+

+

+    // combined strings for convenience

+    String reqStrMainResourceStart = reqStrMainStart + reqStrResourceStart;

+    String reqStrResourceAllEnd = reqStrResourceEnd + reqStrActionStart + reqStrActionEnd + reqStrEnvironmentStartEnd + reqStrMainEnd;

+

+

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

+

+

+

+    // Name Spaces used in the XML as part of these examples - needed for compiling XPaths

+    NamespaceContext nameSpaceContext = new NamespaceContext() {

+        @Override

+        public Iterator<?> getPrefixes(String arg0) {

+            return null;

+        }

+

+        @Override

+        public String getPrefix(String arg0) {

+            return null;

+        }

+

+        @Override

+        public String getNamespaceURI(String arg0) {

+            if("md".equals(arg0)) {

+                return "http://www.medico.com/schemas/record";

+            } else if ("xacml-context".equals(arg0)) {

+                return "urn:oasis:names:tc:xacml:3.0:context:schema:os";

+            } else if ("xsi".equals(arg0)) {

+                return "http://www.w3.org/2001/XMLSchema-instance";

             }

-        };

-        

-        

-        

-        //

-        // URIs for attribute categroies

-        //

-        

-        FunctionArgumentAttributeValue attrUriNull = null;

-        FunctionArgumentAttributeValue attrUriEmpty = null;

-        FunctionArgumentAttributeValue attrUriResources = null;

-        FunctionArgumentAttributeValue attrUriAction = null;

-        FunctionArgumentAttributeValue attrUriNotInRequest = null;

-        FunctionArgumentAttributeValue attrUriNotCategory = null;

-

-        

-        

-        //

-        // XML Contents 

-        //

-        

-        FunctionArgumentAttributeValue attrXnull = null;

-        FunctionArgumentAttributeValue attrXEmpty = null;

-        FunctionArgumentAttributeValue attrXSimpson = null;

-        FunctionArgumentAttributeValue attrXSpringer = null;

-        FunctionArgumentAttributeValue attrXContentSimpson = null;

-        FunctionArgumentAttributeValue attrXContentSpringer = null;

-        FunctionArgumentAttributeValue attrXBadXML = null;

-        

-

-        

-

-        

-        

-        //

-        // REQUEST objects available for use in tests

-        //

-        Request requestEmpty = new StdMutableRequest();

-        Request requestMdRecord = null;

-        Request requestDoubleResources = null;

-        Request requestDoubleContent = null;

-        Request requestResourceActionContent = null;

-        Request requestContentInAction = null;

-

-

-        

-        

-        /**

-         * Set up all variables in one place because it is complicated (lots of steps needed for each attribute)

-         */

-        public FunctionDefinitionAccessPermittedTest() {

-                try {

-

-

-                        // create Function Attributes for URIs

-                        attrUriNull = null;

-                        attrUriEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

-                        attrUriResources = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("urn:oasis:names:tc:xacml:3.0:attribute-category:resource"));

-                        attrUriAction = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("urn:oasis:names:tc:xacml:3.0:attribute-category:action"));

-                        attrUriNotInRequest = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("NoSuchURI"));

-                        attrUriNotCategory = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("urn:oasis:names:tc:xacml:1.0:resource:resource-id"));

-                        

-                        // create Function Attributes for XML Strings

-                        attrXnull = new FunctionArgumentAttributeValue(null);

-                        attrXEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrXSimpson = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrMdRecordSimpson));

-                        attrXSpringer = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrMdRecordSpringer));

-                        attrXContentSimpson = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrContentMdRecordSimpson));

-                        attrXContentSpringer = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrContentMdRecordSpringer));

-                        attrXBadXML = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrMalformedContent));

-

-

-                        

-                        // Request objects

-                        // to create a Request object the easiest way is to put the xml into a file and use the DOMRequest to load it.

-                        

-                        // single Content in the Resources section (normal valid request)

-                        String reqString = reqStrMainResourceStart + reqStrContentMdRecordSimpson + reqStrResourceAllEnd;

-                                File tFile = File.createTempFile("functionJunit", "request");

-                                BufferedWriter bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        requestMdRecord = DOMRequest.load(tFile);

-                                tFile.delete();

-                                

-                        // Resources included twice

-                        reqString = reqStrMainResourceStart + reqStrContentMdRecordSimpson + reqStrResourceEnd + reqStrResourceStart + reqStrContentMdRecordSimpson +reqStrResourceAllEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        requestDoubleResources = DOMRequest.load(tFile);

-                                tFile.delete();

-                                        

-                        // Content included twice - error

-                        reqString = reqStrMainResourceStart + reqStrContentMdRecordSimpson + reqStrContentMdRecordSimpson +reqStrResourceAllEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        try {

-                                requestDoubleContent = DOMRequest.load(tFile);

-                                        tFile.delete();

-                        } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

-                                // this is what it should do, so just continue

-                        } catch (Exception e) {

-                                fail("Unexpected exception for bad XML, e="+e);

-                        }

-                        

-                        // content included in both Resource and Action - ok

-                        reqString = reqStrMainResourceStart + reqStrContentMdRecordSimpson + reqStrResourceEnd + reqStrActionStart + reqStrContentMdRecordSimpson + reqStrActionEnd + reqStrMainEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();	

-                        requestResourceActionContent = DOMRequest.load(tFile);

-                                tFile.delete();

-                                

-                        // Content included only in Action - missing content produces non-error result according to spec

-                        reqString = reqStrMainResourceStart + reqStrResourceEnd + reqStrActionStart + reqStrContentMdRecordSimpson + reqStrActionEnd + reqStrMainEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();		

-                        requestContentInAction = DOMRequest.load(tFile);

-                                tFile.delete();

-                        

-                                

-                                

-                        // Test that Bad XML is caught

-                        @SuppressWarnings("unused")

-                        Request requestContentMisplaced = null;

-                        @SuppressWarnings("unused")

-                        Request requestMalformedContent = null;

-                                

-                                

-                        // Bad XML - Content not under a Category

-                        reqString = reqStrMainStart + reqStrContentMdRecordSimpson + reqStrResourceStart + reqStrResourceEnd + reqStrActionStart + reqStrActionEnd + reqStrMainEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        try {

-                                requestContentMisplaced = DOMRequest.load(tFile);

-                                        tFile.delete();

-                        } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

-                                // this is what it should do, so just continue

-                        } catch (Exception e) {

-                                fail("Unexpected exception for bad XML, e="+e);

-                        }

-                                

-                        // Bad XML - Content is not valid XML

-                        reqString = reqStrMainResourceStart + reqStrMalformedContent + reqStrResourceAllEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        try {

-                                requestMalformedContent = DOMRequest.load(tFile);

-                                        tFile.delete();

-                        } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

-                                // this is what it should do, so just continue

-                        } catch (Exception e) {

-                                fail("Unexpected exception for bad XML, e="+e);

-                        }

-                        

-                } catch (Exception e) {

-                        fail("Constructor initializing variables, e="+ e + "  cause="+e.getCause());

-                }

-                

+            return null;

         }

-        

-

-        

-        

-        

-        

-        

-        @Ignore

-        @Test

-        public void testAccess_permitted() {

-

-                ExpressionResult res = null;

-                Boolean resValue = null;

-                

-                FunctionDefinitionAccessPermitted fd = (FunctionDefinitionAccessPermitted) StdFunctions.FD_ACCESS_PERMITTED;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ACCESS_PERMITTED, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-

-                

-

-                // successful invoke returns true

-                arguments.clear();

-                arguments.add(attrUriResources);

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+    };

 

 

-                                

-                // successful invoke returns false

-                

-                

-                // URI not in Request (ok - evaluate anyway)

-        

-                // test for infinite loop

-                

-                // second arg ok both with and without <Content> tag

-                arguments.clear();

-                arguments.add(attrUriResources);

-                arguments.add(attrXContentSpringer);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                arguments.clear();

-                arguments.add(attrUriResources);

-                arguments.add(attrXSpringer);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // second arg not valid XML

-                arguments.clear();

-                arguments.add(attrUriResources);

-                arguments.add(attrXBadXML);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted Parsing of XML string failed.  Cause='The element type \"md:hospital_info\" must be terminated by the matching end-tag \"</md:hospital_info>\".'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());	

-                

-                // null Evaluation Context

-                arguments.clear();

-                arguments.add(attrUriNotCategory);

-                arguments.add(attrXContentSimpson);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted First argument must be a urn for an attribute-category, not 'urn:oasis:names:tc:xacml:1.0:resource:resource-id", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null Request

-                arguments.clear();

-                arguments.add(attrUriAction);

-                arguments.add(attrXContentSimpson);

-                res = fd.evaluate(new StdEvaluationContext(null, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted Got null Request in EvaluationContext", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        

-                // first arg not uri

-                arguments.clear();

-                arguments.add(attrUriNotCategory);

-                arguments.add(attrXContentSimpson);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted First argument must be a urn for an attribute-category, not 'urn:oasis:names:tc:xacml:1.0:resource:resource-id", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // first arg not attribute-category urn

-                arguments.clear();

-                arguments.add(attrXContentSimpson);

-                arguments.add(attrXContentSimpson);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted Expected data type 'anyURI' saw 'string'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second arg not string

-                arguments.clear();

-                arguments.add(attrUriAction);

-                arguments.add(attrUriAction);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted Expected data type 'string' saw 'anyURI'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

 

-                // too few args

-                arguments.clear();

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXContentSimpson);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrUriEmpty);

-                arguments.add(attrXContentSimpson);

-                arguments.add(attrXContentSimpson);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:access-permitted Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

+    //

+    // URIs for attribute categroies

+    //

+

+    FunctionArgumentAttributeValue attrUriNull = null;

+    FunctionArgumentAttributeValue attrUriEmpty = null;

+    FunctionArgumentAttributeValue attrUriResources = null;

+    FunctionArgumentAttributeValue attrUriAction = null;

+    FunctionArgumentAttributeValue attrUriNotInRequest = null;

+    FunctionArgumentAttributeValue attrUriNotCategory = null;

+

+

+

+    //

+    // XML Contents

+    //

+

+    FunctionArgumentAttributeValue attrXnull = null;

+    FunctionArgumentAttributeValue attrXEmpty = null;

+    FunctionArgumentAttributeValue attrXSimpson = null;

+    FunctionArgumentAttributeValue attrXSpringer = null;

+    FunctionArgumentAttributeValue attrXContentSimpson = null;

+    FunctionArgumentAttributeValue attrXContentSpringer = null;

+    FunctionArgumentAttributeValue attrXBadXML = null;

+

+

+

+

+

+

+    //

+    // REQUEST objects available for use in tests

+    //

+    Request requestEmpty = new StdMutableRequest();

+    Request requestMdRecord = null;

+    Request requestDoubleResources = null;

+    Request requestDoubleContent = null;

+    Request requestResourceActionContent = null;

+    Request requestContentInAction = null;

+

+

+

+

+    /**

+     * Set up all variables in one place because it is complicated (lots of steps needed for each attribute)

+     */

+    public FunctionDefinitionAccessPermittedTest() {

+        try {

+

+

+            // create Function Attributes for URIs

+            attrUriNull = null;

+            attrUriEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

+            attrUriResources = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("urn:oasis:names:tc:xacml:3.0:attribute-category:resource"));

+            attrUriAction = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("urn:oasis:names:tc:xacml:3.0:attribute-category:action"));

+            attrUriNotInRequest = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("NoSuchURI"));

+            attrUriNotCategory = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("urn:oasis:names:tc:xacml:1.0:resource:resource-id"));

+

+            // create Function Attributes for XML Strings

+            attrXnull = new FunctionArgumentAttributeValue(null);

+            attrXEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrXSimpson = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrMdRecordSimpson));

+            attrXSpringer = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrMdRecordSpringer));

+            attrXContentSimpson = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrContentMdRecordSimpson));

+            attrXContentSpringer = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrContentMdRecordSpringer));

+            attrXBadXML = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(reqStrMalformedContent));

+

+

+

+            // Request objects

+            // to create a Request object the easiest way is to put the xml into a file and use the DOMRequest to load it.

+

+            // single Content in the Resources section (normal valid request)

+            String reqString = reqStrMainResourceStart + reqStrContentMdRecordSimpson + reqStrResourceAllEnd;

+            File tFile = File.createTempFile("functionJunit", "request");

+            BufferedWriter bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            requestMdRecord = DOMRequest.load(tFile);

+            tFile.delete();

+

+            // Resources included twice

+            reqString = reqStrMainResourceStart + reqStrContentMdRecordSimpson + reqStrResourceEnd + reqStrResourceStart + reqStrContentMdRecordSimpson +reqStrResourceAllEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            requestDoubleResources = DOMRequest.load(tFile);

+            tFile.delete();

+

+            // Content included twice - error

+            reqString = reqStrMainResourceStart + reqStrContentMdRecordSimpson + reqStrContentMdRecordSimpson +reqStrResourceAllEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            try {

+                requestDoubleContent = DOMRequest.load(tFile);

+                tFile.delete();

+            } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

+                // this is what it should do, so just continue

+            } catch (Exception e) {

+                fail("Unexpected exception for bad XML, e="+e);

+            }

+

+            // content included in both Resource and Action - ok

+            reqString = reqStrMainResourceStart + reqStrContentMdRecordSimpson + reqStrResourceEnd + reqStrActionStart + reqStrContentMdRecordSimpson + reqStrActionEnd + reqStrMainEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            requestResourceActionContent = DOMRequest.load(tFile);

+            tFile.delete();

+

+            // Content included only in Action - missing content produces non-error result according to spec

+            reqString = reqStrMainResourceStart + reqStrResourceEnd + reqStrActionStart + reqStrContentMdRecordSimpson + reqStrActionEnd + reqStrMainEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            requestContentInAction = DOMRequest.load(tFile);

+            tFile.delete();

+

+

+

+            // Test that Bad XML is caught

+            @SuppressWarnings("unused")

+            Request requestContentMisplaced = null;

+            @SuppressWarnings("unused")

+            Request requestMalformedContent = null;

+

+

+            // Bad XML - Content not under a Category

+            reqString = reqStrMainStart + reqStrContentMdRecordSimpson + reqStrResourceStart + reqStrResourceEnd + reqStrActionStart + reqStrActionEnd + reqStrMainEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            try {

+                requestContentMisplaced = DOMRequest.load(tFile);

+                tFile.delete();

+            } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

+                // this is what it should do, so just continue

+            } catch (Exception e) {

+                fail("Unexpected exception for bad XML, e="+e);

+            }

+

+            // Bad XML - Content is not valid XML

+            reqString = reqStrMainResourceStart + reqStrMalformedContent + reqStrResourceAllEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            try {

+                requestMalformedContent = DOMRequest.load(tFile);

+                tFile.delete();

+            } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

+                // this is what it should do, so just continue

+            } catch (Exception e) {

+                fail("Unexpected exception for bad XML, e="+e);

+            }

+

+        } catch (Exception e) {

+            fail("Constructor initializing variables, e="+ e + "  cause="+e.getCause());

         }

-        

+

+    }

+

+

+

+

+

+

+

+    @Ignore

+    @Test

+    public void testAccess_permitted() {

+

+        ExpressionResult res = null;

+        Boolean resValue = null;

+

+        FunctionDefinitionAccessPermitted fd = (FunctionDefinitionAccessPermitted) StdFunctions.FD_ACCESS_PERMITTED;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ACCESS_PERMITTED, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+

+        // successful invoke returns true

+        arguments.clear();

+        arguments.add(attrUriResources);

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+

+

+        // successful invoke returns false

+

+

+        // URI not in Request (ok - evaluate anyway)

+

+        // test for infinite loop

+

+        // second arg ok both with and without <Content> tag

+        arguments.clear();

+        arguments.add(attrUriResources);

+        arguments.add(attrXContentSpringer);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrUriResources);

+        arguments.add(attrXSpringer);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // second arg not valid XML

+        arguments.clear();

+        arguments.add(attrUriResources);

+        arguments.add(attrXBadXML);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted Parsing of XML string failed.  Cause='The element type \"md:hospital_info\" must be terminated by the matching end-tag \"</md:hospital_info>\".'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null Evaluation Context

+        arguments.clear();

+        arguments.add(attrUriNotCategory);

+        arguments.add(attrXContentSimpson);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted First argument must be a urn for an attribute-category, not 'urn:oasis:names:tc:xacml:1.0:resource:resource-id", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null Request

+        arguments.clear();

+        arguments.add(attrUriAction);

+        arguments.add(attrXContentSimpson);

+        res = fd.evaluate(new StdEvaluationContext(null, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted Got null Request in EvaluationContext", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // first arg not uri

+        arguments.clear();

+        arguments.add(attrUriNotCategory);

+        arguments.add(attrXContentSimpson);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted First argument must be a urn for an attribute-category, not 'urn:oasis:names:tc:xacml:1.0:resource:resource-id", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // first arg not attribute-category urn

+        arguments.clear();

+        arguments.add(attrXContentSimpson);

+        arguments.add(attrXContentSimpson);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted Expected data type 'anyURI' saw 'string'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second arg not string

+        arguments.clear();

+        arguments.add(attrUriAction);

+        arguments.add(attrUriAction);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted Expected data type 'string' saw 'anyURI'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // too few args

+        arguments.clear();

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXContentSimpson);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrUriEmpty);

+        arguments.add(attrXContentSimpson);

+        arguments.add(attrXContentSimpson);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:access-permitted Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+    }

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionArithmeticTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionArithmeticTest.java
index a14d9d9..b71bb3c 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionArithmeticTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionArithmeticTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -50,678 +50,678 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionArithmeticTest {

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        @Test

-        public void testInteger_add() {

-                

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                FunctionArgumentAttributeValue attrBadType = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                        attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_ADD;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_ADD, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal add

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("2"), resValue);

-                

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-add Expected data type 'integer' saw 'double' at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

+

+    @Test

+    public void testInteger_add() {

+

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        FunctionArgumentAttributeValue attrBadType = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+            attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

 

-        

-        @Test

-        public void testDouble_add() {

-                

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2  = null;

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_ADD;

 

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.5));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_ADD;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_ADD, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal add

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(4.0), resValue);

-                

-        }

-        

-        

-        @Test

-        public void testInteger_subtract() {

-                

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(6));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_SUBTRACT;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_SUBTRACT, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("5"), resValue);

-                

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_ADD, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal add

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("2"), resValue);

+

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-add Expected data type 'integer' saw 'double' at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testDouble_add() {

+

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2  = null;

+

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.5));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

         }

 

-        

-        @Test

-        public void testDouble_subtract() {

-                

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2  = null;

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_ADD;

 

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(8.5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.3));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_SUBTRACT;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_SUBTRACT, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(6.2), resValue);

-                

-        }

-        

-        

-        @Test

-        public void testInteger_multiply() {

-                

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_MULTIPLY;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_MULTIPLY, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("10"), resValue);

-                

-                

-                // test 0

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("0"), resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_ADD, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal add

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(4.0), resValue);

+

+    }

+

+

+    @Test

+    public void testInteger_subtract() {

+

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(6));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

 

-        

-        @Test

-        public void testDouble_multiply() {

-                

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2  = null;

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_SUBTRACT;

 

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.5));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_MULTIPLY;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_MULTIPLY, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal add

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(3.75), resValue);

-                

-                // test multiply by 0

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(0), resValue);

-        }

-        

-        

-        @Test

-        public void testInteger_divide() {

-                

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_DIVIDE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_DIVIDE, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("2"), resValue);

-                

-                

-                // test 0

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr0);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-divide Divide by 0 error: 5, 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_SUBTRACT, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

 

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("5"), resValue);

+

+    }

+

+

+    @Test

+    public void testDouble_subtract() {

+

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2  = null;

+

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(8.5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.3));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

         }

 

-        

-        @Test

-        public void testDouble_divide() {

-                

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2  = null;

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_SUBTRACT;

 

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.5));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_SUBTRACT, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

 

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_DIVIDE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_DIVIDE, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(0.6), resValue);

-                

-                // test multiply by 0

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr0);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:double-divide Divide by 0 error: 1.5, 0.0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-        }

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testInteger_mod() {

-                

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(28));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_MOD;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_MOD, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr1);

-                arguments.add(attr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("3"), resValue);

-                

-                

-                // test 0

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr0);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-mod Divide by 0 error: 28, 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-        }

-        

+        // test normal

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(6.2), resValue);

 

-        @Test

-        public void testInteger_abs() {

+    }

 

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attrM1 = null;

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

-                        attrM1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-7));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_ABS;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_ABS, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("5"), resValue);

-                

-                arguments.clear();

-                arguments.add(attrM1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("7"), resValue);

 

-                arguments.clear();

-                arguments.add(attr0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("0"), resValue);

+    @Test

+    public void testInteger_multiply() {

+

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

 

-        

-        @Test

-        public void testDouble_abs() {

-                

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2  = null;

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_MULTIPLY;

 

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.5));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_MULTIPLY, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

 

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_ABS;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_ABS, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(1.5), resValue);

-                

-                arguments.clear();

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(2.5), resValue);

-                

-                arguments.clear();

-                arguments.add(attr0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(0), resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

+

+        // test normal

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("10"), resValue);

+

+

+        // test 0

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("0"), resValue);

+    }

+

+

+    @Test

+    public void testDouble_multiply() {

+

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2  = null;

+

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.5));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

         }

-        

-        

-        @Test

-        public void testDouble_round() {

 

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2  = null;

-                FunctionArgumentAttributeValue attr3 = null;

-                FunctionArgumentAttributeValue attr4 = null;

-                FunctionArgumentAttributeValue attr5 = null;

-                FunctionArgumentAttributeValue attr6 = null;

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.49));

-                        attr3 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.51));

-                        attr4 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.5));

-                        attr5 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.49));

-                        attr6 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.51));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_ROUND;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ROUND, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr0);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(0), resValue);

-                

-                arguments.clear();

-                arguments.add(attr1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(2), resValue);

-                

-                arguments.clear();

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(1), resValue);

-                

-                arguments.clear();

-                arguments.add(attr3);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(2), resValue);

-                

-                arguments.clear();

-                arguments.add(attr4);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(-2), resValue);

-        

-                arguments.clear();

-                arguments.add(attr5);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(-2), resValue);

-                

-                arguments.clear();

-                arguments.add(attr6);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(-3), resValue);

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_MULTIPLY;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_MULTIPLY, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal add

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(3.75), resValue);

+

+        // test multiply by 0

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(0), resValue);

+    }

+

+

+    @Test

+    public void testInteger_divide() {

+

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        @Test

-        public void testDouble_floor() {

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2  = null;

-                FunctionArgumentAttributeValue attr3 = null;

-                FunctionArgumentAttributeValue attr4 = null;

-                FunctionArgumentAttributeValue attr5 = null;

-                FunctionArgumentAttributeValue attr6 = null;

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.49));

-                        attr3 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.51));

-                        attr4 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.5));

-                        attr5 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.49));

-                        attr6 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.51));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_FLOOR;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_FLOOR, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                

-                // test normal 

-                arguments.add(attr0);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(0), resValue);

-                

-                arguments.clear();

-                arguments.add(attr1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(1), resValue);

-                

-                arguments.clear();

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(1), resValue);

-                

-                arguments.clear();

-                arguments.add(attr3);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(1), resValue);

-                

-                arguments.clear();

-                arguments.add(attr4);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(-3), resValue);

-        

-                arguments.clear();

-                arguments.add(attr5);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(-3), resValue);

-                

-                arguments.clear();

-                arguments.add(attr6);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(-3), resValue);

+

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_DIVIDE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_DIVIDE, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("2"), resValue);

+

+

+        // test 0

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr0);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-divide Divide by 0 error: 5, 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testDouble_divide() {

+

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2  = null;

+

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.5));

+

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

         }

-        

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_DIVIDE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_DIVIDE, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(0.6), resValue);

+

+        // test multiply by 0

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr0);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:double-divide Divide by 0 error: 1.5, 0.0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+    @Test

+    public void testInteger_mod() {

+

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(28));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

+        }

+

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_MOD;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_MOD, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal

+        arguments.add(attr1);

+        arguments.add(attr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("3"), resValue);

+

+

+        // test 0

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr0);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-mod Divide by 0 error: 28, 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testInteger_abs() {

+

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attrM1 = null;

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+            attrM1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-7));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

+        }

+

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_INTEGER_ABS;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_ABS, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // test normal

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("5"), resValue);

+

+        arguments.clear();

+        arguments.add(attrM1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("7"), resValue);

+

+        arguments.clear();

+        arguments.add(attr0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("0"), resValue);

+    }

+

+

+    @Test

+    public void testDouble_abs() {

+

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2  = null;

+

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.5));

+

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

+        }

+

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_DOUBLE_ABS;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_ABS, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // test normal

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(1.5), resValue);

+

+        arguments.clear();

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(2.5), resValue);

+

+        arguments.clear();

+        arguments.add(attr0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(0), resValue);

+

+    }

+

+

+    @Test

+    public void testDouble_round() {

+

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2  = null;

+        FunctionArgumentAttributeValue attr3 = null;

+        FunctionArgumentAttributeValue attr4 = null;

+        FunctionArgumentAttributeValue attr5 = null;

+        FunctionArgumentAttributeValue attr6 = null;

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.49));

+            attr3 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.51));

+            attr4 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.5));

+            attr5 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.49));

+            attr6 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.51));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

+        }

+

+

+

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_ROUND;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ROUND, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // test normal

+        arguments.add(attr0);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(0), resValue);

+

+        arguments.clear();

+        arguments.add(attr1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(2), resValue);

+

+        arguments.clear();

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(1), resValue);

+

+        arguments.clear();

+        arguments.add(attr3);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(2), resValue);

+

+        arguments.clear();

+        arguments.add(attr4);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(-2), resValue);

+

+        arguments.clear();

+        arguments.add(attr5);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(-2), resValue);

+

+        arguments.clear();

+        arguments.add(attr6);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(-3), resValue);

+    }

+

+

+    @Test

+    public void testDouble_floor() {

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2  = null;

+        FunctionArgumentAttributeValue attr3 = null;

+        FunctionArgumentAttributeValue attr4 = null;

+        FunctionArgumentAttributeValue attr5 = null;

+        FunctionArgumentAttributeValue attr6 = null;

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(0));

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.5));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.49));

+            attr3 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.51));

+            attr4 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.5));

+            attr5 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.49));

+            attr6 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-2.51));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

+        }

+

+        FunctionDefinitionArithmetic<?> fd = (FunctionDefinitionArithmetic<?>) StdFunctions.FD_FLOOR;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_FLOOR, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // test normal

+        arguments.add(attr0);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(0), resValue);

+

+        arguments.clear();

+        arguments.add(attr1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(1), resValue);

+

+        arguments.clear();

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(1), resValue);

+

+        arguments.clear();

+        arguments.add(attr3);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(1), resValue);

+

+        arguments.clear();

+        arguments.add(attr4);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(-3), resValue);

+

+        arguments.clear();

+        arguments.add(attr5);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(-3), resValue);

+

+        arguments.clear();

+        arguments.add(attr6);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(-3), resValue);

+    }

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagIsInTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagIsInTest.java
index e5b1db7..504d311 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagIsInTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagIsInTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -42,180 +42,180 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionBagIsInTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        @Test

-        public void testString() {

-                String v1 = new String("abc");

-                String v2 = new String("def");

-                String notInBag = new String("lmnop");

-                String sameValueV1 = new String("abc");

-                Integer vOtherType = new Integer(11);

-                

-                

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrV2 = null;

-                FunctionArgumentAttributeValue attrNotInBag = null;

-                FunctionArgumentAttributeValue attrSameValueV1 = null;

-                FunctionArgumentAttributeValue attrOtherType = null;

-                try {

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrV2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v2));

-                        attrNotInBag = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(notInBag));

-                        attrSameValueV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(sameValueV1));

-                        attrOtherType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(vOtherType));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                Bag bag0 = new Bag();

-                Bag bag1 = new Bag();

-                        bag1.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));

-                Bag bag2 = new Bag();

-                        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1)); 

-                        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v2));;

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-                

-                

-                FunctionArgumentBag attrBag0 = new FunctionArgumentBag(bag0);

-                FunctionArgumentBag attrBag1 = new FunctionArgumentBag(bag1);

-                FunctionArgumentBag attrBag2 = new FunctionArgumentBag(bag2);

 

-                

-                

-                FunctionDefinitionBagIsIn<?> fd = (FunctionDefinitionBagIsIn<?>) StdFunctions.FD_STRING_IS_IN;

+    @Test

+    public void testString() {

+        String v1 = new String("abc");

+        String v2 = new String("def");

+        String notInBag = new String("lmnop");

+        String sameValueV1 = new String("abc");

+        Integer vOtherType = new Integer(11);

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_IS_IN, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

 

-                

-                // element is in bag

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBag2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // element not in bag

-                arguments.clear();

-                arguments.add(attrNotInBag);

-                arguments.add(attrBag2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // different element with the same value is in bag

-                arguments.clear();

-                arguments.add(attrSameValueV1);

-                arguments.add(attrBag2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // empty bag

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBag0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // missing arg

-                arguments.clear();

-                arguments.add(attrSameValueV1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-is-in Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 1st arg is bag

-                arguments.clear();

-                arguments.add(attrBag1);

-                arguments.add(attrBag2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-is-in Expected a simple value, saw a bag", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 2nd arg not bag

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrV2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-is-in Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // first arg null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBag2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-is-in Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 2nd arg null

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-is-in Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // first arg type does not match bag elements

-                arguments.clear();

-                arguments.add(attrOtherType);

-                arguments.add(attrBag2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-is-in Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag has mixed element types

-// behavior not specified for this case in spec.  It ASSUMES that all elements in bag are same type.

-                

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrV2 = null;

+        FunctionArgumentAttributeValue attrNotInBag = null;

+        FunctionArgumentAttributeValue attrSameValueV1 = null;

+        FunctionArgumentAttributeValue attrOtherType = null;

+        try {

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrV2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v2));

+            attrNotInBag = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(notInBag));

+            attrSameValueV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(sameValueV1));

+            attrOtherType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(vOtherType));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

 

-        

-        

-        //

-        //

-        //  REST OF DATA TYPES OMITTED 

-        //	because they "should" all work the same

-        //

-        //

-        

-        

-        

+        Bag bag0 = new Bag();

+        Bag bag1 = new Bag();

+        bag1.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));

+        Bag bag2 = new Bag();

+        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));

+        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v2));;

+

+

+

+        FunctionArgumentBag attrBag0 = new FunctionArgumentBag(bag0);

+        FunctionArgumentBag attrBag1 = new FunctionArgumentBag(bag1);

+        FunctionArgumentBag attrBag2 = new FunctionArgumentBag(bag2);

+

+

+

+        FunctionDefinitionBagIsIn<?> fd = (FunctionDefinitionBagIsIn<?>) StdFunctions.FD_STRING_IS_IN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_IS_IN, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // element is in bag

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBag2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // element not in bag

+        arguments.clear();

+        arguments.add(attrNotInBag);

+        arguments.add(attrBag2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // different element with the same value is in bag

+        arguments.clear();

+        arguments.add(attrSameValueV1);

+        arguments.add(attrBag2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // empty bag

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBag0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // missing arg

+        arguments.clear();

+        arguments.add(attrSameValueV1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-is-in Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 1st arg is bag

+        arguments.clear();

+        arguments.add(attrBag1);

+        arguments.add(attrBag2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-is-in Expected a simple value, saw a bag", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 2nd arg not bag

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrV2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-is-in Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // first arg null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBag2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-is-in Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 2nd arg null

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-is-in Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // first arg type does not match bag elements

+        arguments.clear();

+        arguments.add(attrOtherType);

+        arguments.add(attrBag2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-is-in Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag has mixed element types

+// behavior not specified for this case in spec.  It ASSUMES that all elements in bag are same type.

+

+    }

+

+

+

+

+    //

+    //

+    //  REST OF DATA TYPES OMITTED

+    //	because they "should" all work the same

+    //

+    //

+

+

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagOneAndOnlyTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagOneAndOnlyTest.java
index a39d6f0..e33c7b0 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagOneAndOnlyTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagOneAndOnlyTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -41,184 +41,184 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionBagOneAndOnlyTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        @Test

-        public void testString() {

-                String v1 = new String("abc");

-                String v2 = new String("def");

-                BigInteger vOtherType = BigInteger.valueOf(11);

-                

-                Bag bag0 = new Bag();

-                Bag bag1 = new Bag();

-                        bag1.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));  

-                Bag bag2 = new Bag();

-                        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));  

-                        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v2));

-                Bag bagOtherType = new Bag();

-                        bagOtherType.add(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), vOtherType));

-                

-                FunctionArgumentBag attrBag0 = new FunctionArgumentBag(bag0);

-                FunctionArgumentBag attrBag1 = new FunctionArgumentBag(bag1);

-                FunctionArgumentBag attrBag2 = new FunctionArgumentBag(bag2);

-                FunctionArgumentBag attrBagOtherType = new FunctionArgumentBag(bagOtherType);

-                

-                

-                FunctionDefinitionBagOneAndOnly<?> fd = (FunctionDefinitionBagOneAndOnly<?>) StdFunctions.FD_STRING_ONE_AND_ONLY;

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_ONE_AND_ONLY, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

 

-                

-                

-                

-                // bag with only one

-                arguments.clear();

-                arguments.add(attrBag1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                String resValue = (String)res.getValue().getValue();

-                assertEquals(v1, resValue);

-                

-                // null bag

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-one-and-only Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag with exactly one but of other type in it

-                arguments.clear();

-                arguments.add(attrBagOtherType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-one-and-only Element in bag of wrong type. Expected string got integer", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag with none

-                arguments.clear();

-                arguments.add(attrBag0);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-one-and-only Expected 1 but Bag has 0 elements", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag with multiple

-                arguments.clear();

-                arguments.add(attrBag2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-one-and-only Expected 1 but Bag has 2 elements", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        @Test

-        public void testBoolean() {

-                Boolean v1 = new Boolean(true);

-                Boolean v2 = new Boolean(false);

-                BigInteger vOtherType = BigInteger.valueOf(11);

-                

-                Bag bag0 = new Bag();

-                Bag bag1 = new Bag();

-                        bag1.add(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), v1));  

-                Bag bag2 = new Bag();

-                        bag2.add(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), v1));  

-                        bag2.add(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), v2)); 

-                Bag bagOtherType = new Bag();

-                        bagOtherType.add(new StdAttributeValue<BigInteger>(DataTypes.DT_STRING.getId(), vOtherType));  

+    @Test

+    public void testString() {

+        String v1 = new String("abc");

+        String v2 = new String("def");

+        BigInteger vOtherType = BigInteger.valueOf(11);

 

-                

-                FunctionArgumentBag attrBag0 = new FunctionArgumentBag(bag0);

-                FunctionArgumentBag attrBag1 = new FunctionArgumentBag(bag1);

-                FunctionArgumentBag attrBag2 = new FunctionArgumentBag(bag2);

-                FunctionArgumentBag attrBagOtherType = new FunctionArgumentBag(bagOtherType);

-                

-                

-                FunctionDefinitionBagOneAndOnly<?> fd = (FunctionDefinitionBagOneAndOnly<?>) StdFunctions.FD_BOOLEAN_ONE_AND_ONLY;

+        Bag bag0 = new Bag();

+        Bag bag1 = new Bag();

+        bag1.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));

+        Bag bag2 = new Bag();

+        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));

+        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v2));

+        Bag bagOtherType = new Bag();

+        bagOtherType.add(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), vOtherType));

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_BOOLEAN_ONE_AND_ONLY, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        FunctionArgumentBag attrBag0 = new FunctionArgumentBag(bag0);

+        FunctionArgumentBag attrBag1 = new FunctionArgumentBag(bag1);

+        FunctionArgumentBag attrBag2 = new FunctionArgumentBag(bag2);

+        FunctionArgumentBag attrBagOtherType = new FunctionArgumentBag(bagOtherType);

 

-                

-                

-                

-                // bag with only one

-                arguments.clear();

-                arguments.add(attrBag1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // null bag

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:boolean-one-and-only Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag with exactly one but of other type in it

-                arguments.clear();

-                arguments.add(attrBagOtherType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:boolean-one-and-only Element in bag of wrong type. Expected boolean got string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag with none

-                arguments.clear();

-                arguments.add(attrBag0);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:boolean-one-and-only Expected 1 but Bag has 0 elements", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag with multiple

-                arguments.clear();

-                arguments.add(attrBag2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:boolean-one-and-only Expected 1 but Bag has 2 elements", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        //

-        //

-        //  REST OF DATA TYPES OMITTED 

-        //	because they "should" all work the same

-        //

-        //

-        

-        

-        

+

+        FunctionDefinitionBagOneAndOnly<?> fd = (FunctionDefinitionBagOneAndOnly<?>) StdFunctions.FD_STRING_ONE_AND_ONLY;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_ONE_AND_ONLY, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+

+

+        // bag with only one

+        arguments.clear();

+        arguments.add(attrBag1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        String resValue = (String)res.getValue().getValue();

+        assertEquals(v1, resValue);

+

+        // null bag

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-one-and-only Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag with exactly one but of other type in it

+        arguments.clear();

+        arguments.add(attrBagOtherType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-one-and-only Element in bag of wrong type. Expected string got integer", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag with none

+        arguments.clear();

+        arguments.add(attrBag0);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-one-and-only Expected 1 but Bag has 0 elements", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag with multiple

+        arguments.clear();

+        arguments.add(attrBag2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-one-and-only Expected 1 but Bag has 2 elements", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+    @Test

+    public void testBoolean() {

+        Boolean v1 = new Boolean(true);

+        Boolean v2 = new Boolean(false);

+        BigInteger vOtherType = BigInteger.valueOf(11);

+

+        Bag bag0 = new Bag();

+        Bag bag1 = new Bag();

+        bag1.add(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), v1));

+        Bag bag2 = new Bag();

+        bag2.add(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), v1));

+        bag2.add(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), v2));

+        Bag bagOtherType = new Bag();

+        bagOtherType.add(new StdAttributeValue<BigInteger>(DataTypes.DT_STRING.getId(), vOtherType));

+

+

+        FunctionArgumentBag attrBag0 = new FunctionArgumentBag(bag0);

+        FunctionArgumentBag attrBag1 = new FunctionArgumentBag(bag1);

+        FunctionArgumentBag attrBag2 = new FunctionArgumentBag(bag2);

+        FunctionArgumentBag attrBagOtherType = new FunctionArgumentBag(bagOtherType);

+

+

+        FunctionDefinitionBagOneAndOnly<?> fd = (FunctionDefinitionBagOneAndOnly<?>) StdFunctions.FD_BOOLEAN_ONE_AND_ONLY;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_BOOLEAN_ONE_AND_ONLY, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+

+

+        // bag with only one

+        arguments.clear();

+        arguments.add(attrBag1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // null bag

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:boolean-one-and-only Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag with exactly one but of other type in it

+        arguments.clear();

+        arguments.add(attrBagOtherType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:boolean-one-and-only Element in bag of wrong type. Expected boolean got string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag with none

+        arguments.clear();

+        arguments.add(attrBag0);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:boolean-one-and-only Expected 1 but Bag has 0 elements", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag with multiple

+        arguments.clear();

+        arguments.add(attrBag2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:boolean-one-and-only Expected 1 but Bag has 2 elements", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+    //

+    //

+    //  REST OF DATA TYPES OMITTED

+    //	because they "should" all work the same

+    //

+    //

+

+

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagSizeTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagSizeTest.java
index 9091ccb..d8f7a20 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagSizeTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagSizeTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -41,118 +41,118 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionBagSizeTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        @Test

-        public void testString() {

-                String v1 = new String("abc");

-                String v2 = new String("def");

-                Integer vOtherType = new Integer(11);

-                

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-                

-                Bag bag0 = new Bag();

-                Bag bag1 = new Bag();

-                        bag1.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));  

-                Bag bag2 = new Bag();

-                        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));  

-                        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v2)); 

-                Bag bagOtherType = new Bag();

-                        bagOtherType.add(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), vOtherType));  

 

-                

-                FunctionArgumentBag attrBag0 = new FunctionArgumentBag(bag0);

-                FunctionArgumentBag attrBag1 = new FunctionArgumentBag(bag1);

-                FunctionArgumentBag attrBag2 = new FunctionArgumentBag(bag2);

-                FunctionArgumentBag attrBagOtherType = new FunctionArgumentBag(bagOtherType);

-                

-                

-                FunctionDefinitionBagSize<?> fd = (FunctionDefinitionBagSize<?>) StdFunctions.FD_STRING_BAG_SIZE;

+    @Test

+    public void testString() {

+        String v1 = new String("abc");

+        String v2 = new String("def");

+        Integer vOtherType = new Integer(11);

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_BAG_SIZE, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

 

-                

-                

-                

-                // bag with only one

-                arguments.clear();

-                arguments.add(attrBag1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(BigInteger.class, res.getValue().getValue().getClass());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(BigInteger.valueOf(1), resValue);

-                

-                // null bag

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-bag-size Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag with exactly one but of other type in it

-                arguments.clear();

-                arguments.add(attrBagOtherType);

-                res = fd.evaluate(null, arguments);

-                // NOTE: Size does not care about content type!

-                assertTrue(res.isOk());

-                assertEquals(BigInteger.class, res.getValue().getValue().getClass());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(BigInteger.valueOf(1), resValue);

-                

-                // bag with none

-                arguments.clear();

-                arguments.add(attrBag0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(BigInteger.class, res.getValue().getValue().getClass());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(BigInteger.valueOf(0), resValue);

-                

-                // bag with multiple

-                arguments.clear();

-                arguments.add(attrBag2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(BigInteger.class, res.getValue().getValue().getClass());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(BigInteger.valueOf(2), resValue);

-        }

-        

-        

 

-        

-        

-        

-        

-        //

-        //

-        //  REST OF DATA TYPES OMITTED 

-        //	because they "should" all work the same

-        //

-        //

-        

-        

-        

+        Bag bag0 = new Bag();

+        Bag bag1 = new Bag();

+        bag1.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));

+        Bag bag2 = new Bag();

+        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v1));

+        bag2.add(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), v2));

+        Bag bagOtherType = new Bag();

+        bagOtherType.add(new StdAttributeValue<Integer>(DataTypes.DT_INTEGER.getId(), vOtherType));

+

+

+        FunctionArgumentBag attrBag0 = new FunctionArgumentBag(bag0);

+        FunctionArgumentBag attrBag1 = new FunctionArgumentBag(bag1);

+        FunctionArgumentBag attrBag2 = new FunctionArgumentBag(bag2);

+        FunctionArgumentBag attrBagOtherType = new FunctionArgumentBag(bagOtherType);

+

+

+        FunctionDefinitionBagSize<?> fd = (FunctionDefinitionBagSize<?>) StdFunctions.FD_STRING_BAG_SIZE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_BAG_SIZE, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+

+

+        // bag with only one

+        arguments.clear();

+        arguments.add(attrBag1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(BigInteger.class, res.getValue().getValue().getClass());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(BigInteger.valueOf(1), resValue);

+

+        // null bag

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-bag-size Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag with exactly one but of other type in it

+        arguments.clear();

+        arguments.add(attrBagOtherType);

+        res = fd.evaluate(null, arguments);

+        // NOTE: Size does not care about content type!

+        assertTrue(res.isOk());

+        assertEquals(BigInteger.class, res.getValue().getValue().getClass());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(BigInteger.valueOf(1), resValue);

+

+        // bag with none

+        arguments.clear();

+        arguments.add(attrBag0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(BigInteger.class, res.getValue().getValue().getClass());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(BigInteger.valueOf(0), resValue);

+

+        // bag with multiple

+        arguments.clear();

+        arguments.add(attrBag2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(BigInteger.class, res.getValue().getValue().getClass());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(BigInteger.valueOf(2), resValue);

+    }

+

+

+

+

+

+

+

+    //

+    //

+    //  REST OF DATA TYPES OMITTED

+    //	because they "should" all work the same

+    //

+    //

+

+

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagTest.java
index 6d2b79e..ca9b8ab 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBagTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -44,504 +44,504 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionBagTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        FunctionArgumentAttributeValue attrInteger = null;

-        FunctionArgumentAttributeValue attrString = null;

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-        public FunctionDefinitionBagTest() {

-                try {

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1111111111));

-                        attrString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("a string value"));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

+

+    FunctionArgumentAttributeValue attrInteger = null;

+    FunctionArgumentAttributeValue attrString = null;

+

+    public FunctionDefinitionBagTest() {

+        try {

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1111111111));

+            attrString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("a string value"));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

         }

-        

-        @Test

-        public void testString() {

+    }

 

-                String s1 = "abc";

-                String s2 = "def";

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(s1));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(s2));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionBag<?> fd = (FunctionDefinitionBag<?>) StdFunctions.FD_STRING_BAG;

+    @Test

+    public void testString() {

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_BAG, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertTrue(fd.returnsBag());

-

-                // bag with only one

-                arguments.clear();

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Bag bag = res.getBag();

-                assertNotNull(bag);

-                Iterator<AttributeValue<?>> it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                AttributeValue<?> attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                

-                // zero args => empty bag

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                assertEquals(0, bag.size());

-

-                

-                // null argument

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-bag Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // argument of other type

-                arguments.clear();

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-bag Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 2 args (check response is correct)

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(2, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s2, attrValueObject.getValue());

-                

-                // duplicate args (verify return)

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                arguments.add(attr1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s2, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                

-                // lots of args

-                arguments.clear();

-                for (int i = 0; i < 1000; i++) {

-                        arguments.add(attr1);

-                }

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1000, bag.size());

-                

+        String s1 = "abc";

+        String s2 = "def";

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(s1));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(s2));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

         }

-        

 

-        @Test

-        public void testBoolean() {

+        FunctionDefinitionBag<?> fd = (FunctionDefinitionBag<?>) StdFunctions.FD_STRING_BAG;

 

-                Boolean s1 = true;

-                Boolean s2 = false;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(s1));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(s2));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionBag<?> fd = (FunctionDefinitionBag<?>) StdFunctions.FD_BOOLEAN_BAG;

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_BAG, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_BOOLEAN_BAG, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertTrue(fd.returnsBag());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertTrue(fd.returnsBag());

 

-                // bag with only one

-                arguments.clear();

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Bag bag = res.getBag();

-                assertNotNull(bag);

-                Iterator<AttributeValue<?>> it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                AttributeValue<?> attrValueObject = it.next();

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                

-                // zero args => empty bag

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                assertEquals(0, bag.size());

+        // bag with only one

+        arguments.clear();

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Bag bag = res.getBag();

+        assertNotNull(bag);

+        Iterator<AttributeValue<?>> it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        AttributeValue<?> attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

 

-                

-                // null argument

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:boolean-bag Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // argument of other type

-                arguments.clear();

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:boolean-bag Expected data type 'boolean' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 2 args (check response is correct)

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(2, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s2, attrValueObject.getValue());

-                

-                // duplicate args (verify return)

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                arguments.add(attr1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s2, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                

-                // lots of args

-                arguments.clear();

-                for (int i = 0; i < 1000; i++) {

-                        arguments.add(attr1);

-                }

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1000, bag.size());

-                

+        // zero args => empty bag

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        assertEquals(0, bag.size());

+

+

+        // null argument

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-bag Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // argument of other type

+        arguments.clear();

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-bag Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 2 args (check response is correct)

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(2, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s2, attrValueObject.getValue());

+

+        // duplicate args (verify return)

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        arguments.add(attr1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s2, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+

+        // lots of args

+        arguments.clear();

+        for (int i = 0; i < 1000; i++) {

+            arguments.add(attr1);

         }

-        

-        

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1000, bag.size());

 

-        @Test

-        public void testInteger() {

+    }

 

-                BigInteger s1 = new BigInteger("123");

-                BigInteger s2 = new BigInteger("456");

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(s1));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(s2));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionBag<?> fd = (FunctionDefinitionBag<?>) StdFunctions.FD_INTEGER_BAG;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_BAG, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertTrue(fd.returnsBag());

+    @Test

+    public void testBoolean() {

 

-                // bag with only one

-                arguments.clear();

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Bag bag = res.getBag();

-                assertNotNull(bag);

-                Iterator<AttributeValue<?>> it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                AttributeValue<?> attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                

-                // zero args => empty bag

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                assertEquals(0, bag.size());

-

-                

-                // null argument

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-bag Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // argument of other type

-                arguments.clear();

-                arguments.add(attrString);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-bag Expected data type 'integer' saw 'string'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 2 args (check response is correct)

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(2, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s2, attrValueObject.getValue());

-                

-                // duplicate args (verify return)

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                arguments.add(attr1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s2, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                

-                // lots of args

-                arguments.clear();

-                for (int i = 0; i < 1000; i++) {

-                        arguments.add(attr1);

-                }

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1000, bag.size());

-                

+        Boolean s1 = true;

+        Boolean s2 = false;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(s1));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(s2));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

         }

-        

-        

-        

 

-        @Test

-        public void testDouble() {

+        FunctionDefinitionBag<?> fd = (FunctionDefinitionBag<?>) StdFunctions.FD_BOOLEAN_BAG;

 

-                Double s1 = 123.45;

-                Double s2 = 678.901;

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(s1));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(s2));

-                } catch (Exception e) {

-                        fail("creating attributes e="+e);

-                }

-                

-                FunctionDefinitionBag<?> fd = (FunctionDefinitionBag<?>) StdFunctions.FD_DOUBLE_BAG;

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_BOOLEAN_BAG, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_BAG, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertTrue(fd.returnsBag());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertTrue(fd.returnsBag());

 

-                // bag with only one

-                arguments.clear();

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Bag bag = res.getBag();

-                assertNotNull(bag);

-                Iterator<AttributeValue<?>> it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                AttributeValue<?> attrValueObject = it.next();

-                assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                

-                // zero args => empty bag

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                assertEquals(0, bag.size());

+        // bag with only one

+        arguments.clear();

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Bag bag = res.getBag();

+        assertNotNull(bag);

+        Iterator<AttributeValue<?>> it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        AttributeValue<?> attrValueObject = it.next();

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

 

-                

-                // null argument

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:double-bag Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // argument of other type

-                arguments.clear();

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:double-bag Expected data type 'double' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 2 args (check response is correct)

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(2, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s2, attrValueObject.getValue());

-                

-                // duplicate args (verify return)

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                arguments.add(attr1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s2, attrValueObject.getValue());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

-                assertEquals(s1, attrValueObject.getValue());

-                

-                // lots of args

-                arguments.clear();

-                for (int i = 0; i < 1000; i++) {

-                        arguments.add(attr1);

-                }

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1000, bag.size());

-                

+        // zero args => empty bag

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        assertEquals(0, bag.size());

+

+

+        // null argument

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:boolean-bag Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // argument of other type

+        arguments.clear();

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:boolean-bag Expected data type 'boolean' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 2 args (check response is correct)

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(2, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s2, attrValueObject.getValue());

+

+        // duplicate args (verify return)

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        arguments.add(attr1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s2, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+

+        // lots of args

+        arguments.clear();

+        for (int i = 0; i < 1000; i++) {

+            arguments.add(attr1);

         }

-        

-        

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1000, bag.size());

 

-        

-        

-        //

-        //

-        //  REST OF DATA TYPES OMITTED 

-        //	because they "should" all work the same

-        //

-        //

-        

-        

-        

+    }

+

+

+

+    @Test

+    public void testInteger() {

+

+        BigInteger s1 = new BigInteger("123");

+        BigInteger s2 = new BigInteger("456");

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(s1));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(s2));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

+        }

+

+        FunctionDefinitionBag<?> fd = (FunctionDefinitionBag<?>) StdFunctions.FD_INTEGER_BAG;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_BAG, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertTrue(fd.returnsBag());

+

+        // bag with only one

+        arguments.clear();

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Bag bag = res.getBag();

+        assertNotNull(bag);

+        Iterator<AttributeValue<?>> it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        AttributeValue<?> attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+

+        // zero args => empty bag

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        assertEquals(0, bag.size());

+

+

+        // null argument

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-bag Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // argument of other type

+        arguments.clear();

+        arguments.add(attrString);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-bag Expected data type 'integer' saw 'string'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 2 args (check response is correct)

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(2, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s2, attrValueObject.getValue());

+

+        // duplicate args (verify return)

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        arguments.add(attr1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s2, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+

+        // lots of args

+        arguments.clear();

+        for (int i = 0; i < 1000; i++) {

+            arguments.add(attr1);

+        }

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1000, bag.size());

+

+    }

+

+

+

+

+    @Test

+    public void testDouble() {

+

+        Double s1 = 123.45;

+        Double s2 = 678.901;

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(s1));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(s2));

+        } catch (Exception e) {

+            fail("creating attributes e="+e);

+        }

+

+        FunctionDefinitionBag<?> fd = (FunctionDefinitionBag<?>) StdFunctions.FD_DOUBLE_BAG;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_BAG, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertTrue(fd.returnsBag());

+

+        // bag with only one

+        arguments.clear();

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Bag bag = res.getBag();

+        assertNotNull(bag);

+        Iterator<AttributeValue<?>> it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        AttributeValue<?> attrValueObject = it.next();

+        assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+

+        // zero args => empty bag

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        assertEquals(0, bag.size());

+

+

+        // null argument

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:double-bag Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // argument of other type

+        arguments.clear();

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:double-bag Expected data type 'double' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 2 args (check response is correct)

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(2, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s2, attrValueObject.getValue());

+

+        // duplicate args (verify return)

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        arguments.add(attr1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s2, attrValueObject.getValue());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_DOUBLE.getId(), attrValueObject.getDataTypeId());

+        assertEquals(s1, attrValueObject.getValue());

+

+        // lots of args

+        arguments.clear();

+        for (int i = 0; i < 1000; i++) {

+            arguments.add(attr1);

+        }

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1000, bag.size());

+

+    }

+

+

+

+

+

+    //

+    //

+    //  REST OF DATA TYPES OMITTED

+    //	because they "should" all work the same

+    //

+    //

+

+

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBaseTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBaseTest.java
index 1061be8..680878f 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBaseTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionBaseTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -45,97 +45,97 @@
 /**

  * Test functions in the abstract FunctionDefinitionSimpleTest class.

  * Functions are tested by creating instances of other classes that should have appropriate properties to verify all variations of the responses expected.

- * 

+ *

  * Note: we do not test getDataTypeId() because all it does is get the String out of the Identity object and we assume that the Data Type Identity objects

  * are tested enough in everything else that any errors in them will be found and fixed quickly.

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionBaseTest {

-        /**

-         * getId() is pretty trivial, so verifying one should be enough to check that the mechanism is working ok

-         */

-        @Test

-        public void testGetId() {

-                FunctionDefinition fd = StdFunctions.FD_STRING_EQUAL;

-                Identifier id = fd.getId();

-                assertTrue(XACML3.ID_FUNCTION_STRING_EQUAL.stringValue().equals(id.stringValue()) );

-        }

+    /**

+     * getId() is pretty trivial, so verifying one should be enough to check that the mechanism is working ok

+     */

+    @Test

+    public void testGetId() {

+        FunctionDefinition fd = StdFunctions.FD_STRING_EQUAL;

+        Identifier id = fd.getId();

+        assertTrue(XACML3.ID_FUNCTION_STRING_EQUAL.stringValue().equals(id.stringValue()) );

+    }

 

-        /**

-         * check an instance of every result type that we can deal with

-         */	

-        @Test

-        public void testGetDataType() {

-                

+    /**

+     * check an instance of every result type that we can deal with

+     */

+    @Test

+    public void testGetDataType() {

+

 //?? Need functions that return each of these data types except for Boolean which is returned by any of the EQUAL functions

-                FunctionDefinition fdstring = StdFunctions.FD_STRING_NORMALIZE_SPACE;

-                assertEquals(XACML3.ID_DATATYPE_STRING, fdstring.getDataTypeId());

+        FunctionDefinition fdstring = StdFunctions.FD_STRING_NORMALIZE_SPACE;

+        assertEquals(XACML3.ID_DATATYPE_STRING, fdstring.getDataTypeId());

 

-                FunctionDefinition fdboolean = StdFunctions.FD_STRING_EQUAL;

-                assertEquals(XACML3.ID_DATATYPE_BOOLEAN, fdboolean.getDataTypeId());

-                

-                FunctionDefinition fdinteger = StdFunctions.FD_INTEGER_ADD;

-                assertEquals(XACML3.ID_DATATYPE_INTEGER, fdinteger.getDataTypeId());

+        FunctionDefinition fdboolean = StdFunctions.FD_STRING_EQUAL;

+        assertEquals(XACML3.ID_DATATYPE_BOOLEAN, fdboolean.getDataTypeId());

 

-                FunctionDefinition fddouble = StdFunctions.FD_DOUBLE_ADD;

-                assertEquals(XACML3.ID_DATATYPE_DOUBLE, fddouble.getDataTypeId());

+        FunctionDefinition fdinteger = StdFunctions.FD_INTEGER_ADD;

+        assertEquals(XACML3.ID_DATATYPE_INTEGER, fdinteger.getDataTypeId());

 

-                FunctionDefinition fddate = StdFunctions.FD_DATE_BAG;

-                assertEquals(XACML3.ID_DATATYPE_DATE, fddate.getDataTypeId());

+        FunctionDefinition fddouble = StdFunctions.FD_DOUBLE_ADD;

+        assertEquals(XACML3.ID_DATATYPE_DOUBLE, fddouble.getDataTypeId());

 

-                FunctionDefinition fdtime = StdFunctions.FD_TIME_BAG;

-                assertEquals(XACML3.ID_DATATYPE_TIME, fdtime.getDataTypeId());

+        FunctionDefinition fddate = StdFunctions.FD_DATE_BAG;

+        assertEquals(XACML3.ID_DATATYPE_DATE, fddate.getDataTypeId());

 

-                FunctionDefinition fddateTime = StdFunctions.FD_DATETIME_BAG;

-                assertEquals(XACML3.ID_DATATYPE_DATETIME, fddateTime.getDataTypeId());

+        FunctionDefinition fdtime = StdFunctions.FD_TIME_BAG;

+        assertEquals(XACML3.ID_DATATYPE_TIME, fdtime.getDataTypeId());

 

-                FunctionDefinition fddayTimeDuration = StdFunctions.FD_DAYTIMEDURATION_FROM_STRING;

-                assertEquals(XACML3.ID_DATATYPE_DAYTIMEDURATION, fddayTimeDuration.getDataTypeId());

+        FunctionDefinition fddateTime = StdFunctions.FD_DATETIME_BAG;

+        assertEquals(XACML3.ID_DATATYPE_DATETIME, fddateTime.getDataTypeId());

 

-                FunctionDefinition fdyearMonthDuration = StdFunctions.FD_YEARMONTHDURATION_FROM_STRING;

-                assertEquals(XACML3.ID_DATATYPE_YEARMONTHDURATION, fdyearMonthDuration.getDataTypeId());

+        FunctionDefinition fddayTimeDuration = StdFunctions.FD_DAYTIMEDURATION_FROM_STRING;

+        assertEquals(XACML3.ID_DATATYPE_DAYTIMEDURATION, fddayTimeDuration.getDataTypeId());

 

-                FunctionDefinition fdanyURI = StdFunctions.FD_ANYURI_FROM_STRING;

-                assertEquals(XACML3.ID_DATATYPE_ANYURI, fdanyURI.getDataTypeId());

+        FunctionDefinition fdyearMonthDuration = StdFunctions.FD_YEARMONTHDURATION_FROM_STRING;

+        assertEquals(XACML3.ID_DATATYPE_YEARMONTHDURATION, fdyearMonthDuration.getDataTypeId());

 

-                FunctionDefinition fdhexBinary = StdFunctions.FD_HEXBINARY_UNION;

-                assertEquals(XACML3.ID_DATATYPE_HEXBINARY, fdhexBinary.getDataTypeId());

+        FunctionDefinition fdanyURI = StdFunctions.FD_ANYURI_FROM_STRING;

+        assertEquals(XACML3.ID_DATATYPE_ANYURI, fdanyURI.getDataTypeId());

 

-                FunctionDefinition fdbase64Binary = StdFunctions.FD_BASE64BINARY_UNION;

-                assertEquals(XACML3.ID_DATATYPE_BASE64BINARY, fdbase64Binary.getDataTypeId());

+        FunctionDefinition fdhexBinary = StdFunctions.FD_HEXBINARY_UNION;

+        assertEquals(XACML3.ID_DATATYPE_HEXBINARY, fdhexBinary.getDataTypeId());

 

-                FunctionDefinition fdrfc822Name = StdFunctions.FD_RFC822NAME_FROM_STRING;

-                assertEquals(XACML3.ID_DATATYPE_RFC822NAME, fdrfc822Name.getDataTypeId());

+        FunctionDefinition fdbase64Binary = StdFunctions.FD_BASE64BINARY_UNION;

+        assertEquals(XACML3.ID_DATATYPE_BASE64BINARY, fdbase64Binary.getDataTypeId());

 

-                FunctionDefinition fdx500Name = StdFunctions.FD_X500NAME_FROM_STRING;

-                assertEquals(XACML3.ID_DATATYPE_X500NAME, fdx500Name.getDataTypeId());

+        FunctionDefinition fdrfc822Name = StdFunctions.FD_RFC822NAME_FROM_STRING;

+        assertEquals(XACML3.ID_DATATYPE_RFC822NAME, fdrfc822Name.getDataTypeId());

+

+        FunctionDefinition fdx500Name = StdFunctions.FD_X500NAME_FROM_STRING;

+        assertEquals(XACML3.ID_DATATYPE_X500NAME, fdx500Name.getDataTypeId());

 

 //TODO - There are currently no functions that return XPathExpression objects

 //		FunctionDefinition fdxpathExpression = StdFunctions.FD_XPATHEXPRESSION_FROM_STRING;

 //		assertEquals(XACML3.ID_DATATYPE_XPATHEXPRESSION, fdxpathExpression.getDataTypeId());

 

-                FunctionDefinition fdipAddress = StdFunctions.FD_IPADDRESS_FROM_STRING;

-                assertEquals(XACML3.ID_DATATYPE_IPADDRESS, fdipAddress.getDataTypeId());

+        FunctionDefinition fdipAddress = StdFunctions.FD_IPADDRESS_FROM_STRING;

+        assertEquals(XACML3.ID_DATATYPE_IPADDRESS, fdipAddress.getDataTypeId());

 

-                FunctionDefinition fddnsName = StdFunctions.FD_DNSNAME_FROM_STRING;

-                assertEquals(XACML3.ID_DATATYPE_DNSNAME, fddnsName.getDataTypeId());

-        }

-        

-        /**

-         * check the type of return, single vs multiple values

-         */

-        @Test

-        public void testReturnsBag() {

-                FunctionDefinition fdNotBag = StdFunctions.FD_BOOLEAN_EQUAL;

-                assertFalse(fdNotBag.returnsBag());

-                

-                FunctionDefinitionBag<?> fdBag = (FunctionDefinitionBag<?>) StdFunctions.FD_STRING_BAG;

-                assertTrue(fdBag.returnsBag());

-        }

-        

+        FunctionDefinition fddnsName = StdFunctions.FD_DNSNAME_FROM_STRING;

+        assertEquals(XACML3.ID_DATATYPE_DNSNAME, fddnsName.getDataTypeId());

+    }

+

+    /**

+     * check the type of return, single vs multiple values

+     */

+    @Test

+    public void testReturnsBag() {

+        FunctionDefinition fdNotBag = StdFunctions.FD_BOOLEAN_EQUAL;

+        assertFalse(fdNotBag.returnsBag());

+

+        FunctionDefinitionBag<?> fdBag = (FunctionDefinitionBag<?>) StdFunctions.FD_STRING_BAG;

+        assertTrue(fdBag.returnsBag());

+    }

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionComparisonTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionComparisonTest.java
index 171c80c..0edef32 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionComparisonTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionComparisonTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -54,1322 +54,1322 @@
 

 /**

  * Test FunctionDefinitionComparison

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionComparisonTest {

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        FunctionArgumentAttributeValue stringAttr1 = null;

-        FunctionArgumentAttributeValue stringAttr1a = null;

-        FunctionArgumentAttributeValue stringAttr2 = null;

-        FunctionArgumentAttributeValue stringAttrNeg1 = null;

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

+

+    FunctionArgumentAttributeValue stringAttr1 = null;

+    FunctionArgumentAttributeValue stringAttr1a = null;

+    FunctionArgumentAttributeValue stringAttr2 = null;

+    FunctionArgumentAttributeValue stringAttrNeg1 = null;

 

 

-        FunctionArgumentAttributeValue intAttr1 = null;

-        FunctionArgumentAttributeValue intAttr1a = null;

-        FunctionArgumentAttributeValue intAttr2 = null;

-        FunctionArgumentAttributeValue intAttr0 = null;

-        FunctionArgumentAttributeValue intAttrNeg1 = null;

-        

-        FunctionArgumentAttributeValue attr1 = null;

-        FunctionArgumentAttributeValue attr1a = null;

-        FunctionArgumentAttributeValue attr2 = null;

-        FunctionArgumentAttributeValue attrNeg1 = null;

-        

-        FunctionArgumentAttributeValue attrDateToday = null;

-        FunctionArgumentAttributeValue attrDateSameDay = null;

-        FunctionArgumentAttributeValue attrDateTommorrow = null;

-        FunctionArgumentAttributeValue attrDateYesterday = null;

-        FunctionArgumentAttributeValue attrDateWithTimeZone = null;

-        FunctionArgumentAttributeValue attrDateNoTimeZone = null;

+    FunctionArgumentAttributeValue intAttr1 = null;

+    FunctionArgumentAttributeValue intAttr1a = null;

+    FunctionArgumentAttributeValue intAttr2 = null;

+    FunctionArgumentAttributeValue intAttr0 = null;

+    FunctionArgumentAttributeValue intAttrNeg1 = null;

 

-        

-        FunctionArgumentAttributeValue attrTimeToday = null;

-        FunctionArgumentAttributeValue attrTimeSameDay = null;

-        FunctionArgumentAttributeValue attrTimeTommorrow = null;

-        FunctionArgumentAttributeValue attrTimeYesterday = null;

-        FunctionArgumentAttributeValue attrTimeWithTimeZone = null;

-        FunctionArgumentAttributeValue attrTimeNoTimeZone = null;

-        

-        FunctionArgumentAttributeValue attrDateTimeToday = null;

-        FunctionArgumentAttributeValue attrDateTimeSameDay = null;

-        FunctionArgumentAttributeValue attrDateTimeTommorrow = null;

-        FunctionArgumentAttributeValue attrDateTimeYesterday = null;

-        FunctionArgumentAttributeValue attrDateTimeWithTimeZone = null;

-        FunctionArgumentAttributeValue attrDateTimeNoTimeZone = null;

-        

-        /**

-         * Set up some common variables on startup

-         */

-        public FunctionDefinitionComparisonTest() {

+    FunctionArgumentAttributeValue attr1 = null;

+    FunctionArgumentAttributeValue attr1a = null;

+    FunctionArgumentAttributeValue attr2 = null;

+    FunctionArgumentAttributeValue attrNeg1 = null;

+

+    FunctionArgumentAttributeValue attrDateToday = null;

+    FunctionArgumentAttributeValue attrDateSameDay = null;

+    FunctionArgumentAttributeValue attrDateTommorrow = null;

+    FunctionArgumentAttributeValue attrDateYesterday = null;

+    FunctionArgumentAttributeValue attrDateWithTimeZone = null;

+    FunctionArgumentAttributeValue attrDateNoTimeZone = null;

+

+

+    FunctionArgumentAttributeValue attrTimeToday = null;

+    FunctionArgumentAttributeValue attrTimeSameDay = null;

+    FunctionArgumentAttributeValue attrTimeTommorrow = null;

+    FunctionArgumentAttributeValue attrTimeYesterday = null;

+    FunctionArgumentAttributeValue attrTimeWithTimeZone = null;

+    FunctionArgumentAttributeValue attrTimeNoTimeZone = null;

+

+    FunctionArgumentAttributeValue attrDateTimeToday = null;

+    FunctionArgumentAttributeValue attrDateTimeSameDay = null;

+    FunctionArgumentAttributeValue attrDateTimeTommorrow = null;

+    FunctionArgumentAttributeValue attrDateTimeYesterday = null;

+    FunctionArgumentAttributeValue attrDateTimeWithTimeZone = null;

+    FunctionArgumentAttributeValue attrDateTimeNoTimeZone = null;

+

+    /**

+     * Set up some common variables on startup

+     */

+    public FunctionDefinitionComparisonTest() {

         try {

-                stringAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

-                stringAttr1a = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

-                stringAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("def"));

-                stringAttrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("AAA"));

+            stringAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

+            stringAttr1a = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

+            stringAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("def"));

+            stringAttrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("AAA"));

 

 

-                intAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                intAttr1a = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                intAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

-                intAttr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                intAttrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-1));

-                

-                attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.0));

-                attr1a = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.0));

-                attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.4));

-                attrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-1.0));

-                

-                // create dates

-                Calendar calendar = Calendar.getInstance();

-                Date today = calendar.getTime();

-                Date longAgo = new Date(1234);

-                // create a date that is different than "today" but within the same day (i.e. has a different hour)

-                if (calendar.get(Calendar.HOUR_OF_DAY) > 3) {

-                        calendar.set(Calendar.HOUR_OF_DAY, 3);

-                } else {

-                        calendar.set(Calendar.HOUR_OF_DAY, 5);

-                }

-                Date todayPlus = calendar.getTime();

-                calendar.add(Calendar.DATE, 1);

-                Date tommorrow = calendar.getTime();

-                attrDateToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(today));

-                attrDateSameDay = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(todayPlus));

-                attrDateTommorrow = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(tommorrow));

-                attrDateYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(longAgo));

-                ISO8601Date isoDate = new ISO8601Date(1920, 5, 8);

-                attrDateNoTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(isoDate));

-                isoDate = new ISO8601Date("GMT+00:02", 1920, 5, 8);

-                attrDateWithTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(isoDate));

-                

-                // create Times

-                ISO8601Time isoTime = new ISO8601Time(14, 43, 12, 145);

-                attrTimeToday = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

-                attrTimeSameDay = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

-                isoTime = new ISO8601Time(18, 53, 34, 423);

-                attrTimeTommorrow = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

-                isoTime = new ISO8601Time(7, 34, 6,543);

-                attrTimeYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

-                isoTime = new ISO8601Time(12, 12, 12, 12);

-                attrTimeNoTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

-                isoTime = new ISO8601Time("GMT:+00:03", 12, 12, 12, 12);

-                attrTimeWithTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

-                

-                // create DateTimes

-                isoDate = new ISO8601Date(1920, 5, 8);

-                isoTime = new ISO8601Time( 18, 53, 34, 423);

-                ISO8601DateTime isoDateTime = new ISO8601DateTime((String)null, 1920, 5, 8, 18, 53, 34, 423);

-                attrDateTimeToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

-                attrDateTimeSameDay = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

-                isoTime = new ISO8601Time(20, 53, 34, 423);

-                isoDateTime = new ISO8601DateTime((String)null, 1920, 5, 8, 20, 53, 34, 423);

-                attrDateTimeTommorrow = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

-                isoTime = new ISO8601Time(7, 34, 6,543);

-                isoDateTime = new ISO8601DateTime((String)null, 1920, 5, 8, 7, 34, 6, 543);

-                attrDateTimeYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

-                isoTime = new ISO8601Time(12, 12, 12, 12);

-                isoDateTime = new ISO8601DateTime((String)null, 1920, 5, 8, 12, 12, 12, 12);

-                attrDateTimeNoTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

-                isoTime = new ISO8601Time("GMT:+00:03", 12, 12, 12, 12);

-                isoDate = new ISO8601Date("GMT:+00:03", 1920, 5, 8);

-                isoDateTime = new ISO8601DateTime("GMT:+00:03", 1920, 5, 8, 12, 12, 12, 12);

-                attrDateTimeWithTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

-                

-                

-                

-                

+            intAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+            intAttr1a = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+            intAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

+            intAttr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            intAttrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-1));

+

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.0));

+            attr1a = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.0));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.4));

+            attrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-1.0));

+

+            // create dates

+            Calendar calendar = Calendar.getInstance();

+            Date today = calendar.getTime();

+            Date longAgo = new Date(1234);

+            // create a date that is different than "today" but within the same day (i.e. has a different hour)

+            if (calendar.get(Calendar.HOUR_OF_DAY) > 3) {

+                calendar.set(Calendar.HOUR_OF_DAY, 3);

+            } else {

+                calendar.set(Calendar.HOUR_OF_DAY, 5);

+            }

+            Date todayPlus = calendar.getTime();

+            calendar.add(Calendar.DATE, 1);

+            Date tommorrow = calendar.getTime();

+            attrDateToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(today));

+            attrDateSameDay = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(todayPlus));

+            attrDateTommorrow = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(tommorrow));

+            attrDateYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(longAgo));

+            ISO8601Date isoDate = new ISO8601Date(1920, 5, 8);

+            attrDateNoTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(isoDate));

+            isoDate = new ISO8601Date("GMT+00:02", 1920, 5, 8);

+            attrDateWithTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(isoDate));

+

+            // create Times

+            ISO8601Time isoTime = new ISO8601Time(14, 43, 12, 145);

+            attrTimeToday = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

+            attrTimeSameDay = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

+            isoTime = new ISO8601Time(18, 53, 34, 423);

+            attrTimeTommorrow = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

+            isoTime = new ISO8601Time(7, 34, 6,543);

+            attrTimeYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

+            isoTime = new ISO8601Time(12, 12, 12, 12);

+            attrTimeNoTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

+            isoTime = new ISO8601Time("GMT:+00:03", 12, 12, 12, 12);

+            attrTimeWithTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(isoTime));

+

+            // create DateTimes

+            isoDate = new ISO8601Date(1920, 5, 8);

+            isoTime = new ISO8601Time( 18, 53, 34, 423);

+            ISO8601DateTime isoDateTime = new ISO8601DateTime((String)null, 1920, 5, 8, 18, 53, 34, 423);

+            attrDateTimeToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

+            attrDateTimeSameDay = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

+            isoTime = new ISO8601Time(20, 53, 34, 423);

+            isoDateTime = new ISO8601DateTime((String)null, 1920, 5, 8, 20, 53, 34, 423);

+            attrDateTimeTommorrow = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

+            isoTime = new ISO8601Time(7, 34, 6,543);

+            isoDateTime = new ISO8601DateTime((String)null, 1920, 5, 8, 7, 34, 6, 543);

+            attrDateTimeYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

+            isoTime = new ISO8601Time(12, 12, 12, 12);

+            isoDateTime = new ISO8601DateTime((String)null, 1920, 5, 8, 12, 12, 12, 12);

+            attrDateTimeNoTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

+            isoTime = new ISO8601Time("GMT:+00:03", 12, 12, 12, 12);

+            isoDate = new ISO8601Date("GMT:+00:03", 1920, 5, 8);

+            isoDateTime = new ISO8601DateTime("GMT:+00:03", 1920, 5, 8, 12, 12, 12, 12);

+            attrDateTimeWithTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(isoDateTime));

+

+

+

+

         } catch (Exception e) {

-                fail("Error creating values e="+ e);

+            fail("Error creating values e="+ e);

         }

-        }

-        

-        /**

-         * String

-         */

-        @Test

-        public void testString_GT() {

-                

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_STRING_GREATER_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_GREATER_THAN, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+    }

 

-                // check first < second

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+    /**

+     * String

+     */

+    @Test

+    public void testString_GT() {

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(stringAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-        }

-        

-        @Test

-        public void testString_GTE() {

-                

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_STRING_GREATER_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_STRING_GREATER_THAN;

 

-                // check first < second

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-        }

-        

-        @Test

-        public void testString_LT() {

-                

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_STRING_LESS_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_LESS_THAN, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_GREATER_THAN, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

 

-                // check first < second

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        @Test

-        public void testString_LTE() {

-                

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_STRING_LESS_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                // check first < second

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

+        // first == second

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-        

-        

-        /**

-         * Integer

-         */

-        @Test

-        public void testInteger_GT() {

-                

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_INTEGER_GREATER_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_GREATER_THAN, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(intAttr1);

-                arguments.add(intAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // check first < second

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                // check first < second

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // first > second

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-        }

-        

-        @Test

-        public void testInteger_GTE() {

-                

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_INTEGER_GREATER_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(intAttr1);

-                arguments.add(intAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(stringAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+    }

 

-                // check first < second

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-        }

-        

-        @Test

-        public void testInteger_LT() {

-                

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_INTEGER_LESS_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_LESS_THAN, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(intAttr1);

-                arguments.add(intAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+    @Test

+    public void testString_GTE() {

 

-                // check first < second

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        @Test

-        public void testInteger_LTE() {

-                

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_INTEGER_LESS_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(intAttr1);

-                arguments.add(intAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_STRING_GREATER_THAN_OR_EQUAL;

 

-                // check first < second

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        

-        

-        

-        /**

-         * Double

-         */

-        @Test

-        public void testDouble_GT() {

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DOUBLE_GREATER_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_GREATER_THAN, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attr1);

-                arguments.add(attr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                // first < second

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // first == second

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // check first < second

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-        }

-        

-        @Test

-        public void testDouble_GTE() {

+        // first > second

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+    }

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DOUBLE_GREATER_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attr1);

-                arguments.add(attr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+    @Test

+    public void testString_LT() {

 

-                // first < second

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-        }

-        

-        @Test

-        public void testDouble_LT() {

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_STRING_LESS_THAN;

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DOUBLE_LESS_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_LESS_THAN, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attr1);

-                arguments.add(attr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_LESS_THAN, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

 

-                // first < second

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        @Test

-        public void testDouble_LTE() {

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DOUBLE_LESS_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attr1);

-                arguments.add(attr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // first == second

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                // first < second

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

+        // check first < second

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-        

-        

-        /**

-         * Date

-         */

-        

-        @Test

-        public void testDate_GT() {

+        // first > second

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATE_GREATER_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATE_GREATER_THAN, fd.getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrDateToday);

-                arguments.add(attrDateSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+    @Test

+    public void testString_LTE() {

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrDateToday);

-                arguments.add(attrDateTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrDateToday);

-                arguments.add(attrDateYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_STRING_LESS_THAN_OR_EQUAL;

 

-                // test bad args data types?  One with TimeZone and one without

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

 

-                // test with TimeZone vs without

-                arguments.clear();

-                arguments.add(attrDateWithTimeZone);

-                arguments.add(attrDateNoTimeZone);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-greater-than Cannot compare this ISO8601DateTime with non-time-zoned ISO8601DateTime", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-        }

+        // first == second

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-        @Test

-        public void testDate_GTE() {

+        // check first < second

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATE_GREATER_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrDateToday);

-                arguments.add(attrDateSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // first > second

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrDateToday);

-                arguments.add(attrDateTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrDateToday);

-                arguments.add(attrDateYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-        }

-        

-        @Test

-        public void testDate_LT() {

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATE_LESS_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATE_LESS_THAN, fd.getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrDateToday);

-                arguments.add(attrDateSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrDateToday);

-                arguments.add(attrDateTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrDateToday);

-                arguments.add(attrDateYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        @Test

-        public void testDate_LTE() {

+    /**

+     * Integer

+     */

+    @Test

+    public void testInteger_GT() {

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATE_LESS_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_INTEGER_GREATER_THAN;

 

-                // first == second

-                arguments.add(attrDateToday);

-                arguments.add(attrDateSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_GREATER_THAN, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrDateToday);

-                arguments.add(attrDateTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrDateToday);

-                arguments.add(attrDateYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        

-        

-        

-        

-        

-        

-        /**

-         * Time

-         */

-        

-        @Test

-        public void testTime_GT() {

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_TIME_GREATER_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_TIME_GREATER_THAN, fd.getId());

-                assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // first == second

+        arguments.add(intAttr1);

+        arguments.add(intAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // check first < second

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                // test bad args data types?  One with TimeZone and one without

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // first > second

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                // test with TimeZone vs without

-                arguments.clear();

-                arguments.add(attrTimeWithTimeZone);

-                arguments.add(attrTimeNoTimeZone);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:time-greater-than Cannot compare this ISO8601DateTime with non-time-zoned ISO8601DateTime", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+    }

 

-        }

-        

-        @Test

-        public void testTime_GTE() {

+    @Test

+    public void testInteger_GTE() {

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_TIME_GREATER_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_INTEGER_GREATER_THAN_OR_EQUAL;

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-        }

-        

-        @Test

-        public void testTime_LT() {

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_TIME_LESS_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_TIME_LESS_THAN, fd.getId());

-                assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        @Test

-        public void testTime_LTE() {

+        // first == second

+        arguments.add(intAttr1);

+        arguments.add(intAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_TIME_LESS_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // check first < second

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        

-        

-        

-        

-        /**

-         * Time-in-range

-         */

-        @Test

-        public void testTime_in_range() {

+        // first > second

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+    }

 

-                FunctionDefinitionTimeInRange<?> fd = (FunctionDefinitionTimeInRange<?>) StdFunctions.FD_TIME_IN_RANGE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_TIME_IN_RANGE, fd.getId());

-                assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(3), fd.getNumArgs());

-                

-                // arg 0 in range of others

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeYesterday);

-                arguments.add(attrTimeTommorrow);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // below range

-                arguments.clear();

-                arguments.add(attrTimeYesterday);

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // above range

-                arguments.clear();

-                arguments.add(attrTimeTommorrow);

-                arguments.add(attrTimeYesterday);

-                arguments.add(attrTimeToday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // range bad

-                arguments.clear();

-                arguments.add(attrTimeToday);

-                arguments.add(attrTimeTommorrow);

-                arguments.add(attrTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bad types

-                arguments.clear();

-                arguments.add(attrDateTimeWithTimeZone);

-                arguments.add(attrDateTimeNoTimeZone);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:time-in-range Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

-                arguments.clear();

-                arguments.add(attrDateTimeWithTimeZone);

-                arguments.add(attrDateTimeNoTimeZone);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:time-in-range Expected data type 'time' saw 'dateTime' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

-        }

+    @Test

+    public void testInteger_LT() {

 

-        

-        

-        

-        

-        

-        /**

-         * DateTime

-         */

-        

-        @Test

-        public void testDateTime_GT() {

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_INTEGER_LESS_THAN;

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATETIME_GREATER_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_GREATER_THAN, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_LESS_THAN, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                // test bad args data types?  One with TimeZone and one without

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // first == second

+        arguments.add(intAttr1);

+        arguments.add(intAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                // test with TimeZone vs without

-                arguments.clear();

-                arguments.add(attrDateTimeWithTimeZone);

-                arguments.add(attrDateTimeNoTimeZone);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-greater-than Cannot compare this ISO8601DateTime with non-time-zoned ISO8601DateTime", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

+        // check first < second

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-        }

-        

-        @Test

-        public void testDateTime_GTE() {

+        // first > second

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATETIME_GREATER_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+    @Test

+    public void testInteger_LTE() {

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-        }

-        

-        @Test

-        public void testDateTime_LT() {

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_INTEGER_LESS_THAN_OR_EQUAL;

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATETIME_LESS_THAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_LESS_THAN, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

-        

-        @Test

-        public void testDateTime_LTE() {

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATETIME_LESS_THAN_OR_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // first == second

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeSameDay);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // first == second

+        arguments.add(intAttr1);

+        arguments.add(intAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                // first < second

-                arguments.clear();

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeTommorrow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first > second

-                arguments.clear();

-                arguments.add(attrDateTimeToday);

-                arguments.add(attrDateTimeYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        }

+        // check first < second

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

+

+

+

+

+    /**

+     * Double

+     */

+    @Test

+    public void testDouble_GT() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DOUBLE_GREATER_THAN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_GREATER_THAN, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attr1);

+        arguments.add(attr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+    @Test

+    public void testDouble_GTE() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DOUBLE_GREATER_THAN_OR_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attr1);

+        arguments.add(attr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+    }

+

+    @Test

+    public void testDouble_LT() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DOUBLE_LESS_THAN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_LESS_THAN, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attr1);

+        arguments.add(attr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

+

+    @Test

+    public void testDouble_LTE() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DOUBLE_LESS_THAN_OR_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attr1);

+        arguments.add(attr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

+

+

+

+    /**

+     * Date

+     */

+

+    @Test

+    public void testDate_GT() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATE_GREATER_THAN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATE_GREATER_THAN, fd.getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrDateToday);

+        arguments.add(attrDateSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrDateToday);

+        arguments.add(attrDateTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrDateToday);

+        arguments.add(attrDateYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // test bad args data types?  One with TimeZone and one without

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+        // test with TimeZone vs without

+        arguments.clear();

+        arguments.add(attrDateWithTimeZone);

+        arguments.add(attrDateNoTimeZone);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-greater-than Cannot compare this ISO8601DateTime with non-time-zoned ISO8601DateTime", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+    }

+

+    @Test

+    public void testDate_GTE() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATE_GREATER_THAN_OR_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrDateToday);

+        arguments.add(attrDateSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrDateToday);

+        arguments.add(attrDateTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrDateToday);

+        arguments.add(attrDateYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+    }

+

+    @Test

+    public void testDate_LT() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATE_LESS_THAN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATE_LESS_THAN, fd.getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrDateToday);

+        arguments.add(attrDateSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrDateToday);

+        arguments.add(attrDateTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrDateToday);

+        arguments.add(attrDateYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

+

+    @Test

+    public void testDate_LTE() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATE_LESS_THAN_OR_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrDateToday);

+        arguments.add(attrDateSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrDateToday);

+        arguments.add(attrDateTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrDateToday);

+        arguments.add(attrDateYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

+

+

+

+

+

+

+

+    /**

+     * Time

+     */

+

+    @Test

+    public void testTime_GT() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_TIME_GREATER_THAN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_TIME_GREATER_THAN, fd.getId());

+        assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // test bad args data types?  One with TimeZone and one without

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+        // test with TimeZone vs without

+        arguments.clear();

+        arguments.add(attrTimeWithTimeZone);

+        arguments.add(attrTimeNoTimeZone);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:time-greater-than Cannot compare this ISO8601DateTime with non-time-zoned ISO8601DateTime", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+    }

+

+    @Test

+    public void testTime_GTE() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_TIME_GREATER_THAN_OR_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+    }

+

+    @Test

+    public void testTime_LT() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_TIME_LESS_THAN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_TIME_LESS_THAN, fd.getId());

+        assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

+

+    @Test

+    public void testTime_LTE() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_TIME_LESS_THAN_OR_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

+

+

+

+

+

+    /**

+     * Time-in-range

+     */

+    @Test

+    public void testTime_in_range() {

+

+        FunctionDefinitionTimeInRange<?> fd = (FunctionDefinitionTimeInRange<?>) StdFunctions.FD_TIME_IN_RANGE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_TIME_IN_RANGE, fd.getId());

+        assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(3), fd.getNumArgs());

+

+        // arg 0 in range of others

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeYesterday);

+        arguments.add(attrTimeTommorrow);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // below range

+        arguments.clear();

+        arguments.add(attrTimeYesterday);

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // above range

+        arguments.clear();

+        arguments.add(attrTimeTommorrow);

+        arguments.add(attrTimeYesterday);

+        arguments.add(attrTimeToday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // range bad

+        arguments.clear();

+        arguments.add(attrTimeToday);

+        arguments.add(attrTimeTommorrow);

+        arguments.add(attrTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bad types

+        arguments.clear();

+        arguments.add(attrDateTimeWithTimeZone);

+        arguments.add(attrDateTimeNoTimeZone);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:time-in-range Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrDateTimeWithTimeZone);

+        arguments.add(attrDateTimeNoTimeZone);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:time-in-range Expected data type 'time' saw 'dateTime' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+    /**

+     * DateTime

+     */

+

+    @Test

+    public void testDateTime_GT() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATETIME_GREATER_THAN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_GREATER_THAN, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // test bad args data types?  One with TimeZone and one without

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+        // test with TimeZone vs without

+        arguments.clear();

+        arguments.add(attrDateTimeWithTimeZone);

+        arguments.add(attrDateTimeNoTimeZone);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-greater-than Cannot compare this ISO8601DateTime with non-time-zoned ISO8601DateTime", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+    }

+

+    @Test

+    public void testDateTime_GTE() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATETIME_GREATER_THAN_OR_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+    }

+

+    @Test

+    public void testDateTime_LT() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATETIME_LESS_THAN;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_LESS_THAN, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

+

+    @Test

+    public void testDateTime_LTE() {

+

+        FunctionDefinitionComparison<?> fd = (FunctionDefinitionComparison<?>) StdFunctions.FD_DATETIME_LESS_THAN_OR_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // first == second

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeSameDay);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first < second

+        arguments.clear();

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeTommorrow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first > second

+        arguments.clear();

+        arguments.add(attrDateTimeToday);

+        arguments.add(attrDateTimeYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+    }

 

 

 

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionDateTimeArithmeticTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionDateTimeArithmeticTest.java
index 5acdc65..7f7852a 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionDateTimeArithmeticTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionDateTimeArithmeticTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -45,1558 +45,1558 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionDateTimeArithmeticTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        ExpressionResult res;

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-        

-        @Test

-        public void testDateTime_add_dayTimeDuration() {

-                // Date objects to be adjusted

-                ISO8601DateTime dateTimeStdExample1 = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 0));

-                ISO8601DateTime dateTimeMsecs = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 777));

-                ISO8601DateTime dateTimeCrossover = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 12, 31), 

-                                new ISO8601Time(23, 59, 30, 1));

-                ISO8601DateTime dateTimeBC = new ISO8601DateTime(null, 

-                                new ISO8601Date(-2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 0));

-                ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

-                ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

-                ISO8601DateTime dateTimeTimeZone0 = new ISO8601DateTime(timeZone0, 

-                                new ISO8601Date(timeZone0, 2000, 1, 12), 

-                                new ISO8601Time(timeZone0, 12, 13, 14, 0));

-                ISO8601DateTime dateTimeTimeZone5 = new ISO8601DateTime(timeZone5, 

-                                new ISO8601Date(timeZone5, 2000, 1, 12), 

-                                new ISO8601Time(timeZone5, 12, 13, 14, 0));

-                ISO8601DateTime dateTimeIIC102Result = null;

-                

-                // Durations

-                XPathDayTimeDuration duration0 = new XPathDayTimeDuration(1, 0, 0, 0, 0);

-                XPathDayTimeDuration durationStdExample1 = new XPathDayTimeDuration(1, 5, 7, 10, 3.3);

-                XPathDayTimeDuration durationNStdExample1 = new XPathDayTimeDuration(-1, 5, 7, 10, 3.3);

-                XPathDayTimeDuration durationMsecs = new XPathDayTimeDuration(1, 5, 7, 10, 3.223);

-                XPathDayTimeDuration durationCrossover = new XPathDayTimeDuration(1, 0, 0, 0, 29.999);

+    ExpressionResult res;

 

-                // ARGS declarations

-                // Dates

-                FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

-                FunctionArgumentAttributeValue attrDateTimeMsecs = null;

-                FunctionArgumentAttributeValue attrDateTimeCrossover = null;

-                FunctionArgumentAttributeValue attrDateTimeBC = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

-                FunctionArgumentAttributeValue attrDateTimeIIC102 = null;

 

-                // Durations

-                FunctionArgumentAttributeValue attrDuration0 = null;

-                FunctionArgumentAttributeValue attrDurationStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationMsecs = null;

-                FunctionArgumentAttributeValue attrDurationCrossover = null;

-                FunctionArgumentAttributeValue attrDurationIIC102 = null;

+    @Test

+    public void testDateTime_add_dayTimeDuration() {

+        // Date objects to be adjusted

+        ISO8601DateTime dateTimeStdExample1 = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 0));

+        ISO8601DateTime dateTimeMsecs = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 777));

+        ISO8601DateTime dateTimeCrossover = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 12, 31),

+                new ISO8601Time(23, 59, 30, 1));

+        ISO8601DateTime dateTimeBC = new ISO8601DateTime(null,

+                new ISO8601Date(-2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 0));

+        ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

+        ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

+        ISO8601DateTime dateTimeTimeZone0 = new ISO8601DateTime(timeZone0,

+                new ISO8601Date(timeZone0, 2000, 1, 12),

+                new ISO8601Time(timeZone0, 12, 13, 14, 0));

+        ISO8601DateTime dateTimeTimeZone5 = new ISO8601DateTime(timeZone5,

+                new ISO8601Date(timeZone5, 2000, 1, 12),

+                new ISO8601Time(timeZone5, 12, 13, 14, 0));

+        ISO8601DateTime dateTimeIIC102Result = null;

 

-                // misc bad

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                // set values

-                try {

-                        // Date attrs

-                        attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeStdExample1));

-                        attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeMsecs));

-                        attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeCrossover));

-                        attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeBC));

-                        attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone0));

-                        attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone5));

-                        attrDateTimeIIC102 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(DataTypes.DT_DATETIME.convert("2002-03-22T08:23:47-05:00")));

+        // Durations

+        XPathDayTimeDuration duration0 = new XPathDayTimeDuration(1, 0, 0, 0, 0);

+        XPathDayTimeDuration durationStdExample1 = new XPathDayTimeDuration(1, 5, 7, 10, 3.3);

+        XPathDayTimeDuration durationNStdExample1 = new XPathDayTimeDuration(-1, 5, 7, 10, 3.3);

+        XPathDayTimeDuration durationMsecs = new XPathDayTimeDuration(1, 5, 7, 10, 3.223);

+        XPathDayTimeDuration durationCrossover = new XPathDayTimeDuration(1, 0, 0, 0, 29.999);

 

-                        dateTimeIIC102Result = DataTypes.DT_DATETIME.convert("2002-03-27T10:23:47-05:00");

-                        

-                        // Duration attrs

-                        attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(duration0));

-                        attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationStdExample1));

-                        attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationNStdExample1));

-                        attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationMsecs));

-                        attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationCrossover));

-                        attrDurationIIC102 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue("P5DT2H0M0S"));

+        // ARGS declarations

+        // Dates

+        FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

+        FunctionArgumentAttributeValue attrDateTimeMsecs = null;

+        FunctionArgumentAttributeValue attrDateTimeCrossover = null;

+        FunctionArgumentAttributeValue attrDateTimeBC = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

+        FunctionArgumentAttributeValue attrDateTimeIIC102 = null;

 

-                        // misc bad

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATETIME_ADD_DAYTIMEDURATION;

+        // Durations

+        FunctionArgumentAttributeValue attrDuration0 = null;

+        FunctionArgumentAttributeValue attrDurationStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationMsecs = null;

+        FunctionArgumentAttributeValue attrDurationCrossover = null;

+        FunctionArgumentAttributeValue attrDurationIIC102 = null;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // Duration = 0 => same as original

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDuration0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(dateTimeStdExample1, resValue);

+        // misc bad

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        // set values

+        try {

+            // Date attrs

+            attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeStdExample1));

+            attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeMsecs));

+            attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeCrossover));

+            attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeBC));

+            attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone0));

+            attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone5));

+            attrDateTimeIIC102 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(DataTypes.DT_DATETIME.convert("2002-03-22T08:23:47-05:00")));

 

-                

-                // simple positive operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                ISO8601DateTime testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2000, 1, 17),

-                                new ISO8601Time(19, 23, 17, 300) );

-                assertEquals(testResponse, resValue);	

-                

-                // negative operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationNStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2000, 1, 7),

-                                new ISO8601Time(5, 3, 10, 700) );

-                assertEquals(testResponse, resValue);

-                

-                // millisecs work correctly

-                arguments.clear();

-                arguments.add(attrDateTimeMsecs);

-                arguments.add(attrDurationMsecs);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2000, 1, 17),

-                                new ISO8601Time(19, 23, 18, 0) );

-                assertEquals(testResponse, resValue);

-        

-                // cross minute => cross day => cross month => cross year

-                arguments.clear();

-                arguments.add(attrDateTimeCrossover);

-                arguments.add(attrDurationCrossover);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2001, 1, 1),

-                                new ISO8601Time(0, 0, 0, 0) );

-                assertEquals(testResponse, resValue);

-                

-                // negative (BC) original date add goes the right direction

-                arguments.clear();

-                arguments.add(attrDateTimeBC);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(-2000, 1, 17),

-                                new ISO8601Time(19, 23, 17, 300) );

-                assertEquals(testResponse, resValue);	

-                

-                // non-null timezone not changed

-                // original has timezone offset = 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone0);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                timeZone0,

-                                new ISO8601Date(timeZone0, 2000, 1, 17),

-                                new ISO8601Time(timeZone0, 19, 23, 17, 300) );

-                assertEquals(testResponse, resValue);

-                

-                // original has timezone offset not 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone5);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                timeZone5,

-                                new ISO8601Date(timeZone5, 2000, 1, 17),

-                                new ISO8601Time(timeZone5, 19, 23, 17, 300) );

-                assertEquals(testResponse, resValue);

-                

-                // conformance test IIC102

-                arguments.clear();

-                arguments.add(attrDateTimeIIC102);

-                arguments.add(attrDurationIIC102);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(dateTimeIIC102Result, resValue);

+            dateTimeIIC102Result = DataTypes.DT_DATETIME.convert("2002-03-27T10:23:47-05:00");

 

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+            // Duration attrs

+            attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(duration0));

+            attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationStdExample1));

+            attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationNStdExample1));

+            attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationMsecs));

+            attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationCrossover));

+            attrDurationIIC102 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue("P5DT2H0M0S"));

 

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-dayTimeDuration Expected data type 'dateTime' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+            // misc bad

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

 

-        

-        @Test

-        public void testDateTime_subtract_dayTimeDuration() {

-                // Date objects to be adjusted

-                ISO8601DateTime dateTimeStdExample1 = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 0));

-                ISO8601DateTime dateTimeMsecs = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 777));

-                ISO8601DateTime dateTimeCrossover = new ISO8601DateTime(null, 

-                                new ISO8601Date(2001, 1, 1),

-                                new ISO8601Time(0, 0, 0, 0) );

-                ISO8601DateTime dateTimeBC = new ISO8601DateTime(null, 

-                                new ISO8601Date(-2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 0));

-                ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

-                ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

-                ISO8601DateTime dateTimeTimeZone0 = new ISO8601DateTime(timeZone0, 

-                                new ISO8601Date(timeZone0, 2000, 1, 12), 

-                                new ISO8601Time(timeZone0, 12, 13, 14, 0));

-                ISO8601DateTime dateTimeTimeZone5 = new ISO8601DateTime(timeZone5, 

-                                new ISO8601Date(timeZone5, 2000, 1, 12), 

-                                new ISO8601Time(timeZone5, 12, 13, 14, 0));

-                

-                // Durations

-                XPathDayTimeDuration duration0 = new XPathDayTimeDuration(1, 0, 0, 0, 0);

-                XPathDayTimeDuration durationStdExample1 = new XPathDayTimeDuration(1, 5, 7, 10, 3.3);

-                XPathDayTimeDuration durationNStdExample1 = new XPathDayTimeDuration(-1, 5, 7, 10, 3.3);

-                XPathDayTimeDuration durationMsecs = new XPathDayTimeDuration(1, 5, 7, 10, 14.778);

-                XPathDayTimeDuration durationCrossover = new XPathDayTimeDuration(1, 0, 0, 0, 29.999);

+        FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATETIME_ADD_DAYTIMEDURATION;

 

-                // ARGS declarations

-                // Dates

-                FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

-                FunctionArgumentAttributeValue attrDateTimeMsecs = null;

-                FunctionArgumentAttributeValue attrDateTimeCrossover = null;

-                FunctionArgumentAttributeValue attrDateTimeBC = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

-        

-                // Durations

-                FunctionArgumentAttributeValue attrDuration0 = null;

-                FunctionArgumentAttributeValue attrDurationStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationMsecs = null;

-                FunctionArgumentAttributeValue attrDurationCrossover = null;

-        

-                // misc bad

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                // set values

-                try {

-                        // Date attrs

-                        attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeStdExample1));

-                        attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeMsecs));

-                        attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeCrossover));

-                        attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeBC));

-                        attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone0));

-                        attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone5));

-                        

-                        // Duration attrs

-                        attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(duration0));

-                        attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationStdExample1));

-                        attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationNStdExample1));

-                        attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationMsecs));

-                        attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationCrossover));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

 

-                        // misc bad

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATETIME_SUBTRACT_DAYTIMEDURATION;

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // Duration = 0 => same as original

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDuration0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(dateTimeStdExample1, resValue);

+        // Duration = 0 => same as original

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDuration0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(dateTimeStdExample1, resValue);

 

-                

-                // simple positive operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                ISO8601DateTime testResponse = new ISO8601DateTime(

-                                null,	

-                                new ISO8601Date(2000, 1, 7),

-                                new ISO8601Time(5, 3, 10, 700) );

-                assertEquals(testResponse, resValue);	

 

-                

-                // negative operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationNStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2000, 1, 17),

-                                new ISO8601Time(19, 23, 17, 300) );

-                assertEquals(testResponse, resValue);

-                

-                // millisecs work correctly

-                arguments.clear();

-                arguments.add(attrDateTimeMsecs);

-                arguments.add(attrDurationMsecs);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2000, 1, 7),

-                                new ISO8601Time(5, 2, 59, 999) );

-                assertEquals(testResponse, resValue);

-        

-                // cross minute => cross day => cross month => cross year

-                arguments.clear();

-                arguments.add(attrDateTimeCrossover);

-                arguments.add(attrDurationCrossover);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2000, 12, 31), 

-                                new ISO8601Time(23, 59, 30, 1));

-                assertEquals(testResponse, resValue);

-                

-                // negative (BC) original date add goes the right direction

-                arguments.clear();

-                arguments.add(attrDateTimeBC);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(-2000, 1, 7),

-                                new ISO8601Time(5, 3, 10, 700) );

-                assertEquals(testResponse, resValue);	

-                

-                // non-null timezone not changed

-                // original has timezone offset = 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone0);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                timeZone0,

-                                new ISO8601Date(timeZone0, 2000, 1, 7),

-                                new ISO8601Time(timeZone0, 5, 3, 10, 700) );

-                assertEquals(testResponse, resValue);

-                

-                // original has timezone offset not 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone5);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                timeZone5,

-                                new ISO8601Date(timeZone5, 2000, 1, 7),

-                                new ISO8601Time(timeZone5, 5, 3, 10, 700) );

-                assertEquals(testResponse, resValue);

+        // simple positive operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        ISO8601DateTime testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2000, 1, 17),

+            new ISO8601Time(19, 23, 17, 300) );

+        assertEquals(testResponse, resValue);

 

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // negative operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationNStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2000, 1, 7),

+            new ISO8601Time(5, 3, 10, 700) );

+        assertEquals(testResponse, resValue);

 

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // millisecs work correctly

+        arguments.clear();

+        arguments.add(attrDateTimeMsecs);

+        arguments.add(attrDurationMsecs);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2000, 1, 17),

+            new ISO8601Time(19, 23, 18, 0) );

+        assertEquals(testResponse, resValue);

 

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // cross minute => cross day => cross month => cross year

+        arguments.clear();

+        arguments.add(attrDateTimeCrossover);

+        arguments.add(attrDurationCrossover);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2001, 1, 1),

+            new ISO8601Time(0, 0, 0, 0) );

+        assertEquals(testResponse, resValue);

 

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-dayTimeDuration Expected data type 'dateTime' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // negative (BC) original date add goes the right direction

+        arguments.clear();

+        arguments.add(attrDateTimeBC);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(-2000, 1, 17),

+            new ISO8601Time(19, 23, 17, 300) );

+        assertEquals(testResponse, resValue);

+

+        // non-null timezone not changed

+        // original has timezone offset = 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone0);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            timeZone0,

+            new ISO8601Date(timeZone0, 2000, 1, 17),

+            new ISO8601Time(timeZone0, 19, 23, 17, 300) );

+        assertEquals(testResponse, resValue);

+

+        // original has timezone offset not 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone5);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            timeZone5,

+            new ISO8601Date(timeZone5, 2000, 1, 17),

+            new ISO8601Time(timeZone5, 19, 23, 17, 300) );

+        assertEquals(testResponse, resValue);

+

+        // conformance test IIC102

+        arguments.clear();

+        arguments.add(attrDateTimeIIC102);

+        arguments.add(attrDurationIIC102);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(dateTimeIIC102Result, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-dayTimeDuration Expected data type 'dateTime' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+    @Test

+    public void testDateTime_subtract_dayTimeDuration() {

+        // Date objects to be adjusted

+        ISO8601DateTime dateTimeStdExample1 = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 0));

+        ISO8601DateTime dateTimeMsecs = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 777));

+        ISO8601DateTime dateTimeCrossover = new ISO8601DateTime(null,

+                new ISO8601Date(2001, 1, 1),

+                new ISO8601Time(0, 0, 0, 0) );

+        ISO8601DateTime dateTimeBC = new ISO8601DateTime(null,

+                new ISO8601Date(-2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 0));

+        ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

+        ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

+        ISO8601DateTime dateTimeTimeZone0 = new ISO8601DateTime(timeZone0,

+                new ISO8601Date(timeZone0, 2000, 1, 12),

+                new ISO8601Time(timeZone0, 12, 13, 14, 0));

+        ISO8601DateTime dateTimeTimeZone5 = new ISO8601DateTime(timeZone5,

+                new ISO8601Date(timeZone5, 2000, 1, 12),

+                new ISO8601Time(timeZone5, 12, 13, 14, 0));

+

+        // Durations

+        XPathDayTimeDuration duration0 = new XPathDayTimeDuration(1, 0, 0, 0, 0);

+        XPathDayTimeDuration durationStdExample1 = new XPathDayTimeDuration(1, 5, 7, 10, 3.3);

+        XPathDayTimeDuration durationNStdExample1 = new XPathDayTimeDuration(-1, 5, 7, 10, 3.3);

+        XPathDayTimeDuration durationMsecs = new XPathDayTimeDuration(1, 5, 7, 10, 14.778);

+        XPathDayTimeDuration durationCrossover = new XPathDayTimeDuration(1, 0, 0, 0, 29.999);

+

+        // ARGS declarations

+        // Dates

+        FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

+        FunctionArgumentAttributeValue attrDateTimeMsecs = null;

+        FunctionArgumentAttributeValue attrDateTimeCrossover = null;

+        FunctionArgumentAttributeValue attrDateTimeBC = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

+

+        // Durations

+        FunctionArgumentAttributeValue attrDuration0 = null;

+        FunctionArgumentAttributeValue attrDurationStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationMsecs = null;

+        FunctionArgumentAttributeValue attrDurationCrossover = null;

+

+        // misc bad

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        // set values

+        try {

+            // Date attrs

+            attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeStdExample1));

+            attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeMsecs));

+            attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeCrossover));

+            attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeBC));

+            attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone0));

+            attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone5));

+

+            // Duration attrs

+            attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(duration0));

+            attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationStdExample1));

+            attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationNStdExample1));

+            attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationMsecs));

+            attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(durationCrossover));

+

+            // misc bad

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

+

+        FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATETIME_SUBTRACT_DAYTIMEDURATION;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // Duration = 0 => same as original

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDuration0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(dateTimeStdExample1, resValue);

 

 

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testDateTime_add_yearMonthDuration() {

-                // Date objects to be adjusted

-                ISO8601DateTime dateTimeStdExample1 = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 0));

-                ISO8601DateTime dateTimeMsecs = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 777));

-                ISO8601DateTime dateTimeCrossover = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 12, 31), 

-                                new ISO8601Time(23, 59, 30, 1));

-                ISO8601DateTime dateTimeBC = new ISO8601DateTime(null, 

-                                new ISO8601Date(-2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 0));

-                ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

-                ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

-                ISO8601DateTime dateTimeTimeZone0 = new ISO8601DateTime(timeZone0, 

-                                new ISO8601Date(timeZone0, 2000, 1, 12), 

-                                new ISO8601Time(timeZone0, 12, 13, 14, 0));

-                ISO8601DateTime dateTimeTimeZone5 = new ISO8601DateTime(timeZone5, 

-                                new ISO8601Date(timeZone5, 2000, 1, 12), 

-                                new ISO8601Time(timeZone5, 12, 13, 14, 0));

-                

-                // Durations

-                XPathYearMonthDuration duration0 = new XPathYearMonthDuration(1, 0, 0);

-                XPathYearMonthDuration durationStdExample1 = new XPathYearMonthDuration(1, 5, 7);

-                XPathYearMonthDuration durationNStdExample1 = new XPathYearMonthDuration(-1, 5, 7);

-                XPathYearMonthDuration durationMsecs = new XPathYearMonthDuration(1, 5, 7);

-                XPathYearMonthDuration durationCrossover = new XPathYearMonthDuration(1, 0, 1);

+        // simple positive operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        ISO8601DateTime testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2000, 1, 7),

+            new ISO8601Time(5, 3, 10, 700) );

+        assertEquals(testResponse, resValue);

 

-                // ARGS declarations

-                // Dates

-                FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

-                FunctionArgumentAttributeValue attrDateTimeMsecs = null;

-                FunctionArgumentAttributeValue attrDateTimeCrossover = null;

-                FunctionArgumentAttributeValue attrDateTimeBC = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

-        

-                // Durations

-                FunctionArgumentAttributeValue attrDuration0 = null;

-                FunctionArgumentAttributeValue attrDurationStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationMsecs = null;

-                FunctionArgumentAttributeValue attrDurationCrossover = null;

-        

-                // misc bad

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                // set values

-                try {

-                        // Date attrs

-                        attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeStdExample1));

-                        attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeMsecs));

-                        attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeCrossover));

-                        attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeBC));

-                        attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone0));

-                        attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone5));

-                        

-                        // Duration attrs

-                        attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(duration0));

-                        attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationStdExample1));

-                        attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationNStdExample1));

-                        attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationMsecs));

-                        attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationCrossover));

 

-                        // misc bad

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATETIME_ADD_YEARMONTHDURATION;

+        // negative operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationNStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2000, 1, 17),

+            new ISO8601Time(19, 23, 17, 300) );

+        assertEquals(testResponse, resValue);

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // Duration = 0 => same as original

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDuration0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(dateTimeStdExample1, resValue);

+        // millisecs work correctly

+        arguments.clear();

+        arguments.add(attrDateTimeMsecs);

+        arguments.add(attrDurationMsecs);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2000, 1, 7),

+            new ISO8601Time(5, 2, 59, 999) );

+        assertEquals(testResponse, resValue);

 

-                

-                // simple positive operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                ISO8601DateTime testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2005, 8, 12),

-                                new ISO8601Time(12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);	

-                

-                // negative operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationNStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(1994, 6, 12),

-                                new ISO8601Time(12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);

-                

-                // millisecs work correctly (not relevant to YearMonth, but should not break

-                arguments.clear();

-                arguments.add(attrDateTimeMsecs);

-                arguments.add(attrDurationMsecs);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2005, 8, 12),

-                                new ISO8601Time(12, 13, 14, 777) );

-                assertEquals(testResponse, resValue);

-        

-                // cross minute => cross day => cross month => cross year

-                arguments.clear();

-                arguments.add(attrDateTimeCrossover);

-                arguments.add(attrDurationCrossover);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2001, 1, 31),

-                                new ISO8601Time(23, 59, 30, 1) );

-                assertEquals(testResponse, resValue);

-                

-                // negative (BC) original date add goes the right direction

-                arguments.clear();

-                arguments.add(attrDateTimeBC);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(-1995, 8, 12),

-                                new ISO8601Time(12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);	

-                

-                // non-null timezone not changed

-                // original has timezone offset = 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone0);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                timeZone0,

-                                new ISO8601Date(timeZone0, 2005, 8, 12),

-                                new ISO8601Time(timeZone0, 12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);

-                

-                // original has timezone offset not 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone5);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                timeZone5,

-                                new ISO8601Date(timeZone5, 2005, 8, 12),

-                                new ISO8601Time(timeZone5, 12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);

+        // cross minute => cross day => cross month => cross year

+        arguments.clear();

+        arguments.add(attrDateTimeCrossover);

+        arguments.add(attrDurationCrossover);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2000, 12, 31),

+            new ISO8601Time(23, 59, 30, 1));

+        assertEquals(testResponse, resValue);

 

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // negative (BC) original date add goes the right direction

+        arguments.clear();

+        arguments.add(attrDateTimeBC);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(-2000, 1, 7),

+            new ISO8601Time(5, 3, 10, 700) );

+        assertEquals(testResponse, resValue);

 

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // non-null timezone not changed

+        // original has timezone offset = 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone0);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            timeZone0,

+            new ISO8601Date(timeZone0, 2000, 1, 7),

+            new ISO8601Time(timeZone0, 5, 3, 10, 700) );

+        assertEquals(testResponse, resValue);

 

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // original has timezone offset not 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone5);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            timeZone5,

+            new ISO8601Date(timeZone5, 2000, 1, 7),

+            new ISO8601Time(timeZone5, 5, 3, 10, 700) );

+        assertEquals(testResponse, resValue);

 

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-yearMonthDuration Expected data type 'dateTime' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-dayTimeDuration Expected data type 'dateTime' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-dayTimeDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+

+

+

+

+    @Test

+    public void testDateTime_add_yearMonthDuration() {

+        // Date objects to be adjusted

+        ISO8601DateTime dateTimeStdExample1 = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 0));

+        ISO8601DateTime dateTimeMsecs = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 777));

+        ISO8601DateTime dateTimeCrossover = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 12, 31),

+                new ISO8601Time(23, 59, 30, 1));

+        ISO8601DateTime dateTimeBC = new ISO8601DateTime(null,

+                new ISO8601Date(-2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 0));

+        ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

+        ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

+        ISO8601DateTime dateTimeTimeZone0 = new ISO8601DateTime(timeZone0,

+                new ISO8601Date(timeZone0, 2000, 1, 12),

+                new ISO8601Time(timeZone0, 12, 13, 14, 0));

+        ISO8601DateTime dateTimeTimeZone5 = new ISO8601DateTime(timeZone5,

+                new ISO8601Date(timeZone5, 2000, 1, 12),

+                new ISO8601Time(timeZone5, 12, 13, 14, 0));

+

+        // Durations

+        XPathYearMonthDuration duration0 = new XPathYearMonthDuration(1, 0, 0);

+        XPathYearMonthDuration durationStdExample1 = new XPathYearMonthDuration(1, 5, 7);

+        XPathYearMonthDuration durationNStdExample1 = new XPathYearMonthDuration(-1, 5, 7);

+        XPathYearMonthDuration durationMsecs = new XPathYearMonthDuration(1, 5, 7);

+        XPathYearMonthDuration durationCrossover = new XPathYearMonthDuration(1, 0, 1);

+

+        // ARGS declarations

+        // Dates

+        FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

+        FunctionArgumentAttributeValue attrDateTimeMsecs = null;

+        FunctionArgumentAttributeValue attrDateTimeCrossover = null;

+        FunctionArgumentAttributeValue attrDateTimeBC = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

+

+        // Durations

+        FunctionArgumentAttributeValue attrDuration0 = null;

+        FunctionArgumentAttributeValue attrDurationStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationMsecs = null;

+        FunctionArgumentAttributeValue attrDurationCrossover = null;

+

+        // misc bad

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        // set values

+        try {

+            // Date attrs

+            attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeStdExample1));

+            attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeMsecs));

+            attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeCrossover));

+            attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeBC));

+            attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone0));

+            attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone5));

+

+            // Duration attrs

+            attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(duration0));

+            attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationStdExample1));

+            attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationNStdExample1));

+            attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationMsecs));

+            attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationCrossover));

+

+            // misc bad

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

 

-        

-        

-        @Test

-        public void testDateTime_subtract_yearMonthDuration() {

-                // Date objects to be adjusted

-                ISO8601DateTime dateTimeStdExample1 = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 0));

-                ISO8601DateTime dateTimeMsecs = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 777));

-                ISO8601DateTime dateTimeCrossover = new ISO8601DateTime(null, 

-                                new ISO8601Date(2000, 1, 1), 

-                                new ISO8601Time(23, 59, 30, 1));

-                ISO8601DateTime dateTimeBC = new ISO8601DateTime(null, 

-                                new ISO8601Date(-2000, 1, 12), 

-                                new ISO8601Time(12, 13, 14, 0));

-                ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

-                ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

-                ISO8601DateTime dateTimeTimeZone0 = new ISO8601DateTime(timeZone0, 

-                                new ISO8601Date(timeZone0, 2000, 1, 12), 

-                                new ISO8601Time(timeZone0, 12, 13, 14, 0));

-                ISO8601DateTime dateTimeTimeZone5 = new ISO8601DateTime(timeZone5, 

-                                new ISO8601Date(timeZone5, 2000, 1, 12), 

-                                new ISO8601Time(timeZone5, 12, 13, 14, 0));

-                

-                // Durations

-                XPathYearMonthDuration duration0 = new XPathYearMonthDuration(1, 0, 0);

-                XPathYearMonthDuration durationStdExample1 = new XPathYearMonthDuration(1, 5, 7);

-                XPathYearMonthDuration durationNStdExample1 = new XPathYearMonthDuration(-1, 5, 7);

-                XPathYearMonthDuration durationMsecs = new XPathYearMonthDuration(1, 5, 7);

-                XPathYearMonthDuration durationCrossover = new XPathYearMonthDuration(1, 0, 1);

+        FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATETIME_ADD_YEARMONTHDURATION;

 

-                // ARGS declarations

-                // Dates

-                FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

-                FunctionArgumentAttributeValue attrDateTimeMsecs = null;

-                FunctionArgumentAttributeValue attrDateTimeCrossover = null;

-                FunctionArgumentAttributeValue attrDateTimeBC = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

-        

-                // Durations

-                FunctionArgumentAttributeValue attrDuration0 = null;

-                FunctionArgumentAttributeValue attrDurationStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationMsecs = null;

-                FunctionArgumentAttributeValue attrDurationCrossover = null;

-        

-                // misc bad

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                // set values

-                try {

-                        // Date attrs

-                        attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeStdExample1));

-                        attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeMsecs));

-                        attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeCrossover));

-                        attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeBC));

-                        attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone0));

-                        attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone5));

-                        

-                        // Duration attrs

-                        attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(duration0));

-                        attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationStdExample1));

-                        attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationNStdExample1));

-                        attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationMsecs));

-                        attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationCrossover));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

 

-                        // misc bad

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATETIME_SUBTRACT_YEARMONTHDURATION;

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // Duration = 0 => same as original

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDuration0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(dateTimeStdExample1, resValue);

+        // Duration = 0 => same as original

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDuration0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(dateTimeStdExample1, resValue);

 

-                

-                // simple positive operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                ISO8601DateTime testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(1994, 6, 12),

-                                new ISO8601Time(12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);	

-                

-                // negative operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationNStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(2005, 8, 12),

-                                new ISO8601Time(12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);

-                

-                // millisecs work correctly (not relevant to YearMonth, but should not break

-                arguments.clear();

-                arguments.add(attrDateTimeMsecs);

-                arguments.add(attrDurationMsecs);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(1994, 6, 12),

-                                new ISO8601Time(12, 13, 14, 777) );

-                assertEquals(testResponse, resValue);

-        

-                // cross minute => cross day => cross month => cross year

-                arguments.clear();

-                arguments.add(attrDateTimeCrossover);

-                arguments.add(attrDurationCrossover);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(1999, 12, 1),

-                                new ISO8601Time(23, 59, 30, 1) );

-                assertEquals(testResponse, resValue);

-                

-                // negative (BC) original date add goes the right direction

-                arguments.clear();

-                arguments.add(attrDateTimeBC);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                null,

-                                new ISO8601Date(-2006, 6, 12),

-                                new ISO8601Time(12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);	

-                

-                // non-null timezone not changed

-                // original has timezone offset = 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone0);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                timeZone0,

-                                new ISO8601Date(timeZone0, 1994, 6, 12),

-                                new ISO8601Time(timeZone0, 12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);

-                

-                // original has timezone offset not 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone5);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                testResponse = new ISO8601DateTime(

-                                timeZone5,

-                                new ISO8601Date(timeZone5, 1994, 6, 12),

-                                new ISO8601Time(timeZone5, 12, 13, 14, 0) );

-                assertEquals(testResponse, resValue);

 

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // simple positive operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        ISO8601DateTime testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2005, 8, 12),

+            new ISO8601Time(12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

 

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // negative operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationNStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(1994, 6, 12),

+            new ISO8601Time(12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

 

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // millisecs work correctly (not relevant to YearMonth, but should not break

+        arguments.clear();

+        arguments.add(attrDateTimeMsecs);

+        arguments.add(attrDurationMsecs);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2005, 8, 12),

+            new ISO8601Time(12, 13, 14, 777) );

+        assertEquals(testResponse, resValue);

 

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-yearMonthDuration Expected data type 'dateTime' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // cross minute => cross day => cross month => cross year

+        arguments.clear();

+        arguments.add(attrDateTimeCrossover);

+        arguments.add(attrDurationCrossover);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2001, 1, 31),

+            new ISO8601Time(23, 59, 30, 1) );

+        assertEquals(testResponse, resValue);

+

+        // negative (BC) original date add goes the right direction

+        arguments.clear();

+        arguments.add(attrDateTimeBC);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(-1995, 8, 12),

+            new ISO8601Time(12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

+

+        // non-null timezone not changed

+        // original has timezone offset = 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone0);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            timeZone0,

+            new ISO8601Date(timeZone0, 2005, 8, 12),

+            new ISO8601Time(timeZone0, 12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

+

+        // original has timezone offset not 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone5);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            timeZone5,

+            new ISO8601Date(timeZone5, 2005, 8, 12),

+            new ISO8601Time(timeZone5, 12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-yearMonthDuration Expected data type 'dateTime' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+    @Test

+    public void testDateTime_subtract_yearMonthDuration() {

+        // Date objects to be adjusted

+        ISO8601DateTime dateTimeStdExample1 = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 0));

+        ISO8601DateTime dateTimeMsecs = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 777));

+        ISO8601DateTime dateTimeCrossover = new ISO8601DateTime(null,

+                new ISO8601Date(2000, 1, 1),

+                new ISO8601Time(23, 59, 30, 1));

+        ISO8601DateTime dateTimeBC = new ISO8601DateTime(null,

+                new ISO8601Date(-2000, 1, 12),

+                new ISO8601Time(12, 13, 14, 0));

+        ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

+        ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

+        ISO8601DateTime dateTimeTimeZone0 = new ISO8601DateTime(timeZone0,

+                new ISO8601Date(timeZone0, 2000, 1, 12),

+                new ISO8601Time(timeZone0, 12, 13, 14, 0));

+        ISO8601DateTime dateTimeTimeZone5 = new ISO8601DateTime(timeZone5,

+                new ISO8601Date(timeZone5, 2000, 1, 12),

+                new ISO8601Time(timeZone5, 12, 13, 14, 0));

+

+        // Durations

+        XPathYearMonthDuration duration0 = new XPathYearMonthDuration(1, 0, 0);

+        XPathYearMonthDuration durationStdExample1 = new XPathYearMonthDuration(1, 5, 7);

+        XPathYearMonthDuration durationNStdExample1 = new XPathYearMonthDuration(-1, 5, 7);

+        XPathYearMonthDuration durationMsecs = new XPathYearMonthDuration(1, 5, 7);

+        XPathYearMonthDuration durationCrossover = new XPathYearMonthDuration(1, 0, 1);

+

+        // ARGS declarations

+        // Dates

+        FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

+        FunctionArgumentAttributeValue attrDateTimeMsecs = null;

+        FunctionArgumentAttributeValue attrDateTimeCrossover = null;

+        FunctionArgumentAttributeValue attrDateTimeBC = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

+

+        // Durations

+        FunctionArgumentAttributeValue attrDuration0 = null;

+        FunctionArgumentAttributeValue attrDurationStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationMsecs = null;

+        FunctionArgumentAttributeValue attrDurationCrossover = null;

+

+        // misc bad

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        // set values

+        try {

+            // Date attrs

+            attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeStdExample1));

+            attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeMsecs));

+            attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeCrossover));

+            attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeBC));

+            attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone0));

+            attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(dateTimeTimeZone5));

+

+            // Duration attrs

+            attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(duration0));

+            attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationStdExample1));

+            attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationNStdExample1));

+            attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationMsecs));

+            attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationCrossover));

+

+            // misc bad

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testDate_add_yearMonthDuration() {

-                // Date objects to be adjusted

-                ISO8601Date dateTimeStdExample1 = new ISO8601Date(2000, 1, 12);

-                ISO8601Date dateTimeMsecs =new ISO8601Date(2000, 1, 12);

-                ISO8601Date dateTimeCrossover = new ISO8601Date(2000, 12, 31);

-                ISO8601Date dateTimeBC = new ISO8601Date(-2000, 1, 12);

-                ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

-                ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

-                ISO8601Date dateTimeTimeZone0 = new ISO8601Date(timeZone0, 2000, 1, 12);

-                ISO8601Date dateTimeTimeZone5 = new ISO8601Date(timeZone5, 2000, 1, 12);

-                

-                // Durations

-                XPathYearMonthDuration duration0 = new XPathYearMonthDuration(1, 0, 0);

-                XPathYearMonthDuration durationStdExample1 = new XPathYearMonthDuration(1, 5, 7);

-                XPathYearMonthDuration durationNStdExample1 = new XPathYearMonthDuration(-1, 5, 7);

-                XPathYearMonthDuration durationMsecs = new XPathYearMonthDuration(1, 5, 7);

-                XPathYearMonthDuration durationCrossover = new XPathYearMonthDuration(1, 0, 1);

 

-                // ARGS declarations

-                // Dates

-                FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

-                FunctionArgumentAttributeValue attrDateTimeMsecs = null;

-                FunctionArgumentAttributeValue attrDateTimeCrossover = null;

-                FunctionArgumentAttributeValue attrDateTimeBC = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

-        

-                // Durations

-                FunctionArgumentAttributeValue attrDuration0 = null;

-                FunctionArgumentAttributeValue attrDurationStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationMsecs = null;

-                FunctionArgumentAttributeValue attrDurationCrossover = null;

-        

-                // misc bad

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                // set values

-                try {

-                        // Date attrs

-                        attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeStdExample1));

-                        attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeMsecs));

-                        attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeCrossover));

-                        attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeBC));

-                        attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeTimeZone0));

-                        attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeTimeZone5));

-                        

-                        // Duration attrs

-                        attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(duration0));

-                        attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationStdExample1));

-                        attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationNStdExample1));

-                        attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationMsecs));

-                        attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationCrossover));

+        FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATETIME_SUBTRACT_YEARMONTHDURATION;

 

-                        // misc bad

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATE_ADD_YEARMONTHDURATION;

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION, fd.getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // Duration = 0 => same as original

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDuration0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                ISO8601Date resValue = (ISO8601Date)res.getValue().getValue();

-                assertEquals(dateTimeStdExample1, resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

 

-                

-                // simple positive operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                ISO8601Date testResponse = new ISO8601Date(2005, 8, 12);

-                assertEquals(testResponse, resValue);	

-                

-                // negative operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationNStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(1994, 6, 12);

-                assertEquals(testResponse, resValue);

-                

-                // millisecs work correctly (not relevant to YearMonth, but should not break

-                arguments.clear();

-                arguments.add(attrDateTimeMsecs);

-                arguments.add(attrDurationMsecs);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(2005, 8, 12);

-                assertEquals(testResponse, resValue);

-        

-                // cross minute => cross day => cross month => cross year

-                arguments.clear();

-                arguments.add(attrDateTimeCrossover);

-                arguments.add(attrDurationCrossover);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(2001, 1, 31);

-                assertEquals(testResponse, resValue);

-                

-                // negative (BC) original date add goes the right direction

-                arguments.clear();

-                arguments.add(attrDateTimeBC);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(-1995, 8, 12);

-                assertEquals(testResponse, resValue);	

-                

-                // non-null timezone not changed

-                // original has timezone offset = 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone0);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(timeZone0, 2005, 8, 12);

-                assertEquals(testResponse, resValue);

-                

-                // original has timezone offset not 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone5);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(timeZone5, 2005, 8, 12);

-                assertEquals(testResponse, resValue);

+        // Duration = 0 => same as original

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDuration0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(dateTimeStdExample1, resValue);

 

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // simple positive operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        ISO8601DateTime testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(1994, 6, 12),

+            new ISO8601Time(12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

 

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // negative operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationNStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(2005, 8, 12),

+            new ISO8601Time(12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

 

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-add-yearMonthDuration Expected data type 'date' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // millisecs work correctly (not relevant to YearMonth, but should not break

+        arguments.clear();

+        arguments.add(attrDateTimeMsecs);

+        arguments.add(attrDurationMsecs);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(1994, 6, 12),

+            new ISO8601Time(12, 13, 14, 777) );

+        assertEquals(testResponse, resValue);

+

+        // cross minute => cross day => cross month => cross year

+        arguments.clear();

+        arguments.add(attrDateTimeCrossover);

+        arguments.add(attrDurationCrossover);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(1999, 12, 1),

+            new ISO8601Time(23, 59, 30, 1) );

+        assertEquals(testResponse, resValue);

+

+        // negative (BC) original date add goes the right direction

+        arguments.clear();

+        arguments.add(attrDateTimeBC);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            null,

+            new ISO8601Date(-2006, 6, 12),

+            new ISO8601Time(12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

+

+        // non-null timezone not changed

+        // original has timezone offset = 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone0);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            timeZone0,

+            new ISO8601Date(timeZone0, 1994, 6, 12),

+            new ISO8601Time(timeZone0, 12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

+

+        // original has timezone offset not 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone5);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601DateTime.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        testResponse = new ISO8601DateTime(

+            timeZone5,

+            new ISO8601Date(timeZone5, 1994, 6, 12),

+            new ISO8601Time(timeZone5, 12, 13, 14, 0) );

+        assertEquals(testResponse, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-yearMonthDuration Expected data type 'dateTime' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+

+

+

+

+

+

+    @Test

+    public void testDate_add_yearMonthDuration() {

+        // Date objects to be adjusted

+        ISO8601Date dateTimeStdExample1 = new ISO8601Date(2000, 1, 12);

+        ISO8601Date dateTimeMsecs =new ISO8601Date(2000, 1, 12);

+        ISO8601Date dateTimeCrossover = new ISO8601Date(2000, 12, 31);

+        ISO8601Date dateTimeBC = new ISO8601Date(-2000, 1, 12);

+        ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

+        ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

+        ISO8601Date dateTimeTimeZone0 = new ISO8601Date(timeZone0, 2000, 1, 12);

+        ISO8601Date dateTimeTimeZone5 = new ISO8601Date(timeZone5, 2000, 1, 12);

+

+        // Durations

+        XPathYearMonthDuration duration0 = new XPathYearMonthDuration(1, 0, 0);

+        XPathYearMonthDuration durationStdExample1 = new XPathYearMonthDuration(1, 5, 7);

+        XPathYearMonthDuration durationNStdExample1 = new XPathYearMonthDuration(-1, 5, 7);

+        XPathYearMonthDuration durationMsecs = new XPathYearMonthDuration(1, 5, 7);

+        XPathYearMonthDuration durationCrossover = new XPathYearMonthDuration(1, 0, 1);

+

+        // ARGS declarations

+        // Dates

+        FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

+        FunctionArgumentAttributeValue attrDateTimeMsecs = null;

+        FunctionArgumentAttributeValue attrDateTimeCrossover = null;

+        FunctionArgumentAttributeValue attrDateTimeBC = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

+

+        // Durations

+        FunctionArgumentAttributeValue attrDuration0 = null;

+        FunctionArgumentAttributeValue attrDurationStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationMsecs = null;

+        FunctionArgumentAttributeValue attrDurationCrossover = null;

+

+        // misc bad

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        // set values

+        try {

+            // Date attrs

+            attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeStdExample1));

+            attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeMsecs));

+            attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeCrossover));

+            attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeBC));

+            attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeTimeZone0));

+            attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeTimeZone5));

+

+            // Duration attrs

+            attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(duration0));

+            attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationStdExample1));

+            attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationNStdExample1));

+            attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationMsecs));

+            attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationCrossover));

+

+            // misc bad

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testDate_subtract_yearMonthDuration() {

-                // Date objects to be adjusted

-                ISO8601Date dateTimeStdExample1 =new ISO8601Date(2000, 1, 12);

-                ISO8601Date dateTimeMsecs = new ISO8601Date(2000, 1, 12);

-                ISO8601Date dateTimeCrossover = new ISO8601Date(2000, 1, 1);

-                ISO8601Date dateTimeBC = new ISO8601Date(-2000, 1, 12);

-                ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

-                ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

-                ISO8601Date dateTimeTimeZone0 = new ISO8601Date(timeZone0, 2000, 1, 12);

-                ISO8601Date dateTimeTimeZone5 = new ISO8601Date(timeZone5, 2000, 1, 12);

-                

-                // Durations

-                XPathYearMonthDuration duration0 = new XPathYearMonthDuration(1, 0, 0);

-                XPathYearMonthDuration durationStdExample1 = new XPathYearMonthDuration(1, 5, 7);

-                XPathYearMonthDuration durationNStdExample1 = new XPathYearMonthDuration(-1, 5, 7);

-                XPathYearMonthDuration durationMsecs = new XPathYearMonthDuration(1, 5, 7);

-                XPathYearMonthDuration durationCrossover = new XPathYearMonthDuration(1, 0, 1);

 

-                // ARGS declarations

-                // Dates

-                FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

-                FunctionArgumentAttributeValue attrDateTimeMsecs = null;

-                FunctionArgumentAttributeValue attrDateTimeCrossover = null;

-                FunctionArgumentAttributeValue attrDateTimeBC = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

-                FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

-        

-                // Durations

-                FunctionArgumentAttributeValue attrDuration0 = null;

-                FunctionArgumentAttributeValue attrDurationStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

-                FunctionArgumentAttributeValue attrDurationMsecs = null;

-                FunctionArgumentAttributeValue attrDurationCrossover = null;

-        

-                // misc bad

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                // set values

-                try {

-                        // Date attrs

-                        attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeStdExample1));

-                        attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeMsecs));

-                        attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeCrossover));

-                        attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeBC));

-                        attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeTimeZone0));

-                        attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeTimeZone5));

-                        

-                        // Duration attrs

-                        attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(duration0));

-                        attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationStdExample1));

-                        attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationNStdExample1));

-                        attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationMsecs));

-                        attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationCrossover));

+        FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATE_ADD_YEARMONTHDURATION;

 

-                        // misc bad

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATE_SUBTRACT_YEARMONTHDURATION;

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION, fd.getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeId());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION, fd.getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // Duration = 0 => same as original

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDuration0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                ISO8601Date resValue = (ISO8601Date)res.getValue().getValue();

-                assertEquals(dateTimeStdExample1, resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

 

-                

-                // simple positive operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                ISO8601Date testResponse = new ISO8601Date(1994, 6, 12);

-                assertEquals(testResponse, resValue);	

-                

-                // negative operation

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrDurationNStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(2005, 8, 12);

-                assertEquals(testResponse, resValue);

-                

-                // millisecs work correctly (not relevant to YearMonth, but should not break

-                arguments.clear();

-                arguments.add(attrDateTimeMsecs);

-                arguments.add(attrDurationMsecs);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(1994, 6, 12);

-                assertEquals(testResponse, resValue);

-        

-                // cross minute => cross day => cross month => cross year

-                arguments.clear();

-                arguments.add(attrDateTimeCrossover);

-                arguments.add(attrDurationCrossover);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(1999, 12, 1);

-                assertEquals(testResponse, resValue);

-                

-                // negative (BC) original date add goes the right direction

-                arguments.clear();

-                arguments.add(attrDateTimeBC);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(-2006, 6, 12);

-                assertEquals(testResponse, resValue);	

-                

-                // non-null timezone not changed

-                // original has timezone offset = 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone0);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(timeZone0, 1994, 6, 12);

-                assertEquals(testResponse, resValue);

-                

-                // original has timezone offset not 0

-                arguments.clear();

-                arguments.add(attrDateTimeTimeZone5);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                testResponse = new ISO8601Date(timeZone5, 1994, 6, 12);

-                assertEquals(testResponse, resValue);

+        // Duration = 0 => same as original

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDuration0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        ISO8601Date resValue = (ISO8601Date)res.getValue().getValue();

+        assertEquals(dateTimeStdExample1, resValue);

 

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // simple positive operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        ISO8601Date testResponse = new ISO8601Date(2005, 8, 12);

+        assertEquals(testResponse, resValue);

 

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // negative operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationNStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(1994, 6, 12);

+        assertEquals(testResponse, resValue);

 

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrDurationStdExample1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-subtract-yearMonthDuration Expected data type 'date' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrDateTimeStdExample1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // millisecs work correctly (not relevant to YearMonth, but should not break

+        arguments.clear();

+        arguments.add(attrDateTimeMsecs);

+        arguments.add(attrDurationMsecs);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(2005, 8, 12);

+        assertEquals(testResponse, resValue);

+

+        // cross minute => cross day => cross month => cross year

+        arguments.clear();

+        arguments.add(attrDateTimeCrossover);

+        arguments.add(attrDurationCrossover);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(2001, 1, 31);

+        assertEquals(testResponse, resValue);

+

+        // negative (BC) original date add goes the right direction

+        arguments.clear();

+        arguments.add(attrDateTimeBC);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(-1995, 8, 12);

+        assertEquals(testResponse, resValue);

+

+        // non-null timezone not changed

+        // original has timezone offset = 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone0);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(timeZone0, 2005, 8, 12);

+        assertEquals(testResponse, resValue);

+

+        // original has timezone offset not 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone5);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(timeZone5, 2005, 8, 12);

+        assertEquals(testResponse, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-add-yearMonthDuration Expected data type 'date' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-add-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+

+    @Test

+    public void testDate_subtract_yearMonthDuration() {

+        // Date objects to be adjusted

+        ISO8601Date dateTimeStdExample1 =new ISO8601Date(2000, 1, 12);

+        ISO8601Date dateTimeMsecs = new ISO8601Date(2000, 1, 12);

+        ISO8601Date dateTimeCrossover = new ISO8601Date(2000, 1, 1);

+        ISO8601Date dateTimeBC = new ISO8601Date(-2000, 1, 12);

+        ISO8601TimeZone timeZone0 = new ISO8601TimeZone(0);

+        ISO8601TimeZone timeZone5 = new ISO8601TimeZone(5 * 60);

+        ISO8601Date dateTimeTimeZone0 = new ISO8601Date(timeZone0, 2000, 1, 12);

+        ISO8601Date dateTimeTimeZone5 = new ISO8601Date(timeZone5, 2000, 1, 12);

+

+        // Durations

+        XPathYearMonthDuration duration0 = new XPathYearMonthDuration(1, 0, 0);

+        XPathYearMonthDuration durationStdExample1 = new XPathYearMonthDuration(1, 5, 7);

+        XPathYearMonthDuration durationNStdExample1 = new XPathYearMonthDuration(-1, 5, 7);

+        XPathYearMonthDuration durationMsecs = new XPathYearMonthDuration(1, 5, 7);

+        XPathYearMonthDuration durationCrossover = new XPathYearMonthDuration(1, 0, 1);

+

+        // ARGS declarations

+        // Dates

+        FunctionArgumentAttributeValue attrDateTimeStdExample1 = null;

+        FunctionArgumentAttributeValue attrDateTimeMsecs = null;

+        FunctionArgumentAttributeValue attrDateTimeCrossover = null;

+        FunctionArgumentAttributeValue attrDateTimeBC = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone0 = null;

+        FunctionArgumentAttributeValue attrDateTimeTimeZone5 = null;

+

+        // Durations

+        FunctionArgumentAttributeValue attrDuration0 = null;

+        FunctionArgumentAttributeValue attrDurationStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationNStdExample1 = null;

+        FunctionArgumentAttributeValue attrDurationMsecs = null;

+        FunctionArgumentAttributeValue attrDurationCrossover = null;

+

+        // misc bad

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        // set values

+        try {

+            // Date attrs

+            attrDateTimeStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeStdExample1));

+            attrDateTimeMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeMsecs));

+            attrDateTimeCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeCrossover));

+            attrDateTimeBC = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeBC));

+            attrDateTimeTimeZone0 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeTimeZone0));

+            attrDateTimeTimeZone5 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(dateTimeTimeZone5));

+

+            // Duration attrs

+            attrDuration0 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(duration0));

+            attrDurationStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationStdExample1));

+            attrDurationNStdExample1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationNStdExample1));

+            attrDurationMsecs = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationMsecs));

+            attrDurationCrossover = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(durationCrossover));

+

+            // misc bad

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        

+

+        FunctionDefinitionDateTimeArithmetic<?,?> fd = (FunctionDefinitionDateTimeArithmetic<?,?>) StdFunctions.FD_DATE_SUBTRACT_YEARMONTHDURATION;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION, fd.getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // Duration = 0 => same as original

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDuration0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        ISO8601Date resValue = (ISO8601Date)res.getValue().getValue();

+        assertEquals(dateTimeStdExample1, resValue);

+

+

+        // simple positive operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        ISO8601Date testResponse = new ISO8601Date(1994, 6, 12);

+        assertEquals(testResponse, resValue);

+

+        // negative operation

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrDurationNStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(2005, 8, 12);

+        assertEquals(testResponse, resValue);

+

+        // millisecs work correctly (not relevant to YearMonth, but should not break

+        arguments.clear();

+        arguments.add(attrDateTimeMsecs);

+        arguments.add(attrDurationMsecs);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(1994, 6, 12);

+        assertEquals(testResponse, resValue);

+

+        // cross minute => cross day => cross month => cross year

+        arguments.clear();

+        arguments.add(attrDateTimeCrossover);

+        arguments.add(attrDurationCrossover);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(1999, 12, 1);

+        assertEquals(testResponse, resValue);

+

+        // negative (BC) original date add goes the right direction

+        arguments.clear();

+        arguments.add(attrDateTimeBC);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(-2006, 6, 12);

+        assertEquals(testResponse, resValue);

+

+        // non-null timezone not changed

+        // original has timezone offset = 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone0);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(timeZone0, 1994, 6, 12);

+        assertEquals(testResponse, resValue);

+

+        // original has timezone offset not 0

+        arguments.clear();

+        arguments.add(attrDateTimeTimeZone5);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(ISO8601Date.class, res.getValue().getValue().getClass());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        testResponse = new ISO8601Date(timeZone5, 1994, 6, 12);

+        assertEquals(testResponse, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrDurationStdExample1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-subtract-yearMonthDuration Expected data type 'date' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrDateTimeStdExample1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-subtract-yearMonthDuration Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionEqualityTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionEqualityTest.java
index 5ed8dda..935f6dd 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionEqualityTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionEqualityTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -62,10 +62,10 @@
 

 /**

  * Test FunctionDefinitionEquality, all of its super-classes, and all XACML functions supported by that class.

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

@@ -78,1125 +78,1125 @@
  * 		dateTime-equal

  * 		dayTimeDuration-equal

  * 		yearMonthDuration-equal

- * 

+ *

  * Each of these is put into a separate test method just to keep things organized.

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionEqualityTest {

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        FunctionArgumentAttributeValue stringAttr1 = null;

-        FunctionArgumentAttributeValue stringAttr2 = null;

-        FunctionArgumentAttributeValue stringAttr3 = null;

-        FunctionArgumentAttributeValue stringAttr4 =  null;

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-        FunctionArgumentAttributeValue booleanAttrT1 = null;

-        FunctionArgumentAttributeValue booleanAttrT2 = null;

-        FunctionArgumentAttributeValue booleanAttrF1 = null;

-        FunctionArgumentAttributeValue booleanAttrF2 = null;

+    FunctionArgumentAttributeValue stringAttr1 = null;

+    FunctionArgumentAttributeValue stringAttr2 = null;

+    FunctionArgumentAttributeValue stringAttr3 = null;

+    FunctionArgumentAttributeValue stringAttr4 =  null;

 

-        FunctionArgumentAttributeValue intAttr1 = null;

-        FunctionArgumentAttributeValue intAttr1a = null;

-        FunctionArgumentAttributeValue intAttr2 = null;

-        FunctionArgumentAttributeValue intAttr0 = null;

-        FunctionArgumentAttributeValue intAttrNeg1 = null;

+    FunctionArgumentAttributeValue booleanAttrT1 = null;

+    FunctionArgumentAttributeValue booleanAttrT2 = null;

+    FunctionArgumentAttributeValue booleanAttrF1 = null;

+    FunctionArgumentAttributeValue booleanAttrF2 = null;

 

-        public FunctionDefinitionEqualityTest() {

-                try {

-                        stringAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

-                        stringAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

-                        stringAttr3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("ABC"));

-                        stringAttr4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("def"));

+    FunctionArgumentAttributeValue intAttr1 = null;

+    FunctionArgumentAttributeValue intAttr1a = null;

+    FunctionArgumentAttributeValue intAttr2 = null;

+    FunctionArgumentAttributeValue intAttr0 = null;

+    FunctionArgumentAttributeValue intAttrNeg1 = null;

 

-                        booleanAttrT1 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(true));

-                        booleanAttrT2 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(true));

-                        booleanAttrF1 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                        booleanAttrF2 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+    public FunctionDefinitionEqualityTest() {

+        try {

+            stringAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

+            stringAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

+            stringAttr3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("ABC"));

+            stringAttr4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("def"));

 

-                        intAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                        intAttr1a = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                        intAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

-                        intAttr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                        intAttrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-1));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

+            booleanAttrT1 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(true));

+            booleanAttrT2 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(true));

+            booleanAttrF1 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            booleanAttrF2 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+

+            intAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+            intAttr1a = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+            intAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

+            intAttr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            intAttrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-1));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        

-        

-        /**

-         * String (matching case)

-         */

-        @Test

-        public void testString_Equal() {

-                

-                // String exact match

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_STRING_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check "abc" with "abc" - separate string objects with same value

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+    }

 

-                // check "abc" with "ABC" (not same)

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr3);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

 

+

+

+    /**

+     * String (matching case)

+     */

+    @Test

+    public void testString_Equal() {

+

+        // String exact match

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_STRING_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check "abc" with "abc" - separate string objects with same value

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check "abc" with "ABC" (not same)

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr3);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+

+    /**

+     * Boolean

+     */

+    @Test

+    public void testBoolean_Equal() {

+

+        // String exact match

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_BOOLEAN_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_BOOLEAN_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with same value

+        arguments.add(booleanAttrT1);

+        arguments.add(booleanAttrT2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check different values

+        arguments.clear();

+        arguments.add(booleanAttrT1);

+        arguments.add(booleanAttrF1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+    /**

+     * Integer

+     */

+    @Test

+    public void testInteger_Equal() {

+

+        // String exact match

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_INTEGER_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with same value

+        arguments.add(intAttr1);

+        arguments.add(intAttr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        arguments.clear();

+        arguments.add(intAttr1);

+        arguments.add(intAttrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+

+    /**

+     * Double

+     */

+    @Test

+    public void testDouble_Equal() {

+        FunctionArgumentAttributeValue attr1 = null;

+        FunctionArgumentAttributeValue attr1a = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        FunctionArgumentAttributeValue attrNeg1 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.0));

+            attr1a = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.0));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.4));

+            attrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-1.0));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        

-        

-        /**

-         * Boolean

-         */

-        @Test

-        public void testBoolean_Equal() {

-                

-                // String exact match

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_BOOLEAN_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_BOOLEAN_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with same value

-                arguments.add(booleanAttrT1);

-                arguments.add(booleanAttrT2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // String exact match

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DOUBLE_EQUAL;

 

-                // check different values

-                arguments.clear();

-                arguments.add(booleanAttrT1);

-                arguments.add(booleanAttrF1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

 

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attr1);

+        arguments.add(attr1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        arguments.clear();

+        arguments.add(attr1);

+        arguments.add(attrNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+

+

+

+    /**

+     * Date

+     */

+    @Test

+    public void testDate_Equal() {

+        Calendar calendar = Calendar.getInstance();

+        Date today = calendar.getTime();

+        Date longAgo = new Date(1234);

+        // create a date that is different than "today" but within the same day (i.e. has a different hour)

+        if (calendar.get(Calendar.HOUR_OF_DAY) > 3) {

+            calendar.set(Calendar.HOUR_OF_DAY, 3);

+        } else {

+            calendar.set(Calendar.HOUR_OF_DAY, 5);

         }

-        

-        

-        /**

-         * Integer

-         */

-        @Test

-        public void testInteger_Equal() {

-                

-                // String exact match

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_INTEGER_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with same value

-                arguments.add(intAttr1);

-                arguments.add(intAttr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        Date todayPlus = calendar.getTime();

 

-                // check not same

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                arguments.clear();

-                arguments.add(intAttr1);

-                arguments.add(intAttrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

 

+        FunctionArgumentAttributeValue attrToday = null;

+        FunctionArgumentAttributeValue attrToday2 = null;

+        FunctionArgumentAttributeValue attrLaterToday = null;

+        FunctionArgumentAttributeValue attrYesterday = null;

+        try {

+            attrToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(today));

+            attrToday2 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(today));

+            attrLaterToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(todayPlus));

+            attrYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(longAgo));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        

-        /**

-         * Double

-         */

-        @Test

-        public void testDouble_Equal() {

-                FunctionArgumentAttributeValue attr1 = null;

-                FunctionArgumentAttributeValue attr1a = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                FunctionArgumentAttributeValue attrNeg1 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.0));

-                        attr1a = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.0));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(2.4));

-                        attrNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(-1.0));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                // String exact match

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DOUBLE_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attr1);

-                arguments.add(attr1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

 

-                // check not same

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                arguments.clear();

-                arguments.add(attr1);

-                arguments.add(attrNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // String exact match

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DATE_EQUAL;

 

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATE_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrToday);

+        arguments.add(attrToday2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrToday);

+        arguments.add(attrYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // Date objects with different times but within the same day should match

+        arguments.clear();

+        arguments.add(attrToday);

+        arguments.add(attrLaterToday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+

+

+    /**

+     * Time

+     */

+    @Test

+    public void testTime_Equal() {

+

+        Date now = new Date();

+        Date now2 = new Date(now.getTime());

+        Date notNow = new Date(now.getTime() - 100000);

+

+        FunctionArgumentAttributeValue attrNow = null;

+        FunctionArgumentAttributeValue attrNow2 = null;

+        FunctionArgumentAttributeValue attrNotNow = null;

+        try {

+            attrNow = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(now));

+            attrNow2 = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(now2));

+            attrNotNow = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(notNow));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        

-        

-        

-        /**

-         * Date

-         */

-        @Test

-        public void testDate_Equal() {

-                Calendar calendar = Calendar.getInstance();

-                Date today = calendar.getTime();

-                Date longAgo = new Date(1234);

-                // create a date that is different than "today" but within the same day (i.e. has a different hour)

-                if (calendar.get(Calendar.HOUR_OF_DAY) > 3) {

-                        calendar.set(Calendar.HOUR_OF_DAY, 3);

-                } else {

-                        calendar.set(Calendar.HOUR_OF_DAY, 5);

-                }

-                Date todayPlus = calendar.getTime();

+

+        // String exact match

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_TIME_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_TIME_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrNow);

+        arguments.add(attrNow2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrNow);

+        arguments.add(attrNotNow);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

 

 

-                FunctionArgumentAttributeValue attrToday = null;

-                FunctionArgumentAttributeValue attrToday2 = null;

-                FunctionArgumentAttributeValue attrLaterToday = null;		

-                FunctionArgumentAttributeValue attrYesterday = null;

-                try {

-                        attrToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(today));

-                        attrToday2 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(today));

-                        attrLaterToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(todayPlus));		

-                        attrYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue(longAgo));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                // String exact match

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DATE_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATE_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrToday);

-                arguments.add(attrToday2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

 

-                // check not same

-                arguments.clear();

-                arguments.add(attrToday);

-                arguments.add(attrYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // Date objects with different times but within the same day should match

-                arguments.clear();

-                arguments.add(attrToday);

-                arguments.add(attrLaterToday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-

+    /**

+     * DateTime

+     */

+    @Test

+    public void testDateTime_Equal() {

+        Calendar calendar = Calendar.getInstance();

+        Date today = calendar.getTime();

+        Date longAgo = new Date(1234);

+        // create a dateTime that is different than "today" changing only the Timezone

+        if (calendar.get(Calendar.ZONE_OFFSET) > 3) {

+            calendar.set(Calendar.ZONE_OFFSET, 3);

+        } else {

+            calendar.set(Calendar.ZONE_OFFSET, 5);

         }

-        

-        

-        

-        

-        /**

-         * Time

-         */

-        @Test

-        public void testTime_Equal() {

-                

-                Date now = new Date();

-                Date now2 = new Date(now.getTime());

-                Date notNow = new Date(now.getTime() - 100000);

-                

-                FunctionArgumentAttributeValue attrNow = null;

-                FunctionArgumentAttributeValue attrNow2 = null;

-                FunctionArgumentAttributeValue attrNotNow = null;

-                try {

-                        attrNow = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(now));

-                        attrNow2 = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(now2));

-                        attrNotNow = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue(notNow));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

+        Date todayPlus = calendar.getTime();

 

-                // String exact match

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_TIME_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_TIME_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrNow);

-                arguments.add(attrNow2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

 

-                // check not same

-                arguments.clear();

-                arguments.add(attrNow);

-                arguments.add(attrNotNow);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-

+        FunctionArgumentAttributeValue attrToday = null;

+        FunctionArgumentAttributeValue attrToday2 = null;

+        FunctionArgumentAttributeValue attrLaterToday = null;

+        FunctionArgumentAttributeValue attrYesterday = null;

+        try {

+            attrToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(today));

+            attrToday2 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(today));

+            attrLaterToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(todayPlus));

+            attrYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(longAgo));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        

-        

-        /**

-         * DateTime

-         */

-        @Test

-        public void testDateTime_Equal() {

-                Calendar calendar = Calendar.getInstance();

-                Date today = calendar.getTime();

-                Date longAgo = new Date(1234);

-                // create a dateTime that is different than "today" changing only the Timezone

-                if (calendar.get(Calendar.ZONE_OFFSET) > 3) {

-                        calendar.set(Calendar.ZONE_OFFSET, 3);

-                } else {

-                        calendar.set(Calendar.ZONE_OFFSET, 5);

-                }

-                Date todayPlus = calendar.getTime();

+

+        // String exact match

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DATETIME_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrToday);

+        arguments.add(attrToday2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrToday);

+        arguments.add(attrYesterday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // DateTime with different Zones should not match

+        arguments.clear();

+        arguments.add(attrToday);

+        arguments.add(attrLaterToday);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

 

 

-                FunctionArgumentAttributeValue attrToday = null;

-                FunctionArgumentAttributeValue attrToday2 = null;

-                FunctionArgumentAttributeValue attrLaterToday = null;		

-                FunctionArgumentAttributeValue attrYesterday = null;

-                try {

-                        attrToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(today));

-                        attrToday2 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(today));

-                        attrLaterToday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(todayPlus));		

-                        attrYesterday = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue(longAgo));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                // String exact match

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DATETIME_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrToday);

-                arguments.add(attrToday2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+    /**

+     * dayTimeDuration - Version1

+     */

+    @Test

+    public void testDayTimeDuration_Equal_V1() {

 

-                // check not same

-                arguments.clear();

-                arguments.add(attrToday);

-                arguments.add(attrYesterday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // DateTime with different Zones should not match

-                arguments.clear();

-                arguments.add(attrToday);

-                arguments.add(attrLaterToday);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        XPathDayTimeDuration dur1 = new XPathDayTimeDuration(1, 3, 5, 12, 38);

+        XPathDayTimeDuration dur2 = new XPathDayTimeDuration(1, 3, 5, 12, 38);

+        XPathDayTimeDuration differentDur = new XPathDayTimeDuration(-1, 4, 7, 5, 33);

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-

+        FunctionArgumentAttributeValue attrDur1 = null;

+        FunctionArgumentAttributeValue attrDur2 = null;

+        FunctionArgumentAttributeValue attrDifferentDur = null;

+        try {

+            attrDur1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(dur1));

+            attrDur2 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(dur2));

+            attrDifferentDur = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(differentDur));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        /**

-         * dayTimeDuration - Version1

-         */

-        @Test

-        public void testDayTimeDuration_Equal_V1() {

-                

-                XPathDayTimeDuration dur1 = new XPathDayTimeDuration(1, 3, 5, 12, 38);

-                XPathDayTimeDuration dur2 = new XPathDayTimeDuration(1, 3, 5, 12, 38);

-                XPathDayTimeDuration differentDur = new XPathDayTimeDuration(-1, 4, 7, 5, 33);

 

-                FunctionArgumentAttributeValue attrDur1 = null;

-                FunctionArgumentAttributeValue attrDur2 = null;

-                FunctionArgumentAttributeValue attrDifferentDur = null;

-                try {

-                        attrDur1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(dur1));

-                        attrDur2 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(dur2));

-                        attrDifferentDur = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(differentDur));		

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DAYTIMEDURATION_EQUAL_VERSION1;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML1.ID_FUNCTION_DAYTIMEDURATION_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DAYTIMEDURATION.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrDur1);

-                arguments.add(attrDur2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DAYTIMEDURATION_EQUAL_VERSION1;

 

-                // check not same

-                arguments.clear();

-                arguments.add(attrDur1);

-                arguments.add(attrDifferentDur);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML1.ID_FUNCTION_DAYTIMEDURATION_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DAYTIMEDURATION.getId(), fd.getDataTypeArgs().getId());

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrDur1);

+        arguments.add(attrDur2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrDur1);

+        arguments.add(attrDifferentDur);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+    /**

+     * dayTimeDuration - Current version

+     */

+    @Test

+    public void testDayTimeDuration_Equal() {

+

+        XPathDayTimeDuration dur1 = new XPathDayTimeDuration(1, 3, 5, 12, 38);

+        XPathDayTimeDuration dur2 = new XPathDayTimeDuration(1, 3, 5, 12, 38);

+        XPathDayTimeDuration differentDur = new XPathDayTimeDuration(-1, 4, 7, 5, 33);

+

+        FunctionArgumentAttributeValue attrDur1 = null;

+        FunctionArgumentAttributeValue attrDur2 = null;

+        FunctionArgumentAttributeValue attrDifferentDur = null;

+        try {

+            attrDur1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(dur1));

+            attrDur2 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(dur2));

+            attrDifferentDur = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(differentDur));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        /**

-         * dayTimeDuration - Current version

-         */

-        @Test

-        public void testDayTimeDuration_Equal() {

-                

-                XPathDayTimeDuration dur1 = new XPathDayTimeDuration(1, 3, 5, 12, 38);

-                XPathDayTimeDuration dur2 = new XPathDayTimeDuration(1, 3, 5, 12, 38);

-                XPathDayTimeDuration differentDur = new XPathDayTimeDuration(-1, 4, 7, 5, 33);

 

-                FunctionArgumentAttributeValue attrDur1 = null;

-                FunctionArgumentAttributeValue attrDur2 = null;

-                FunctionArgumentAttributeValue attrDifferentDur = null;		

-                try {

-                        attrDur1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(dur1));

-                        attrDur2 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(dur2));

-                        attrDifferentDur = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(differentDur));	

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DAYTIMEDURATION_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DAYTIMEDURATION_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_DAYTIMEDURATION.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrDur1);

-                arguments.add(attrDur2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_DAYTIMEDURATION_EQUAL;

 

-                // check not same

-                arguments.clear();

-                arguments.add(attrDur1);

-                arguments.add(attrDifferentDur);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DAYTIMEDURATION_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_DAYTIMEDURATION.getId(), fd.getDataTypeArgs().getId());

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrDur1);

+        arguments.add(attrDur2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrDur1);

+        arguments.add(attrDifferentDur);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+

+    /**

+     * dayTimeDuration - Version1

+     */

+    @Test

+    public void testYearMonthDuration_Equal_V1() {

+

+        XPathYearMonthDuration dur1 = new XPathYearMonthDuration(1, 3, 5);

+        XPathYearMonthDuration dur2 = new XPathYearMonthDuration(1, 3, 5);

+        XPathYearMonthDuration differentDur = new XPathYearMonthDuration(-1, 4, 7);

+

+        FunctionArgumentAttributeValue attrDur1 = null;

+        FunctionArgumentAttributeValue attrDur2 = null;

+        FunctionArgumentAttributeValue attrDifferentDur = null;

+        try {

+            attrDur1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(dur1));

+            attrDur2 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(dur2));

+            attrDifferentDur = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(differentDur));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        

-        /**

-         * dayTimeDuration - Version1

-         */

-        @Test

-        public void testYearMonthDuration_Equal_V1() {

-                

-                XPathYearMonthDuration dur1 = new XPathYearMonthDuration(1, 3, 5);

-                XPathYearMonthDuration dur2 = new XPathYearMonthDuration(1, 3, 5);

-                XPathYearMonthDuration differentDur = new XPathYearMonthDuration(-1, 4, 7);

 

-                FunctionArgumentAttributeValue attrDur1 = null;

-                FunctionArgumentAttributeValue attrDur2 = null;

-                FunctionArgumentAttributeValue attrDifferentDur = null;		

-                try {

-                        attrDur1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(dur1));

-                        attrDur2 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(dur2));

-                        attrDifferentDur = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(differentDur));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_YEARMONTHDURATION_EQUAL_VERSION1;

 

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_YEARMONTHDURATION_EQUAL_VERSION1;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML1.ID_FUNCTION_YEARMONTHDURATION_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_YEARMONTHDURATION.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrDur1);

-                arguments.add(attrDur2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML1.ID_FUNCTION_YEARMONTHDURATION_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_YEARMONTHDURATION.getId(), fd.getDataTypeArgs().getId());

 

-                // check not same

-                arguments.clear();

-                arguments.add(attrDur1);

-                arguments.add(attrDifferentDur);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrDur1);

+        arguments.add(attrDur2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

+        // check not same

+        arguments.clear();

+        arguments.add(attrDur1);

+        arguments.add(attrDifferentDur);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+

+

+    /**

+     * dayTimeDuration - Current version

+     */

+    @Test

+    public void testYearMonthDuration_Equal() {

+

+        XPathYearMonthDuration dur1 = new XPathYearMonthDuration(1, 3, 5);

+        XPathYearMonthDuration dur2 = new XPathYearMonthDuration(1, 3, 5);

+        XPathYearMonthDuration differentDur = new XPathYearMonthDuration(-1, 4, 7);

+

+        FunctionArgumentAttributeValue attrDur1 = null;

+        FunctionArgumentAttributeValue attrDur2 = null;

+        FunctionArgumentAttributeValue attrDifferentDur = null;

+        try {

+            attrDur1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(dur1));

+            attrDur2 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(dur2));

+            attrDifferentDur = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(differentDur));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

 

-        

-        /**

-         * dayTimeDuration - Current version

-         */

-        @Test

-        public void testYearMonthDuration_Equal() {

-                

-                XPathYearMonthDuration dur1 = new XPathYearMonthDuration(1, 3, 5);

-                XPathYearMonthDuration dur2 = new XPathYearMonthDuration(1, 3, 5);

-                XPathYearMonthDuration differentDur = new XPathYearMonthDuration(-1, 4, 7);

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_YEARMONTHDURATION_EQUAL;

 

-                FunctionArgumentAttributeValue attrDur1 = null;

-                FunctionArgumentAttributeValue attrDur2 = null;

-                FunctionArgumentAttributeValue attrDifferentDur = null;		

-                try {

-                        attrDur1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(dur1));

-                        attrDur2 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(dur2));

-                        attrDifferentDur = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(differentDur));	

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_YEARMONTHDURATION_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_YEARMONTHDURATION.getId(), fd.getDataTypeArgs().getId());

 

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_YEARMONTHDURATION_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_YEARMONTHDURATION_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_YEARMONTHDURATION.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrDur1);

-                arguments.add(attrDur2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

-                // check not same

-                arguments.clear();

-                arguments.add(attrDur1);

-                arguments.add(attrDifferentDur);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrDur1);

+        arguments.add(attrDur2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        // check not same

+        arguments.clear();

+        arguments.add(attrDur1);

+        arguments.add(attrDifferentDur);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+    /**

+     * URI

+     */

+    @Test

+    public void testAnyURI_Equal() {

+

+        URI uri1 = null;

+        URI uri2 = null;

+        URI uriNotThere = null;

+        try {

+            uri1 = new URI("http://someplace.com/gothere");

+            uri2 = new URI("http://someplace.com/gothere");

+            uriNotThere = new URI("http://someplace.com/notGoingThere");

+        } catch (Exception e) {

+            fail(e.toString());

         }

-        

-        

-        /**

-         * URI

-         */

-        @Test

-        public void testAnyURI_Equal() {

 

-                URI uri1 = null;

-                URI uri2 = null;

-                URI uriNotThere = null;

-                try {

-                        uri1 = new URI("http://someplace.com/gothere");

-                        uri2 = new URI("http://someplace.com/gothere");

-                        uriNotThere = new URI("http://someplace.com/notGoingThere");

-                } catch (Exception e) {

-                        fail(e.toString());

-                }

-

-                FunctionArgumentAttributeValue attrUri1 = null;

-                FunctionArgumentAttributeValue attrUri2 = null;

-                FunctionArgumentAttributeValue attrUriNotThere = null;	

-                try {

-                        attrUri1 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uri1));

-                        attrUri2 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uri2));

-                        attrUriNotThere = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uriNotThere));	

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_ANYURI_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANYURI_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_ANYURI.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrUri1);

-                arguments.add(attrUri2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-

-                // check not same

-                arguments.clear();

-                arguments.add(attrUri1);

-                arguments.add(attrUriNotThere);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-

+        FunctionArgumentAttributeValue attrUri1 = null;

+        FunctionArgumentAttributeValue attrUri2 = null;

+        FunctionArgumentAttributeValue attrUriNotThere = null;

+        try {

+            attrUri1 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uri1));

+            attrUri2 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uri2));

+            attrUriNotThere = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uriNotThere));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        /**

-         * X500Name

-         */

-        @Test

-        public void testX500Name_Equal() {

 

-                X500Principal name1 = new X500Principal("CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US");

-                X500Principal name2 = new X500Principal("CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US");

-                X500Principal name3 = new X500Principal("CN=NotDuke, OU=NotThere, O=Oracle, C=US");

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_ANYURI_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANYURI_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_ANYURI.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrUri1);

+        arguments.add(attrUri2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrUri1);

+        arguments.add(attrUriNotThere);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

 

 

-                FunctionArgumentAttributeValue attrName1 = null;

-                FunctionArgumentAttributeValue attrName1a = null;

-                FunctionArgumentAttributeValue attrNotSameName = null;		

-                try {

-                        attrName1 = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(name1));

-                        attrName1a = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(name2));

-                        attrNotSameName = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(name3));	

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

+    /**

+     * X500Name

+     */

+    @Test

+    public void testX500Name_Equal() {

 

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_X500NAME_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_X500NAME_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_X500NAME.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrName1);

-                arguments.add(attrName1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        X500Principal name1 = new X500Principal("CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US");

+        X500Principal name2 = new X500Principal("CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US");

+        X500Principal name3 = new X500Principal("CN=NotDuke, OU=NotThere, O=Oracle, C=US");

 

-                // check not same

-                arguments.clear();

-                arguments.add(attrName1);

-                arguments.add(attrNotSameName);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

 

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-

+        FunctionArgumentAttributeValue attrName1 = null;

+        FunctionArgumentAttributeValue attrName1a = null;

+        FunctionArgumentAttributeValue attrNotSameName = null;

+        try {

+            attrName1 = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(name1));

+            attrName1a = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(name2));

+            attrNotSameName = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(name3));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        

-        /**

-         * RFC822Name

-         */

-        @Test

-        public void testRfc822Name_Equal() {

 

-                RFC822Name name1 = null;

-                RFC822Name name1a = null;

-                RFC822Name differentLocalName = null;

-                RFC822Name differentDomainName = null;

-                RFC822Name localCaseName = null;

-                RFC822Name domainCaseName = null;

-                @SuppressWarnings("unused")

-                RFC822Name noAtName = null;

-                

-                try {

-                        name1 = RFC822Name.newInstance("localPart@DomainPart");

-                        name1a = RFC822Name.newInstance("localPart@DomainPart");

-                        differentLocalName = RFC822Name.newInstance("differentlocalPart@DomainPart");

-                        differentDomainName = RFC822Name.newInstance("localPart@differentDomainPart");

-                        localCaseName = RFC822Name.newInstance("LOCALPart@DomainPart");

-                        domainCaseName = RFC822Name.newInstance("localPart@DOMAINPart");

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_X500NAME_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_X500NAME_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_X500NAME.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrName1);

+        arguments.add(attrName1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrName1);

+        arguments.add(attrNotSameName);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

 

 

-                } catch (Exception e) {

-                        fail(e.toString());

-                }

-                

-                // should not be able to create a name without an @.  If you try, newInstance returns null

-                Exception exSeen = null;

-                try {

-                        noAtName = RFC822Name.newInstance("nameWithoutAnAtSign");

-                } catch (Exception e) {

-                        exSeen = e;

-                }

-                assertNotNull(exSeen);

-                

 

-                FunctionArgumentAttributeValue attrName1 = null;

-                FunctionArgumentAttributeValue attrName1a = null;

-                FunctionArgumentAttributeValue attrDifferentLocalName = null;		

-                FunctionArgumentAttributeValue attrDifferentDomainName = null;		

-                FunctionArgumentAttributeValue attrLocalCaseName = null;

-                FunctionArgumentAttributeValue attrDomainCaseName = null;

-                try {

-                        attrName1 = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(name1));

-                        attrName1a = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(name1a));

-                        attrDifferentLocalName = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(differentLocalName));		

-                        attrDifferentDomainName = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(differentDomainName));		

-                        attrLocalCaseName = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(localCaseName));

-                        attrDomainCaseName = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(domainCaseName));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

+    /**

+     * RFC822Name

+     */

+    @Test

+    public void testRfc822Name_Equal() {

 

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_RFC822NAME_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_RFC822NAME_EQUAL, fd.getId());

-                assertEquals(DataTypeRFC822Name.newInstance().getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrName1);

-                arguments.add(attrName1a);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        RFC822Name name1 = null;

+        RFC822Name name1a = null;

+        RFC822Name differentLocalName = null;

+        RFC822Name differentDomainName = null;

+        RFC822Name localCaseName = null;

+        RFC822Name domainCaseName = null;

+        @SuppressWarnings("unused")

+        RFC822Name noAtName = null;

 

-                // check not same Local

-                arguments.clear();

-                arguments.add(attrName1);

-                arguments.add(attrDifferentLocalName);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // check not same Domain

-                arguments.clear();

-                arguments.add(attrName1);

-                arguments.add(attrDifferentDomainName);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // test case-sensitivity in local part

-                arguments.clear();

-                arguments.add(attrName1);

-                arguments.add(attrLocalCaseName);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // test non-case-sensitivity in Domain part

-                arguments.clear();

-                arguments.add(attrName1);

-                arguments.add(attrDomainCaseName);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+        try {

+            name1 = RFC822Name.newInstance("localPart@DomainPart");

+            name1a = RFC822Name.newInstance("localPart@DomainPart");

+            differentLocalName = RFC822Name.newInstance("differentlocalPart@DomainPart");

+            differentDomainName = RFC822Name.newInstance("localPart@differentDomainPart");

+            localCaseName = RFC822Name.newInstance("LOCALPart@DomainPart");

+            domainCaseName = RFC822Name.newInstance("localPart@DOMAINPart");

 

+

+        } catch (Exception e) {

+            fail(e.toString());

         }

-        

-        

-        /**

-         * Hex Binary

-         */

-        @Test

-        public void testHexBinary_Equal() {

-                HexBinary binary = null;

-                HexBinary sameBinary = null;

-                HexBinary differentBinary = null;

-                try {

-                        binary = HexBinary.newInstance("e04fd020ea3a6910a2d808002b30309d");

-                        sameBinary = HexBinary.newInstance("e04fd020ea3a6910a2d808002b30309d");

-                        differentBinary = HexBinary.newInstance("f123a890ee3d");

-                } catch (Exception e) {

-                        fail(e.toString());

-                }

 

-                FunctionArgumentAttributeValue attrBinary = null;

-                FunctionArgumentAttributeValue attrSameBinary = null;

-                FunctionArgumentAttributeValue attrDifferentBinary = null;;		

-                try {

-                        attrBinary = new FunctionArgumentAttributeValue(DataTypes.DT_HEXBINARY.createAttributeValue(binary));

-                        attrSameBinary = new FunctionArgumentAttributeValue(DataTypes.DT_HEXBINARY.createAttributeValue(sameBinary));

-                        attrDifferentBinary = new FunctionArgumentAttributeValue(DataTypes.DT_HEXBINARY.createAttributeValue(differentBinary));		

-

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_HEXBINARY_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_HEXBINARY_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_HEXBINARY.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrBinary);

-                arguments.add(attrSameBinary);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-

-                // check not same

-                arguments.clear();

-                arguments.add(attrBinary);

-                arguments.add(attrDifferentBinary);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-

+        // should not be able to create a name without an @.  If you try, newInstance returns null

+        Exception exSeen = null;

+        try {

+            noAtName = RFC822Name.newInstance("nameWithoutAnAtSign");

+        } catch (Exception e) {

+            exSeen = e;

         }

-        

-        

-        /**

-         * Base64 Binary

-         */

-        @Test

-        public void testBase64Binary_Equal() {

-                Base64Binary binary = null;

-                Base64Binary sameBinary = null;

-                Base64Binary differentBinary = null;

-                try {

-                        binary = Base64Binary.newInstance("TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz");

-                        sameBinary = Base64Binary.newInstance("TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz");

-                        differentBinary = Base64Binary.newInstance("f123a890ee3d");

-                } catch (Exception e) {

-                        fail(e.toString());

-                }

+        assertNotNull(exSeen);

 

-                FunctionArgumentAttributeValue attrBinary = null;

-                FunctionArgumentAttributeValue attrSameBinary = null;

-                FunctionArgumentAttributeValue attrDifferentBinary = null;		

-                try {

-                        attrBinary = new FunctionArgumentAttributeValue(DataTypes.DT_BASE64BINARY.createAttributeValue(binary));

-                        attrSameBinary = new FunctionArgumentAttributeValue(DataTypes.DT_BASE64BINARY.createAttributeValue(sameBinary));

-                        attrDifferentBinary = new FunctionArgumentAttributeValue(DataTypes.DT_BASE64BINARY.createAttributeValue(differentBinary));		

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_BASE64BINARY_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_BASE64BINARY_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_BASE64BINARY.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                // test normal equals and non-equals

-                // check separate objects with the same value

-                arguments.add(attrBinary);

-                arguments.add(attrSameBinary);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-

-                // check not same

-                arguments.clear();

-                arguments.add(attrBinary);

-                arguments.add(attrDifferentBinary);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-

+        FunctionArgumentAttributeValue attrName1 = null;

+        FunctionArgumentAttributeValue attrName1a = null;

+        FunctionArgumentAttributeValue attrDifferentLocalName = null;

+        FunctionArgumentAttributeValue attrDifferentDomainName = null;

+        FunctionArgumentAttributeValue attrLocalCaseName = null;

+        FunctionArgumentAttributeValue attrDomainCaseName = null;

+        try {

+            attrName1 = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(name1));

+            attrName1a = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(name1a));

+            attrDifferentLocalName = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(differentLocalName));

+            attrDifferentDomainName = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(differentDomainName));

+            attrLocalCaseName = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(localCaseName));

+            attrDomainCaseName = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(domainCaseName));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

+

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_RFC822NAME_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_RFC822NAME_EQUAL, fd.getId());

+        assertEquals(DataTypeRFC822Name.newInstance().getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrName1);

+        arguments.add(attrName1a);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same Local

+        arguments.clear();

+        arguments.add(attrName1);

+        arguments.add(attrDifferentLocalName);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // check not same Domain

+        arguments.clear();

+        arguments.add(attrName1);

+        arguments.add(attrDifferentDomainName);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test case-sensitivity in local part

+        arguments.clear();

+        arguments.add(attrName1);

+        arguments.add(attrLocalCaseName);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test non-case-sensitivity in Domain part

+        arguments.clear();

+        arguments.add(attrName1);

+        arguments.add(attrDomainCaseName);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+    /**

+     * Hex Binary

+     */

+    @Test

+    public void testHexBinary_Equal() {

+        HexBinary binary = null;

+        HexBinary sameBinary = null;

+        HexBinary differentBinary = null;

+        try {

+            binary = HexBinary.newInstance("e04fd020ea3a6910a2d808002b30309d");

+            sameBinary = HexBinary.newInstance("e04fd020ea3a6910a2d808002b30309d");

+            differentBinary = HexBinary.newInstance("f123a890ee3d");

+        } catch (Exception e) {

+            fail(e.toString());

+        }

+

+        FunctionArgumentAttributeValue attrBinary = null;

+        FunctionArgumentAttributeValue attrSameBinary = null;

+        FunctionArgumentAttributeValue attrDifferentBinary = null;;

+        try {

+            attrBinary = new FunctionArgumentAttributeValue(DataTypes.DT_HEXBINARY.createAttributeValue(binary));

+            attrSameBinary = new FunctionArgumentAttributeValue(DataTypes.DT_HEXBINARY.createAttributeValue(sameBinary));

+            attrDifferentBinary = new FunctionArgumentAttributeValue(DataTypes.DT_HEXBINARY.createAttributeValue(differentBinary));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_HEXBINARY_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_HEXBINARY_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_HEXBINARY.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrBinary);

+        arguments.add(attrSameBinary);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrBinary);

+        arguments.add(attrDifferentBinary);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

+

+

+    /**

+     * Base64 Binary

+     */

+    @Test

+    public void testBase64Binary_Equal() {

+        Base64Binary binary = null;

+        Base64Binary sameBinary = null;

+        Base64Binary differentBinary = null;

+        try {

+            binary = Base64Binary.newInstance("TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz");

+            sameBinary = Base64Binary.newInstance("TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz");

+            differentBinary = Base64Binary.newInstance("f123a890ee3d");

+        } catch (Exception e) {

+            fail(e.toString());

+        }

+

+        FunctionArgumentAttributeValue attrBinary = null;

+        FunctionArgumentAttributeValue attrSameBinary = null;

+        FunctionArgumentAttributeValue attrDifferentBinary = null;

+        try {

+            attrBinary = new FunctionArgumentAttributeValue(DataTypes.DT_BASE64BINARY.createAttributeValue(binary));

+            attrSameBinary = new FunctionArgumentAttributeValue(DataTypes.DT_BASE64BINARY.createAttributeValue(sameBinary));

+            attrDifferentBinary = new FunctionArgumentAttributeValue(DataTypes.DT_BASE64BINARY.createAttributeValue(differentBinary));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_BASE64BINARY_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_BASE64BINARY_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_BASE64BINARY.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+        // test normal equals and non-equals

+        // check separate objects with the same value

+        arguments.add(attrBinary);

+        arguments.add(attrSameBinary);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check not same

+        arguments.clear();

+        arguments.add(attrBinary);

+        arguments.add(attrDifferentBinary);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+    }

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHigherOrderBagTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHigherOrderBagTest.java
index 9d236de..6edf90c 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHigherOrderBagTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHigherOrderBagTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -43,2151 +43,2151 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionHigherOrderBagTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        

-        //

-        // ANY-OF tests

-        //

-        

-        

-        @Test

-        public void testAny_of() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                Bag bagStringBooleansTrue = null;

-                Bag bagStringBooleansFalse = null;

-                

-                

-                // primitive attrs

-                FunctionArgumentAttributeValue attra = null;

-                FunctionArgumentAttributeValue attrb = null;

-                FunctionArgumentAttributeValue attrh = null;

-        

-                

-                // predicates passed as arguments

-                FunctionArgumentAttributeValue attrPredicateStringEqual = null;

-                FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

-                FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

 

-                try {

-                        

-                        // Create Bag contents

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                        bagStringBooleansTrue = new Bag();

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                        bagStringBooleansFalse = new Bag();

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                        

-                        

-                        // create primitive attrs

-                        attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

-                        attrb = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(b));

-                        attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+    //

+    // ANY-OF tests

+    //

 

-                        

-                        // predicates passed as function arguments

-                        attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

-                        attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

-                        attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

 

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

-                FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

-                FunctionArgumentBag attrBagStringBooleansFalse = new FunctionArgumentBag(bagStringBooleansFalse);

+    @Test

+    public void testAny_of() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

 

-                FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ANY_OF;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANY_OF, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal match

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attra);

-                arguments.add(attrBagabcdefg);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // bag in first position - match

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attra);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // normal no-match

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attra);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // multiple primitives 

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrh);

-                arguments.add(attrb);

-                arguments.add(attrBagace);

-                arguments.add(attra);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of Predicate error: function:string-equal Expected 2 arguments, got 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // no primitives - predicate function expects 2	

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of Predicate error: function:string-equal Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no primitives - predicate expects only 1 arg

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansFalse);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag is empty

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrh);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+        Bag bagStringBooleansTrue = null;

+        Bag bagStringBooleansFalse = null;

 

-                // no bag

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrh);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of Did not get any Bag argument; must have at least 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // extra bag

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrh);

-                arguments.add(attrBagStringBooleansTrue);

-                arguments.add(attrh);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of must have only 1 bag; found one at index 2 and another at 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        

-                // bad predicate

-                arguments.clear();

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-boolean predicate

-                arguments.clear();

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // predicate after first arg

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of Predicate error: function:string-equal Expected data type 'string' saw 'anyURI' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of Predicate Function (first argument) was null", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of Got null argument at index 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

+        // primitive attrs

+        FunctionArgumentAttributeValue attra = null;

+        FunctionArgumentAttributeValue attrb = null;

+        FunctionArgumentAttributeValue attrh = null;

+

+

+        // predicates passed as arguments

+        FunctionArgumentAttributeValue attrPredicateStringEqual = null;

+        FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

+        FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+

+        try {

+

+            // Create Bag contents

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+            bagStringBooleansTrue = new Bag();

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansFalse = new Bag();

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+

+

+            // create primitive attrs

+            attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

+            attrb = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(b));

+            attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+

+

+            // predicates passed as function arguments

+            attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

+            attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

+            attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

 

-        

-        

-        

-        @Test

-        public void testAll_of() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

-                

-                String w = "w";

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

+        FunctionArgumentBag attrBagStringBooleansFalse = new FunctionArgumentBag(bagStringBooleansFalse);

+

+        FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ANY_OF;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANY_OF, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal match

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attra);

+        arguments.add(attrBagabcdefg);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // bag in first position - match

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attra);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // normal no-match

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attra);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // multiple primitives

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrh);

+        arguments.add(attrb);

+        arguments.add(attrBagace);

+        arguments.add(attra);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of Predicate error: function:string-equal Expected 2 arguments, got 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                Bag bagStringBooleansFalse = null;

-                Bag bagStringBooleansTrue = null;

-                

-                

-                // primitive attrs

-                FunctionArgumentAttributeValue attra = null;

-                FunctionArgumentAttributeValue attrh = null;

-                FunctionArgumentAttributeValue attrw = null;

+        // no primitives - predicate function expects 2

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of Predicate error: function:string-equal Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no primitives - predicate expects only 1 arg

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansFalse);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bag is empty

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrh);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // no bag

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrh);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of Did not get any Bag argument; must have at least 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // extra bag

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrh);

+        arguments.add(attrBagStringBooleansTrue);

+        arguments.add(attrh);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of must have only 1 bag; found one at index 2 and another at 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                

-                // predicates passed as arguments

-                FunctionArgumentAttributeValue attrPredicateStringEqual = null;

-                FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

-                FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

-                FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+        // bad predicate

+        arguments.clear();

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                try {

-                        

-                        // Create Bag contents

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                        bagStringBooleansTrue = new Bag();

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                        bagStringBooleansFalse = new Bag();

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                        

-                        

-                        

-                        // create primitive attrs

-                        attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

-                        attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

-                        attrw = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(w));

+        // non-boolean predicate

+        arguments.clear();

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                        

-                        // predicates passed as function arguments

-                        attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

-                        attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

-                        attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

-                        attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+        // predicate after first arg

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of Predicate error: function:string-equal Expected data type 'string' saw 'anyURI' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

-                FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

-                FunctionArgumentBag attrBagStringBooleansFalse = new FunctionArgumentBag(bagStringBooleansFalse);

-                

-                FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ALL_OF;

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ALL_OF, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrw);

-                arguments.add(attrBagace);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // normal no-match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attra);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // no primitives - predicate function expects 2	

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of Predicate error: function:string-equal Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no primitives - predicate expects only 1 arg

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansFalse);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag is empty

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of Predicate Function (first argument) was null", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // no bag

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of Did not get any Bag argument; must have at least 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // extra bag

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrh);

-                arguments.add(attrBagStringBooleansTrue);

-                arguments.add(attrh);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of must have only 1 bag; found one at index 2 and another at 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        

-                // bad predicate

-                arguments.clear();

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-boolean predicate

-                arguments.clear();

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // predicate after first arg

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of Predicate error: function:string-greater-than Expected data type 'string' saw 'anyURI' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of Predicate Function (first argument) was null", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of Got null argument at index 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // second null

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of Got null argument at index 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

+    }

+

+

+

+

+

+    @Test

+    public void testAll_of() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+        String w = "w";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+        Bag bagStringBooleansFalse = null;

+        Bag bagStringBooleansTrue = null;

+

+

+        // primitive attrs

+        FunctionArgumentAttributeValue attra = null;

+        FunctionArgumentAttributeValue attrh = null;

+        FunctionArgumentAttributeValue attrw = null;

+

+

+

+        // predicates passed as arguments

+        FunctionArgumentAttributeValue attrPredicateStringEqual = null;

+        FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

+        FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

+        FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+

+        try {

+

+            // Create Bag contents

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+            bagStringBooleansTrue = new Bag();

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansFalse = new Bag();

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+

+

+

+            // create primitive attrs

+            attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

+            attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+            attrw = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(w));

+

+

+            // predicates passed as function arguments

+            attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

+            attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

+            attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

+            attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

 

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testAny_of_any() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

-                

-                String w = "w";

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

+        FunctionArgumentBag attrBagStringBooleansFalse = new FunctionArgumentBag(bagStringBooleansFalse);

+

+        FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ALL_OF;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ALL_OF, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrw);

+        arguments.add(attrBagace);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // normal no-match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attra);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // no primitives - predicate function expects 2

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of Predicate error: function:string-equal Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no primitives - predicate expects only 1 arg

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansFalse);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bag is empty

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // no bag

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of Did not get any Bag argument; must have at least 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // extra bag

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrh);

+        arguments.add(attrBagStringBooleansTrue);

+        arguments.add(attrh);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of must have only 1 bag; found one at index 2 and another at 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                Bag bagStringBooleansFalse = null;

-                Bag bagStringBooleansTrue = null;

-                Bag bagBooleansFalse = null;

-                Bag bagBooleansTrue = null;

-                

-                

-                // primitive attrs

-                FunctionArgumentAttributeValue attra = null;

-                FunctionArgumentAttributeValue attrh = null;

-                FunctionArgumentAttributeValue attrw = null;

+        // bad predicate

+        arguments.clear();

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                FunctionArgumentAttributeValue attrInt4 = null;

+        // non-boolean predicate

+        arguments.clear();

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                // predicates passed as arguments

-                FunctionArgumentAttributeValue attrPredicateStringEqual = null;

-                FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

-                FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

-                FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

-                FunctionArgumentAttributeValue attrPredicateNof = null;

+        // predicate after first arg

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of Predicate error: function:string-greater-than Expected data type 'string' saw 'anyURI' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                try {

-                        

-                        // Create Bag contents

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                        bagStringBooleansTrue = new Bag();

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                        bagStringBooleansFalse = new Bag();

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                        bagBooleansTrue = new Bag();

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(true));

-                        bagBooleansFalse = new Bag();

-                                bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                        

-                        

-                        // create primitive attrs

-                        attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

-                        attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

-                        attrw = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(w));

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

 

-                        attrInt4 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(4));

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of Predicate Function (first argument) was null", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                        

-                        // predicates passed as function arguments

-                        attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

-                        attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

-                        attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

-                        attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

-                        attrPredicateNof = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_N_OF));

+        // second null

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of Got null argument at index 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

-                FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

-                FunctionArgumentBag attrBagStringBooleansFalse = new FunctionArgumentBag(bagStringBooleansFalse);

-                FunctionArgumentBag attrBagBooleansTrue = new FunctionArgumentBag(bagBooleansTrue);

-                FunctionArgumentBag attrBagBooleansFalse = new FunctionArgumentBag(bagBooleansFalse);

-                

-                FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ANY_OF_ANY;

+    }

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANY_OF_ANY, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrw);

-                arguments.add(attrBagace);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // normal no-match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attra);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // no primitives - predicate function expects 2	

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-any Predicate error: function:string-equal Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagace);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // no primitives - predicate expects only 1 arg

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansFalse);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // n-of with lots of bags - success

-                arguments.clear();

-                arguments.add(attrPredicateNof);

-                arguments.add(attrInt4);

-                arguments.add(attrBagBooleansTrue);

-                arguments.add(attrBagBooleansTrue);

-                arguments.add(attrBagBooleansTrue);

-                arguments.add(attrBagBooleansTrue);

-                arguments.add(attrBagBooleansTrue);

-                arguments.add(attrBagBooleansTrue);

-                arguments.add(attrBagBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // n-of with lots of bags - fail

-                arguments.clear();

-                arguments.add(attrPredicateNof);

-                arguments.add(attrInt4);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansTrue);

-                arguments.add(attrBagBooleansTrue);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                arguments.add(attrBagBooleansFalse);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                

-                // bag is empty

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-any Bag is empty at index 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

 

-                // no bag

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-any Predicate error: function:string-greater-than Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                arguments.add(attrh);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-        

-                // bad predicate

-                arguments.clear();

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-any First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-boolean predicate

-                arguments.clear();

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-any Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // predicate after first arg

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-any Predicate error: function:string-greater-than Expected data type 'string' saw 'anyURI' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-any Predicate Function (first argument) was null", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-any Got null argument at index 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

+

+

+

+

+

+

+

+

+

+

+    @Test

+    public void testAny_of_any() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+        String w = "w";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+        Bag bagStringBooleansFalse = null;

+        Bag bagStringBooleansTrue = null;

+        Bag bagBooleansFalse = null;

+        Bag bagBooleansTrue = null;

+

+

+        // primitive attrs

+        FunctionArgumentAttributeValue attra = null;

+        FunctionArgumentAttributeValue attrh = null;

+        FunctionArgumentAttributeValue attrw = null;

+

+

+        FunctionArgumentAttributeValue attrInt4 = null;

+

+

+        // predicates passed as arguments

+        FunctionArgumentAttributeValue attrPredicateStringEqual = null;

+        FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

+        FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

+        FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+        FunctionArgumentAttributeValue attrPredicateNof = null;

+

+        try {

+

+            // Create Bag contents

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+            bagStringBooleansTrue = new Bag();

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansFalse = new Bag();

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagBooleansTrue = new Bag();

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(true));

+            bagBooleansFalse = new Bag();

+            bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+

+

+            // create primitive attrs

+            attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

+            attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+            attrw = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(w));

+

+            attrInt4 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(4));

+

+

+            // predicates passed as function arguments

+            attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

+            attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

+            attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

+            attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+            attrPredicateNof = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_N_OF));

+

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testAll_of_any() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

-                

-                String w = "w";

-                String x = "x";

+

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

+        FunctionArgumentBag attrBagStringBooleansFalse = new FunctionArgumentBag(bagStringBooleansFalse);

+        FunctionArgumentBag attrBagBooleansTrue = new FunctionArgumentBag(bagBooleansTrue);

+        FunctionArgumentBag attrBagBooleansFalse = new FunctionArgumentBag(bagBooleansFalse);

+

+        FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ANY_OF_ANY;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANY_OF_ANY, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrw);

+        arguments.add(attrBagace);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // normal no-match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attra);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // no primitives - predicate function expects 2

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-any Predicate error: function:string-equal Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagace);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // no primitives - predicate expects only 1 arg

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansFalse);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // n-of with lots of bags - success

+        arguments.clear();

+        arguments.add(attrPredicateNof);

+        arguments.add(attrInt4);

+        arguments.add(attrBagBooleansTrue);

+        arguments.add(attrBagBooleansTrue);

+        arguments.add(attrBagBooleansTrue);

+        arguments.add(attrBagBooleansTrue);

+        arguments.add(attrBagBooleansTrue);

+        arguments.add(attrBagBooleansTrue);

+        arguments.add(attrBagBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // n-of with lots of bags - fail

+        arguments.clear();

+        arguments.add(attrPredicateNof);

+        arguments.add(attrInt4);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansTrue);

+        arguments.add(attrBagBooleansTrue);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        arguments.add(attrBagBooleansFalse);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagawx = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                Bag bagStringBooleansFalse = null;

-                Bag bagStringBooleansTrue = null;

-                Bag bagBooleansFalse = null;

-                Bag bagBooleansTrue = null;

-                

-                

-                // primitive attrs

-                FunctionArgumentAttributeValue attra = null;

-                FunctionArgumentAttributeValue attrh = null;

-

-                

-

-                

-                // predicates passed as arguments

-                FunctionArgumentAttributeValue attrPredicateStringEqual = null;

-                FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

-                FunctionArgumentAttributeValue attrPredicateStringLessThan = null;

-                FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

-                FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

-

-                try {

-                        

-                        // Create Bag contents

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagawx = new Bag();

-                                bagawx.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagawx.add(DataTypes.DT_STRING.createAttributeValue(w));

-                                bagawx.add(DataTypes.DT_STRING.createAttributeValue(x));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                        bagStringBooleansTrue = new Bag();

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                        bagStringBooleansFalse = new Bag();

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                        bagBooleansTrue = new Bag();

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(true));

-                        bagBooleansFalse = new Bag();

-                                bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                        

-                        

-                        // create primitive attrs

-                        attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

-                        attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+        // bag is empty

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-any Bag is empty at index 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                        

-                        // predicates passed as function arguments

-                        attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

-                        attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

-                        attrPredicateStringLessThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_LESS_THAN));

-                        attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

-                        attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+        // no bag

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-any Predicate error: function:string-greater-than Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagawx = new FunctionArgumentBag(bagawx);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

-                FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

-                

-                FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ALL_OF_ANY;

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        arguments.add(attrh);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ALL_OF_ANY, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal match

-                arguments.clear();

-                arguments.add(attrPredicateStringLessThan);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagawx);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // normal no-match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagace);

-                arguments.add(attrBagawx);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // primitive instead of bag

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attra);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any 2nd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagace);

-                arguments.add(attra);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any 3rd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no primitives - predicate expects only 1 arg

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansTrue);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any Predicate error: function:boolean-from-string Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        // bad predicate

+        arguments.clear();

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-any First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                // bag is empty

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagace);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // non-boolean predicate

+        arguments.clear();

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-any Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // no bag

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        

-                // bad predicate

-                arguments.clear();

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-boolean predicate

-                arguments.clear();

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // predicate after first arg

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any 2nd argument must be bag, got 'anyURI'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any Predicate error: function:string-greater-than Expected data type 'string' saw 'integer' at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any Expected at least 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // one arg

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any Expected at least 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // predicate after first arg

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-any Predicate error: function:string-greater-than Expected data type 'string' saw 'anyURI' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-any 3rd argument must be bag, got 'null'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-any Predicate Function (first argument) was null", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second null

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-any Got null argument at index 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+    @Test

+    public void testAll_of_any() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+        String w = "w";

+        String x = "x";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagawx = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+        Bag bagStringBooleansFalse = null;

+        Bag bagStringBooleansTrue = null;

+        Bag bagBooleansFalse = null;

+        Bag bagBooleansTrue = null;

+

+

+        // primitive attrs

+        FunctionArgumentAttributeValue attra = null;

+        FunctionArgumentAttributeValue attrh = null;

+

+

+

+

+        // predicates passed as arguments

+        FunctionArgumentAttributeValue attrPredicateStringEqual = null;

+        FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

+        FunctionArgumentAttributeValue attrPredicateStringLessThan = null;

+        FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

+        FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+

+        try {

+

+            // Create Bag contents

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagawx = new Bag();

+            bagawx.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagawx.add(DataTypes.DT_STRING.createAttributeValue(w));

+            bagawx.add(DataTypes.DT_STRING.createAttributeValue(x));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+            bagStringBooleansTrue = new Bag();

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansFalse = new Bag();

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagBooleansTrue = new Bag();

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(true));

+            bagBooleansFalse = new Bag();

+            bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+

+

+            // create primitive attrs

+            attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

+            attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+

+

+

+            // predicates passed as function arguments

+            attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

+            attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

+            attrPredicateStringLessThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_LESS_THAN));

+            attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

+            attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

 

-        @Test

-        public void testAny_of_all() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

-                

-                String w = "w";

-                String x = "x";

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagawx = new FunctionArgumentBag(bagawx);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

+

+        FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ALL_OF_ANY;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ALL_OF_ANY, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal match

+        arguments.clear();

+        arguments.add(attrPredicateStringLessThan);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagawx);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // normal no-match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagace);

+        arguments.add(attrBagawx);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // primitive instead of bag

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attra);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any 2nd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagace);

+        arguments.add(attra);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any 3rd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no primitives - predicate expects only 1 arg

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansTrue);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any Predicate error: function:boolean-from-string Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagewx = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                Bag bagStringBooleansFalse = null;

-                Bag bagStringBooleansTrue = null;

-                Bag bagBooleansFalse = null;

-                Bag bagBooleansTrue = null;

-                

-                

-                // primitive attrs

-                FunctionArgumentAttributeValue attra = null;

-                FunctionArgumentAttributeValue attrh = null;

 

-                

+        // bag is empty

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagace);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                

-                // predicates passed as arguments

-                FunctionArgumentAttributeValue attrPredicateStringEqual = null;

-                FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

-                FunctionArgumentAttributeValue attrPredicateStringGreaterThanOrEqual = null;

-                FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

-                FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                try {

-                        

-                        // Create Bag contents

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagewx = new Bag();

-                                bagewx.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagewx.add(DataTypes.DT_STRING.createAttributeValue(w));

-                                bagewx.add(DataTypes.DT_STRING.createAttributeValue(x));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                        bagStringBooleansTrue = new Bag();

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                        bagStringBooleansFalse = new Bag();

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                        bagBooleansTrue = new Bag();

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(true));

-                        bagBooleansFalse = new Bag();

-                                bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                        

-                        

-                        // create primitive attrs

-                        attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

-                        attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+        // no bag

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                        

-                        // predicates passed as function arguments

-                        attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

-                        attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

-                        attrPredicateStringGreaterThanOrEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL));

-                        attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

-                        attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+        // bad predicate

+        arguments.clear();

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagewx = new FunctionArgumentBag(bagewx);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

-                FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

-                

-                FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ANY_OF_ALL;

+        // non-boolean predicate

+        arguments.clear();

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANY_OF_ALL, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThanOrEqual);

-                arguments.add(attrBagewx);

-                arguments.add(attrBagace);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // normal no-match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagace);

-                arguments.add(attrBagewx);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // primitive instead of bag

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attra);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all 2nd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagace);

-                arguments.add(attra);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all 3rd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no primitives - predicate expects only 1 arg

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansTrue);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all Predicate error: function:boolean-from-string Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag is empty

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagace);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // predicate after first arg

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any 2nd argument must be bag, got 'anyURI'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // no bag

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        

-                // bad predicate

-                arguments.clear();

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-boolean predicate

-                arguments.clear();

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // predicate after first arg

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all 2nd argument must be bag, got 'anyURI'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all Predicate error: function:string-greater-than Expected data type 'string' saw 'integer' at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all Expected at least 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // one arg

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all Expected at least 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any Predicate error: function:string-greater-than Expected data type 'string' saw 'integer' at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:any-of-all 3rd argument must be bag, got 'null'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // no args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any Expected at least 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

+        // one arg

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any Expected at least 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second null

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-any 3rd argument must be bag, got 'null'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+

+

+

+

+

+

+    @Test

+    public void testAny_of_all() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+        String w = "w";

+        String x = "x";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagewx = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+        Bag bagStringBooleansFalse = null;

+        Bag bagStringBooleansTrue = null;

+        Bag bagBooleansFalse = null;

+        Bag bagBooleansTrue = null;

+

+

+        // primitive attrs

+        FunctionArgumentAttributeValue attra = null;

+        FunctionArgumentAttributeValue attrh = null;

+

+

+

+

+        // predicates passed as arguments

+        FunctionArgumentAttributeValue attrPredicateStringEqual = null;

+        FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

+        FunctionArgumentAttributeValue attrPredicateStringGreaterThanOrEqual = null;

+        FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

+        FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+

+        try {

+

+            // Create Bag contents

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagewx = new Bag();

+            bagewx.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagewx.add(DataTypes.DT_STRING.createAttributeValue(w));

+            bagewx.add(DataTypes.DT_STRING.createAttributeValue(x));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+            bagStringBooleansTrue = new Bag();

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansFalse = new Bag();

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagBooleansTrue = new Bag();

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(true));

+            bagBooleansFalse = new Bag();

+            bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+

+

+            // create primitive attrs

+            attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

+            attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+

+

+

+            // predicates passed as function arguments

+            attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

+            attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

+            attrPredicateStringGreaterThanOrEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL));

+            attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

+            attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testAll_of_all() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

-                

-                String w = "w";

-                String x = "x";

+

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagewx = new FunctionArgumentBag(bagewx);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

+

+        FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ANY_OF_ALL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANY_OF_ALL, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThanOrEqual);

+        arguments.add(attrBagewx);

+        arguments.add(attrBagace);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // normal no-match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagace);

+        arguments.add(attrBagewx);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // primitive instead of bag

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attra);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all 2nd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagace);

+        arguments.add(attra);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all 3rd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no primitives - predicate expects only 1 arg

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansTrue);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all Predicate error: function:boolean-from-string Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag is empty

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagace);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // no bag

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagawx = null;

-                Bag bagwx = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                Bag bagStringBooleansFalse = null;

-                Bag bagStringBooleansTrue = null;

-                Bag bagBooleansFalse = null;

-                Bag bagBooleansTrue = null;

-                

-                

-                // primitive attrs

-                FunctionArgumentAttributeValue attra = null;

-                FunctionArgumentAttributeValue attrh = null;

+        // bad predicate

+        arguments.clear();

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

+        // non-boolean predicate

+        arguments.clear();

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                // predicates passed as arguments

-                FunctionArgumentAttributeValue attrPredicateStringEqual = null;

-                FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

-                FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

-                FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+        // predicate after first arg

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all 2nd argument must be bag, got 'anyURI'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                try {

-                        

-                        // Create Bag contents

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagawx = new Bag();

-                                bagawx.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagawx.add(DataTypes.DT_STRING.createAttributeValue(w));

-                                bagawx.add(DataTypes.DT_STRING.createAttributeValue(x));

-                        bagwx = new Bag();

-                                bagwx.add(DataTypes.DT_STRING.createAttributeValue(w));

-                                bagwx.add(DataTypes.DT_STRING.createAttributeValue(x));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                        bagStringBooleansTrue = new Bag();

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                        bagStringBooleansFalse = new Bag();

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                        bagBooleansTrue = new Bag();

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(true));

-                        bagBooleansFalse = new Bag();

-                                bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                                bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                        

-                        

-                        // create primitive attrs

-                        attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

-                        attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all Predicate error: function:string-greater-than Expected data type 'string' saw 'integer' at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all Expected at least 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // one arg

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all Expected at least 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                        

-                        // predicates passed as function arguments

-                        attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

-                        attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

-                        attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

-                        attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagawx = new FunctionArgumentBag(bagawx);

-                FunctionArgumentBag attrBagwx = new FunctionArgumentBag(bagwx);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

-                FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

-                

-                FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ALL_OF_ALL;

+        // second null

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:any-of-all 3rd argument must be bag, got 'null'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ALL_OF_ALL, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagwx);

-                arguments.add(attrBagace);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // normal no-match

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagawx);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagace);

-                arguments.add(attrBagwx);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // primitive instead of bag

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attra);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all 2nd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringEqual);

-                arguments.add(attrBagace);

-                arguments.add(attra);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all 3rd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no primitives - predicate expects only 1 arg

-                arguments.clear();

-                arguments.add(attrPredicateBooleanFromString);

-                arguments.add(attrBagStringBooleansTrue);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all Predicate error: function:boolean-from-string Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag is empty

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagace);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+    }

 

-                // no bag

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrh);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        

-                // bad predicate

-                arguments.clear();

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-boolean predicate

-                arguments.clear();

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // predicate after first arg

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrPredicateStringIntersection);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all 2nd argument must be bag, got 'anyURI'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagwx);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all Predicate error: function:string-greater-than Expected data type 'string' saw 'integer' at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all Expected at least 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // one arg

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all Expected at least 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrPredicateStringGreaterThan);

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:all-of-all 3rd argument must be bag, got 'null'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

+

+

+

+    @Test

+    public void testAll_of_all() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+        String w = "w";

+        String x = "x";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagawx = null;

+        Bag bagwx = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+        Bag bagStringBooleansFalse = null;

+        Bag bagStringBooleansTrue = null;

+        Bag bagBooleansFalse = null;

+        Bag bagBooleansTrue = null;

+

+

+        // primitive attrs

+        FunctionArgumentAttributeValue attra = null;

+        FunctionArgumentAttributeValue attrh = null;

+

+

+

+

+        // predicates passed as arguments

+        FunctionArgumentAttributeValue attrPredicateStringEqual = null;

+        FunctionArgumentAttributeValue attrPredicateStringIntersection = null;

+        FunctionArgumentAttributeValue attrPredicateStringGreaterThan = null;

+        FunctionArgumentAttributeValue attrPredicateBooleanFromString = null;

+

+        try {

+

+            // Create Bag contents

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagawx = new Bag();

+            bagawx.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagawx.add(DataTypes.DT_STRING.createAttributeValue(w));

+            bagawx.add(DataTypes.DT_STRING.createAttributeValue(x));

+            bagwx = new Bag();

+            bagwx.add(DataTypes.DT_STRING.createAttributeValue(w));

+            bagwx.add(DataTypes.DT_STRING.createAttributeValue(x));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+            bagStringBooleansTrue = new Bag();

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansFalse = new Bag();

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagBooleansTrue = new Bag();

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansTrue.add(DataTypes.DT_BOOLEAN.createAttributeValue(true));

+            bagBooleansFalse = new Bag();

+            bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+            bagBooleansFalse.add(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+

+

+            // create primitive attrs

+            attra = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(a));

+            attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+

+

+

+            // predicates passed as function arguments

+            attrPredicateStringEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_EQUAL));

+            attrPredicateStringIntersection = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_INTERSECTION));

+            attrPredicateStringGreaterThan = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_GREATER_THAN));

+            attrPredicateBooleanFromString = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING));

+

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testMap() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

+

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagawx = new FunctionArgumentBag(bagawx);

+        FunctionArgumentBag attrBagwx = new FunctionArgumentBag(bagwx);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

+

+        FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_ALL_OF_ALL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ALL_OF_ALL, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagwx);

+        arguments.add(attrBagace);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // normal no-match

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagawx);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagace);

+        arguments.add(attrBagwx);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // primitive instead of bag

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attra);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all 2nd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrPredicateStringEqual);

+        arguments.add(attrBagace);

+        arguments.add(attra);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all 3rd argument must be bag, got 'string'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no primitives - predicate expects only 1 arg

+        arguments.clear();

+        arguments.add(attrPredicateBooleanFromString);

+        arguments.add(attrBagStringBooleansTrue);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all Predicate error: function:boolean-from-string Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag is empty

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagace);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // no bag

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrh);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                Bag bagStringBooleansFalse = null;

-                Bag bagStringBooleansTrue = null;

-                Bag bagInt123 = null;

-                Bag bagInt789 = null;

-                

-                

-                // primitive attrs

-                FunctionArgumentAttributeValue attrh = null;

-                FunctionArgumentAttributeValue attrInt7 = null;

+        // bad predicate

+        arguments.clear();

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // non-boolean predicate

+        arguments.clear();

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all Predicate Function must return boolean, but 'urn:oasis:names:tc:xacml:1.0:function:string-intersection' returns 'string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // predicate after first arg

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrPredicateStringIntersection);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all 2nd argument must be bag, got 'anyURI'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagwx);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all Predicate error: function:string-greater-than Expected data type 'string' saw 'integer' at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all Expected at least 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // one arg

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all Expected at least 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                

-                // predicates passed as arguments

-                FunctionArgumentAttributeValue attrPredicateStringNormalizeToLowerCase = null;

-                FunctionArgumentAttributeValue attrPredicateIntegerEqual = null;

-                FunctionArgumentAttributeValue attrPredicateIntegerAdd = null;

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                try {

-                        

-                        // Create Bag contents

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue("A"));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue("C"));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue("E"));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                        bagStringBooleansTrue = new Bag();

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                                bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

-                        bagStringBooleansFalse = new Bag();

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                                bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

-                        bagInt123 = new Bag();

-                                bagInt123.add(DataTypes.DT_INTEGER.createAttributeValue(1));

-                                bagInt123.add(DataTypes.DT_INTEGER.createAttributeValue(2));

-                                bagInt123.add(DataTypes.DT_INTEGER.createAttributeValue(3));

-                        bagInt789 = new Bag();

-                                bagInt789.add(DataTypes.DT_INTEGER.createAttributeValue(7));

-                                bagInt789.add(DataTypes.DT_INTEGER.createAttributeValue(8));

-                                bagInt789.add(DataTypes.DT_INTEGER.createAttributeValue(9));

-                        

-                        

-                        

-                        // create primitive attrs

-                        attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

-                        attrInt7 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(7));

+        // second null

+        arguments.clear();

+        arguments.add(attrPredicateStringGreaterThan);

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:all-of-all 3rd argument must be bag, got 'null'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                        

-                        // predicates passed as function arguments

-                        attrPredicateStringNormalizeToLowerCase = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE));

-                        attrPredicateIntegerEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_INTEGER_EQUAL));

-                        attrPredicateIntegerAdd = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_INTEGER_ADD));

+    }

 

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

-                FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

-                FunctionArgumentBag attrBagInt789 = new FunctionArgumentBag(bagInt789);

-        

-                FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_MAP;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_MAP, fd.getId());

-                assertNull( fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertTrue(fd.returnsBag());

-                

-                // normal match

-                arguments.clear();

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrBagace);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertTrue(res.isBag());

-                Bag bag = res.getBag();

-                assertEquals(3, bag.size());

-                List<AttributeValue<?>> bagAttributes = bag.getAttributeValueList();

-                try {

-                        assertTrue(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("a")));

-                        assertFalse(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("A")));

-                        assertTrue(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("c")));

-                        assertFalse(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("C")));

-                        assertTrue(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("e")));

-                        assertFalse(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("E")));

-                } catch (Exception ex) {

-                        fail("checking result e="+ex);

-                }

-                

-                // 2-input predicate

-                arguments.clear();

-                arguments.add(attrPredicateIntegerAdd);

-                arguments.add(attrInt7);

-                arguments.add(attrBagInt789);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertTrue(res.isBag());

-                bag = res.getBag();

-                assertEquals(3, bag.size());

-                bagAttributes = bag.getAttributeValueList();

-                try {

-                        assertTrue(bagAttributes.contains(DataTypes.DT_INTEGER.createAttributeValue("14")));

-                        assertTrue(bagAttributes.contains(DataTypes.DT_INTEGER.createAttributeValue("15")));

-                        assertTrue(bagAttributes.contains(DataTypes.DT_INTEGER.createAttributeValue("16")));

-                } catch (Exception ex) {

-                        fail("checking result e="+ex);

-                }

-                

-                

-                // predicate returns booleans

-                arguments.clear();

-                arguments.add(attrPredicateIntegerEqual);

-                arguments.add(attrInt7);

-                arguments.add(attrBagInt789);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertTrue(res.isBag());

-                bag = res.getBag();

-                assertEquals(3, bag.size());

-                bagAttributes = bag.getAttributeValueList();

-                try {

-                        assertEquals(bagAttributes.get(0), (DataTypes.DT_BOOLEAN.createAttributeValue(true)));

-                        assertEquals(bagAttributes.get(1), (DataTypes.DT_BOOLEAN.createAttributeValue(false)));

-                        assertEquals(bagAttributes.get(2), (DataTypes.DT_BOOLEAN.createAttributeValue(false)));

-                } catch (Exception ex) {

-                        fail("checking result e="+ex);

-                }

-                

-                // predicate returns bag

 

-                

-        

-                // no primitives - predicate function expects 2	

-                arguments.clear();

-                arguments.add(attrPredicateIntegerAdd);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:map Predicate error: function:integer-add Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bag is empty

-                arguments.clear();

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrh);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertTrue(res.isBag());

-                bag = res.getBag();

-                assertEquals(0, bag.size());;

 

-                // no bag

-                arguments.clear();

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrh);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:map Did not get any Bag argument; must have at least 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // extra bag

-                arguments.clear();

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrh);

-                arguments.add(attrBagStringBooleansTrue);

-                arguments.add(attrh);

-                arguments.add(attrBagStringBooleansTrue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:map must have only 1 bag; found one at index 2 and another at 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        

-                // bad predicate

-                arguments.clear();

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:map First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // predicate gets unexpected number of args

-                arguments.clear();

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:map Predicate error: function:string-normalize-to-lower-case Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // predicate gets bad primitive type

-                arguments.clear();

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:map Predicate error: function:string-normalize-to-lower-case Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrh);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:map Predicate Function (first argument) was null", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrPredicateStringNormalizeToLowerCase);

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:map Got null argument at index 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

+

+

+

+

+

+    @Test

+    public void testMap() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+        Bag bagStringBooleansFalse = null;

+        Bag bagStringBooleansTrue = null;

+        Bag bagInt123 = null;

+        Bag bagInt789 = null;

+

+

+        // primitive attrs

+        FunctionArgumentAttributeValue attrh = null;

+        FunctionArgumentAttributeValue attrInt7 = null;

+

+

+

+        // predicates passed as arguments

+        FunctionArgumentAttributeValue attrPredicateStringNormalizeToLowerCase = null;

+        FunctionArgumentAttributeValue attrPredicateIntegerEqual = null;

+        FunctionArgumentAttributeValue attrPredicateIntegerAdd = null;

+

+        try {

+

+            // Create Bag contents

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue("A"));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue("C"));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue("E"));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+            bagStringBooleansTrue = new Bag();

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansTrue.add(DataTypes.DT_STRING.createAttributeValue("true"));

+            bagStringBooleansFalse = new Bag();

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagStringBooleansFalse.add(DataTypes.DT_STRING.createAttributeValue("false"));

+            bagInt123 = new Bag();

+            bagInt123.add(DataTypes.DT_INTEGER.createAttributeValue(1));

+            bagInt123.add(DataTypes.DT_INTEGER.createAttributeValue(2));

+            bagInt123.add(DataTypes.DT_INTEGER.createAttributeValue(3));

+            bagInt789 = new Bag();

+            bagInt789.add(DataTypes.DT_INTEGER.createAttributeValue(7));

+            bagInt789.add(DataTypes.DT_INTEGER.createAttributeValue(8));

+            bagInt789.add(DataTypes.DT_INTEGER.createAttributeValue(9));

+

+

+

+            // create primitive attrs

+            attrh = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(h));

+            attrInt7 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(7));

+

+

+            // predicates passed as function arguments

+            attrPredicateStringNormalizeToLowerCase = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE));

+            attrPredicateIntegerEqual = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_INTEGER_EQUAL));

+            attrPredicateIntegerAdd = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(XACML3.ID_FUNCTION_INTEGER_ADD));

+

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

+

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        FunctionArgumentBag attrBagStringBooleansTrue = new FunctionArgumentBag(bagStringBooleansTrue);

+        FunctionArgumentBag attrBagInt789 = new FunctionArgumentBag(bagInt789);

+

+        FunctionDefinitionHigherOrderBag<?,?> fd = (FunctionDefinitionHigherOrderBag<?,?>) StdFunctions.FD_MAP;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_MAP, fd.getId());

+        assertNull( fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertTrue(fd.returnsBag());

+

+        // normal match

+        arguments.clear();

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrBagace);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertTrue(res.isBag());

+        Bag bag = res.getBag();

+        assertEquals(3, bag.size());

+        List<AttributeValue<?>> bagAttributes = bag.getAttributeValueList();

+        try {

+            assertTrue(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("a")));

+            assertFalse(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("A")));

+            assertTrue(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("c")));

+            assertFalse(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("C")));

+            assertTrue(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("e")));

+            assertFalse(bagAttributes.contains(DataTypes.DT_STRING.createAttributeValue("E")));

+        } catch (Exception ex) {

+            fail("checking result e="+ex);

+        }

+

+        // 2-input predicate

+        arguments.clear();

+        arguments.add(attrPredicateIntegerAdd);

+        arguments.add(attrInt7);

+        arguments.add(attrBagInt789);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertTrue(res.isBag());

+        bag = res.getBag();

+        assertEquals(3, bag.size());

+        bagAttributes = bag.getAttributeValueList();

+        try {

+            assertTrue(bagAttributes.contains(DataTypes.DT_INTEGER.createAttributeValue("14")));

+            assertTrue(bagAttributes.contains(DataTypes.DT_INTEGER.createAttributeValue("15")));

+            assertTrue(bagAttributes.contains(DataTypes.DT_INTEGER.createAttributeValue("16")));

+        } catch (Exception ex) {

+            fail("checking result e="+ex);

+        }

+

+

+        // predicate returns booleans

+        arguments.clear();

+        arguments.add(attrPredicateIntegerEqual);

+        arguments.add(attrInt7);

+        arguments.add(attrBagInt789);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertTrue(res.isBag());

+        bag = res.getBag();

+        assertEquals(3, bag.size());

+        bagAttributes = bag.getAttributeValueList();

+        try {

+            assertEquals(bagAttributes.get(0), (DataTypes.DT_BOOLEAN.createAttributeValue(true)));

+            assertEquals(bagAttributes.get(1), (DataTypes.DT_BOOLEAN.createAttributeValue(false)));

+            assertEquals(bagAttributes.get(2), (DataTypes.DT_BOOLEAN.createAttributeValue(false)));

+        } catch (Exception ex) {

+            fail("checking result e="+ex);

+        }

+

+        // predicate returns bag

+

+

+

+        // no primitives - predicate function expects 2

+        arguments.clear();

+        arguments.add(attrPredicateIntegerAdd);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:map Predicate error: function:integer-add Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bag is empty

+        arguments.clear();

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrh);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertTrue(res.isBag());

+        bag = res.getBag();

+        assertEquals(0, bag.size());;

+

+        // no bag

+        arguments.clear();

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrh);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:map Did not get any Bag argument; must have at least 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // extra bag

+        arguments.clear();

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrh);

+        arguments.add(attrBagStringBooleansTrue);

+        arguments.add(attrh);

+        arguments.add(attrBagStringBooleansTrue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:map must have only 1 bag; found one at index 2 and another at 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // bad predicate

+        arguments.clear();

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:map First argument expected URI, got http://www.w3.org/2001/XMLSchema#string", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // predicate gets unexpected number of args

+        arguments.clear();

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:map Predicate error: function:string-normalize-to-lower-case Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // predicate gets bad primitive type

+        arguments.clear();

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:map Predicate error: function:string-normalize-to-lower-case Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrh);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:map Predicate Function (first argument) was null", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second null

+        arguments.clear();

+        arguments.add(attrPredicateStringNormalizeToLowerCase);

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:map Got null argument at index 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHomogeneousSimpleTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHomogeneousSimpleTest.java
index ced10d2..6640fb1 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHomogeneousSimpleTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionHomogeneousSimpleTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -51,13 +51,13 @@
 /**

  * FunctionDefinitionHomogeneousSimple is an abstract class, so we have to test it by creating a sub-class.

  * The constructor is tested by default when an instance of the sub-class is created for other tests.

- * 

+ *

  * Each of these functions needs to be tested for each type of function to be sure the values are correct,

  * so this is just a simple test to see that the mechanism works.

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

@@ -65,96 +65,96 @@
 

 

 

-        @Test

-        public void testGetDataTypeArgs() {

-                

-                // test a simple instance using the Equality class

-                FunctionDefinitionEquality<String> fd   = new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING);

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+    @Test

+    public void testGetDataTypeArgs() {

+

+        // test a simple instance using the Equality class

+        FunctionDefinitionEquality<String> fd   = new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING);

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+    }

+

+    @Test

+    public void testGetNumArgs() {

+        // test a simple instance using the Equality class

+        FunctionDefinitionEquality<String> fd   = new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING);

+        assertEquals(new Integer(2), fd.getNumArgs());

+    }

+

+    @Test

+    public void testValidateArguments() {

+        // create some arguments to use later

+        FunctionArgumentAttributeValue stringAttr1 = null;

+        FunctionArgumentAttributeValue stringAttr2 = null;

+        FunctionArgumentAttributeValue stringAttr3 = null;

+        FunctionArgumentAttributeValue intAttr = null;

+        try {

+            stringAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

+            stringAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("def"));

+            stringAttr3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("ghi"));

+            intAttr = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testGetNumArgs() {

-                // test a simple instance using the Equality class

-                FunctionDefinitionEquality<String> fd   = new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING);

-                assertEquals(new Integer(2), fd.getNumArgs());

-        }

+        FunctionDefinitionEquality<String> fd   = new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING);

+        List<String> convertedValues = new ArrayList<String>();

+        List<FunctionArgument> listFunctionArguments = new ArrayList<FunctionArgument>();

 

-        @Test

-        public void testValidateArguments() {

-                // create some arguments to use later

-                FunctionArgumentAttributeValue stringAttr1 = null;

-                FunctionArgumentAttributeValue stringAttr2 = null;

-                FunctionArgumentAttributeValue stringAttr3 = null;

-                FunctionArgumentAttributeValue intAttr = null;

-                try {

-                        stringAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

-                        stringAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("def"));

-                        stringAttr3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("ghi"));

-                        intAttr = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionEquality<String> fd   = new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING);

-                List<String> convertedValues = new ArrayList<String>();

-                List<FunctionArgument> listFunctionArguments = new ArrayList<FunctionArgument>();

-                

-                // test correct # of args, both of them strings

-                listFunctionArguments.add(stringAttr1);

-                listFunctionArguments.add(stringAttr2);

-                Status status = fd.validateArguments(listFunctionArguments, convertedValues);

-                assertTrue(status.isOk());

-                assertEquals(convertedValues.size(),2);

-                

-                // test too few args

-                listFunctionArguments.remove(1);

-                status = fd.validateArguments(listFunctionArguments, convertedValues);

-                assertFalse(status.isOk());

-                assertEquals("Expected 2 arguments, got 1", status.getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

-                

-                // test too many args

-                listFunctionArguments.add(stringAttr2);

-                listFunctionArguments.add(stringAttr3);

-                status = fd.validateArguments(listFunctionArguments, convertedValues);

-                assertFalse(status.isOk());

-                assertEquals("Expected 2 arguments, got 3", status.getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

-                

-                // test with null arg

-                listFunctionArguments.clear();

-                listFunctionArguments.add(null);

-                listFunctionArguments.add(stringAttr1);

-                status = fd.validateArguments(listFunctionArguments, convertedValues);

-                assertFalse(status.isOk());

-                assertEquals("Got null argument at arg index 0", status.getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

+        // test correct # of args, both of them strings

+        listFunctionArguments.add(stringAttr1);

+        listFunctionArguments.add(stringAttr2);

+        Status status = fd.validateArguments(listFunctionArguments, convertedValues);

+        assertTrue(status.isOk());

+        assertEquals(convertedValues.size(),2);

 

-                // test function that takes 0 args

+        // test too few args

+        listFunctionArguments.remove(1);

+        status = fd.validateArguments(listFunctionArguments, convertedValues);

+        assertFalse(status.isOk());

+        assertEquals("Expected 2 arguments, got 1", status.getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

+

+        // test too many args

+        listFunctionArguments.add(stringAttr2);

+        listFunctionArguments.add(stringAttr3);

+        status = fd.validateArguments(listFunctionArguments, convertedValues);

+        assertFalse(status.isOk());

+        assertEquals("Expected 2 arguments, got 3", status.getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

+

+        // test with null arg

+        listFunctionArguments.clear();

+        listFunctionArguments.add(null);

+        listFunctionArguments.add(stringAttr1);

+        status = fd.validateArguments(listFunctionArguments, convertedValues);

+        assertFalse(status.isOk());

+        assertEquals("Got null argument at arg index 0", status.getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

+

+        // test function that takes 0 args

 //TODO test with func that specifies 0 args? ASSUME for now that there are no such functions since a function needs to operate on something

 //		fail("need to test function with 0 args and various inputs - see validateArguments code");

-                

 

-                // test with one is a bag

-                listFunctionArguments.clear();

-                listFunctionArguments.add(stringAttr1);

-                Bag bag = new Bag();

-                FunctionArgument bagArg = new FunctionArgumentBag(bag);

-                listFunctionArguments.add(bagArg);

-                status = fd.validateArguments(listFunctionArguments, convertedValues);

-                assertFalse(status.isOk());

-                assertEquals("Expected a simple value, saw a bag at arg index 1", status.getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

-                

-                // test with string and int

-                listFunctionArguments.clear();

-                listFunctionArguments.add(stringAttr1);

-                listFunctionArguments.add(intAttr);

-                status = fd.validateArguments(listFunctionArguments, convertedValues);

-                assertFalse(status.isOk());

-                assertEquals("Expected data type 'string' saw 'integer' at arg index 1", status.getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

-        }

+

+        // test with one is a bag

+        listFunctionArguments.clear();

+        listFunctionArguments.add(stringAttr1);

+        Bag bag = new Bag();

+        FunctionArgument bagArg = new FunctionArgumentBag(bag);

+        listFunctionArguments.add(bagArg);

+        status = fd.validateArguments(listFunctionArguments, convertedValues);

+        assertFalse(status.isOk());

+        assertEquals("Expected a simple value, saw a bag at arg index 1", status.getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

+

+        // test with string and int

+        listFunctionArguments.clear();

+        listFunctionArguments.add(stringAttr1);

+        listFunctionArguments.add(intAttr);

+        status = fd.validateArguments(listFunctionArguments, convertedValues);

+        assertFalse(status.isOk());

+        assertEquals("Expected data type 'string' saw 'integer' at arg index 1", status.getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", status.getStatusCode().getStatusCodeValue().stringValue());

+    }

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionLogicalTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionLogicalTest.java
index 9416cf8..2d05334 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionLogicalTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionLogicalTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -39,384 +39,384 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionLogicalTest {

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        // use the same args for each test

-        FunctionArgumentAttributeValue attrT = null;

-        FunctionArgumentAttributeValue attrF = null;

-        public FunctionDefinitionLogicalTest () {

-                try {

-                        attrT = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(true));

-                        attrF = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(false));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-        }

-        

-        

-        @Test

-        public void testOR() {

-                FunctionArgumentAttributeValue attr5 = null;

-                try {

-                        attr5 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionLogical fd = (FunctionDefinitionLogical) StdFunctions.FD_OR;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_OR, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                

-                // test normal 

-                arguments.add(attrT);

-                arguments.add(attrF);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                arguments.clear();

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(false), resValue);

-                

-                //	test no args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(false), resValue);

-                

-                // first true, second error

-                arguments.clear();

-                arguments.add(attrT);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // first false, second error

-                arguments.clear();

-                arguments.add(attrF);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:or Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // multiple false

-                arguments.clear();

-                arguments.add(attrF);

-                arguments.add(attrF);

-                arguments.add(attrF);

-                arguments.add(attrF);

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(false), resValue);

-                

-                // non-boolean

-                arguments.clear();

-                arguments.add(attrF);

-                arguments.add(attr5);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:or Expected data type 'boolean' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // first arg error

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:or Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+    // use the same args for each test

+    FunctionArgumentAttributeValue attrT = null;

+    FunctionArgumentAttributeValue attrF = null;

+    public FunctionDefinitionLogicalTest () {

+        try {

+            attrT = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(true));

+            attrF = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(false));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+    }

+

+

+    @Test

+    public void testOR() {

+        FunctionArgumentAttributeValue attr5 = null;

+        try {

+            attr5 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        

-        @Test

-        public void testAND() {

-                FunctionArgumentAttributeValue attr5 = null;

-                try {

-                        attr5 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+        FunctionDefinitionLogical fd = (FunctionDefinitionLogical) StdFunctions.FD_OR;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                

-                FunctionDefinitionLogical fd = (FunctionDefinitionLogical) StdFunctions.FD_AND;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_AND, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                

-                // test normal 

-                arguments.add(attrT);

-                arguments.add(attrF);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(false), resValue);

-                

-                arguments.clear();

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(false), resValue);

-                

-                //	test no args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // first true, second error

-                arguments.clear();

-                arguments.add(attrT);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:and Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // first false, second error

-                arguments.clear();

-                arguments.add(attrF);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(false), resValue);

-                

-                // multiple true

-                arguments.clear();

-                arguments.add(attrT);

-                arguments.add(attrT);

-                arguments.add(attrT);

-                arguments.add(attrT);

-                arguments.add(attrT);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // non-boolean

-                arguments.clear();

-                arguments.add(attrT);

-                arguments.add(attr5);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals("function:and Expected data type 'boolean' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // first arg error

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals("function:and Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_OR, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // test normal

+        arguments.add(attrT);

+        arguments.add(attrF);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        arguments.clear();

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(false), resValue);

+

+        //	test no args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(false), resValue);

+

+        // first true, second error

+        arguments.clear();

+        arguments.add(attrT);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // first false, second error

+        arguments.clear();

+        arguments.add(attrF);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:or Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // multiple false

+        arguments.clear();

+        arguments.add(attrF);

+        arguments.add(attrF);

+        arguments.add(attrF);

+        arguments.add(attrF);

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(false), resValue);

+

+        // non-boolean

+        arguments.clear();

+        arguments.add(attrF);

+        arguments.add(attr5);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:or Expected data type 'boolean' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // first arg error

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:or Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testAND() {

+        FunctionArgumentAttributeValue attr5 = null;

+        try {

+            attr5 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        

-        

-        @Test

-        public void testN_of() {

-                FunctionArgumentAttributeValue attr0 = null;

-                FunctionArgumentAttributeValue attr2 = null;

-                try {

-                        attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                        attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                

-                FunctionDefinitionLogical fd = (FunctionDefinitionLogical) StdFunctions.FD_N_OF;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_N_OF, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                

-                // test normal 

-                arguments.add(attr2);

-                arguments.add(attrT);

-                arguments.add(attrF);

-                arguments.add(attrT);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // normal fail

-                arguments.clear();

-                arguments.add(attr2);

-                arguments.add(attrT);

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(false), resValue);

-                

-                

-                // null count

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrT);

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // 0 count

-                arguments.clear();

-                arguments.add(attr0);

-                arguments.add(attrT);

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // bad object type for count

-                arguments.clear();

-                arguments.add(attrT);

-                arguments.add(attrT);

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:n-of For input string: \"true\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // count larger than list

-                arguments.clear();

-                arguments.add(attr2);

-                arguments.add(attrT);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:n-of Expected 2 arguments but only 1 arguments in list after the count", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // aborts after find ok

-                arguments.clear();

-                arguments.add(attr2);

-                arguments.add(attrT);

-                arguments.add(attrT);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // error before find ok

-                arguments.clear();

-                arguments.add(attr2);

-                arguments.add(null);

-                arguments.add(attrT);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:n-of Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // non-boolean in list

-                arguments.clear();

-                arguments.add(attr2);

-                arguments.add(attrT);

-                arguments.add(attr0);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:n-of Expected data type 'boolean' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                                

+

+

+        FunctionDefinitionLogical fd = (FunctionDefinitionLogical) StdFunctions.FD_AND;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_AND, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // test normal

+        arguments.add(attrT);

+        arguments.add(attrF);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(false), resValue);

+

+        arguments.clear();

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(false), resValue);

+

+        //	test no args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // first true, second error

+        arguments.clear();

+        arguments.add(attrT);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:and Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // first false, second error

+        arguments.clear();

+        arguments.add(attrF);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(false), resValue);

+

+        // multiple true

+        arguments.clear();

+        arguments.add(attrT);

+        arguments.add(attrT);

+        arguments.add(attrT);

+        arguments.add(attrT);

+        arguments.add(attrT);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // non-boolean

+        arguments.clear();

+        arguments.add(attrT);

+        arguments.add(attr5);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals("function:and Expected data type 'boolean' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // first arg error

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals("function:and Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+    @Test

+    public void testN_of() {

+        FunctionArgumentAttributeValue attr0 = null;

+        FunctionArgumentAttributeValue attr2 = null;

+        try {

+            attr0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            attr2 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(2));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        @Test

-        public void testNot() {

-                

-                FunctionDefinitionLogical fd = (FunctionDefinitionLogical) StdFunctions.FD_NOT;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_NOT, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                

-                // test normal 

-                arguments.clear();

-                arguments.add(attrT);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(false), resValue);

-                

-                arguments.clear();

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                

-                // test null/0 args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:not Expected 1 argument, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // test 2 args

-                arguments.clear();

-                arguments.add(attrT);

-                arguments.add(attrF);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:not Expected 1 argument, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

+

+

+        FunctionDefinitionLogical fd = (FunctionDefinitionLogical) StdFunctions.FD_N_OF;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_N_OF, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // test normal

+        arguments.add(attr2);

+        arguments.add(attrT);

+        arguments.add(attrF);

+        arguments.add(attrT);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // normal fail

+        arguments.clear();

+        arguments.add(attr2);

+        arguments.add(attrT);

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(false), resValue);

+

+

+        // null count

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrT);

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // 0 count

+        arguments.clear();

+        arguments.add(attr0);

+        arguments.add(attrT);

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // bad object type for count

+        arguments.clear();

+        arguments.add(attrT);

+        arguments.add(attrT);

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:n-of For input string: \"true\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // count larger than list

+        arguments.clear();

+        arguments.add(attr2);

+        arguments.add(attrT);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:n-of Expected 2 arguments but only 1 arguments in list after the count", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // aborts after find ok

+        arguments.clear();

+        arguments.add(attr2);

+        arguments.add(attrT);

+        arguments.add(attrT);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // error before find ok

+        arguments.clear();

+        arguments.add(attr2);

+        arguments.add(null);

+        arguments.add(attrT);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:n-of Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // non-boolean in list

+        arguments.clear();

+        arguments.add(attr2);

+        arguments.add(attrT);

+        arguments.add(attr0);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:n-of Expected data type 'boolean' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testNot() {

+

+        FunctionDefinitionLogical fd = (FunctionDefinitionLogical) StdFunctions.FD_NOT;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_NOT, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrT);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(false), resValue);

+

+        arguments.clear();

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+

+        // test null/0 args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:not Expected 1 argument, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // test 2 args

+        arguments.clear();

+        arguments.add(attrT);

+        arguments.add(attrF);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:not Expected 1 argument, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionNumberTypeConversionTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionNumberTypeConversionTest.java
index a83282f..44d9063 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionNumberTypeConversionTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionNumberTypeConversionTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -40,80 +40,80 @@
 

 /**

  * Tests for various classes containing only one function.

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionNumberTypeConversionTest {

-        

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        @Test

-        public void testDouble_to_integer() {

-                FunctionArgumentAttributeValue attr1 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(5.432));

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionNumberTypeConversion<?, ?> fd = (FunctionDefinitionNumberTypeConversion<?, ?>) StdFunctions.FD_DOUBLE_TO_INTEGER;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_TO_INTEGER, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                

-                // test normal add

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(BigInteger.valueOf(5), resValue);

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

+

+    @Test

+    public void testDouble_to_integer() {

+        FunctionArgumentAttributeValue attr1 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(5.432));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        

-        @Test

-        public void testInteger_to_double() {

-                FunctionArgumentAttributeValue attr1 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+        FunctionDefinitionNumberTypeConversion<?, ?> fd = (FunctionDefinitionNumberTypeConversion<?, ?>) StdFunctions.FD_DOUBLE_TO_INTEGER;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionNumberTypeConversion<?, ?> fd = (FunctionDefinitionNumberTypeConversion<?, ?>) StdFunctions.FD_INTEGER_TO_DOUBLE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_TO_DOUBLE, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                

-                // test normal add

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(5.0), resValue);

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_TO_INTEGER, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // test normal add

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(BigInteger.valueOf(5), resValue);

+    }

+

+

+    @Test

+    public void testInteger_to_double() {

+        FunctionArgumentAttributeValue attr1 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(5));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

+

+        FunctionDefinitionNumberTypeConversion<?, ?> fd = (FunctionDefinitionNumberTypeConversion<?, ?>) StdFunctions.FD_INTEGER_TO_DOUBLE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_TO_DOUBLE, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // test normal add

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(5.0), resValue);

+    }

+

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRegexpMatchTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRegexpMatchTest.java
index 06689b5..8b5ac89 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRegexpMatchTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionRegexpMatchTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -45,467 +45,467 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionRegexpMatchTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        @Test

-        public void testString() {

-                String v1 = new String("abc");

-                String v2 = new String("def");

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-                

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrV2 = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrV2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v2));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_STRING_REGEXP_MATCH;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_REGEXP_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+    @Test

+    public void testString() {

+        String v1 = new String("abc");

+        String v2 = new String("def");

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrV1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrV2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // null regex

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrV2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-regexp-match Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

-                

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrV2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-regexp-match Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // null object to match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-regexp-match Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-regexp-match Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                // regex not string

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrV2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-regexp-match Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-

-                // object to match not correct type

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-regexp-match Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrV2 = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrV2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v2));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        @Test

-        public void testAnyURI() {

-                String regexp = new String("abc");

-                URI uri1 = null;

-                URI uri2 = null;

-                try {

-                        uri1 = new URI("abc");

-                        uri2 = new URI("def");

-                } catch (Exception e) {

-                        fail("Unable to create URIs, e="+e);

-                }

 

-                

-                FunctionArgumentAttributeValue attrRegexp = null;

-                FunctionArgumentAttributeValue attrUri1 = null;

-                FunctionArgumentAttributeValue attrUri2 = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

-                        attrUri1 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uri1));

-                        attrUri2 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uri2));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_ANYURI_REGEXP_MATCH;

+        FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_STRING_REGEXP_MATCH;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANYURI_REGEXP_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_REGEXP_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrUri1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrUri2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // object to match not correct type

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-regexp-match Expected data type 'anyURI' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrV1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrV2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // null regex

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrV2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-regexp-match Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrV2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-regexp-match Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null object to match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-regexp-match Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-regexp-match Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // regex not string

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrV2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-regexp-match Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // object to match not correct type

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-regexp-match Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+    @Test

+    public void testAnyURI() {

+        String regexp = new String("abc");

+        URI uri1 = null;

+        URI uri2 = null;

+        try {

+            uri1 = new URI("abc");

+            uri2 = new URI("def");

+        } catch (Exception e) {

+            fail("Unable to create URIs, e="+e);

         }

-        

-        

-        @Test

-        public void testIpAddress() {

-                String regexp = new String(".*123.*");

-                IPAddress addr1 = null;

-                IPAddress addr2 = null;

-                try {

-                        addr1 = IPAddress.newInstance("199.123.45.67");

-                        addr2 = IPAddress.newInstance("12.34.67.87");

-                } catch (Exception e) {

-                        fail("Unable to create IPAddresses, e="+e);

-                }

 

-                

-                FunctionArgumentAttributeValue attrRegexp = null;

-                FunctionArgumentAttributeValue attrAddr1 = null;

-                FunctionArgumentAttributeValue attrAddr2 = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

-                        attrAddr1 = new FunctionArgumentAttributeValue(DataTypes.DT_IPADDRESS.createAttributeValue(addr1));

-                        attrAddr2 = new FunctionArgumentAttributeValue(DataTypes.DT_IPADDRESS.createAttributeValue(addr2));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_IPADDRESS_REGEXP_MATCH;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_IPADDRESS_REGEXP_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-

-                

-                // match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrAddr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrAddr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // object to match not correct type

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-regexp-match Expected data type 'ipAddress' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        FunctionArgumentAttributeValue attrRegexp = null;

+        FunctionArgumentAttributeValue attrUri1 = null;

+        FunctionArgumentAttributeValue attrUri2 = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

+            attrUri1 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uri1));

+            attrUri2 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(uri2));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        @Test

-        public void testDnsName() {

-                String regexp = new String("abc");

-                RFC2396DomainName addr1 = null;

-                RFC2396DomainName addr2 = null;

-                try {

-                        addr1 = RFC2396DomainName.newInstance("abc");

-                        addr2 = RFC2396DomainName.newInstance("def");

-                } catch (Exception e) {

-                        fail("Unable to create DNSNames, e="+e);

-                }

 

-                

-                FunctionArgumentAttributeValue attrRegexp = null;

-                FunctionArgumentAttributeValue attrAddr1 = null;

-                FunctionArgumentAttributeValue attrAddr2 = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

-                        attrAddr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DNSNAME.createAttributeValue(addr1));

-                        attrAddr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DNSNAME.createAttributeValue(addr2));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_DNSNAME_REGEXP_MATCH;

+        FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_ANYURI_REGEXP_MATCH;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DNSNAME_REGEXP_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANYURI_REGEXP_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrAddr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrAddr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // object to match not correct type

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dnsName-regexp-match Expected data type 'dnsName' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrUri1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrUri2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // object to match not correct type

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-regexp-match Expected data type 'anyURI' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testIpAddress() {

+        String regexp = new String(".*123.*");

+        IPAddress addr1 = null;

+        IPAddress addr2 = null;

+        try {

+            addr1 = IPAddress.newInstance("199.123.45.67");

+            addr2 = IPAddress.newInstance("12.34.67.87");

+        } catch (Exception e) {

+            fail("Unable to create IPAddresses, e="+e);

         }

-        

-        

-        @Test

-        public void testRfc822Name() {

-                String regexp = new String(".*abc.*");

-                RFC822Name addr1 = null;

-                RFC822Name addr2 = null;

-                try {

-                        addr1 = RFC822Name.newInstance("abc@somewhere");

-                        addr2 = RFC822Name.newInstance("def@somewhere");

-                } catch (Exception e) {

-                        fail("Unable to create RFC822Names, e="+e);

-                }

 

-                

-                FunctionArgumentAttributeValue attrRegexp = null;

-                FunctionArgumentAttributeValue attrAddr1 = null;

-                FunctionArgumentAttributeValue attrAddr2 = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

-                        attrAddr1 = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(addr1));

-                        attrAddr2 = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(addr2));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_RFC822NAME_REGEXP_MATCH;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_RFC822NAME_REGEXP_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-

-                

-                // match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrAddr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrAddr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // object to match not correct type

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:rfc822Name-regexp-match Expected data type 'rfc822Name' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        FunctionArgumentAttributeValue attrRegexp = null;

+        FunctionArgumentAttributeValue attrAddr1 = null;

+        FunctionArgumentAttributeValue attrAddr2 = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

+            attrAddr1 = new FunctionArgumentAttributeValue(DataTypes.DT_IPADDRESS.createAttributeValue(addr1));

+            attrAddr2 = new FunctionArgumentAttributeValue(DataTypes.DT_IPADDRESS.createAttributeValue(addr2));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        @Test

-        public void testX500Name() {

-                String regexp = new String(".*Duke.*");

-                X500Principal addr1 = null;

-                X500Principal addr2 = null;

-                try {

-                        addr1 = new X500Principal("CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US");

-                        addr2 = new X500Principal("CN=Policy Engine, OU=Research, O=ATT, C=US");

-                } catch (Exception e) {

-                        fail("Unable to create X500Name, e="+e);

-                }

 

-                

-                FunctionArgumentAttributeValue attrRegexp = null;

-                FunctionArgumentAttributeValue attrAddr1 = null;

-                FunctionArgumentAttributeValue attrAddr2 = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

-                        attrAddr1 = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(addr1));

-                        attrAddr2 = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(addr2));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_X500NAME_REGEXP_MATCH;

+        FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_IPADDRESS_REGEXP_MATCH;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_X500NAME_REGEXP_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_IPADDRESS_REGEXP_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrAddr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrAddr2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // object to match not correct type

-                arguments.clear();

-                arguments.add(attrRegexp);

-                arguments.add(attrInteger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:x500Name-regexp-match Expected data type 'x500Name' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrAddr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrAddr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // object to match not correct type

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-regexp-match Expected data type 'ipAddress' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testDnsName() {

+        String regexp = new String("abc");

+        RFC2396DomainName addr1 = null;

+        RFC2396DomainName addr2 = null;

+        try {

+            addr1 = RFC2396DomainName.newInstance("abc");

+            addr2 = RFC2396DomainName.newInstance("def");

+        } catch (Exception e) {

+            fail("Unable to create DNSNames, e="+e);

         }

-        

-        

-        

+

+

+        FunctionArgumentAttributeValue attrRegexp = null;

+        FunctionArgumentAttributeValue attrAddr1 = null;

+        FunctionArgumentAttributeValue attrAddr2 = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

+            attrAddr1 = new FunctionArgumentAttributeValue(DataTypes.DT_DNSNAME.createAttributeValue(addr1));

+            attrAddr2 = new FunctionArgumentAttributeValue(DataTypes.DT_DNSNAME.createAttributeValue(addr2));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

+        }

+

+        FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_DNSNAME_REGEXP_MATCH;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DNSNAME_REGEXP_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrAddr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrAddr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // object to match not correct type

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dnsName-regexp-match Expected data type 'dnsName' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testRfc822Name() {

+        String regexp = new String(".*abc.*");

+        RFC822Name addr1 = null;

+        RFC822Name addr2 = null;

+        try {

+            addr1 = RFC822Name.newInstance("abc@somewhere");

+            addr2 = RFC822Name.newInstance("def@somewhere");

+        } catch (Exception e) {

+            fail("Unable to create RFC822Names, e="+e);

+        }

+

+

+        FunctionArgumentAttributeValue attrRegexp = null;

+        FunctionArgumentAttributeValue attrAddr1 = null;

+        FunctionArgumentAttributeValue attrAddr2 = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

+            attrAddr1 = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(addr1));

+            attrAddr2 = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(addr2));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

+        }

+

+        FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_RFC822NAME_REGEXP_MATCH;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_RFC822NAME_REGEXP_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrAddr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrAddr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // object to match not correct type

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:rfc822Name-regexp-match Expected data type 'rfc822Name' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testX500Name() {

+        String regexp = new String(".*Duke.*");

+        X500Principal addr1 = null;

+        X500Principal addr2 = null;

+        try {

+            addr1 = new X500Principal("CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US");

+            addr2 = new X500Principal("CN=Policy Engine, OU=Research, O=ATT, C=US");

+        } catch (Exception e) {

+            fail("Unable to create X500Name, e="+e);

+        }

+

+

+        FunctionArgumentAttributeValue attrRegexp = null;

+        FunctionArgumentAttributeValue attrAddr1 = null;

+        FunctionArgumentAttributeValue attrAddr2 = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrRegexp = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(regexp));

+            attrAddr1 = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(addr1));

+            attrAddr2 = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(addr2));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

+        }

+

+        FunctionDefinitionRegexpMatch<?> fd = (FunctionDefinitionRegexpMatch<?>) StdFunctions.FD_X500NAME_REGEXP_MATCH;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_X500NAME_REGEXP_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrAddr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrAddr2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // object to match not correct type

+        arguments.clear();

+        arguments.add(attrRegexp);

+        arguments.add(attrInteger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:x500Name-regexp-match Expected data type 'x500Name' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSetTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSetTest.java
index eff69c9..517dd3c 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSetTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSetTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -45,1859 +45,1859 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionSetTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        

-        //

-        // INTERSECTION tests

-        //

-        

-        

-        @Test

-        public void testString_intersection() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                

-                FunctionArgumentAttributeValue attrBadType = null;

-                

-                try {

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                                

-                        attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

-                FunctionArgumentBag attrBagaaacccef = new FunctionArgumentBag(bagaaacccef);

-                FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

 

-                FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_INTERSECTION;

+    //

+    // INTERSECTION tests

+    //

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_INTERSECTION, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertTrue(fd.returnsBag());

-                

-                // normal intersection (everything in both bags, no duplicates)

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Bag bag = res.getBag();

-                assertNotNull(bag);

-                Iterator<AttributeValue<?>> it = bag.getAttributeValues();

-                assertEquals(7, bag.size());

-                AttributeValue<?> attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                

-                // several but not all intersection

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(b, attrValueObject.getValue() );

-                

-                // no intersection

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(0, bag.size());

-                

-                // one intersection

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagb);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(b, attrValueObject.getValue() );

-                

-                // bag one has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagaaacccef);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(f, attrValueObject.getValue() );

-                

-                // bag one has duplicates that do intersect

-                arguments.clear();

-                arguments.add(attrBagaaacccef);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(c, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(e, attrValueObject.getValue() );

-                

-                // bag 2 has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagbdfhj);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(f, attrValueObject.getValue() );

-                

-                // bag 2 has duplicates that intersect

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(c, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(e, attrValueObject.getValue() );

-                

-                // first bag is empty

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(0, bag.size());

-                

-                // second bag is empty

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(0, bag.size());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

 

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(0, bag.size());

-                

-                // first not a bag

-                arguments.clear();

-                arguments.add(attrBadType);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-intersection Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second not a bag

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-intersection Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-intersection Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-intersection Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-intersection Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-intersection Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-intersection Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

+    @Test

+    public void testString_intersection() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+

+        FunctionArgumentAttributeValue attrBadType = null;

+

+        try {

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+

+            attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

 

-        

-        @Test

-        public void testInteger_intersection() {

-                BigInteger a = new BigInteger("1");

-                BigInteger b = new BigInteger("2");

-                BigInteger c = new BigInteger("3");

-                BigInteger d = new BigInteger("4");

-                BigInteger e = new BigInteger("5");

-                BigInteger f = new BigInteger("6");

-                BigInteger g = new BigInteger("7");

-                BigInteger h = new BigInteger("8");

-                BigInteger j = new BigInteger("9");

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

+        FunctionArgumentBag attrBagaaacccef = new FunctionArgumentBag(bagaaacccef);

+        FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+

+        FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_INTERSECTION;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_INTERSECTION, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertTrue(fd.returnsBag());

+

+        // normal intersection (everything in both bags, no duplicates)

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Bag bag = res.getBag();

+        assertNotNull(bag);

+        Iterator<AttributeValue<?>> it = bag.getAttributeValues();

+        assertEquals(7, bag.size());

+        AttributeValue<?> attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        // several but not all intersection

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(b, attrValueObject.getValue() );

+

+        // no intersection

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(0, bag.size());

+

+        // one intersection

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagb);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(b, attrValueObject.getValue() );

+

+        // bag one has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagaaacccef);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(f, attrValueObject.getValue() );

+

+        // bag one has duplicates that do intersect

+        arguments.clear();

+        arguments.add(attrBagaaacccef);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(c, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(e, attrValueObject.getValue() );

+

+        // bag 2 has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagbdfhj);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(f, attrValueObject.getValue() );

+

+        // bag 2 has duplicates that intersect

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(c, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(e, attrValueObject.getValue() );

+

+        // first bag is empty

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(0, bag.size());

+

+        // second bag is empty

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(0, bag.size());

+

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(0, bag.size());

+

+        // first not a bag

+        arguments.clear();

+        arguments.add(attrBadType);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-intersection Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second not a bag

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-intersection Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaacccef = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                

-                FunctionArgumentAttributeValue attrBadType = null;

-                

-                try {

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_INTEGER.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_INTEGER.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_INTEGER.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_INTEGER.createAttributeValue(b));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(f));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue("abc"));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(1));

-                        bagEmpty = new Bag();

-                                

-                        attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

-                FunctionArgumentBag attrBagaaacccef = new FunctionArgumentBag(bagaaacccef);

-                FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-intersection Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_INTEGER_INTERSECTION;

+        // second null

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-intersection Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_INTERSECTION, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertTrue(fd.returnsBag());

-                

-                // normal intersection (everything in both bags, no duplicates)

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Bag bag = res.getBag();

-                assertNotNull(bag);

-                Iterator<AttributeValue<?>> it = bag.getAttributeValues();

-                assertEquals(7, bag.size());

-                AttributeValue<?> attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                

-                // several but not all intersection

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(b, attrValueObject.getValue() );

-                

-                // no intersection

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(0, bag.size());

-                

-                // one intersection

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagb);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(b, attrValueObject.getValue() );

-                

-                // bag one has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagaaacccef);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(f, attrValueObject.getValue() );

-                

-                // bag one has duplicates that do intersect

-                arguments.clear();

-                arguments.add(attrBagaaacccef);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(c, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(e, attrValueObject.getValue() );

-                

-                // bag 2 has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagbdfhj);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(f, attrValueObject.getValue() );

-                

-                // bag 2 has duplicates that intersect

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(3, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(c, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(e, attrValueObject.getValue() );

-                

-                // first bag is empty

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(0, bag.size());

-                

-                // second bag is empty

-                arguments.clear();

-                arguments.add(attrBagbdfhj);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(0, bag.size());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

+        // too few args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-intersection Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagInt);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(1, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-intersection Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                // first not a bag

-                arguments.clear();

-                arguments.add(attrBadType);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-intersection Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second not a bag

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-intersection Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-intersection Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-intersection Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-intersection Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-intersection Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-intersection Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-intersection Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

+    }

+

+

+

+    @Test

+    public void testInteger_intersection() {

+        BigInteger a = new BigInteger("1");

+        BigInteger b = new BigInteger("2");

+        BigInteger c = new BigInteger("3");

+        BigInteger d = new BigInteger("4");

+        BigInteger e = new BigInteger("5");

+        BigInteger f = new BigInteger("6");

+        BigInteger g = new BigInteger("7");

+        BigInteger h = new BigInteger("8");

+        BigInteger j = new BigInteger("9");

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaacccef = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+

+        FunctionArgumentAttributeValue attrBadType = null;

+

+        try {

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_INTEGER.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_INTEGER.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_INTEGER.createAttributeValue(a));

+            bagace.add(DataTypes.DT_INTEGER.createAttributeValue(c));

+            bagace.add(DataTypes.DT_INTEGER.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_INTEGER.createAttributeValue(b));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_INTEGER.createAttributeValue(f));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue("abc"));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(1));

+            bagEmpty = new Bag();

+

+            attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        //

-        // AT_LEAST_ONE_MEMBER_OF tests

-        //

-        

-        @Test

-        public void testString_at_least_one_member_of() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

+

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

+        FunctionArgumentBag attrBagaaacccef = new FunctionArgumentBag(bagaaacccef);

+        FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+

+        FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_INTEGER_INTERSECTION;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_INTERSECTION, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertTrue(fd.returnsBag());

+

+        // normal intersection (everything in both bags, no duplicates)

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Bag bag = res.getBag();

+        assertNotNull(bag);

+        Iterator<AttributeValue<?>> it = bag.getAttributeValues();

+        assertEquals(7, bag.size());

+        AttributeValue<?> attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        // several but not all intersection

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(b, attrValueObject.getValue() );

+

+        // no intersection

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(0, bag.size());

+

+        // one intersection

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagb);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(b, attrValueObject.getValue() );

+

+        // bag one has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagaaacccef);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(f, attrValueObject.getValue() );

+

+        // bag one has duplicates that do intersect

+        arguments.clear();

+        arguments.add(attrBagaaacccef);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(c, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(e, attrValueObject.getValue() );

+

+        // bag 2 has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagbdfhj);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(f, attrValueObject.getValue() );

+

+        // bag 2 has duplicates that intersect

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(3, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(c, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(e, attrValueObject.getValue() );

+

+        // first bag is empty

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(0, bag.size());

+

+        // second bag is empty

+        arguments.clear();

+        arguments.add(attrBagbdfhj);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(0, bag.size());

+

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagInt);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(1, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_INTEGER.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaaccce = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                

-                FunctionArgumentAttributeValue attrBadType = null;

-                

-                try {

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaaccce = new Bag();

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                                

-                        attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

-                FunctionArgumentBag attrBagaaaccce = new FunctionArgumentBag(bagaaaccce);

-                FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        // first not a bag

+        arguments.clear();

+        arguments.add(attrBadType);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-intersection Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_AT_LEAST_ONE_MEMBER_OF;

+        // second not a bag

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-intersection Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal intersection (everything in both bags, no duplicates)

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

 

-                

-                // several but not all intersection

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // no intersection

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // one intersection

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagb);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // bag one has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag one has duplicates that do intersect

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // bag 2 has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagbdfhj);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag 2 has duplicates that intersect

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // 2 empty bags

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first non-empty, 2nd empty

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first empty, 2nd not empty

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-intersection Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first not a bag

-                arguments.clear();

-                arguments.add(attrBadType);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-at-least-one-member-of Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second not a bag

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-at-least-one-member-of Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-at-least-one-member-of Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-at-least-one-member-of Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-at-least-one-member-of Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-at-least-one-member-of Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-at-least-one-member-of Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

+        // second null

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-intersection Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too few args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-intersection Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-intersection Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-intersection Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+

+

+

+

+

+

+

+    //

+    // AT_LEAST_ONE_MEMBER_OF tests

+    //

+

+    @Test

+    public void testString_at_least_one_member_of() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaaccce = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+

+        FunctionArgumentAttributeValue attrBadType = null;

+

+        try {

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaaccce = new Bag();

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+

+            attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

 

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        //

-        // UNION tests

-        //

-        

-        

-        

-        

-        

-        @Test

-        public void testString_union() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

+        FunctionArgumentBag attrBagaaaccce = new FunctionArgumentBag(bagaaaccce);

+        FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+

+        FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_AT_LEAST_ONE_MEMBER_OF;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal intersection (everything in both bags, no duplicates)

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagaaacccef = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                

-                FunctionArgumentAttributeValue attrBadType = null;

-                

-                try {

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagaaacccef = new Bag();

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                                

-                        attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagaaacccef = new FunctionArgumentBag(bagaaacccef);

-                FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        // several but not all intersection

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_UNION;

+        // no intersection

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_UNION, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertTrue(fd.returnsBag());

-                

-                // normal intersection (everything in both bags, no duplicates)

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Bag bag = res.getBag();

-                assertNotNull(bag);

-                Iterator<AttributeValue<?>> it = bag.getAttributeValues();

-                assertEquals(7, bag.size());

-                AttributeValue<?> attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                

-                // several but not all union

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(8, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                

-                // bag one has duplicates that do not match first bag

-                arguments.clear();

-                arguments.add(attrBagaaacccef);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(8, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                

-                // bag one has duplicates that do match first bag

-                arguments.clear();

-                arguments.add(attrBagaaacccef);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(4, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(c, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(e, attrValueObject.getValue() );

-                

-                // bag 2 has duplicates that do not match first bag

-                arguments.clear();

-                arguments.add(attrBagbdfhj);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(8, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(b, attrValueObject.getValue() );

-                

-                // bag 2 has duplicates that do match first bag

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(4, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(c, attrValueObject.getValue() );

-                attrValueObject = it.next();

-                assertEquals(e, attrValueObject.getValue() );

-                

-                // two empty bags

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(0, bag.size());

-                

-                // first bag empty, 2nd not empty

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagaaacccef);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(4, bag.size());

-                

-                // first bag not empty, 2nd empty

-                arguments.clear();

-                arguments.add(attrBagaaacccef);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(4, bag.size());

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(4, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

+        // one intersection

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagb);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                bag = res.getBag();

-                assertNotNull(bag);

-                it = bag.getAttributeValues();

-                assertEquals(4, bag.size());

-                attrValueObject = it.next();

-                assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

-                assertEquals(a, attrValueObject.getValue() );

-                

-                // first not a bag

-                arguments.clear();

-                arguments.add(attrBadType);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-union Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second not a bag

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-union Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-union Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-union Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-union Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-union Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-union Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // bag one has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

+        // bag one has duplicates that do intersect

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // bag 2 has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagbdfhj);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bag 2 has duplicates that intersect

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // 2 empty bags

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first non-empty, 2nd empty

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first empty, 2nd not empty

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first not a bag

+        arguments.clear();

+        arguments.add(attrBadType);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-at-least-one-member-of Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second not a bag

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-at-least-one-member-of Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-at-least-one-member-of Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second null

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-at-least-one-member-of Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too few args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-at-least-one-member-of Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-at-least-one-member-of Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-at-least-one-member-of Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+

+

+

+

+

+

+

+    //

+    // UNION tests

+    //

+

+

+

+

+

+    @Test

+    public void testString_union() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagaaacccef = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+

+        FunctionArgumentAttributeValue attrBadType = null;

+

+        try {

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef = new Bag();

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagaaacccef.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+

+            attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        //

-        // SUBSET tests

-        //

-        

-        @Test

-        public void testString_subset() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

+

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagaaacccef = new FunctionArgumentBag(bagaaacccef);

+        FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+

+        FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_UNION;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_UNION, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertTrue(fd.returnsBag());

+

+        // normal intersection (everything in both bags, no duplicates)

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Bag bag = res.getBag();

+        assertNotNull(bag);

+        Iterator<AttributeValue<?>> it = bag.getAttributeValues();

+        assertEquals(7, bag.size());

+        AttributeValue<?> attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        // several but not all union

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(8, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        // bag one has duplicates that do not match first bag

+        arguments.clear();

+        arguments.add(attrBagaaacccef);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(8, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        // bag one has duplicates that do match first bag

+        arguments.clear();

+        arguments.add(attrBagaaacccef);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(4, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(c, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(e, attrValueObject.getValue() );

+

+        // bag 2 has duplicates that do not match first bag

+        arguments.clear();

+        arguments.add(attrBagbdfhj);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(8, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(b, attrValueObject.getValue() );

+

+        // bag 2 has duplicates that do match first bag

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(4, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(c, attrValueObject.getValue() );

+        attrValueObject = it.next();

+        assertEquals(e, attrValueObject.getValue() );

+

+        // two empty bags

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(0, bag.size());

+

+        // first bag empty, 2nd not empty

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagaaacccef);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(4, bag.size());

+

+        // first bag not empty, 2nd empty

+        arguments.clear();

+        arguments.add(attrBagaaacccef);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(4, bag.size());

+

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(4, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        bag = res.getBag();

+        assertNotNull(bag);

+        it = bag.getAttributeValues();

+        assertEquals(4, bag.size());

+        attrValueObject = it.next();

+        assertEquals(DataTypes.DT_STRING.getId(), attrValueObject.getDataTypeId());

+        assertEquals(a, attrValueObject.getValue() );

+

+        // first not a bag

+        arguments.clear();

+        arguments.add(attrBadType);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-union Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second not a bag

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-union Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaaccce = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                

-                FunctionArgumentAttributeValue attrBadType = null;

-                

-                try {

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaaccce = new Bag();

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                                

-                        attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

-                FunctionArgumentBag attrBagaaaccce = new FunctionArgumentBag(bagaaaccce);

-                FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-union Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_SUBSET;

+        // second null

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-union Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_SUBSET, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal intersection (everything in both bags, no duplicates)

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // too few args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-union Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                // not subset

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // subset

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                

-                // no intersection

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // Not

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagb);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // Subset

-                arguments.clear();

-                arguments.add(attrBagb);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // bag one has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag one has duplicates that do intersect

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // bag 2 has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagbdfhj);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag 2 has duplicates that intersect

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // 2 empty bags

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first non-empty, 2nd empty

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first empty, 2nd not empty

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                arguments.clear();

-                arguments.add(attrBagb);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-union Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first not a bag

-                arguments.clear();

-                arguments.add(attrBadType);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-subset Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second not a bag

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-subset Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-subset Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-subset Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-subset Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-subset Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-subset Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-union Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+

+

+

+

+    //

+    // SUBSET tests

+    //

+

+    @Test

+    public void testString_subset() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaaccce = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+

+        FunctionArgumentAttributeValue attrBadType = null;

+

+        try {

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaaccce = new Bag();

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+

+            attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

 

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        //

-        // SET_EQUALS tests

-        //

-        

-        @Test

-        public void testString_set_equals() {

-                String a = "a";

-                String b = "b";

-                String c = "c";

-                String d = "d";

-                String e = "e";

-                String f = "f";

-                String g = "g";

-                String h = "h";

-                String j = "j";

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

+        FunctionArgumentBag attrBagaaaccce = new FunctionArgumentBag(bagaaaccce);

+        FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+

+        FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_SUBSET;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_SUBSET, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal intersection (everything in both bags, no duplicates)

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

 

-                Bag bagabcdefg = null;

-                Bag bagbdfhj = null;

-                Bag bagace = null;

-                Bag bagb = null;

-                Bag bagaaaccce = null;

-                Bag bagInt = null;

-                Bag bagStringInt = null;

-                Bag bagEmpty = null;

-                

-                FunctionArgumentAttributeValue attrBadType = null;

-                

-                try {

-                        bagabcdefg = new Bag();

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

-                        bagbdfhj = new Bag();

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

-                                bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

-                        bagace = new Bag();

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagb = new Bag();

-                                bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

-                        bagaaaccce = new Bag();

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

-                                bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(e));

-                        bagInt = new Bag();

-                                bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagStringInt = new Bag();

-                                bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

-                                bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

-                        bagEmpty = new Bag();

-                                

-                        attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

-                } catch (Exception ex) {

-                        fail("creating attribute e="+ ex);

-                }

-                

-                // make into attributes

-                FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

-                FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

-                FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

-                FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

-                FunctionArgumentBag attrBagaaaccce = new FunctionArgumentBag(bagaaaccce);

-                FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

-                FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

-                FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+        // not subset

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_SET_EQUALS;

+        // subset

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_SET_EQUALS, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                // normal intersection (everything in both bags, no duplicates)

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

 

-                

-                // several but not all intersection

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // no intersection

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // one intersection

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagb);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag one has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagbdfhj);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag one has duplicates that do intersect

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagace);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // bag 2 has duplicates that do not intersect

-                arguments.clear();

-                arguments.add(attrBagbdfhj);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bag 2 has duplicates that intersect

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // 2 empty bags

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // first non-empty, 2nd empty

-                arguments.clear();

-                arguments.add(attrBagaaaccce);

-                arguments.add(attrBagEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first empty, 2nd not empty

-                arguments.clear();

-                arguments.add(attrBagEmpty);

-                arguments.add(attrBagaaaccce);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bags of different types

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagStringInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

+        // no intersection

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

 

-                arguments.clear();

-                arguments.add(attrBagace);

-                arguments.add(attrBagInt);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first not a bag

-                arguments.clear();

-                arguments.add(attrBadType);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-set-equals Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second not a bag

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-set-equals Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first null

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-set-equals Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // second null

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-set-equals Got null argument", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-set-equals Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-set-equals Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                arguments.add(attrBagabcdefg);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-set-equals Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

+        // Not

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagb);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // Subset

+        arguments.clear();

+        arguments.add(attrBagb);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // bag one has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bag one has duplicates that do intersect

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // bag 2 has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagbdfhj);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bag 2 has duplicates that intersect

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // 2 empty bags

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first non-empty, 2nd empty

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first empty, 2nd not empty

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        arguments.clear();

+        arguments.add(attrBagb);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first not a bag

+        arguments.clear();

+        arguments.add(attrBadType);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-subset Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second not a bag

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-subset Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-subset Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second null

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-subset Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too few args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-subset Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-subset Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-subset Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+

+

+

+

+

+    //

+    // SET_EQUALS tests

+    //

+

+    @Test

+    public void testString_set_equals() {

+        String a = "a";

+        String b = "b";

+        String c = "c";

+        String d = "d";

+        String e = "e";

+        String f = "f";

+        String g = "g";

+        String h = "h";

+        String j = "j";

+

+

+        Bag bagabcdefg = null;

+        Bag bagbdfhj = null;

+        Bag bagace = null;

+        Bag bagb = null;

+        Bag bagaaaccce = null;

+        Bag bagInt = null;

+        Bag bagStringInt = null;

+        Bag bagEmpty = null;

+

+        FunctionArgumentAttributeValue attrBadType = null;

+

+        try {

+            bagabcdefg = new Bag();

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagabcdefg.add(DataTypes.DT_STRING.createAttributeValue(g));

+            bagbdfhj = new Bag();

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(d));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(f));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(h));

+            bagbdfhj.add(DataTypes.DT_STRING.createAttributeValue(j));

+            bagace = new Bag();

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagace.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagb = new Bag();

+            bagb.add(DataTypes.DT_STRING.createAttributeValue(b));

+            bagaaaccce = new Bag();

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(c));

+            bagaaaccce.add(DataTypes.DT_STRING.createAttributeValue(e));

+            bagInt = new Bag();

+            bagInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagStringInt = new Bag();

+            bagStringInt.add(DataTypes.DT_STRING.createAttributeValue(a));

+            bagStringInt.add(DataTypes.DT_INTEGER.createAttributeValue(123));

+            bagEmpty = new Bag();

+

+            attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(1.1));

+        } catch (Exception ex) {

+            fail("creating attribute e="+ ex);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        //

-        //

-        //  REST OF DATA TYPES OMITTED 

-        //	because they "should" all work the same

-        //

-        //

-        

-        

-        

+

+        // make into attributes

+        FunctionArgumentBag attrBagabcdefg = new FunctionArgumentBag(bagabcdefg);

+        FunctionArgumentBag attrBagbdfhj = new FunctionArgumentBag(bagbdfhj);

+        FunctionArgumentBag attrBagace = new FunctionArgumentBag(bagace);

+        FunctionArgumentBag attrBagb = new FunctionArgumentBag(bagb);

+        FunctionArgumentBag attrBagaaaccce = new FunctionArgumentBag(bagaaaccce);

+        FunctionArgumentBag attrBagInt = new FunctionArgumentBag(bagInt);

+        FunctionArgumentBag attrBagStringInt = new FunctionArgumentBag(bagStringInt);

+        FunctionArgumentBag attrBagEmpty = new FunctionArgumentBag(bagEmpty);

+

+        FunctionDefinitionSet<?,?> fd = (FunctionDefinitionSet<?,?>) StdFunctions.FD_STRING_SET_EQUALS;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_SET_EQUALS, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+        // normal intersection (everything in both bags, no duplicates)

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+

+        // several but not all intersection

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // no intersection

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // one intersection

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagb);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bag one has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagbdfhj);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bag one has duplicates that do intersect

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagace);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // bag 2 has duplicates that do not intersect

+        arguments.clear();

+        arguments.add(attrBagbdfhj);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bag 2 has duplicates that intersect

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // 2 empty bags

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first non-empty, 2nd empty

+        arguments.clear();

+        arguments.add(attrBagaaaccce);

+        arguments.add(attrBagEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first empty, 2nd not empty

+        arguments.clear();

+        arguments.add(attrBagEmpty);

+        arguments.add(attrBagaaaccce);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bags of different types

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagStringInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        arguments.clear();

+        arguments.add(attrBagace);

+        arguments.add(attrBagInt);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first not a bag

+        arguments.clear();

+        arguments.add(attrBadType);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-set-equals Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second not a bag

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-set-equals Expected a bag, saw a simple value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // first null

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-set-equals Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // second null

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-set-equals Got null argument", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too few args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-set-equals Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-set-equals Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        arguments.add(attrBagabcdefg);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-set-equals Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+

+

+

+

+    //

+    //

+    //  REST OF DATA TYPES OMITTED

+    //	because they "should" all work the same

+    //

+    //

+

+

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSpecialMatchTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSpecialMatchTest.java
index 7e43e89..e4b2d05 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSpecialMatchTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionSpecialMatchTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -43,445 +43,445 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionSpecialMatchTest {

-        

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        @Test

-        public void testX500NameMatch() {

-                // assume that the contents of the name components are not significant and we can treat them as simple blocks of "<name>=<value>"

-                String A = "cn=Some person";

-                String B = "O=Medico Corp";

-                String C = "C=US";

-                String D = "DNQUALIFIER=d string";

-                String E = "SURNAME=some name";

-                String F = "INITIALS=inits";

-                

-                

-                X500Principal abc = new X500Principal(A + "," + B + "," + C);

-                X500Principal dabc = new X500Principal(D + "," + A + "," + B + "," + C);

-                X500Principal abcd = new X500Principal(A + "," + B + "," + C + "," + D);

-                X500Principal adbc = new X500Principal(A + "," + D + "," + B + "," + C);

-                X500Principal dcab = new X500Principal(D + "," + C + "," +  A + "," + B) ;

-                X500Principal def = new X500Principal(D + "," + E + "," +  F) ;

 

-                

-                FunctionArgumentAttributeValue attrABC = null;

-                FunctionArgumentAttributeValue attrDABC = null;

-                FunctionArgumentAttributeValue attrABCD = null;

-                FunctionArgumentAttributeValue attrADBC = null;

-                FunctionArgumentAttributeValue attrDCAB = null;

-                FunctionArgumentAttributeValue attrDEF = null;

-                

-                FunctionArgumentAttributeValue attrBad = null;

-                FunctionArgumentBag attrBag = new FunctionArgumentBag(new Bag());

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-                

-                try {

-                        attrABC = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(abc));

-                        attrDABC = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(dabc));

-                        attrABCD = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(abcd));

-                        attrADBC = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(adbc));

-                        attrDCAB = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(dcab));

-                        attrDEF = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(def));

+    @Test

+    public void testX500NameMatch() {

+        // assume that the contents of the name components are not significant and we can treat them as simple blocks of "<name>=<value>"

+        String A = "cn=Some person";

+        String B = "O=Medico Corp";

+        String C = "C=US";

+        String D = "DNQUALIFIER=d string";

+        String E = "SURNAME=some name";

+        String F = "INITIALS=inits";

 

-                        attrBad = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionX500NameMatch fd = (FunctionDefinitionX500NameMatch) StdFunctions.FD_X500NAME_MATCH;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_X500NAME_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_X500NAME.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal, first exact match for second

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrABC);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

 

-                // test first is end of second

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrDABC);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        X500Principal abc = new X500Principal(A + "," + B + "," + C);

+        X500Principal dabc = new X500Principal(D + "," + A + "," + B + "," + C);

+        X500Principal abcd = new X500Principal(A + "," + B + "," + C + "," + D);

+        X500Principal adbc = new X500Principal(A + "," + D + "," + B + "," + C);

+        X500Principal dcab = new X500Principal(D + "," + C + "," +  A + "," + B) ;

+        X500Principal def = new X500Principal(D + "," + E + "," +  F) ;

 

-                // first exact match for sub-section but not end of second

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrABCD);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // components of first match components in second but not contiguous

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrADBC);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // components of first match components in second but not in order

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrDCAB);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first does not match second at all

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrDEF);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first arg larger than 2nd arg

-                arguments.clear();

-                arguments.add(attrABCD);

-                arguments.add(attrABC);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // bad arg types

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrBad);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:x500Name-match Expected data type 'x500Name' saw 'integer' at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrABC);

-                arguments.add(attrABC);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:x500Name-match Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                arguments.add(attrABC);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:x500Name-match Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:x500Name-match Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // one arg is bag

-                arguments.clear();

-                arguments.add(attrABC);

-                arguments.add(attrBag);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:x500Name-match Expected a simple value, saw a bag at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null arg

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrBag);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:x500Name-match Got null argument at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+

+        FunctionArgumentAttributeValue attrABC = null;

+        FunctionArgumentAttributeValue attrDABC = null;

+        FunctionArgumentAttributeValue attrABCD = null;

+        FunctionArgumentAttributeValue attrADBC = null;

+        FunctionArgumentAttributeValue attrDCAB = null;

+        FunctionArgumentAttributeValue attrDEF = null;

+

+        FunctionArgumentAttributeValue attrBad = null;

+        FunctionArgumentBag attrBag = new FunctionArgumentBag(new Bag());

+

+

+        try {

+            attrABC = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(abc));

+            attrDABC = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(dabc));

+            attrABCD = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(abcd));

+            attrADBC = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(adbc));

+            attrDCAB = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(dcab));

+            attrDEF = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(def));

+

+            attrBad = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        

-        @Test

-        public void testRfc822NameMatch() {

+        FunctionDefinitionX500NameMatch fd = (FunctionDefinitionX500NameMatch) StdFunctions.FD_X500NAME_MATCH;

 

-                

-                

-                

-                FunctionArgumentAttributeValue attrStringabcxyz = null;

-                FunctionArgumentAttributeValue attrStringABCxyz = null;

-                FunctionArgumentAttributeValue attrStringabcXYZ = null;

-                FunctionArgumentAttributeValue attrStringcx = null;

-                FunctionArgumentAttributeValue attrStringwholedomainpart = null;

-                FunctionArgumentAttributeValue attrStringWholeDomainPart = null;

-                FunctionArgumentAttributeValue attrStringWholeDomain = null;

-                FunctionArgumentAttributeValue attrStringdomainpart = null;

-                FunctionArgumentAttributeValue attrStringDomainPart = null;

-                FunctionArgumentAttributeValue attrStringdotWholeDomain = null;

-                FunctionArgumentAttributeValue attrStringdomain = null;

-                

-                FunctionArgumentAttributeValue attrStringNoMatch = null;

-                FunctionArgumentAttributeValue attrStringMultipleAt = null;

-                FunctionArgumentAttributeValue attrStringMissingLocal = null;

-                FunctionArgumentAttributeValue attrStringMissingDomain = null;

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_X500NAME_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_X500NAME.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                

-                FunctionArgumentAttributeValue attrRfcabcxyz = null;

-                FunctionArgumentAttributeValue attrRfcwholedomainpart = null;

-                FunctionArgumentAttributeValue attrRfcWholeDomainPart = null;

-

-                FunctionArgumentBag attrBag = new FunctionArgumentBag(new Bag());

-

-                try {

-                        attrStringabcxyz = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc@xyz"));

-                        attrStringABCxyz = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("ABC@xyz"));

-                        attrStringabcXYZ = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc@XYZ"));

-                        attrStringcx = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("c@x"));

-                        attrStringwholedomainpart = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("whole.domain.part"));

-                        attrStringWholeDomainPart = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("Whole.Domain.Part"));

-                        attrStringWholeDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("Whole.Domain"));

-                        attrStringdomainpart = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(".domain.part"));

-                        attrStringDomainPart = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(".Domain.Part"));

-                        attrStringdotWholeDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(".Whole.Domain"));

-                        attrStringdomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(".domain."));

-                        

-                        attrStringNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("no match to any legal name"));

-                        attrStringMultipleAt = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("name@with@multipleAts"));

-                        attrStringMissingLocal = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("@multipleAts"));

-                        attrStringMissingDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("localpart@"));

-                

-                        attrRfcabcxyz = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue("abc@xyz"));

-                        attrRfcwholedomainpart = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue("abc@whole.domain.part"));

-                        attrRfcWholeDomainPart = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue("abc@Whole.Domain.Part"));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionRFC822NameMatch fd = (FunctionDefinitionRFC822NameMatch) StdFunctions.FD_RFC822NAME_MATCH;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_RFC822NAME_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_RFC822NAME.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                

-                

-                // string identical to name - exact match on whole search term

-                arguments.clear();

-                arguments.add(attrStringabcxyz);

-                arguments.add(attrRfcabcxyz);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // no match local case different

-                arguments.clear();

-                arguments.add(attrStringABCxyz);

-                arguments.add(attrRfcabcxyz);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // match domain case different

-                arguments.clear();

-                arguments.add(attrStringabcXYZ);

-                arguments.add(attrRfcabcxyz);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

 

 

-                // partial local + partial domain

-                arguments.clear();

-                arguments.add(attrStringcx);

-                arguments.add(attrRfcabcxyz);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // whole domain

-                arguments.clear();

-                arguments.add(attrStringwholedomainpart);

-                arguments.add(attrRfcwholedomainpart);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // whole domain different case

-                arguments.clear();

-                arguments.add(attrStringWholeDomainPart);

-                arguments.add(attrRfcwholedomainpart);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                arguments.clear();

-                arguments.add(attrStringwholedomainpart);

-                arguments.add(attrRfcWholeDomainPart);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // whole domain fail

-                arguments.clear();

-                arguments.add(attrStringWholeDomain);

-                arguments.add(attrRfcWholeDomainPart);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // partial domain match

-                arguments.clear();

-                arguments.add(attrStringDomainPart);

-                arguments.add(attrRfcWholeDomainPart);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // partial domain different case

-                arguments.clear();

-                arguments.add(attrStringdomainpart);

-                arguments.add(attrRfcWholeDomainPart);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // partial domain fail

-                arguments.clear();

-                arguments.add(attrStringdotWholeDomain);

-                arguments.add(attrRfcWholeDomainPart);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                arguments.clear();

-                arguments.add(attrStringdomain);

-                arguments.add(attrRfcWholeDomainPart);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.getStatus().isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // search term contains more than 1 @

-                arguments.clear();

-                arguments.add(attrStringMultipleAt);

-                arguments.add(attrRfcabcxyz);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match String contained more than 1 '@' in 'name@with@multipleAts'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // search term missing local part

-                arguments.clear();

-                arguments.add(attrStringMissingLocal);

-                arguments.add(attrRfcabcxyz);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match String missing local part in '@multipleAts'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // search term missing domain part

-                arguments.clear();

-                arguments.add(attrStringMissingDomain);

-                arguments.add(attrRfcabcxyz);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match String missing domain part in 'localpart@'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg types

-                arguments.clear();

-                arguments.add(attrRfcabcxyz);

-                arguments.add(attrStringNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match Expected data type 'string' saw 'rfc822Name' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrStringNoMatch);

-                arguments.add(attrStringNoMatch);

-                arguments.add(attrStringNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                arguments.add(attrStringNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // one arg is bag

-                arguments.clear();

-                arguments.add(attrStringNoMatch);

-                arguments.add(attrBag);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match Expected a simple value, saw a bag at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null arg

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrStringNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:rfc822Name-match Got null argument at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                

+        // test normal, first exact match for second

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrABC);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // test first is end of second

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrDABC);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // first exact match for sub-section but not end of second

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrABCD);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // components of first match components in second but not contiguous

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrADBC);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // components of first match components in second but not in order

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrDCAB);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first does not match second at all

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrDEF);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first arg larger than 2nd arg

+        arguments.clear();

+        arguments.add(attrABCD);

+        arguments.add(attrABC);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // bad arg types

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrBad);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:x500Name-match Expected data type 'x500Name' saw 'integer' at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrABC);

+        arguments.add(attrABC);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:x500Name-match Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too few args

+        arguments.clear();

+        arguments.add(attrABC);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:x500Name-match Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:x500Name-match Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // one arg is bag

+        arguments.clear();

+        arguments.add(attrABC);

+        arguments.add(attrBag);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:x500Name-match Expected a simple value, saw a bag at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null arg

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrBag);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:x500Name-match Got null argument at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testRfc822NameMatch() {

+

+

+

+

+        FunctionArgumentAttributeValue attrStringabcxyz = null;

+        FunctionArgumentAttributeValue attrStringABCxyz = null;

+        FunctionArgumentAttributeValue attrStringabcXYZ = null;

+        FunctionArgumentAttributeValue attrStringcx = null;

+        FunctionArgumentAttributeValue attrStringwholedomainpart = null;

+        FunctionArgumentAttributeValue attrStringWholeDomainPart = null;

+        FunctionArgumentAttributeValue attrStringWholeDomain = null;

+        FunctionArgumentAttributeValue attrStringdomainpart = null;

+        FunctionArgumentAttributeValue attrStringDomainPart = null;

+        FunctionArgumentAttributeValue attrStringdotWholeDomain = null;

+        FunctionArgumentAttributeValue attrStringdomain = null;

+

+        FunctionArgumentAttributeValue attrStringNoMatch = null;

+        FunctionArgumentAttributeValue attrStringMultipleAt = null;

+        FunctionArgumentAttributeValue attrStringMissingLocal = null;

+        FunctionArgumentAttributeValue attrStringMissingDomain = null;

+

+

+        FunctionArgumentAttributeValue attrRfcabcxyz = null;

+        FunctionArgumentAttributeValue attrRfcwholedomainpart = null;

+        FunctionArgumentAttributeValue attrRfcWholeDomainPart = null;

+

+        FunctionArgumentBag attrBag = new FunctionArgumentBag(new Bag());

+

+        try {

+            attrStringabcxyz = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc@xyz"));

+            attrStringABCxyz = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("ABC@xyz"));

+            attrStringabcXYZ = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc@XYZ"));

+            attrStringcx = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("c@x"));

+            attrStringwholedomainpart = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("whole.domain.part"));

+            attrStringWholeDomainPart = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("Whole.Domain.Part"));

+            attrStringWholeDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("Whole.Domain"));

+            attrStringdomainpart = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(".domain.part"));

+            attrStringDomainPart = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(".Domain.Part"));

+            attrStringdotWholeDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(".Whole.Domain"));

+            attrStringdomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(".domain."));

+

+            attrStringNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("no match to any legal name"));

+            attrStringMultipleAt = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("name@with@multipleAts"));

+            attrStringMissingLocal = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("@multipleAts"));

+            attrStringMissingDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("localpart@"));

+

+            attrRfcabcxyz = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue("abc@xyz"));

+            attrRfcwholedomainpart = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue("abc@whole.domain.part"));

+            attrRfcWholeDomainPart = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue("abc@Whole.Domain.Part"));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

+

+        FunctionDefinitionRFC822NameMatch fd = (FunctionDefinitionRFC822NameMatch) StdFunctions.FD_RFC822NAME_MATCH;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_RFC822NAME_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_RFC822NAME.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // string identical to name - exact match on whole search term

+        arguments.clear();

+        arguments.add(attrStringabcxyz);

+        arguments.add(attrRfcabcxyz);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // no match local case different

+        arguments.clear();

+        arguments.add(attrStringABCxyz);

+        arguments.add(attrRfcabcxyz);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // match domain case different

+        arguments.clear();

+        arguments.add(attrStringabcXYZ);

+        arguments.add(attrRfcabcxyz);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+

+        // partial local + partial domain

+        arguments.clear();

+        arguments.add(attrStringcx);

+        arguments.add(attrRfcabcxyz);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // whole domain

+        arguments.clear();

+        arguments.add(attrStringwholedomainpart);

+        arguments.add(attrRfcwholedomainpart);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // whole domain different case

+        arguments.clear();

+        arguments.add(attrStringWholeDomainPart);

+        arguments.add(attrRfcwholedomainpart);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        arguments.clear();

+        arguments.add(attrStringwholedomainpart);

+        arguments.add(attrRfcWholeDomainPart);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // whole domain fail

+        arguments.clear();

+        arguments.add(attrStringWholeDomain);

+        arguments.add(attrRfcWholeDomainPart);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // partial domain match

+        arguments.clear();

+        arguments.add(attrStringDomainPart);

+        arguments.add(attrRfcWholeDomainPart);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // partial domain different case

+        arguments.clear();

+        arguments.add(attrStringdomainpart);

+        arguments.add(attrRfcWholeDomainPart);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // partial domain fail

+        arguments.clear();

+        arguments.add(attrStringdotWholeDomain);

+        arguments.add(attrRfcWholeDomainPart);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        arguments.clear();

+        arguments.add(attrStringdomain);

+        arguments.add(attrRfcWholeDomainPart);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.getStatus().isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // search term contains more than 1 @

+        arguments.clear();

+        arguments.add(attrStringMultipleAt);

+        arguments.add(attrRfcabcxyz);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match String contained more than 1 '@' in 'name@with@multipleAts'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // search term missing local part

+        arguments.clear();

+        arguments.add(attrStringMissingLocal);

+        arguments.add(attrRfcabcxyz);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match String missing local part in '@multipleAts'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // search term missing domain part

+        arguments.clear();

+        arguments.add(attrStringMissingDomain);

+        arguments.add(attrRfcabcxyz);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match String missing domain part in 'localpart@'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg types

+        arguments.clear();

+        arguments.add(attrRfcabcxyz);

+        arguments.add(attrStringNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match Expected data type 'string' saw 'rfc822Name' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrStringNoMatch);

+        arguments.add(attrStringNoMatch);

+        arguments.add(attrStringNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too few args

+        arguments.clear();

+        arguments.add(attrStringNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // one arg is bag

+        arguments.clear();

+        arguments.add(attrStringNoMatch);

+        arguments.add(attrBag);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match Expected a simple value, saw a bag at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null arg

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrStringNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:rfc822Name-match Got null argument at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+

+    }

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringConversionTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringConversionTest.java
index c5c1b27..6e6cfa1 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringConversionTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringConversionTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -58,2447 +58,2447 @@
 

 /**

  * Tests for converting objects to/from Strings.

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionStringConversionTest {

-        

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        /**

-         * Boolean

-         */

-        @Test

-        public void testBoolean_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("true"));

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_BOOLEAN_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(new Boolean(true), resValue);

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:boolean-from-string Cannot convert from \"java.lang.String\" with value \"not valid obj value\" to boolean", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:boolean-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

+

+

+    /**

+     * Boolean

+     */

+    @Test

+    public void testBoolean_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("true"));

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_boolean() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "false";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(objValueString));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_BOOLEAN_FROM_STRING;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_BOOLEAN;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_BOOLEAN, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-boolean Expected data type 'boolean' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        

-        /**

-         * Integer

-         */

-        @Test

-        public void testInteger_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123456"));

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_BOOLEAN_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_INTEGER_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_INTEGER_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("123456"), resValue);

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-from-string For input string: \"n\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:integer-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(new Boolean(true), resValue);

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:boolean-from-string Cannot convert from \"java.lang.String\" with value \"not valid obj value\" to boolean", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:boolean-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_boolean() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "false";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_BOOLEAN.createAttributeValue(objValueString));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_integer() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "1234";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(objValueString));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_BOOLEAN;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_INTEGER;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_INTEGER, fd.getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-integer Expected data type 'integer' saw 'double' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        /**

-         * Double

-         */

-        @Test

-        public void testDouble_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("5.432"));

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_BOOLEAN, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DOUBLE_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DOUBLE_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Double resValue = (Double)res.getValue().getValue();

-                assertEquals(new Double(5.432), resValue);

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:double-from-string For input string: \"not valid obj value\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:double-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-boolean Expected data type 'boolean' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+    /**

+     * Integer

+     */

+    @Test

+    public void testInteger_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123456"));

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_double() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrObjBig = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "5.432";

-                String objValueStringBig = "55555555555555555555.123455";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(objValueString));

-                        attrObjBig = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(objValueStringBig));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_INTEGER_FROM_STRING;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DOUBLE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DOUBLE, fd.getId());

-                assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                arguments.clear();

-                arguments.add(attrObjBig);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("5.555555555555556E19", res.getValue().getValue());

-                

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-double Expected data type 'double' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        

-        

-        /**

-         * Time

-         */

-        @Test

-        public void testTime_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrString2 = null;

-                FunctionArgumentAttributeValue attrString3 = null;

-                FunctionArgumentAttributeValue attrString4 = null;

-                FunctionArgumentAttributeValue attrStringTimeZone = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("05:12:34.323"));

-                        attrString2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("5:12:34.323"));

-                        attrString3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("05:12"));

-                        attrString4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("05:12:34"));

-                        attrStringTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("05:12:34.323+03:00"));

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_INTEGER_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_TIME_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_TIME_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                ISO8601Time resValue = (ISO8601Time)res.getValue().getValue();

-                assertEquals(new ISO8601Time(5, 12, 34, 323), resValue);

-                

-                // check missing 0 in front

-                arguments.clear();

-                arguments.add(attrString2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:time-from-string Invalid hour of day", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // check missing seconds/msecs

-                arguments.clear();

-                arguments.add(attrString3);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:time-from-string Time string too short", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

 

-                // check missing just msecs

-                arguments.clear();

-                arguments.add(attrString4);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601Time)res.getValue().getValue();

-                assertEquals(new ISO8601Time(5, 12, 34, 0), resValue);

-                

-                // check TimeZone

-                arguments.clear();

-                arguments.add(attrStringTimeZone);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601Time)res.getValue().getValue();

-                assertEquals(new ISO8601Time(new ISO8601TimeZone(180), 5, 12, 34, 323), resValue);

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:time-from-string Invalid hour of day", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:time-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("123456"), resValue);

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-from-string For input string: \"n\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:integer-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_integer() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "1234";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(objValueString));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_time() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrObj2 = null;

-                FunctionArgumentAttributeValue attrObjTimeZone = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue("05:12:34.323"));

-                        attrObj2 = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue("05:01:02.323"));

-                        attrObjTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue("05:12:34.323+03:00"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_INTEGER;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_TIME;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_TIME, fd.getId());

-                assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("05:12:34.323", res.getValue().getValue());

-                

-                // missing digits in string value?

-                arguments.clear();

-                arguments.add(attrObj2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("05:01:02.323", res.getValue().getValue());

-                

-                // include TimeZone

-                arguments.clear();

-                arguments.add(attrObjTimeZone);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("05:12:34.323+03:00", res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-time Expected data type 'time' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        

-        

-        /**

-         * Date

-         */

-        @Test

-        public void testDate_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrString2 = null;

-                FunctionArgumentAttributeValue attrString3 = null;

-                FunctionArgumentAttributeValue attrString4 = null;

-                FunctionArgumentAttributeValue attrString5 = null;

-                FunctionArgumentAttributeValue attrString6 = null;

-                FunctionArgumentAttributeValue attrString7 = null;

-                FunctionArgumentAttributeValue attrString8 = null;

-                FunctionArgumentAttributeValue attrString9 = null;

-                FunctionArgumentAttributeValue attrStringDateZone = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-12"));

-                        attrString2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-2013-05-12"));

-                        attrString3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("1232013-05-12"));

-                        attrString4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-1232013-05-12"));

-                        attrString5 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("213-05-12"));

-                        attrString6 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-5-12"));

-                        attrString7 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-2"));

-                        attrString8 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-32-12"));

-                        attrString9 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-45"));

-                        attrStringDateZone = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-12+03:00"));

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_INTEGER, fd.getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DATE_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATE_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                ISO8601Date resValue = (ISO8601Date)res.getValue().getValue();

-                assertEquals(new ISO8601Date(2013, 5, 12), resValue);

-                

-                // check negative

-                arguments.clear();

-                arguments.add(attrString2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                assertEquals(new ISO8601Date(-2013, 5, 12), resValue);

-                

-                // check big

-                arguments.clear();

-                arguments.add(attrString3);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                assertEquals(new ISO8601Date(1232013, 5, 12), resValue);

-                

-                // check big negative

-                arguments.clear();

-                arguments.add(attrString4);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                assertEquals(new ISO8601Date(-1232013, 5, 12), resValue);

-                

-                // bad year

-                arguments.clear();

-                arguments.add(attrString5);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-from-string Invalid year (must be at least 4 digits)", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

 

-                // bad month

-                arguments.clear();

-                arguments.add(attrString6);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-from-string Invalid month", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

 

-                // bad day format

-                arguments.clear();

-                arguments.add(attrString7);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-from-string Invalid day", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-integer Expected data type 'integer' saw 'double' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

 

-                // month out of range

-                arguments.clear();

-                arguments.add(attrString8);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-from-string Invalid month", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // day out of range

-                arguments.clear();

-                arguments.add(attrString9);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-from-string Invalid day", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                // check TimeZone

-                arguments.clear();

-                arguments.add(attrStringDateZone);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601Date)res.getValue().getValue();

-                assertEquals(new ISO8601Date(new ISO8601TimeZone(180), 2013, 5, 12), resValue);

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-from-string Invalid year", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:date-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    /**

+     * Double

+     */

+    @Test

+    public void testDouble_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("5.432"));

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_date() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrObj2 = null;

-                FunctionArgumentAttributeValue attrObjDateZone = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue("2013-05-12"));

-                        attrObj2 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue("0001-01-01"));

-                        attrObjDateZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue("2013-05-12+03:00"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DOUBLE_FROM_STRING;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DATE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DATE, fd.getId());

-                assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("2013-05-12", res.getValue().getValue());

-                

-                // missing digits in string value?

-                arguments.clear();

-                arguments.add(attrObj2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("1-01-01", res.getValue().getValue());

-                

-                // include DateZone

-                arguments.clear();

-                arguments.add(attrObjDateZone);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("2013-05-12+03:00", res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-date Expected data type 'date' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        

-        

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DOUBLE_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeId());

 

-        /**

-         * DateTime

-         */

-        @Test

-        public void testDateTime_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrString2 = null;

-                FunctionArgumentAttributeValue attrString3 = null;

-                FunctionArgumentAttributeValue attrString4 = null;

-                FunctionArgumentAttributeValue attrString5 = null;

-                FunctionArgumentAttributeValue attrString6 = null;

-                FunctionArgumentAttributeValue attrString7 = null;

-                FunctionArgumentAttributeValue attrString8 = null;

-                FunctionArgumentAttributeValue attrString9 = null;

-                FunctionArgumentAttributeValue attrStringDateTimeZone = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-12T12:14:15.323"));

-                        attrString2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-2013-05-12T12:14:15.323"));

-                        attrString3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("1232013-05-12T12:14:15.323"));

-                        attrString4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-1232013-05-12T12:14:15.323"));

-                        attrString5 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("213-05-12T12:14:15.323"));

-                        attrString6 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-5-12T12:14:15.323"));

-                        attrString7 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-2T12:14:15.323"));

-                        attrString8 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-32-12T12:14:15.323"));

-                        attrString9 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-45T12:14:15.323"));

-                        attrStringDateTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-12T12:14:15.323+03:00"));

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DATETIME_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DATETIME_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(new ISO8601DateTime(null, new ISO8601Date(2013, 5, 12), new ISO8601Time(12, 14, 15, 323)), resValue);

-                

-                // check negative

-                arguments.clear();

-                arguments.add(attrString2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(new ISO8601DateTime(null, new ISO8601Date(-2013, 5, 12), new ISO8601Time(12, 14, 15, 323)), resValue);

-                

-                

-                // check big

-                arguments.clear();

-                arguments.add(attrString3);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(new ISO8601DateTime(null, new ISO8601Date(1232013, 5, 12), new ISO8601Time(12, 14, 15, 323)), resValue);

-                

-                // check big negative

-                arguments.clear();

-                arguments.add(attrString4);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(new ISO8601DateTime(null, new ISO8601Date(-1232013, 5, 12), new ISO8601Time(12, 14, 15, 323)), resValue);

-                

-                // bad year

-                arguments.clear();

-                arguments.add(attrString5);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-from-string Invalid year (must be at least 4 digits)", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Double resValue = (Double)res.getValue().getValue();

+        assertEquals(new Double(5.432), resValue);

 

-                // bad month

-                arguments.clear();

-                arguments.add(attrString6);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-from-string Invalid month", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:double-from-string For input string: \"not valid obj value\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // bad day format

-                arguments.clear();

-                arguments.add(attrString7);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-from-string Invalid day", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:double-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

 

-                // month out of range

-                arguments.clear();

-                arguments.add(attrString8);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-from-string Invalid month", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    @Test

+    public void testString_from_double() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrObjBig = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "5.432";

+        String objValueStringBig = "55555555555555555555.123455";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(objValueString));

+            attrObjBig = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(objValueStringBig));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

 

-                // day out of range

-                arguments.clear();

-                arguments.add(attrString9);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-from-string Invalid day", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-

-                

-                // check TimeZone

-                arguments.clear();

-                arguments.add(attrStringDateTimeZone);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (ISO8601DateTime)res.getValue().getValue();

-                assertEquals(new ISO8601DateTime(new ISO8601TimeZone(180), new ISO8601Date(new ISO8601TimeZone(180), 2013, 5, 12), new ISO8601Time(new ISO8601TimeZone(180),12, 14, 15, 323)), resValue);

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-from-string Invalid year", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dateTime-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_dateTime() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrObj2 = null;

-                FunctionArgumentAttributeValue attrObjDateTimeZone = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue("2013-05-12T12:14:15.323"));

-                        attrObj2 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue("0001-01-01T12:14:15.323"));

-                        attrObjDateTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue("2013-05-12T12:14:15.323+03:00"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DOUBLE;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DATETIME;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DATETIME, fd.getId());

-                assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("2013-05-12T12:14:15.323", res.getValue().getValue());

-                

-                // missing digits in string value?

-                arguments.clear();

-                arguments.add(attrObj2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("1-01-01T12:14:15.323", res.getValue().getValue());

-                

-                // include DateTimeZone

-                arguments.clear();

-                arguments.add(attrObjDateTimeZone);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("2013-05-12T12:14:15.323+03:00", res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-dateTime Expected data type 'dateTime' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        

-        

-        /**

-         * URI

-         */

-        @Test

-        public void testURI_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("http://someMachine.com/subdir"));

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DOUBLE, fd.getId());

+        assertEquals(DataTypes.DT_DOUBLE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_ANYURI_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANYURI_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_ANYURI.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                URI resValue = (URI)res.getValue().getValue();

-                try {

-                        assertEquals(new URI("http://someMachine.com/subdir"), resValue);

-                } catch (URISyntaxException e) {

-                        fail("uri generation e="+e);

-                }

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-from-string Illegal character in path at index 3: not valid obj value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

+

+        arguments.clear();

+        arguments.add(attrObjBig);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("5.555555555555556E19", res.getValue().getValue());

+

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-double Expected data type 'double' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+    /**

+     * Time

+     */

+    @Test

+    public void testTime_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrString2 = null;

+        FunctionArgumentAttributeValue attrString3 = null;

+        FunctionArgumentAttributeValue attrString4 = null;

+        FunctionArgumentAttributeValue attrStringTimeZone = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("05:12:34.323"));

+            attrString2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("5:12:34.323"));

+            attrString3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("05:12"));

+            attrString4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("05:12:34"));

+            attrStringTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("05:12:34.323+03:00"));

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_anyURI() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "http://aMachine.com:8080/aRef";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(objValueString));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_TIME_FROM_STRING;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_ANYURI;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_ANYURI, fd.getId());

-                assertEquals(DataTypes.DT_ANYURI.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-anyURI Expected data type 'anyURI' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        /**

-         * XPathDayTimeDuration

-         */

-        @Test

-        public void testXPathDayTimeDuration_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringNeg1 = null;

-                FunctionArgumentAttributeValue attrStringNeg2 = null;

-                FunctionArgumentAttributeValue attrStringNoDay = null;

-                FunctionArgumentAttributeValue attrStringNoHour = null;

-                FunctionArgumentAttributeValue attrStringNoMin = null;

-                FunctionArgumentAttributeValue attrStringNoSec = null;

-                FunctionArgumentAttributeValue attrStringNoP = null;

-                FunctionArgumentAttributeValue attrStringSecondsDot = null;

-                FunctionArgumentAttributeValue attrStringMissingTOk = null;

-                FunctionArgumentAttributeValue attrStringMissingTBad = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT10H30M23S"));

-                        attrStringNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-P3DT10H30M23S"));

-                        attrStringNeg2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P-3DT10H30M23S"));

-                        attrStringNoDay = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("PT10H30M23S"));

-                        attrStringNoHour = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT30M23S"));

-                        attrStringNoMin = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT10H23S"));

-                        attrStringNoSec = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT10H30M"));

-                        attrStringNoP = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("3DT10H30M"));

-                        attrStringSecondsDot = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT10H30M23.456S"));

-                        attrStringMissingTOk = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3D"));

-                        attrStringMissingTBad = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3D10H30M23S"));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_TIME_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeId());

 

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DAYTIMEDURATION_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DAYTIMEDURATION_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DAYTIMEDURATION.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                XPathDayTimeDuration resValue = (XPathDayTimeDuration)res.getValue().getValue();

-                assertEquals(new XPathDayTimeDuration(1, 3, 10, 30, 23), resValue);

-                

-                

-                //		negative values in front is allowed

-                arguments.clear();

-                arguments.add(attrStringNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathDayTimeDuration)res.getValue().getValue();

-                assertEquals(new XPathDayTimeDuration(-1, 3, 10, 30, 23), resValue);

-                

-                // negative in middle of string not ok

-                arguments.clear();

-                arguments.add(attrStringNeg2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dayTimeDuration-from-string Invalid chunk \"P-3DT10H30M23S\" at position 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                //	omit parts that are 0

-                arguments.clear();

-                arguments.add(attrStringNoDay);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathDayTimeDuration)res.getValue().getValue();

-                assertEquals(new XPathDayTimeDuration(1, 0, 10, 30, 23), resValue);

-                

-                arguments.clear();

-                arguments.add(attrStringNoHour);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathDayTimeDuration)res.getValue().getValue();

-                assertEquals(new XPathDayTimeDuration(1, 3, 0, 30, 23), resValue);

-                

-                arguments.clear();

-                arguments.add(attrStringNoMin);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathDayTimeDuration)res.getValue().getValue();

-                assertEquals(new XPathDayTimeDuration(1, 3, 10, 0, 23), resValue);

-                

-                arguments.clear();

-                arguments.add(attrStringNoSec);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathDayTimeDuration)res.getValue().getValue();

-                assertEquals(new XPathDayTimeDuration(1, 3, 10, 30, 0), resValue);

-                

-                //		P must always be present

-                arguments.clear();

-                arguments.add(attrStringNoP);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dayTimeDuration-from-string Invalid ISO8601 duration string \"3DT10H30M\" at position 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                //		seconds may contain decimal

-                arguments.clear();

-                arguments.add(attrStringSecondsDot);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathDayTimeDuration)res.getValue().getValue();

-                assertEquals(new XPathDayTimeDuration(1, 3, 10, 30, 23.456), resValue);

-                

-                //		T must be absent iff all time items are absent

-                arguments.clear();

-                arguments.add(attrStringMissingTOk);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathDayTimeDuration)res.getValue().getValue();

-                assertEquals(new XPathDayTimeDuration(1, 3, 0, 0, 0), resValue);

-                

-                // negative in middle of string not ok

-                arguments.clear();

-                arguments.add(attrStringMissingTBad);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dayTimeDuration-from-string Invalid ISO8601 duration string \"P3D10H30M23S\" at position 6: out of order component", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dayTimeDuration-from-string Invalid ISO8601 duration string \"not valid obj value\" at position 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dayTimeDuration-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        ISO8601Time resValue = (ISO8601Time)res.getValue().getValue();

+        assertEquals(new ISO8601Time(5, 12, 34, 323), resValue);

+

+        // check missing 0 in front

+        arguments.clear();

+        arguments.add(attrString2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:time-from-string Invalid hour of day", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // check missing seconds/msecs

+        arguments.clear();

+        arguments.add(attrString3);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:time-from-string Time string too short", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // check missing just msecs

+        arguments.clear();

+        arguments.add(attrString4);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601Time)res.getValue().getValue();

+        assertEquals(new ISO8601Time(5, 12, 34, 0), resValue);

+

+        // check TimeZone

+        arguments.clear();

+        arguments.add(attrStringTimeZone);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601Time)res.getValue().getValue();

+        assertEquals(new ISO8601Time(new ISO8601TimeZone(180), 5, 12, 34, 323), resValue);

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:time-from-string Invalid hour of day", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:time-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_time() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrObj2 = null;

+        FunctionArgumentAttributeValue attrObjTimeZone = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue("05:12:34.323"));

+            attrObj2 = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue("05:01:02.323"));

+            attrObjTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_TIME.createAttributeValue("05:12:34.323+03:00"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_dayTimeDuration() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "P3DT10H30M23S";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(objValueString));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_TIME;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DAYTIMEDURATION;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DAYTIMEDURATION, fd.getId());

-                assertEquals(DataTypes.DT_DAYTIMEDURATION.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-dayTimeDuration Expected data type 'dayTimeDuration' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        /**

-         * XPathYearMonthDuration

-         */

-        @Test

-        public void testXPathYearMonthDuration_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringNeg1 = null;

-                FunctionArgumentAttributeValue attrStringNeg2 = null;

-                FunctionArgumentAttributeValue attrStringNoYear1 = null;

-                FunctionArgumentAttributeValue attrStringNoYear2 = null;

-                FunctionArgumentAttributeValue attrStringNoMonth1 = null;

-                FunctionArgumentAttributeValue attrStringNoMonth2 = null;

-                FunctionArgumentAttributeValue attrStringNoValue = null;

-                FunctionArgumentAttributeValue attrStringNoP = null;

-                FunctionArgumentAttributeValue attrStringBigMonths = null;

-                FunctionArgumentAttributeValue attrStringMissingTOk = null;

-                FunctionArgumentAttributeValue attrStringMissingTBad = null;

-                FunctionArgumentAttributeValue attrStringZeroMonths = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P1Y2M"));

-                        attrStringNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-P1Y2M"));

-                        attrStringNeg2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P-1Y2M"));

-                        attrStringNoYear1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P2M"));

-                        attrStringNoYear2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("PY2M"));

-                        attrStringNoMonth1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P1Y"));

-                        attrStringNoMonth2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P1YM"));

-                        attrStringNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P"));

-                        attrStringNoP = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("1Y2M"));

-                        attrStringBigMonths = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P1Y12M"));

-                        attrStringMissingTOk = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3D"));

-                        attrStringMissingTBad = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3D10H30M23S"));

-                        attrStringZeroMonths = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P0M"));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_TIME, fd.getId());

+        assertEquals(DataTypes.DT_TIME.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

 

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_YEARMONTHDURATION_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_YEARMONTHDURATION_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_YEARMONTHDURATION.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                XPathYearMonthDuration resValue = (XPathYearMonthDuration)res.getValue().getValue();

-                assertEquals(new XPathYearMonthDuration(1,1, 2), resValue);

-                

-                

-                //		negative values in front is allowed

-                arguments.clear();

-                arguments.add(attrStringNeg1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathYearMonthDuration)res.getValue().getValue();

-                assertEquals(new XPathYearMonthDuration(-1, 1, 2), resValue);

-                

-                // negative in middle of string not ok

-                arguments.clear();

-                arguments.add(attrStringNeg2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Invalid chunk \"P-1Y2M\" at position 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                //	omit parts that are 0

-                arguments.clear();

-                arguments.add(attrStringNoYear1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathYearMonthDuration)res.getValue().getValue();

-                assertEquals(new XPathYearMonthDuration(1, 0, 2), resValue);

-                

-                arguments.clear();

-                arguments.add(attrStringNoYear2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Invalid chunk \"PY2M\" at position 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                arguments.clear();

-                arguments.add(attrStringNoMonth1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathYearMonthDuration)res.getValue().getValue();

-                assertEquals(new XPathYearMonthDuration(1, 1, 0), resValue);

-                

-                arguments.clear();

-                arguments.add(attrStringNoMonth2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Invalid chunk \"P1YM\" at position 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // No field with a value 

-                arguments.clear();

-                arguments.add(attrStringNoValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Invalid ISO8601 duration string \"P\": No duration components following P", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                //		P must always be present

-                arguments.clear();

-                arguments.add(attrStringNoP);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Invalid ISO8601 duration string \"1Y2M\" at position 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                //		Canonical Form of output may not have more than 12 months, but input as string is ok?

-                arguments.clear();

-                arguments.add(attrStringBigMonths);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathYearMonthDuration)res.getValue().getValue();

-                assertEquals(new XPathYearMonthDuration(1, 1, 12), resValue);

-                

-                // Canonical representation of 0 Months

-                arguments.clear();

-                arguments.add(attrStringZeroMonths);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (XPathYearMonthDuration)res.getValue().getValue();

-                assertEquals(new XPathYearMonthDuration(1, 0, 0), resValue);

-                

-                //		T must be absent iff all time items are absent

-                arguments.clear();

-                arguments.add(attrStringMissingTOk);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Invalid XPath yearMonthDuraiton \"{durationSign=1years=0months=0days=3hours=0minutes=0seconds=0millis=0}\": includes days, hours, minutes, or seconds", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // negative in middle of string not ok

-                arguments.clear();

-                arguments.add(attrStringMissingTBad);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Invalid ISO8601 duration string \"P3D10H30M23S\" at position 6: out of order component", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Invalid ISO8601 duration string \"not valid obj value\" at position 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:yearMonthDuration-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("05:12:34.323", res.getValue().getValue());

+

+        // missing digits in string value?

+        arguments.clear();

+        arguments.add(attrObj2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("05:01:02.323", res.getValue().getValue());

+

+        // include TimeZone

+        arguments.clear();

+        arguments.add(attrObjTimeZone);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("05:12:34.323+03:00", res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-time Expected data type 'time' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+    /**

+     * Date

+     */

+    @Test

+    public void testDate_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrString2 = null;

+        FunctionArgumentAttributeValue attrString3 = null;

+        FunctionArgumentAttributeValue attrString4 = null;

+        FunctionArgumentAttributeValue attrString5 = null;

+        FunctionArgumentAttributeValue attrString6 = null;

+        FunctionArgumentAttributeValue attrString7 = null;

+        FunctionArgumentAttributeValue attrString8 = null;

+        FunctionArgumentAttributeValue attrString9 = null;

+        FunctionArgumentAttributeValue attrStringDateZone = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-12"));

+            attrString2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-2013-05-12"));

+            attrString3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("1232013-05-12"));

+            attrString4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-1232013-05-12"));

+            attrString5 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("213-05-12"));

+            attrString6 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-5-12"));

+            attrString7 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-2"));

+            attrString8 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-32-12"));

+            attrString9 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-45"));

+            attrStringDateZone = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-12+03:00"));

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_yearMonthDuration() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "P1Y2M";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(objValueString));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DATE_FROM_STRING;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_YEARMONTHDURATION;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_YEARMONTHDURATION, fd.getId());

-                assertEquals(DataTypes.DT_YEARMONTHDURATION.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-yearMonthDuration Expected data type 'yearMonthDuration' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATE_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        ISO8601Date resValue = (ISO8601Date)res.getValue().getValue();

+        assertEquals(new ISO8601Date(2013, 5, 12), resValue);

+

+        // check negative

+        arguments.clear();

+        arguments.add(attrString2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        assertEquals(new ISO8601Date(-2013, 5, 12), resValue);

+

+        // check big

+        arguments.clear();

+        arguments.add(attrString3);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        assertEquals(new ISO8601Date(1232013, 5, 12), resValue);

+

+        // check big negative

+        arguments.clear();

+        arguments.add(attrString4);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        assertEquals(new ISO8601Date(-1232013, 5, 12), resValue);

+

+        // bad year

+        arguments.clear();

+        arguments.add(attrString5);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-from-string Invalid year (must be at least 4 digits)", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad month

+        arguments.clear();

+        arguments.add(attrString6);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-from-string Invalid month", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad day format

+        arguments.clear();

+        arguments.add(attrString7);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-from-string Invalid day", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // month out of range

+        arguments.clear();

+        arguments.add(attrString8);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-from-string Invalid month", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // day out of range

+        arguments.clear();

+        arguments.add(attrString9);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-from-string Invalid day", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

 

-        

-        

-        /**

-         * X500Principal

-         * 

-         * See http://www.ietf.org/rfc/rfc2253.txt and http://www.ietf.org/rfc/rfc2251.txt

-         */

-        @Test

-        public void testX500Principal_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringNoComma = null;

-                FunctionArgumentAttributeValue attrStringEmpty = null;

-                FunctionArgumentAttributeValue attrStringNoValue = null;

-                FunctionArgumentAttributeValue attrStringOrder = null;

-                FunctionArgumentAttributeValue attrStringDottedDecimalOID = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("CN=Name, L=local, ST=NJ, O=ATT, C=USA"));

-                        attrStringNoComma = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("CN=Name, L=local ST=NJ, O=ATT, C=USA"));

-                        attrStringEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrStringNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("CN=Name, L=, ST=NJ, O=ATT, C=USA"));

-                        attrStringOrder = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("L=local, ST=NJ, O=ATT, CN=Name, C=USA"));

-                        attrStringDottedDecimalOID = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2.5.4.3=A. N. Other"));

+        // check TimeZone

+        arguments.clear();

+        arguments.add(attrStringDateZone);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601Date)res.getValue().getValue();

+        assertEquals(new ISO8601Date(new ISO8601TimeZone(180), 2013, 5, 12), resValue);

 

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-from-string Invalid year", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:date-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

 

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_X500NAME_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_X500NAME_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_X500NAME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                X500Principal resValue = (X500Principal)res.getValue().getValue();

-                assertEquals(new X500Principal("CN=Name, L=local, ST=NJ, O=ATT, C=USA"), resValue);

-                

-                // no comma between components => next attribute/value is included as part of first value

-                arguments.clear();

-                arguments.add(attrStringNoComma);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (X500Principal)res.getValue().getValue();

-                assertEquals(new X500Principal("CN=Name, L=local ST=NJ, O=ATT, C=USA"), resValue);

-                

-                // nothing in name (fail)

-                arguments.clear();

-                arguments.add(attrStringEmpty);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (X500Principal)res.getValue().getValue();

-                assertEquals(new X500Principal(""), resValue);

-                

-                // type value with no =

-                arguments.clear();

-                arguments.add(attrStringNoValue);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (X500Principal)res.getValue().getValue();

-                assertEquals(new X500Principal("CN=Name, L=, ST=NJ, O=ATT, C=USA"), resValue);

-                

-                // different order

-                arguments.clear();

-                arguments.add(attrStringOrder);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (X500Principal)res.getValue().getValue();

-                assertNotEquals(new X500Principal("CN=Name, L=local, ST=NJ, O=ATT, C=USA"), resValue);

-        

-                // dotted-decimal name with numbers

-                arguments.clear();

-                arguments.add(attrStringDottedDecimalOID);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (X500Principal)res.getValue().getValue();

-                assertEquals(new X500Principal("2.5.4.3=A. N. Other"), resValue);

-                

+    @Test

+    public void testString_from_date() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrObj2 = null;

+        FunctionArgumentAttributeValue attrObjDateZone = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue("2013-05-12"));

+            attrObj2 = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue("0001-01-01"));

+            attrObjDateZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATE.createAttributeValue("2013-05-12+03:00"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

 

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:x500Name-from-string improperly specified input name: not valid obj value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:x500Name-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_x500Name() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "CN=Name, L=local, ST=NJ, O=ATT, C=USA";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(objValueString));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DATE;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_X500NAME;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_X500NAME, fd.getId());

-                assertEquals(DataTypes.DT_X500NAME.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-x500Name Expected data type 'x500Name' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DATE, fd.getId());

+        assertEquals(DataTypes.DT_DATE.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("2013-05-12", res.getValue().getValue());

+

+        // missing digits in string value?

+        arguments.clear();

+        arguments.add(attrObj2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("1-01-01", res.getValue().getValue());

+

+        // include DateZone

+        arguments.clear();

+        arguments.add(attrObjDateZone);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("2013-05-12+03:00", res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-date Expected data type 'date' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+

+    /**

+     * DateTime

+     */

+    @Test

+    public void testDateTime_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrString2 = null;

+        FunctionArgumentAttributeValue attrString3 = null;

+        FunctionArgumentAttributeValue attrString4 = null;

+        FunctionArgumentAttributeValue attrString5 = null;

+        FunctionArgumentAttributeValue attrString6 = null;

+        FunctionArgumentAttributeValue attrString7 = null;

+        FunctionArgumentAttributeValue attrString8 = null;

+        FunctionArgumentAttributeValue attrString9 = null;

+        FunctionArgumentAttributeValue attrStringDateTimeZone = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-12T12:14:15.323"));

+            attrString2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-2013-05-12T12:14:15.323"));

+            attrString3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("1232013-05-12T12:14:15.323"));

+            attrString4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-1232013-05-12T12:14:15.323"));

+            attrString5 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("213-05-12T12:14:15.323"));

+            attrString6 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-5-12T12:14:15.323"));

+            attrString7 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-2T12:14:15.323"));

+            attrString8 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-32-12T12:14:15.323"));

+            attrString9 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-45T12:14:15.323"));

+            attrStringDateTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2013-05-12T12:14:15.323+03:00"));

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        

-        

-        

-        /**

-         * RFC822Name

-         */

-        @Test

-        public void testRFC822Name_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringCapsDomain = null;

-                FunctionArgumentAttributeValue attrStringCapsLocal = null;

-                FunctionArgumentAttributeValue attrStringMissingAt = null;

-                FunctionArgumentAttributeValue attrStringMissingLocal = null;

-                FunctionArgumentAttributeValue attrStringMissingDomain = null;

-                FunctionArgumentAttributeValue attrStringEmpty = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("local@Domain"));

-                        attrStringCapsDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("local@DOMAIN"));

-                        attrStringCapsLocal = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("LOCAL@Domain"));

-                        attrStringMissingAt = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("localDomain"));

-                        attrStringMissingLocal = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("@Domain"));

-                        attrStringMissingDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("local@"));

-                        attrStringEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DATETIME_FROM_STRING;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_RFC822NAME_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_RFC822NAME_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_RFC822NAME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                RFC822Name resValue = (RFC822Name)res.getValue().getValue();

-                assertEquals(new RFC822Name("local", "domain"), resValue);

-                

-                // caps domain

-                arguments.clear();

-                arguments.add(attrStringCapsDomain);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (RFC822Name)res.getValue().getValue();

-                assertEquals(new RFC822Name("local", "domain"), resValue);

-                

-                // caps local

-                arguments.clear();

-                arguments.add(attrStringCapsLocal);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (RFC822Name)res.getValue().getValue();

-                assertNotEquals(new RFC822Name("local", "domain"), resValue);

-                

-                // missing at

-                arguments.clear();

-                arguments.add(attrStringMissingAt);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"localDomain\": missing local part", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // missing local

-                arguments.clear();

-                arguments.add(attrStringMissingLocal);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"@Domain\": empty parts", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // missing domain

-                arguments.clear();

-                arguments.add(attrStringMissingDomain);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"local@\": empty parts", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // empty

-                arguments.clear();

-                arguments.add(attrStringEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"\": missing local part", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"not valid obj value\": missing local part", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:rfc822Name-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DATETIME_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        ISO8601DateTime resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(new ISO8601DateTime(null, new ISO8601Date(2013, 5, 12), new ISO8601Time(12, 14, 15, 323)), resValue);

+

+        // check negative

+        arguments.clear();

+        arguments.add(attrString2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(new ISO8601DateTime(null, new ISO8601Date(-2013, 5, 12), new ISO8601Time(12, 14, 15, 323)), resValue);

+

+

+        // check big

+        arguments.clear();

+        arguments.add(attrString3);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(new ISO8601DateTime(null, new ISO8601Date(1232013, 5, 12), new ISO8601Time(12, 14, 15, 323)), resValue);

+

+        // check big negative

+        arguments.clear();

+        arguments.add(attrString4);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(new ISO8601DateTime(null, new ISO8601Date(-1232013, 5, 12), new ISO8601Time(12, 14, 15, 323)), resValue);

+

+        // bad year

+        arguments.clear();

+        arguments.add(attrString5);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-from-string Invalid year (must be at least 4 digits)", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad month

+        arguments.clear();

+        arguments.add(attrString6);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-from-string Invalid month", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad day format

+        arguments.clear();

+        arguments.add(attrString7);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-from-string Invalid day", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // month out of range

+        arguments.clear();

+        arguments.add(attrString8);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-from-string Invalid month", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // day out of range

+        arguments.clear();

+        arguments.add(attrString9);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-from-string Invalid day", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // check TimeZone

+        arguments.clear();

+        arguments.add(attrStringDateTimeZone);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (ISO8601DateTime)res.getValue().getValue();

+        assertEquals(new ISO8601DateTime(new ISO8601TimeZone(180), new ISO8601Date(new ISO8601TimeZone(180), 2013, 5, 12), new ISO8601Time(new ISO8601TimeZone(180),12, 14, 15, 323)), resValue);

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-from-string Invalid year", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dateTime-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_dateTime() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrObj2 = null;

+        FunctionArgumentAttributeValue attrObjDateTimeZone = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue("2013-05-12T12:14:15.323"));

+            attrObj2 = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue("0001-01-01T12:14:15.323"));

+            attrObjDateTimeZone = new FunctionArgumentAttributeValue(DataTypes.DT_DATETIME.createAttributeValue("2013-05-12T12:14:15.323+03:00"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_rfc822Name() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "local@DOMAIN";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(objValueString));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DATETIME;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_RFC822NAME;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_RFC822NAME, fd.getId());

-                assertEquals(DataTypes.DT_RFC822NAME.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals("local@domain", res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-rfc822Name Expected data type 'rfc822Name' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        

-        /**

-         * IPAddress

-         */

-        @Test

-        public void testIPAddress_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrStringFull = null;

-                FunctionArgumentAttributeValue attrStringMissingElement = null;

-                FunctionArgumentAttributeValue attrStringTooManyElement = null;

-                FunctionArgumentAttributeValue attrStringIllegalElement = null;

-                FunctionArgumentAttributeValue attrStringOutOfOrder = null;

-                

-                FunctionArgumentAttributeValue attrStringMask = null;

-                FunctionArgumentAttributeValue attrStringMissingMaskElement = null;

-                FunctionArgumentAttributeValue attrStringTooManyMaskElement = null;

-                FunctionArgumentAttributeValue attrStringIllegalMaskElement = null;

-                FunctionArgumentAttributeValue attrStringMaskNoValue = null;

-                

-                FunctionArgumentAttributeValue attrStringMinusPort = null;

-                FunctionArgumentAttributeValue attrStringPortMinus = null;

-                FunctionArgumentAttributeValue attrStringPortPort = null;

-                FunctionArgumentAttributeValue attrStringNoPort = null;

-                FunctionArgumentAttributeValue attrStringBadPort = null;

-                FunctionArgumentAttributeValue attrStringTooManyPorts = null;

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                

-                // set up for v4 address tests - this setup and the tests are repeated for V6

-                short[] addrShorts= {123, 134, 156, 255 };

-                short[] addrMaskShorts= {255, 255, 255, 255 };

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255"));

-                        attrStringFull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/255.255.255.255:123-456"));

-                        attrStringMissingElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.255"));

-                        attrStringTooManyElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.255.111.222"));

-                        attrStringIllegalElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.256.255"));

-                        attrStringOutOfOrder = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.256.255:123-456/255.255.255.255"));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DATETIME, fd.getId());

+        assertEquals(DataTypes.DT_DATETIME.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

 

-                        attrStringMask = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/255.255.255.255"));

-                        attrStringMissingMaskElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/123.134.255"));

-                        attrStringTooManyMaskElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/122.134.155.111.222"));

-                        attrStringIllegalMaskElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/123.134.256.255"));

-                        attrStringMaskNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/"));

-                        // optional mask

-                        // "/" with no mask (fail)

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

 

-                        attrStringMinusPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:-123"));

-                        attrStringPortMinus = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:123-"));

-                        attrStringPortPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:1234567-432"));

-                        attrStringNoPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:"));

-                        attrStringBadPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:12.34"));

-                        attrStringTooManyPorts = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:-123-456"));

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("2013-05-12T12:14:15.323", res.getValue().getValue());

+

+        // missing digits in string value?

+        arguments.clear();

+        arguments.add(attrObj2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("1-01-01T12:14:15.323", res.getValue().getValue());

+

+        // include DateTimeZone

+        arguments.clear();

+        arguments.add(attrObjDateTimeZone);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("2013-05-12T12:14:15.323+03:00", res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-dateTime Expected data type 'dateTime' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

 

 

-                        

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_IPADDRESS_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_IPADDRESS_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_IPADDRESS.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                IPAddress resValue = (IPAddress)res.getValue().getValue();

-                assertEquals(new IPv4Address(addrShorts, null, null), resValue);

 

-                // fully-loaded address

-                arguments.clear();

-                arguments.add(attrStringFull);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv4Address(addrShorts, addrMaskShorts, PortRange.newInstance("123-456")), resValue);

-                } catch (Exception e) {

-                        fail("port error e="+e);

-                }

-                

-                // missing element

-                arguments.clear();

-                arguments.add(attrStringMissingElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.255\": invalid address", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many elements

-                arguments.clear();

-                arguments.add(attrStringTooManyElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.255.111.222\": invalid address", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // illegal element

-                arguments.clear();

-                arguments.add(attrStringIllegalElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.256.255\": invalid octet: \"256", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // Out of order

-                arguments.clear();

-                arguments.add(attrStringOutOfOrder);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.256.255:123-456/255.255.255.255\": out of order components", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // simple mask

-                arguments.clear();

-                arguments.add(attrStringMask);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv4Address(addrShorts, addrMaskShorts, null), resValue);

-                } catch (Exception e) {

-                        fail("port error e="+e);

-                }

-                

-                // missing mask element

-                arguments.clear();

-                arguments.add(attrStringMissingMaskElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.255\": invalid address", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many mask elements

-                arguments.clear();

-                arguments.add(attrStringTooManyMaskElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"122.134.155.111.222\": invalid address", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // illegal Mask element

-                arguments.clear();

-                arguments.add(attrStringIllegalMaskElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.256.255\": invalid octet: \"256", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                //mask indicator without value

-                arguments.clear();

-                arguments.add(attrStringMaskNoValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"\": invalid address", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // portrange (-port, port-, port-port)

-                arguments.clear();

-                arguments.add(attrStringMinusPort);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv4Address(addrShorts, null, PortRange.newInstance("-123")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                arguments.clear();

-                arguments.add(attrStringPortMinus);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv4Address(addrShorts, null, PortRange.newInstance("123-")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                arguments.clear();

-                arguments.add(attrStringPortPort);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv4Address(addrShorts, null, PortRange.newInstance("1234567-432")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                // ":" without port

-                arguments.clear();

-                arguments.add(attrStringNoPort);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.156.255:\": no portrange given after ':'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // bad port number

-                arguments.clear();

-                arguments.add(attrStringBadPort);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid PortRange \"12.34\": invalid port number", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad port range

-                arguments.clear();

-                arguments.add(attrStringTooManyPorts);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid PortRange \"-123-456\": too many ranges", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Unknown IPAddress type for \"not valid obj value\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        

-        

-                //

-                // V6 IP Addresses

-                //

-                

-                // reset the variable for IPv6 tests

-                FunctionArgumentAttributeValue attrStringAlternateFull = null;

-                FunctionArgumentAttributeValue attrStringEmptyElement = null;

-                FunctionArgumentAttributeValue attrString2xEmptyElement = null;

-                FunctionArgumentAttributeValue attrStringNoStartBracket = null;

-                FunctionArgumentAttributeValue attrStringNoEndBracket = null;

-                short[] addrv6Shorts = {(short)0x2001, (short)0xdb8, (short)0x85a3, (short)0x0, (short)0x0, (short)0x8a2e, (short)0x370, (short)0x1};

-                Short prefix = new Short((short) 121);

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]"));

-                        attrStringFull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1/121]:123-456"));

-                        attrStringAlternateFull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]/121:123-456"));

-                        attrStringEmptyElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3::8a2e:370:1]"));

-                        attrString2xEmptyElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3::8a2e::1]"));

-                        attrStringNoStartBracket = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2002:db8:85a3::8a2e::1]"));

-                        attrStringNoEndBracket = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3::8a2e::1"));

 

-                        attrStringMissingElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:1]"));

-                        attrStringTooManyElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1:123]"));

-                        attrStringIllegalElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:mnop:85a3:0:0:8a2e:370:1]"));

-                        attrStringOutOfOrder = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:mnop:85a3:0:0:8a2e:370:1:123-456/121]"));

+    /**

+     * URI

+     */

+    @Test

+    public void testURI_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("http://someMachine.com/subdir"));

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

 

-                        attrStringMask = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1/21]"));

-                        attrStringIllegalMaskElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1/130]"));

-                        attrStringMaskNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1/]"));

-

-                        attrStringMinusPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:-123"));

-                        attrStringPortMinus = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:123-"));

-                        attrStringPortPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:1234567-432"));

-                        attrStringNoPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:"));

-                        attrStringBadPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:12.34"));

-                        attrStringTooManyPorts = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:-123-456"));

-

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

-

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-        

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                assertEquals(new IPv6Address(addrv6Shorts, null, null), resValue);

-

-                // fully-loaded address - "prefix" is inside the brackets (not clear if this is correct)

-                arguments.clear();

-                arguments.add(attrStringFull);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv6Address(addrv6Shorts, new Short(prefix), PortRange.newInstance("123-456")), resValue);

-                } catch (Exception e) {

-                        fail("port error e="+e);

-                }

-                

-                // Alternate way of identifying "prefix" - outside the brackets

-                arguments.clear();

-                arguments.add(attrStringAlternateFull);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv6Address(addrv6Shorts, prefix, PortRange.newInstance("123-456")), resValue);

-                } catch (Exception e) {

-                        fail("port error e="+e);

-                }

-                

-                

-                // consecutive zero elements removed

-                arguments.clear();

-                arguments.add(attrStringEmptyElement);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv6Address(addrv6Shorts, prefix, null), resValue);

-                } catch (Exception e) {

-                        fail("port error e="+e);

-                }

-                

-                // consecutive zero elements removed in two locations (no-no)

-                arguments.clear();

-                arguments.add(attrString2xEmptyElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2001:db8:85a3::8a2e::1\": multiple zero runs", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // address must have [] on it

-                arguments.clear();

-                arguments.add(attrStringNoStartBracket);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2002:db8:85a3::8a2e::1]\": missing opening bracket", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrStringNoEndBracket);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"[2001:db8:85a3::8a2e::1\": missing closing bracket", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // missing element

-                arguments.clear();

-                arguments.add(attrStringMissingElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2001:db8:85a3:0:0:8a2e:1\": not enough address fields", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many elements

-                arguments.clear();

-                arguments.add(attrStringTooManyElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2001:db8:85a3:0:0:8a2e:370:1:123\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // illegal element

-                arguments.clear();

-                arguments.add(attrStringIllegalElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv6Address component \"mnop\": invalid hex", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // Out of order

-                arguments.clear();

-                arguments.add(attrStringOutOfOrder);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2001:mnop:85a3:0:0:8a2e:370:1:123-456\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // simple mask

-                arguments.clear();

-                arguments.add(attrStringMask);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv6Address(addrv6Shorts, prefix, null), resValue);

-                } catch (Exception e) {

-                        fail("port error e="+e);

-                }

-                

-                // illegal Mask element

-                arguments.clear();

-                arguments.add(attrStringIllegalMaskElement);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid Ipv6Address string \"[2001:db8:85a3:0:0:8a2e:370:1/130]\": prefix is larger than 128", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                //mask indicator without value

-                arguments.clear();

-                arguments.add(attrStringMaskNoValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid Ipv6Address string \"[2001:db8:85a3:0:0:8a2e:370:1/]\": prefix designation without value", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // portrange (-port, port-, port-port)

-                arguments.clear();

-                arguments.add(attrStringMinusPort);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv6Address(addrv6Shorts, null, PortRange.newInstance("-123")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                arguments.clear();

-                arguments.add(attrStringPortMinus);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv6Address(addrv6Shorts, null, PortRange.newInstance("123-")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                arguments.clear();

-                arguments.add(attrStringPortPort);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (IPAddress)res.getValue().getValue();

-                try {

-                        assertEquals(new IPv6Address(addrv6Shorts, null, PortRange.newInstance("1234567-432")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                // ":" without port

-                arguments.clear();

-                arguments.add(attrStringNoPort);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid IPv6 address string \"[2001:db8:85a3:0:0:8a2e:370:1]:\": no portrange given after ':'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // bad port number

-                arguments.clear();

-                arguments.add(attrStringBadPort);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid PortRange \"12.34\": invalid port number", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad port range

-                arguments.clear();

-                arguments.add(attrStringTooManyPorts);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:ipAddress-from-string Invalid PortRange \"-123-456\": too many ranges", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-        

-        

-        

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        @Test

-        public void testString_from_ipAddress() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrObjV6 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "123.145.255.255";

-                String objValueStringV6 = "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_IPADDRESS.createAttributeValue(objValueString));

-                        attrObjV6 = new FunctionArgumentAttributeValue(DataTypes.DT_IPADDRESS.createAttributeValue(objValueStringV6));

-                        

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_ANYURI_FROM_STRING;

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_IPADDRESS;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_IPADDRESS, fd.getId());

-                assertEquals(DataTypes.DT_IPADDRESS.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal V4

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                // test normal V6

-                arguments.clear();

-                arguments.add(attrObjV6);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueStringV6.toLowerCase(), res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-ipAddress Expected data type 'ipAddress' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-        }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        /**

-         * RFC2396DomainName

-         */

-        @Test

-        public void testRFC2396DomainName_from_string() {

-                FunctionArgumentAttributeValue attrString1 = null;

-                FunctionArgumentAttributeValue attrString2 = null;

-                FunctionArgumentAttributeValue attrStringMinusPort = null;

-                FunctionArgumentAttributeValue attrStringPortMinus = null;

-                FunctionArgumentAttributeValue attrStringPortPort = null;

-                FunctionArgumentAttributeValue attrStringNoPort = null;

-                FunctionArgumentAttributeValue attrStringBadPort = null;

-                FunctionArgumentAttributeValue attrStringTooManyPorts = null;

-        

-                FunctionArgumentAttributeValue attrStringBadValue = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                try {

-                        attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host"));

-                        attrString2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host"));

-                

-                        attrStringMinusPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:-123"));

-                        attrStringPortMinus = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:123-"));

-                        attrStringPortPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:1234567-432"));

-                        attrStringNoPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:"));

-                        attrStringBadPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:12.34"));

-                        attrStringTooManyPorts = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:-123-456"));

-                

-                        attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANYURI_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_ANYURI.getId(), fd.getDataTypeId());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DNSNAME_FROM_STRING;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_DNSNAME_FROM_STRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_DNSNAME.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrString1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                RFC2396DomainName resValue = (RFC2396DomainName)res.getValue().getValue();

-                assertEquals(new RFC2396DomainName("host", null), resValue);

-                

-                arguments.clear();

-                arguments.add(attrString2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (RFC2396DomainName)res.getValue().getValue();

-                assertEquals(new RFC2396DomainName("host.host", null), resValue);

-                

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

 

-                // portrange (-port, port-, port-port)

-                arguments.clear();

-                arguments.add(attrStringMinusPort);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (RFC2396DomainName)res.getValue().getValue();

-                try {

-                        assertEquals(new RFC2396DomainName("host.host", PortRange.newInstance("-123")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                arguments.clear();

-                arguments.add(attrStringPortMinus);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (RFC2396DomainName)res.getValue().getValue();

-                try {

-                        assertEquals(new RFC2396DomainName("host.host", PortRange.newInstance("123-")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                arguments.clear();

-                arguments.add(attrStringPortPort);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (RFC2396DomainName)res.getValue().getValue();

-                try {

-                        assertEquals(new RFC2396DomainName("host.host", PortRange.newInstance("1234567-432")), resValue);

-                } catch (ParseException e) {

-                        fail("port error e="+e);

-                }

-                

-                // ":" without port

-                arguments.clear();

-                arguments.add(attrStringNoPort);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dnsName-from-string Invalid RFC 2396 port range \"host.host:\": no port numbers", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad port number

-                arguments.clear();

-                arguments.add(attrStringBadPort);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dnsName-from-string Invalid RFC 2396 port range \"12.34\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad port range

-                arguments.clear();

-                arguments.add(attrStringTooManyPorts);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dnsName-from-string Invalid RFC 2396 port range \"-123-456\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad value

-                arguments.clear();

-                arguments.add(attrStringBadValue);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dnsName-from-string Invalid RFC 2396 host name \"not valid obj value\"", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:dnsName-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        URI resValue = (URI)res.getValue().getValue();

+        try {

+            assertEquals(new URI("http://someMachine.com/subdir"), resValue);

+        } catch (URISyntaxException e) {

+            fail("uri generation e="+e);

         }

 

-        @Test

-        public void testString_from_dnsName() {

-                FunctionArgumentAttributeValue attrObj1 = null;

-                FunctionArgumentAttributeValue attrStringBadType = null;

-                String objValueString = "someName.com";

-                try {

-                        attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DNSNAME.createAttributeValue(objValueString));

-                        attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-from-string Illegal character in path at index 3: not valid obj value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DNSNAME;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DNSNAME, fd.getId());

-                assertEquals(DataTypes.DT_DNSNAME.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                // test normal

-                arguments.clear();

-                arguments.add(attrObj1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(objValueString, res.getValue().getValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrStringBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-from-dnsName Expected data type 'dnsName' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_anyURI() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "http://aMachine.com:8080/aRef";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(objValueString));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        

-        

-        

-        

-        

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_ANYURI;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_ANYURI, fd.getId());

+        assertEquals(DataTypes.DT_ANYURI.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-anyURI Expected data type 'anyURI' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+    /**

+     * XPathDayTimeDuration

+     */

+    @Test

+    public void testXPathDayTimeDuration_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringNeg1 = null;

+        FunctionArgumentAttributeValue attrStringNeg2 = null;

+        FunctionArgumentAttributeValue attrStringNoDay = null;

+        FunctionArgumentAttributeValue attrStringNoHour = null;

+        FunctionArgumentAttributeValue attrStringNoMin = null;

+        FunctionArgumentAttributeValue attrStringNoSec = null;

+        FunctionArgumentAttributeValue attrStringNoP = null;

+        FunctionArgumentAttributeValue attrStringSecondsDot = null;

+        FunctionArgumentAttributeValue attrStringMissingTOk = null;

+        FunctionArgumentAttributeValue attrStringMissingTBad = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT10H30M23S"));

+            attrStringNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-P3DT10H30M23S"));

+            attrStringNeg2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P-3DT10H30M23S"));

+            attrStringNoDay = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("PT10H30M23S"));

+            attrStringNoHour = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT30M23S"));

+            attrStringNoMin = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT10H23S"));

+            attrStringNoSec = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT10H30M"));

+            attrStringNoP = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("3DT10H30M"));

+            attrStringSecondsDot = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3DT10H30M23.456S"));

+            attrStringMissingTOk = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3D"));

+            attrStringMissingTBad = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3D10H30M23S"));

+

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DAYTIMEDURATION_FROM_STRING;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DAYTIMEDURATION_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DAYTIMEDURATION.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        XPathDayTimeDuration resValue = (XPathDayTimeDuration)res.getValue().getValue();

+        assertEquals(new XPathDayTimeDuration(1, 3, 10, 30, 23), resValue);

+

+

+        //		negative values in front is allowed

+        arguments.clear();

+        arguments.add(attrStringNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathDayTimeDuration)res.getValue().getValue();

+        assertEquals(new XPathDayTimeDuration(-1, 3, 10, 30, 23), resValue);

+

+        // negative in middle of string not ok

+        arguments.clear();

+        arguments.add(attrStringNeg2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dayTimeDuration-from-string Invalid chunk \"P-3DT10H30M23S\" at position 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        //	omit parts that are 0

+        arguments.clear();

+        arguments.add(attrStringNoDay);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathDayTimeDuration)res.getValue().getValue();

+        assertEquals(new XPathDayTimeDuration(1, 0, 10, 30, 23), resValue);

+

+        arguments.clear();

+        arguments.add(attrStringNoHour);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathDayTimeDuration)res.getValue().getValue();

+        assertEquals(new XPathDayTimeDuration(1, 3, 0, 30, 23), resValue);

+

+        arguments.clear();

+        arguments.add(attrStringNoMin);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathDayTimeDuration)res.getValue().getValue();

+        assertEquals(new XPathDayTimeDuration(1, 3, 10, 0, 23), resValue);

+

+        arguments.clear();

+        arguments.add(attrStringNoSec);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathDayTimeDuration)res.getValue().getValue();

+        assertEquals(new XPathDayTimeDuration(1, 3, 10, 30, 0), resValue);

+

+        //		P must always be present

+        arguments.clear();

+        arguments.add(attrStringNoP);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dayTimeDuration-from-string Invalid ISO8601 duration string \"3DT10H30M\" at position 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        //		seconds may contain decimal

+        arguments.clear();

+        arguments.add(attrStringSecondsDot);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathDayTimeDuration)res.getValue().getValue();

+        assertEquals(new XPathDayTimeDuration(1, 3, 10, 30, 23.456), resValue);

+

+        //		T must be absent iff all time items are absent

+        arguments.clear();

+        arguments.add(attrStringMissingTOk);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathDayTimeDuration)res.getValue().getValue();

+        assertEquals(new XPathDayTimeDuration(1, 3, 0, 0, 0), resValue);

+

+        // negative in middle of string not ok

+        arguments.clear();

+        arguments.add(attrStringMissingTBad);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dayTimeDuration-from-string Invalid ISO8601 duration string \"P3D10H30M23S\" at position 6: out of order component", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dayTimeDuration-from-string Invalid ISO8601 duration string \"not valid obj value\" at position 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dayTimeDuration-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_dayTimeDuration() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "P3DT10H30M23S";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DAYTIMEDURATION.createAttributeValue(objValueString));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DAYTIMEDURATION;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DAYTIMEDURATION, fd.getId());

+        assertEquals(DataTypes.DT_DAYTIMEDURATION.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-dayTimeDuration Expected data type 'dayTimeDuration' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+

+

+

+

+    /**

+     * XPathYearMonthDuration

+     */

+    @Test

+    public void testXPathYearMonthDuration_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringNeg1 = null;

+        FunctionArgumentAttributeValue attrStringNeg2 = null;

+        FunctionArgumentAttributeValue attrStringNoYear1 = null;

+        FunctionArgumentAttributeValue attrStringNoYear2 = null;

+        FunctionArgumentAttributeValue attrStringNoMonth1 = null;

+        FunctionArgumentAttributeValue attrStringNoMonth2 = null;

+        FunctionArgumentAttributeValue attrStringNoValue = null;

+        FunctionArgumentAttributeValue attrStringNoP = null;

+        FunctionArgumentAttributeValue attrStringBigMonths = null;

+        FunctionArgumentAttributeValue attrStringMissingTOk = null;

+        FunctionArgumentAttributeValue attrStringMissingTBad = null;

+        FunctionArgumentAttributeValue attrStringZeroMonths = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P1Y2M"));

+            attrStringNeg1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("-P1Y2M"));

+            attrStringNeg2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P-1Y2M"));

+            attrStringNoYear1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P2M"));

+            attrStringNoYear2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("PY2M"));

+            attrStringNoMonth1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P1Y"));

+            attrStringNoMonth2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P1YM"));

+            attrStringNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P"));

+            attrStringNoP = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("1Y2M"));

+            attrStringBigMonths = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P1Y12M"));

+            attrStringMissingTOk = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3D"));

+            attrStringMissingTBad = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P3D10H30M23S"));

+            attrStringZeroMonths = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("P0M"));

+

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_YEARMONTHDURATION_FROM_STRING;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_YEARMONTHDURATION_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_YEARMONTHDURATION.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        XPathYearMonthDuration resValue = (XPathYearMonthDuration)res.getValue().getValue();

+        assertEquals(new XPathYearMonthDuration(1,1, 2), resValue);

+

+

+        //		negative values in front is allowed

+        arguments.clear();

+        arguments.add(attrStringNeg1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathYearMonthDuration)res.getValue().getValue();

+        assertEquals(new XPathYearMonthDuration(-1, 1, 2), resValue);

+

+        // negative in middle of string not ok

+        arguments.clear();

+        arguments.add(attrStringNeg2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Invalid chunk \"P-1Y2M\" at position 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        //	omit parts that are 0

+        arguments.clear();

+        arguments.add(attrStringNoYear1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathYearMonthDuration)res.getValue().getValue();

+        assertEquals(new XPathYearMonthDuration(1, 0, 2), resValue);

+

+        arguments.clear();

+        arguments.add(attrStringNoYear2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Invalid chunk \"PY2M\" at position 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        arguments.clear();

+        arguments.add(attrStringNoMonth1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathYearMonthDuration)res.getValue().getValue();

+        assertEquals(new XPathYearMonthDuration(1, 1, 0), resValue);

+

+        arguments.clear();

+        arguments.add(attrStringNoMonth2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Invalid chunk \"P1YM\" at position 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // No field with a value

+        arguments.clear();

+        arguments.add(attrStringNoValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Invalid ISO8601 duration string \"P\": No duration components following P", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        //		P must always be present

+        arguments.clear();

+        arguments.add(attrStringNoP);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Invalid ISO8601 duration string \"1Y2M\" at position 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        //		Canonical Form of output may not have more than 12 months, but input as string is ok?

+        arguments.clear();

+        arguments.add(attrStringBigMonths);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathYearMonthDuration)res.getValue().getValue();

+        assertEquals(new XPathYearMonthDuration(1, 1, 12), resValue);

+

+        // Canonical representation of 0 Months

+        arguments.clear();

+        arguments.add(attrStringZeroMonths);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (XPathYearMonthDuration)res.getValue().getValue();

+        assertEquals(new XPathYearMonthDuration(1, 0, 0), resValue);

+

+        //		T must be absent iff all time items are absent

+        arguments.clear();

+        arguments.add(attrStringMissingTOk);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Invalid XPath yearMonthDuraiton \"{durationSign=1years=0months=0days=3hours=0minutes=0seconds=0millis=0}\": includes days, hours, minutes, or seconds", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // negative in middle of string not ok

+        arguments.clear();

+        arguments.add(attrStringMissingTBad);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Invalid ISO8601 duration string \"P3D10H30M23S\" at position 6: out of order component", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Invalid ISO8601 duration string \"not valid obj value\" at position 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:yearMonthDuration-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_yearMonthDuration() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "P1Y2M";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_YEARMONTHDURATION.createAttributeValue(objValueString));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_YEARMONTHDURATION;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_YEARMONTHDURATION, fd.getId());

+        assertEquals(DataTypes.DT_YEARMONTHDURATION.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-yearMonthDuration Expected data type 'yearMonthDuration' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+

+    /**

+     * X500Principal

+     *

+     * See http://www.ietf.org/rfc/rfc2253.txt and http://www.ietf.org/rfc/rfc2251.txt

+     */

+    @Test

+    public void testX500Principal_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringNoComma = null;

+        FunctionArgumentAttributeValue attrStringEmpty = null;

+        FunctionArgumentAttributeValue attrStringNoValue = null;

+        FunctionArgumentAttributeValue attrStringOrder = null;

+        FunctionArgumentAttributeValue attrStringDottedDecimalOID = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("CN=Name, L=local, ST=NJ, O=ATT, C=USA"));

+            attrStringNoComma = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("CN=Name, L=local ST=NJ, O=ATT, C=USA"));

+            attrStringEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrStringNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("CN=Name, L=, ST=NJ, O=ATT, C=USA"));

+            attrStringOrder = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("L=local, ST=NJ, O=ATT, CN=Name, C=USA"));

+            attrStringDottedDecimalOID = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2.5.4.3=A. N. Other"));

+

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_X500NAME_FROM_STRING;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_X500NAME_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_X500NAME.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        X500Principal resValue = (X500Principal)res.getValue().getValue();

+        assertEquals(new X500Principal("CN=Name, L=local, ST=NJ, O=ATT, C=USA"), resValue);

+

+        // no comma between components => next attribute/value is included as part of first value

+        arguments.clear();

+        arguments.add(attrStringNoComma);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (X500Principal)res.getValue().getValue();

+        assertEquals(new X500Principal("CN=Name, L=local ST=NJ, O=ATT, C=USA"), resValue);

+

+        // nothing in name (fail)

+        arguments.clear();

+        arguments.add(attrStringEmpty);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (X500Principal)res.getValue().getValue();

+        assertEquals(new X500Principal(""), resValue);

+

+        // type value with no =

+        arguments.clear();

+        arguments.add(attrStringNoValue);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (X500Principal)res.getValue().getValue();

+        assertEquals(new X500Principal("CN=Name, L=, ST=NJ, O=ATT, C=USA"), resValue);

+

+        // different order

+        arguments.clear();

+        arguments.add(attrStringOrder);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (X500Principal)res.getValue().getValue();

+        assertNotEquals(new X500Principal("CN=Name, L=local, ST=NJ, O=ATT, C=USA"), resValue);

+

+        // dotted-decimal name with numbers

+        arguments.clear();

+        arguments.add(attrStringDottedDecimalOID);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (X500Principal)res.getValue().getValue();

+        assertEquals(new X500Principal("2.5.4.3=A. N. Other"), resValue);

+

+

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:x500Name-from-string improperly specified input name: not valid obj value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:x500Name-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_x500Name() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "CN=Name, L=local, ST=NJ, O=ATT, C=USA";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_X500NAME.createAttributeValue(objValueString));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_X500NAME;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_X500NAME, fd.getId());

+        assertEquals(DataTypes.DT_X500NAME.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-x500Name Expected data type 'x500Name' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+    /**

+     * RFC822Name

+     */

+    @Test

+    public void testRFC822Name_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringCapsDomain = null;

+        FunctionArgumentAttributeValue attrStringCapsLocal = null;

+        FunctionArgumentAttributeValue attrStringMissingAt = null;

+        FunctionArgumentAttributeValue attrStringMissingLocal = null;

+        FunctionArgumentAttributeValue attrStringMissingDomain = null;

+        FunctionArgumentAttributeValue attrStringEmpty = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("local@Domain"));

+            attrStringCapsDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("local@DOMAIN"));

+            attrStringCapsLocal = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("LOCAL@Domain"));

+            attrStringMissingAt = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("localDomain"));

+            attrStringMissingLocal = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("@Domain"));

+            attrStringMissingDomain = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("local@"));

+            attrStringEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_RFC822NAME_FROM_STRING;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_RFC822NAME_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_RFC822NAME.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        RFC822Name resValue = (RFC822Name)res.getValue().getValue();

+        assertEquals(new RFC822Name("local", "domain"), resValue);

+

+        // caps domain

+        arguments.clear();

+        arguments.add(attrStringCapsDomain);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (RFC822Name)res.getValue().getValue();

+        assertEquals(new RFC822Name("local", "domain"), resValue);

+

+        // caps local

+        arguments.clear();

+        arguments.add(attrStringCapsLocal);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (RFC822Name)res.getValue().getValue();

+        assertNotEquals(new RFC822Name("local", "domain"), resValue);

+

+        // missing at

+        arguments.clear();

+        arguments.add(attrStringMissingAt);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"localDomain\": missing local part", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // missing local

+        arguments.clear();

+        arguments.add(attrStringMissingLocal);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"@Domain\": empty parts", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // missing domain

+        arguments.clear();

+        arguments.add(attrStringMissingDomain);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"local@\": empty parts", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // empty

+        arguments.clear();

+        arguments.add(attrStringEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"\": missing local part", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:rfc822Name-from-string Invalid RFC822Name \"not valid obj value\": missing local part", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:rfc822Name-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_rfc822Name() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "local@DOMAIN";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_RFC822NAME.createAttributeValue(objValueString));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_RFC822NAME;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_RFC822NAME, fd.getId());

+        assertEquals(DataTypes.DT_RFC822NAME.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals("local@domain", res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-rfc822Name Expected data type 'rfc822Name' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+    /**

+     * IPAddress

+     */

+    @Test

+    public void testIPAddress_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrStringFull = null;

+        FunctionArgumentAttributeValue attrStringMissingElement = null;

+        FunctionArgumentAttributeValue attrStringTooManyElement = null;

+        FunctionArgumentAttributeValue attrStringIllegalElement = null;

+        FunctionArgumentAttributeValue attrStringOutOfOrder = null;

+

+        FunctionArgumentAttributeValue attrStringMask = null;

+        FunctionArgumentAttributeValue attrStringMissingMaskElement = null;

+        FunctionArgumentAttributeValue attrStringTooManyMaskElement = null;

+        FunctionArgumentAttributeValue attrStringIllegalMaskElement = null;

+        FunctionArgumentAttributeValue attrStringMaskNoValue = null;

+

+        FunctionArgumentAttributeValue attrStringMinusPort = null;

+        FunctionArgumentAttributeValue attrStringPortMinus = null;

+        FunctionArgumentAttributeValue attrStringPortPort = null;

+        FunctionArgumentAttributeValue attrStringNoPort = null;

+        FunctionArgumentAttributeValue attrStringBadPort = null;

+        FunctionArgumentAttributeValue attrStringTooManyPorts = null;

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+

+        // set up for v4 address tests - this setup and the tests are repeated for V6

+        short[] addrShorts= {123, 134, 156, 255 };

+        short[] addrMaskShorts= {255, 255, 255, 255 };

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255"));

+            attrStringFull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/255.255.255.255:123-456"));

+            attrStringMissingElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.255"));

+            attrStringTooManyElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.255.111.222"));

+            attrStringIllegalElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.256.255"));

+            attrStringOutOfOrder = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.256.255:123-456/255.255.255.255"));

+

+            attrStringMask = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/255.255.255.255"));

+            attrStringMissingMaskElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/123.134.255"));

+            attrStringTooManyMaskElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/122.134.155.111.222"));

+            attrStringIllegalMaskElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/123.134.256.255"));

+            attrStringMaskNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255/"));

+            // optional mask

+            // "/" with no mask (fail)

+

+            attrStringMinusPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:-123"));

+            attrStringPortMinus = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:123-"));

+            attrStringPortPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:1234567-432"));

+            attrStringNoPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:"));

+            attrStringBadPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:12.34"));

+            attrStringTooManyPorts = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("123.134.156.255:-123-456"));

+

+

+

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_IPADDRESS_FROM_STRING;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_IPADDRESS_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_IPADDRESS.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        IPAddress resValue = (IPAddress)res.getValue().getValue();

+        assertEquals(new IPv4Address(addrShorts, null, null), resValue);

+

+        // fully-loaded address

+        arguments.clear();

+        arguments.add(attrStringFull);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv4Address(addrShorts, addrMaskShorts, PortRange.newInstance("123-456")), resValue);

+        } catch (Exception e) {

+            fail("port error e="+e);

+        }

+

+        // missing element

+        arguments.clear();

+        arguments.add(attrStringMissingElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.255\": invalid address", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many elements

+        arguments.clear();

+        arguments.add(attrStringTooManyElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.255.111.222\": invalid address", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal element

+        arguments.clear();

+        arguments.add(attrStringIllegalElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.256.255\": invalid octet: \"256", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // Out of order

+        arguments.clear();

+        arguments.add(attrStringOutOfOrder);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.256.255:123-456/255.255.255.255\": out of order components", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // simple mask

+        arguments.clear();

+        arguments.add(attrStringMask);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv4Address(addrShorts, addrMaskShorts, null), resValue);

+        } catch (Exception e) {

+            fail("port error e="+e);

+        }

+

+        // missing mask element

+        arguments.clear();

+        arguments.add(attrStringMissingMaskElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.255\": invalid address", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many mask elements

+        arguments.clear();

+        arguments.add(attrStringTooManyMaskElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"122.134.155.111.222\": invalid address", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal Mask element

+        arguments.clear();

+        arguments.add(attrStringIllegalMaskElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.256.255\": invalid octet: \"256", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        //mask indicator without value

+        arguments.clear();

+        arguments.add(attrStringMaskNoValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"\": invalid address", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // portrange (-port, port-, port-port)

+        arguments.clear();

+        arguments.add(attrStringMinusPort);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv4Address(addrShorts, null, PortRange.newInstance("-123")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        arguments.clear();

+        arguments.add(attrStringPortMinus);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv4Address(addrShorts, null, PortRange.newInstance("123-")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        arguments.clear();

+        arguments.add(attrStringPortPort);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv4Address(addrShorts, null, PortRange.newInstance("1234567-432")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        // ":" without port

+        arguments.clear();

+        arguments.add(attrStringNoPort);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv4 address string \"123.134.156.255:\": no portrange given after ':'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // bad port number

+        arguments.clear();

+        arguments.add(attrStringBadPort);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid PortRange \"12.34\": invalid port number", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad port range

+        arguments.clear();

+        arguments.add(attrStringTooManyPorts);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid PortRange \"-123-456\": too many ranges", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Unknown IPAddress type for \"not valid obj value\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        //

+        // V6 IP Addresses

+        //

+

+        // reset the variable for IPv6 tests

+        FunctionArgumentAttributeValue attrStringAlternateFull = null;

+        FunctionArgumentAttributeValue attrStringEmptyElement = null;

+        FunctionArgumentAttributeValue attrString2xEmptyElement = null;

+        FunctionArgumentAttributeValue attrStringNoStartBracket = null;

+        FunctionArgumentAttributeValue attrStringNoEndBracket = null;

+        short[] addrv6Shorts = {(short)0x2001, (short)0xdb8, (short)0x85a3, (short)0x0, (short)0x0, (short)0x8a2e, (short)0x370, (short)0x1};

+        Short prefix = new Short((short) 121);

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]"));

+            attrStringFull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1/121]:123-456"));

+            attrStringAlternateFull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]/121:123-456"));

+            attrStringEmptyElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3::8a2e:370:1]"));

+            attrString2xEmptyElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3::8a2e::1]"));

+            attrStringNoStartBracket = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("2002:db8:85a3::8a2e::1]"));

+            attrStringNoEndBracket = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3::8a2e::1"));

+

+            attrStringMissingElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:1]"));

+            attrStringTooManyElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1:123]"));

+            attrStringIllegalElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:mnop:85a3:0:0:8a2e:370:1]"));

+            attrStringOutOfOrder = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:mnop:85a3:0:0:8a2e:370:1:123-456/121]"));

+

+            attrStringMask = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1/21]"));

+            attrStringIllegalMaskElement = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1/130]"));

+            attrStringMaskNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1/]"));

+

+            attrStringMinusPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:-123"));

+            attrStringPortMinus = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:123-"));

+            attrStringPortPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:1234567-432"));

+            attrStringNoPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:"));

+            attrStringBadPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:12.34"));

+            attrStringTooManyPorts = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("[2001:db8:85a3:0:0:8a2e:370:1]:-123-456"));

+

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        assertEquals(new IPv6Address(addrv6Shorts, null, null), resValue);

+

+        // fully-loaded address - "prefix" is inside the brackets (not clear if this is correct)

+        arguments.clear();

+        arguments.add(attrStringFull);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv6Address(addrv6Shorts, new Short(prefix), PortRange.newInstance("123-456")), resValue);

+        } catch (Exception e) {

+            fail("port error e="+e);

+        }

+

+        // Alternate way of identifying "prefix" - outside the brackets

+        arguments.clear();

+        arguments.add(attrStringAlternateFull);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv6Address(addrv6Shorts, prefix, PortRange.newInstance("123-456")), resValue);

+        } catch (Exception e) {

+            fail("port error e="+e);

+        }

+

+

+        // consecutive zero elements removed

+        arguments.clear();

+        arguments.add(attrStringEmptyElement);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv6Address(addrv6Shorts, prefix, null), resValue);

+        } catch (Exception e) {

+            fail("port error e="+e);

+        }

+

+        // consecutive zero elements removed in two locations (no-no)

+        arguments.clear();

+        arguments.add(attrString2xEmptyElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2001:db8:85a3::8a2e::1\": multiple zero runs", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // address must have [] on it

+        arguments.clear();

+        arguments.add(attrStringNoStartBracket);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2002:db8:85a3::8a2e::1]\": missing opening bracket", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrStringNoEndBracket);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"[2001:db8:85a3::8a2e::1\": missing closing bracket", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // missing element

+        arguments.clear();

+        arguments.add(attrStringMissingElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2001:db8:85a3:0:0:8a2e:1\": not enough address fields", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many elements

+        arguments.clear();

+        arguments.add(attrStringTooManyElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2001:db8:85a3:0:0:8a2e:370:1:123\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal element

+        arguments.clear();

+        arguments.add(attrStringIllegalElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv6Address component \"mnop\": invalid hex", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // Out of order

+        arguments.clear();

+        arguments.add(attrStringOutOfOrder);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv6Address string \"2001:mnop:85a3:0:0:8a2e:370:1:123-456\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // simple mask

+        arguments.clear();

+        arguments.add(attrStringMask);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv6Address(addrv6Shorts, prefix, null), resValue);

+        } catch (Exception e) {

+            fail("port error e="+e);

+        }

+

+        // illegal Mask element

+        arguments.clear();

+        arguments.add(attrStringIllegalMaskElement);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid Ipv6Address string \"[2001:db8:85a3:0:0:8a2e:370:1/130]\": prefix is larger than 128", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        //mask indicator without value

+        arguments.clear();

+        arguments.add(attrStringMaskNoValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid Ipv6Address string \"[2001:db8:85a3:0:0:8a2e:370:1/]\": prefix designation without value", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // portrange (-port, port-, port-port)

+        arguments.clear();

+        arguments.add(attrStringMinusPort);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv6Address(addrv6Shorts, null, PortRange.newInstance("-123")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        arguments.clear();

+        arguments.add(attrStringPortMinus);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv6Address(addrv6Shorts, null, PortRange.newInstance("123-")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        arguments.clear();

+        arguments.add(attrStringPortPort);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (IPAddress)res.getValue().getValue();

+        try {

+            assertEquals(new IPv6Address(addrv6Shorts, null, PortRange.newInstance("1234567-432")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        // ":" without port

+        arguments.clear();

+        arguments.add(attrStringNoPort);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid IPv6 address string \"[2001:db8:85a3:0:0:8a2e:370:1]:\": no portrange given after ':'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // bad port number

+        arguments.clear();

+        arguments.add(attrStringBadPort);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid PortRange \"12.34\": invalid port number", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad port range

+        arguments.clear();

+        arguments.add(attrStringTooManyPorts);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:ipAddress-from-string Invalid PortRange \"-123-456\": too many ranges", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+

+

+

+    }

+

+    @Test

+    public void testString_from_ipAddress() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrObjV6 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "123.145.255.255";

+        String objValueStringV6 = "[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_IPADDRESS.createAttributeValue(objValueString));

+            attrObjV6 = new FunctionArgumentAttributeValue(DataTypes.DT_IPADDRESS.createAttributeValue(objValueStringV6));

+

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_IPADDRESS;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_IPADDRESS, fd.getId());

+        assertEquals(DataTypes.DT_IPADDRESS.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal V4

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

+

+        // test normal V6

+        arguments.clear();

+        arguments.add(attrObjV6);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueStringV6.toLowerCase(), res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-ipAddress Expected data type 'ipAddress' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+

+

+

+

+

+    /**

+     * RFC2396DomainName

+     */

+    @Test

+    public void testRFC2396DomainName_from_string() {

+        FunctionArgumentAttributeValue attrString1 = null;

+        FunctionArgumentAttributeValue attrString2 = null;

+        FunctionArgumentAttributeValue attrStringMinusPort = null;

+        FunctionArgumentAttributeValue attrStringPortMinus = null;

+        FunctionArgumentAttributeValue attrStringPortPort = null;

+        FunctionArgumentAttributeValue attrStringNoPort = null;

+        FunctionArgumentAttributeValue attrStringBadPort = null;

+        FunctionArgumentAttributeValue attrStringTooManyPorts = null;

+

+        FunctionArgumentAttributeValue attrStringBadValue = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        try {

+            attrString1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host"));

+            attrString2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host"));

+

+            attrStringMinusPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:-123"));

+            attrStringPortMinus = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:123-"));

+            attrStringPortPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:1234567-432"));

+            attrStringNoPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:"));

+            attrStringBadPort = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:12.34"));

+            attrStringTooManyPorts = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("host.host:-123-456"));

+

+            attrStringBadValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("not valid obj value"));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_DNSNAME_FROM_STRING;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_DNSNAME_FROM_STRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_DNSNAME.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrString1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        RFC2396DomainName resValue = (RFC2396DomainName)res.getValue().getValue();

+        assertEquals(new RFC2396DomainName("host", null), resValue);

+

+        arguments.clear();

+        arguments.add(attrString2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (RFC2396DomainName)res.getValue().getValue();

+        assertEquals(new RFC2396DomainName("host.host", null), resValue);

+

+

+        // portrange (-port, port-, port-port)

+        arguments.clear();

+        arguments.add(attrStringMinusPort);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (RFC2396DomainName)res.getValue().getValue();

+        try {

+            assertEquals(new RFC2396DomainName("host.host", PortRange.newInstance("-123")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        arguments.clear();

+        arguments.add(attrStringPortMinus);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (RFC2396DomainName)res.getValue().getValue();

+        try {

+            assertEquals(new RFC2396DomainName("host.host", PortRange.newInstance("123-")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        arguments.clear();

+        arguments.add(attrStringPortPort);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (RFC2396DomainName)res.getValue().getValue();

+        try {

+            assertEquals(new RFC2396DomainName("host.host", PortRange.newInstance("1234567-432")), resValue);

+        } catch (ParseException e) {

+            fail("port error e="+e);

+        }

+

+        // ":" without port

+        arguments.clear();

+        arguments.add(attrStringNoPort);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dnsName-from-string Invalid RFC 2396 port range \"host.host:\": no port numbers", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad port number

+        arguments.clear();

+        arguments.add(attrStringBadPort);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dnsName-from-string Invalid RFC 2396 port range \"12.34\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad port range

+        arguments.clear();

+        arguments.add(attrStringTooManyPorts);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dnsName-from-string Invalid RFC 2396 port range \"-123-456\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad value

+        arguments.clear();

+        arguments.add(attrStringBadValue);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dnsName-from-string Invalid RFC 2396 host name \"not valid obj value\"", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:dnsName-from-string Expected data type 'string' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+    @Test

+    public void testString_from_dnsName() {

+        FunctionArgumentAttributeValue attrObj1 = null;

+        FunctionArgumentAttributeValue attrStringBadType = null;

+        String objValueString = "someName.com";

+        try {

+            attrObj1 = new FunctionArgumentAttributeValue(DataTypes.DT_DNSNAME.createAttributeValue(objValueString));

+            attrStringBadType = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(123));

+

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

+        }

+

+        FunctionDefinitionStringConversion<?, ?> fd = (FunctionDefinitionStringConversion<?, ?>) StdFunctions.FD_STRING_FROM_DNSNAME;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_FROM_DNSNAME, fd.getId());

+        assertEquals(DataTypes.DT_DNSNAME.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+        // test normal

+        arguments.clear();

+        arguments.add(attrObj1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(objValueString, res.getValue().getValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrStringBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-from-dnsName Expected data type 'dnsName' saw 'integer' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+    }

+

+

+

+

+

+

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringEqualIgnoreCaseTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringEqualIgnoreCaseTest.java
index a773b8b..cf4157c 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringEqualIgnoreCaseTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringEqualIgnoreCaseTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -49,91 +49,91 @@
 

 /**

  * Only one function to test here.  Code copy/pasted from FunctionDefinitionEqualityTest

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * In the first implementation of XACML we had separate files for each XACML Function.

  * This release combines multiple Functions in fewer files to minimize code duplication.

  * This file supports the following XACML codes:

  * 		string-equal-ignore-case

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionStringEqualIgnoreCaseTest {

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        FunctionArgumentAttributeValue stringAttr1 = null;

-        FunctionArgumentAttributeValue stringAttr2 = null;

-        FunctionArgumentAttributeValue stringAttr3 = null;

-        FunctionArgumentAttributeValue stringAttr4 = null;

-        

-        FunctionArgumentAttributeValue intAttr1 = null;

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-        public FunctionDefinitionStringEqualIgnoreCaseTest() {

-                try {

-                        stringAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

-                        stringAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

-                        stringAttr3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("ABC"));

-                        stringAttr4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("def"));

-                        intAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

+    FunctionArgumentAttributeValue stringAttr1 = null;

+    FunctionArgumentAttributeValue stringAttr2 = null;

+    FunctionArgumentAttributeValue stringAttr3 = null;

+    FunctionArgumentAttributeValue stringAttr4 = null;

+

+    FunctionArgumentAttributeValue intAttr1 = null;

+

+    public FunctionDefinitionStringEqualIgnoreCaseTest() {

+        try {

+            stringAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

+            stringAttr2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("abc"));

+            stringAttr3 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("ABC"));

+            stringAttr4 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("def"));

+            intAttr1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

-        

-        /**

-         * String match even when Case is different

-         */

-        @Test

-        public void testFunctionDefinitionStringEqualIgnoreCase() {

-                

-                FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_STRING_EQUAL_IGNORE_CASE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_EQUAL_IGNORE_CASE, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

+    }

 

-                

-                // test normal equals and non-equals

-                // check "abc" with "abc"

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr2);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

 

-                // check "abc" with "ABC" (should be same)

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(stringAttr3);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // test bad args data types?  Not needed?

-                arguments.clear();

-                arguments.add(stringAttr1);

-                arguments.add(intAttr1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

+    /**

+     * String match even when Case is different

+     */

+    @Test

+    public void testFunctionDefinitionStringEqualIgnoreCase() {

 

-                

+        FunctionDefinitionEquality<?> fd = (FunctionDefinitionEquality<?>) StdFunctions.FD_STRING_EQUAL_IGNORE_CASE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_EQUAL_IGNORE_CASE, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+

+        // test normal equals and non-equals

+        // check "abc" with "abc"

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr2);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // check "abc" with "ABC" (should be same)

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(stringAttr3);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // test bad args data types?  Not needed?

+        arguments.clear();

+        arguments.add(stringAttr1);

+        arguments.add(intAttr1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+

+

 //TODO - null in either first or 2nd arg => NullPointerException

-        }

+    }

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringFunctionsTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringFunctionsTest.java
index d00dcd7..a254a18 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringFunctionsTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringFunctionsTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -40,1458 +40,1458 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionStringFunctionsTest {

 

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        ExpressionResult res;

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-        

-        @Test

-        public void testConcatenate() {

-                String v1 = new String("abc");

-                String v2 = new String("def");

-                

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrV2 = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrV2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v2));

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_CONCATENATE;

+    ExpressionResult res;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_CONCATENATE, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrV2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                String resValue = (String)res.getValue().getValue();

-                assertEquals(v1 + v2, resValue);

-                

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrV2);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals(v2, resValue);

-                

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals(v1, resValue);

-                

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("", resValue);

-                

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-concatenate Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-concatenate Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrV2);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-concatenate Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-concatenate Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        }

-        

-        

-        

-        @Test

-        public void testStringStartsWith() {

-                String v1 = new String("abc");

-                String bigger = new String("abc some string");

-                String biggerNoMatch = new String(" abc some string");

-                String caps = new String("AbC");

-        

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrBigger = null;

-                FunctionArgumentAttributeValue attrBiggerNoMatch = null;

-                FunctionArgumentAttributeValue attrCaps = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigger));

-                        attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(biggerNoMatch));

-                        attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_STARTS_WITH;

+    @Test

+    public void testConcatenate() {

+        String v1 = new String("abc");

+        String v2 = new String("def");

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_STARTS_WITH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-

-                

-                // match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBiggerNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // caps no match

-                arguments.clear();

-                arguments.add(attrCaps);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // bigger on the inside

-                arguments.clear();

-                arguments.add(attrBigger);

-                arguments.add(attrV1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-starts-with Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-starts-with Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // illegal arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-starts-with Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-        }

-        

-        

-        @Test

-        public void testAnyuriStartsWith() {

-

-        

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrBigger = null;

-                FunctionArgumentAttributeValue attrBiggerNoMatch = null;

-                FunctionArgumentAttributeValue attrCaps = null;

-                FunctionArgumentAttributeValue attrBigString = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlankString = null;

-                FunctionArgumentAttributeValue attrBlankURI = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        String v1 = new String("abc");

-                        URI bigger = new URI("abc.some.string");

-                        URI biggerNoMatch = new URI("Zabc.some.string");

-                        String caps = new String("AbC");

-                        String bigString = "thisIsSomeReallyBigStringToMatch";

-                        

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(bigger));

-                        attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(biggerNoMatch));

-                        attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

-                        attrBigString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigString));

-                        attrBlankString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrBlankURI = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_ANYURI_STARTS_WITH;

-

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANYURI_STARTS_WITH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-

-                

-                // match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBiggerNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // caps no match

-                arguments.clear();

-                arguments.add(attrCaps);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // bigger on the inside

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlankString);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlankString);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // arguments reversed

-                arguments.clear();

-                arguments.add(attrBigger);

-                arguments.add(attrV1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-starts-with Expected data type 'string' saw 'anyURI'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-starts-with Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-starts-with Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // illegal arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-starts-with Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrV2 = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrV2 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v2));

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

 

-        

-        

-        

-        @Test

-        public void testStringEndsWith() {

-                String v1 = new String("abc");

-                String bigger = new String("abc some string abc");

-                String biggerNoMatch = new String(" abc some string abc ");

-                String caps = new String("AbC");

-        

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrBigger = null;

-                FunctionArgumentAttributeValue attrBiggerNoMatch = null;

-                FunctionArgumentAttributeValue attrCaps = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigger));

-                        attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(biggerNoMatch));

-                        attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_ENDS_WITH;

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_CONCATENATE;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_ENDS_WITH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_CONCATENATE, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBiggerNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // caps no match

-                arguments.clear();

-                arguments.add(attrCaps);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // bigger on the inside

-                arguments.clear();

-                arguments.add(attrBigger);

-                arguments.add(attrV1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-ends-with Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-ends-with Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // illegal arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-ends-with Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrV2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        String resValue = (String)res.getValue().getValue();

+        assertEquals(v1 + v2, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrV2);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals(v2, resValue);

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals(v1, resValue);

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("", resValue);

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-concatenate Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-concatenate Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrV2);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-concatenate Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-concatenate Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+    @Test

+    public void testStringStartsWith() {

+        String v1 = new String("abc");

+        String bigger = new String("abc some string");

+        String biggerNoMatch = new String(" abc some string");

+        String caps = new String("AbC");

+

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrBigger = null;

+        FunctionArgumentAttributeValue attrBiggerNoMatch = null;

+        FunctionArgumentAttributeValue attrCaps = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigger));

+            attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(biggerNoMatch));

+            attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        @Test

-        public void testAnyuriEndsWith() {

 

-        

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrBigger = null;

-                FunctionArgumentAttributeValue attrBiggerNoMatch = null;

-                FunctionArgumentAttributeValue attrCaps = null;

-                FunctionArgumentAttributeValue attrBigString = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlankString = null;

-                FunctionArgumentAttributeValue attrBlankURI = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        String v1 = new String("abc");

-                        URI bigger = new URI("abc.some.stringabc");

-                        URI biggerNoMatch = new URI("Zabc.some.stringabcZ");

-                        String caps = new String("AbC");

-                        String bigString = "thisIsSomeReallyBigStringToMatch";

-                        

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(bigger));

-                        attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(biggerNoMatch));

-                        attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

-                        attrBigString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigString));

-                        attrBlankString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrBlankURI = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_ANYURI_ENDS_WITH;

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_STARTS_WITH;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANYURI_ENDS_WITH, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_STARTS_WITH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBiggerNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // caps no match

-                arguments.clear();

-                arguments.add(attrCaps);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // bigger on the inside

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlankString);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlankString);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // arguments reversed

-                arguments.clear();

-                arguments.add(attrBigger);

-                arguments.add(attrV1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-ends-with Expected data type 'string' saw 'anyURI'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-ends-with Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-ends-with Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // illegal arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-ends-with Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBiggerNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // caps no match

+        arguments.clear();

+        arguments.add(attrCaps);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // bigger on the inside

+        arguments.clear();

+        arguments.add(attrBigger);

+        arguments.add(attrV1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-starts-with Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-starts-with Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-starts-with Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testAnyuriStartsWith() {

+

+

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrBigger = null;

+        FunctionArgumentAttributeValue attrBiggerNoMatch = null;

+        FunctionArgumentAttributeValue attrCaps = null;

+        FunctionArgumentAttributeValue attrBigString = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlankString = null;

+        FunctionArgumentAttributeValue attrBlankURI = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            String v1 = new String("abc");

+            URI bigger = new URI("abc.some.string");

+            URI biggerNoMatch = new URI("Zabc.some.string");

+            String caps = new String("AbC");

+            String bigString = "thisIsSomeReallyBigStringToMatch";

+

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(bigger));

+            attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(biggerNoMatch));

+            attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

+            attrBigString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigString));

+            attrBlankString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrBlankURI = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        

-        

-        @Test

-        public void testStringSubstring() {

-                String bigString = new String("abc some string abc");

 

-                FunctionArgumentAttributeValue attrBigString = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrDouble = null;

-        

-                FunctionArgumentAttributeValue attrInteger0 = null;

-                FunctionArgumentAttributeValue attrInteger1 = null;

-                FunctionArgumentAttributeValue attrIntegerM1 = null;

-                FunctionArgumentAttributeValue attrInteger8 = null;

-                FunctionArgumentAttributeValue attrInteger19 = null;

-                FunctionArgumentAttributeValue attrInteger20 = null;

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_ANYURI_STARTS_WITH;

 

-                

-                

-                try {

-                        attrBigString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigString));

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                        attrInteger1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                        attrIntegerM1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-1));

-                        attrInteger8 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(8));

-                        attrInteger19 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(19));

-                        attrInteger20 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(20));

-                        attrDouble = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(123.4));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_SUBSTRING;

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANYURI_STARTS_WITH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_SUBSTRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger1);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                String resValue = (String)res.getValue().getValue();

-                assertEquals("bc some", resValue);

-                

-                // edge: start

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger0);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("abc some", resValue);

-                

-                // edge: end

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger19);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals(" string abc", resValue);

-                

-                // from index to end of string

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger8);

-                arguments.add(attrIntegerM1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals(" string abc", resValue);

-                

-                // first index too low

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrIntegerM1);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring Start point '-1' out of range 0-19 for string='abc some string abc'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                

-                // second index too big

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger20);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring End point '20' out of range 0-19 for string='abc some string abc'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // indexes reversed

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring End point '1' less than start point 'null' for string='abc some string abc'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // indexes the same

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("", resValue);

-                

-                // blank string with indexes both 0

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrInteger0);

-                arguments.add(attrInteger0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("", resValue);

-                

-                // non-string first attribute

-                arguments.clear();

-                arguments.add(attrDouble);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring Expected data type 'string' saw 'double'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-integer 2nd attr

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrDouble);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring Expected data type 'integer' saw 'double'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-integer 3rd attr

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger8);

-                arguments.add(attrDouble);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring Expected data type 'integer' saw 'double'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 4 args

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger1);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 2 args

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null 1st arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // null 2nd arg

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrNull);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-substring Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

 

+        // match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBiggerNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // caps no match

+        arguments.clear();

+        arguments.add(attrCaps);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // bigger on the inside

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlankString);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlankString);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // arguments reversed

+        arguments.clear();

+        arguments.add(attrBigger);

+        arguments.add(attrV1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-starts-with Expected data type 'string' saw 'anyURI'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-starts-with Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-starts-with Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-starts-with Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+    @Test

+    public void testStringEndsWith() {

+        String v1 = new String("abc");

+        String bigger = new String("abc some string abc");

+        String biggerNoMatch = new String(" abc some string abc ");

+        String caps = new String("AbC");

+

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrBigger = null;

+        FunctionArgumentAttributeValue attrBiggerNoMatch = null;

+        FunctionArgumentAttributeValue attrCaps = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigger));

+            attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(biggerNoMatch));

+            attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        

-        

-        @Test

-        public void testAnyURISubstring() {

-                String bigString = new String("http://company.com:8080/this/is/some/long/uri");

 

-                FunctionArgumentAttributeValue attrURI = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrDouble = null;

-        

-                FunctionArgumentAttributeValue attrInteger0 = null;

-                FunctionArgumentAttributeValue attrInteger1 = null;

-                FunctionArgumentAttributeValue attrIntegerM1 = null;

-                FunctionArgumentAttributeValue attrInteger8 = null;

-                FunctionArgumentAttributeValue attrInteger45 = null;

-                FunctionArgumentAttributeValue attrInteger46 = null;

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_ENDS_WITH;

 

-                

-                

-                try {

-                        attrURI = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(bigString));

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(null));

-                        attrInteger0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

-                        attrInteger1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

-                        attrIntegerM1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-1));

-                        attrInteger8 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(8));

-                        attrInteger45 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(45));

-                        attrInteger46 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(46));

-                        attrDouble = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(123.4));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_ANYURI_SUBSTRING;

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_ENDS_WITH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANYURI_SUBSTRING, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger1);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                String resValue = (String)res.getValue().getValue();

-                assertEquals("ttp://c", resValue);

-                

-                // edge: start

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger0);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("http://c", resValue);

 

-                // edge: end

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger45);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("ompany.com:8080/this/is/some/long/uri", resValue);

-                

-                // from index to end of string

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger8);

-                arguments.add(attrIntegerM1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("ompany.com:8080/this/is/some/long/uri", resValue);

-                

-                // first index too low

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrIntegerM1);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring Start point '-1' out of range 0-45 for string='http://company.com:8080/this/is/some/long/uri'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                

-                // second index too big

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger46);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring End point '46' out of range 0-45 for string='http://company.com:8080/this/is/some/long/uri'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // indexes reversed

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring End point '1' less than start point 'null' for string='http://company.com:8080/this/is/some/long/uri'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // indexes the same

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("", resValue);

-                

-                // blank string with indexes both 0

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrInteger0);

-                arguments.add(attrInteger0);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(String.class, res.getValue().getValue().getClass());

-                resValue = (String)res.getValue().getValue();

-                assertEquals("", resValue);

-                

-                // non-string first attribute

-                arguments.clear();

-                arguments.add(attrDouble);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring Expected data type 'anyURI' saw 'double'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-integer 2nd attr

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrDouble);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring Expected data type 'integer' saw 'double'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // non-integer 3rd attr

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger8);

-                arguments.add(attrDouble);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring Expected data type 'integer' saw 'double'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 4 args

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger1);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // 2 args

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrInteger8);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null 1st arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrInteger8);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // null 2nd arg

-                arguments.clear();

-                arguments.add(attrURI);

-                arguments.add(attrNull);

-                arguments.add(attrInteger1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-substring Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        // match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBiggerNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // caps no match

+        arguments.clear();

+        arguments.add(attrCaps);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // bigger on the inside

+        arguments.clear();

+        arguments.add(attrBigger);

+        arguments.add(attrV1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-ends-with Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-ends-with Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-ends-with Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testAnyuriEndsWith() {

+

+

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrBigger = null;

+        FunctionArgumentAttributeValue attrBiggerNoMatch = null;

+        FunctionArgumentAttributeValue attrCaps = null;

+        FunctionArgumentAttributeValue attrBigString = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlankString = null;

+        FunctionArgumentAttributeValue attrBlankURI = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            String v1 = new String("abc");

+            URI bigger = new URI("abc.some.stringabc");

+            URI biggerNoMatch = new URI("Zabc.some.stringabcZ");

+            String caps = new String("AbC");

+            String bigString = "thisIsSomeReallyBigStringToMatch";

+

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(bigger));

+            attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(biggerNoMatch));

+            attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

+            attrBigString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigString));

+            attrBlankString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrBlankURI = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        

 

-        

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testStringContains() {

-                String v1 = new String("abc");

-                String bigger = new String("abc some string abc");

-                String biggerNoMatch = new String(" abc some string abc ");

-                String caps = new String("AbC");

-        

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrBigger = null;

-                FunctionArgumentAttributeValue attrBiggerNoMatch = null;

-                FunctionArgumentAttributeValue attrCaps = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlank = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigger));

-                        attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(biggerNoMatch));

-                        attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

-                        attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_CONTAINS;

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_ANYURI_ENDS_WITH;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_CONTAINS, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANYURI_ENDS_WITH, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrBiggerNoMatch);

-                arguments.add(attrV1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // caps no match

-                arguments.clear();

-                arguments.add(attrCaps);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // bigger on the inside

-                arguments.clear();

-                arguments.add(attrBigger);

-                arguments.add(attrV1);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlank);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlank);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-contains Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-contains Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // illegal arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:string-contains Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBiggerNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // caps no match

+        arguments.clear();

+        arguments.add(attrCaps);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // bigger on the inside

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlankString);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlankString);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // arguments reversed

+        arguments.clear();

+        arguments.add(attrBigger);

+        arguments.add(attrV1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-ends-with Expected data type 'string' saw 'anyURI'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-ends-with Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-ends-with Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-ends-with Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+    @Test

+    public void testStringSubstring() {

+        String bigString = new String("abc some string abc");

+

+        FunctionArgumentAttributeValue attrBigString = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrDouble = null;

+

+        FunctionArgumentAttributeValue attrInteger0 = null;

+        FunctionArgumentAttributeValue attrInteger1 = null;

+        FunctionArgumentAttributeValue attrIntegerM1 = null;

+        FunctionArgumentAttributeValue attrInteger8 = null;

+        FunctionArgumentAttributeValue attrInteger19 = null;

+        FunctionArgumentAttributeValue attrInteger20 = null;

+

+

+

+        try {

+            attrBigString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigString));

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            attrInteger1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+            attrIntegerM1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-1));

+            attrInteger8 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(8));

+            attrInteger19 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(19));

+            attrInteger20 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(20));

+            attrDouble = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(123.4));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        @Test

-        public void testAnyuriContains() {

 

-        

-                FunctionArgumentAttributeValue attrV1 = null;

-                FunctionArgumentAttributeValue attrBigger = null;

-                FunctionArgumentAttributeValue attrBiggerNoMatch = null;

-                FunctionArgumentAttributeValue attrCaps = null;

-                FunctionArgumentAttributeValue attrBigString = null;

-                FunctionArgumentAttributeValue attrNull = null;

-                FunctionArgumentAttributeValue attrBlankString = null;

-                FunctionArgumentAttributeValue attrBlankURI = null;

-                FunctionArgumentAttributeValue attrInteger = null;

-                try {

-                        String v1 = new String("abc");

-                        URI bigger = new URI("abc.some.stringabc");

-                        URI biggerNoMatch = new URI("Zabc.some.stringabcZ");

-                        String caps = new String("AbC");

-                        String bigString = "thisIsSomeReallyBigStringToMatch";

-                        

-                        attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

-                        attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(bigger));

-                        attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(biggerNoMatch));

-                        attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

-                        attrBigString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigString));

-                        attrBlankString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrBlankURI = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

-                        attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

-                        attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_ANYURI_CONTAINS;

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_SUBSTRING;

 

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_ANYURI_CONTAINS, fd.getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_SUBSTRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

 

-                

-                // match

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // no match

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrBiggerNoMatch);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // caps no match

-                arguments.clear();

-                arguments.add(attrCaps);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // bigger on the inside

-                arguments.clear();

-                arguments.add(attrBigString);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                // empty non-null first arg

-                arguments.clear();

-                arguments.add(attrBlankString);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // empty non-null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(false, resValue);

-                

-                

-                // two blanks

-                arguments.clear();

-                arguments.add(attrBlankString);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(Boolean.class, res.getValue().getValue().getClass());

-                resValue = (Boolean)res.getValue().getValue();

-                assertEquals(true, resValue);

-                

-                // arguments reversed

-                arguments.clear();

-                arguments.add(attrBigger);

-                arguments.add(attrV1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-contains Expected data type 'string' saw 'anyURI'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // null firat arg

-                arguments.clear();

-                arguments.add(attrNull);

-                arguments.add(attrBlankURI);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-contains Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null second arg

-                arguments.clear();

-                arguments.add(attrV1);

-                arguments.add(attrNull);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-contains Got null attribute", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // illegal arg type

-                arguments.clear();

-                arguments.add(attrInteger);

-                arguments.add(attrBigger);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:anyURI-contains Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger1);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        String resValue = (String)res.getValue().getValue();

+        assertEquals("bc some", resValue);

+

+        // edge: start

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger0);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("abc some", resValue);

+

+        // edge: end

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger19);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals(" string abc", resValue);

+

+        // from index to end of string

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger8);

+        arguments.add(attrIntegerM1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals(" string abc", resValue);

+

+        // first index too low

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrIntegerM1);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring Start point '-1' out of range 0-19 for string='abc some string abc'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // second index too big

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger20);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring End point '20' out of range 0-19 for string='abc some string abc'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // indexes reversed

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring End point '1' less than start point 'null' for string='abc some string abc'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // indexes the same

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("", resValue);

+

+        // blank string with indexes both 0

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrInteger0);

+        arguments.add(attrInteger0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("", resValue);

+

+        // non-string first attribute

+        arguments.clear();

+        arguments.add(attrDouble);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring Expected data type 'string' saw 'double'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // non-integer 2nd attr

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrDouble);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring Expected data type 'integer' saw 'double'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // non-integer 3rd attr

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger8);

+        arguments.add(attrDouble);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring Expected data type 'integer' saw 'double'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 4 args

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger1);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 2 args

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null 1st arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // null 2nd arg

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrNull);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-substring Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+    }

+

+

+

+

+    @Test

+    public void testAnyURISubstring() {

+        String bigString = new String("http://company.com:8080/this/is/some/long/uri");

+

+        FunctionArgumentAttributeValue attrURI = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrDouble = null;

+

+        FunctionArgumentAttributeValue attrInteger0 = null;

+        FunctionArgumentAttributeValue attrInteger1 = null;

+        FunctionArgumentAttributeValue attrIntegerM1 = null;

+        FunctionArgumentAttributeValue attrInteger8 = null;

+        FunctionArgumentAttributeValue attrInteger45 = null;

+        FunctionArgumentAttributeValue attrInteger46 = null;

+

+

+

+        try {

+            attrURI = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(bigString));

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(null));

+            attrInteger0 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(0));

+            attrInteger1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1));

+            attrIntegerM1 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(-1));

+            attrInteger8 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(8));

+            attrInteger45 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(45));

+            attrInteger46 = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(46));

+            attrDouble = new FunctionArgumentAttributeValue(DataTypes.DT_DOUBLE.createAttributeValue(123.4));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

-        

-        

+

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_ANYURI_SUBSTRING;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANYURI_SUBSTRING, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger1);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        String resValue = (String)res.getValue().getValue();

+        assertEquals("ttp://c", resValue);

+

+        // edge: start

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger0);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("http://c", resValue);

+

+        // edge: end

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger45);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("ompany.com:8080/this/is/some/long/uri", resValue);

+

+        // from index to end of string

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger8);

+        arguments.add(attrIntegerM1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("ompany.com:8080/this/is/some/long/uri", resValue);

+

+        // first index too low

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrIntegerM1);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring Start point '-1' out of range 0-45 for string='http://company.com:8080/this/is/some/long/uri'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // second index too big

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger46);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring End point '46' out of range 0-45 for string='http://company.com:8080/this/is/some/long/uri'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // indexes reversed

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring End point '1' less than start point 'null' for string='http://company.com:8080/this/is/some/long/uri'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // indexes the same

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("", resValue);

+

+        // blank string with indexes both 0

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrInteger0);

+        arguments.add(attrInteger0);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(String.class, res.getValue().getValue().getClass());

+        resValue = (String)res.getValue().getValue();

+        assertEquals("", resValue);

+

+        // non-string first attribute

+        arguments.clear();

+        arguments.add(attrDouble);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring Expected data type 'anyURI' saw 'double'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // non-integer 2nd attr

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrDouble);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring Expected data type 'integer' saw 'double'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // non-integer 3rd attr

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger8);

+        arguments.add(attrDouble);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring Expected data type 'integer' saw 'double'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 4 args

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger1);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring Expected 3 arguments, got 4", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // 2 args

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrInteger8);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring Expected 3 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null 1st arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrInteger8);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // null 2nd arg

+        arguments.clear();

+        arguments.add(attrURI);

+        arguments.add(attrNull);

+        arguments.add(attrInteger1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-substring Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+

+    @Test

+    public void testStringContains() {

+        String v1 = new String("abc");

+        String bigger = new String("abc some string abc");

+        String biggerNoMatch = new String(" abc some string abc ");

+        String caps = new String("AbC");

+

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrBigger = null;

+        FunctionArgumentAttributeValue attrBiggerNoMatch = null;

+        FunctionArgumentAttributeValue attrCaps = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlank = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigger));

+            attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(biggerNoMatch));

+            attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

+            attrBlank = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

+        }

+

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_STRING_CONTAINS;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_CONTAINS, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrBiggerNoMatch);

+        arguments.add(attrV1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // caps no match

+        arguments.clear();

+        arguments.add(attrCaps);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // bigger on the inside

+        arguments.clear();

+        arguments.add(attrBigger);

+        arguments.add(attrV1);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlank);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlank);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-contains Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-contains Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:string-contains Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+    @Test

+    public void testAnyuriContains() {

+

+

+        FunctionArgumentAttributeValue attrV1 = null;

+        FunctionArgumentAttributeValue attrBigger = null;

+        FunctionArgumentAttributeValue attrBiggerNoMatch = null;

+        FunctionArgumentAttributeValue attrCaps = null;

+        FunctionArgumentAttributeValue attrBigString = null;

+        FunctionArgumentAttributeValue attrNull = null;

+        FunctionArgumentAttributeValue attrBlankString = null;

+        FunctionArgumentAttributeValue attrBlankURI = null;

+        FunctionArgumentAttributeValue attrInteger = null;

+        try {

+            String v1 = new String("abc");

+            URI bigger = new URI("abc.some.stringabc");

+            URI biggerNoMatch = new URI("Zabc.some.stringabcZ");

+            String caps = new String("AbC");

+            String bigString = "thisIsSomeReallyBigStringToMatch";

+

+            attrV1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(v1));

+            attrBigger = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(bigger));

+            attrBiggerNoMatch = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(biggerNoMatch));

+            attrCaps = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(caps));

+            attrBigString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(bigString));

+            attrBlankString = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrBlankURI = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue(""));

+            attrNull = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(null));

+            attrInteger = new FunctionArgumentAttributeValue(DataTypes.DT_INTEGER.createAttributeValue(1234));

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

+        }

+

+        FunctionDefinitionStringFunctions<?,?> fd = (FunctionDefinitionStringFunctions<?,?>) StdFunctions.FD_ANYURI_CONTAINS;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_ANYURI_CONTAINS, fd.getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // match

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // no match

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrBiggerNoMatch);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // caps no match

+        arguments.clear();

+        arguments.add(attrCaps);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // bigger on the inside

+        arguments.clear();

+        arguments.add(attrBigString);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+        // empty non-null first arg

+        arguments.clear();

+        arguments.add(attrBlankString);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // empty non-null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(false, resValue);

+

+

+        // two blanks

+        arguments.clear();

+        arguments.add(attrBlankString);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(Boolean.class, res.getValue().getValue().getClass());

+        resValue = (Boolean)res.getValue().getValue();

+        assertEquals(true, resValue);

+

+        // arguments reversed

+        arguments.clear();

+        arguments.add(attrBigger);

+        arguments.add(attrV1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-contains Expected data type 'string' saw 'anyURI'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // null firat arg

+        arguments.clear();

+        arguments.add(attrNull);

+        arguments.add(attrBlankURI);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-contains Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null second arg

+        arguments.clear();

+        arguments.add(attrV1);

+        arguments.add(attrNull);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-contains Got null attribute", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // illegal arg type

+        arguments.clear();

+        arguments.add(attrInteger);

+        arguments.add(attrBigger);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:anyURI-contains Expected data type 'string' saw 'integer'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringNormalizeTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringNormalizeTest.java
index 93b4281..bbe1260 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringNormalizeTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionStringNormalizeTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -39,80 +39,80 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionStringNormalizeTest {

-        

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        @Test

-        public void testString_normalize_space() {

-                String initialString = "  First and last are whitespace 	";

-                FunctionArgumentAttributeValue attr1 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(initialString));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringNormalize fd = (FunctionDefinitionStringNormalize) StdFunctions.FD_STRING_NORMALIZE_SPACE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_NORMALIZE_SPACE, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                

-                // test normal add

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                String resValue = (String)res.getValue().getValue();

-                assertEquals(initialString.length() - 4, resValue.length());

-                assertTrue(initialString.trim().equals(resValue));

+

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

+

+    @Test

+    public void testString_normalize_space() {

+        String initialString = "  First and last are whitespace 	";

+        FunctionArgumentAttributeValue attr1 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(initialString));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

 

-        

-        @Test

-        public void testString_normalize_to_lower_case() {

-                String initialString = "  First and last are whitespace 	";

-                FunctionArgumentAttributeValue attr1 = null;

-                try {

-                        attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(initialString));

-                } catch (Exception e) {

-                        fail("creating attribute e="+ e);

-                }

-                

-                FunctionDefinitionStringNormalize fd = (FunctionDefinitionStringNormalize) StdFunctions.FD_STRING_NORMALIZE_TO_LOWER_CASE;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE, fd.getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

-                

-                // test normal add

-                arguments.add(attr1);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                String resValue = (String)res.getValue().getValue();

-                assertTrue(initialString.toLowerCase().equals(resValue));

+        FunctionDefinitionStringNormalize fd = (FunctionDefinitionStringNormalize) StdFunctions.FD_STRING_NORMALIZE_SPACE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_NORMALIZE_SPACE, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // test normal add

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        String resValue = (String)res.getValue().getValue();

+        assertEquals(initialString.length() - 4, resValue.length());

+        assertTrue(initialString.trim().equals(resValue));

+    }

+

+

+    @Test

+    public void testString_normalize_to_lower_case() {

+        String initialString = "  First and last are whitespace 	";

+        FunctionArgumentAttributeValue attr1 = null;

+        try {

+            attr1 = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(initialString));

+        } catch (Exception e) {

+            fail("creating attribute e="+ e);

         }

-        

+

+        FunctionDefinitionStringNormalize fd = (FunctionDefinitionStringNormalize) StdFunctions.FD_STRING_NORMALIZE_TO_LOWER_CASE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE, fd.getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_STRING.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // test normal add

+        arguments.add(attr1);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        String resValue = (String)res.getValue().getValue();

+        assertTrue(initialString.toLowerCase().equals(resValue));

+    }

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionURIStringConcatenateTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionURIStringConcatenateTest.java
index b21573d..9688d14 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionURIStringConcatenateTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionURIStringConcatenateTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -40,146 +40,146 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionURIStringConcatenateTest {

 

-        /*

-         * THE FUNCTION BEING TESTED BY THIS CLASS IS DEPRECATED

-         * uri-string-concatenate has been deprecated in XACML 3.0

-         */

+    /*

+     * THE FUNCTION BEING TESTED BY THIS CLASS IS DEPRECATED

+     * uri-string-concatenate has been deprecated in XACML 3.0

+     */

 

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

 

-        @SuppressWarnings("deprecation")

-        @Test

-        public void testURI_string_concatenate() {

 

-                // URI args

-                FunctionArgumentAttributeValue attrURI1 = null;

+    @SuppressWarnings("deprecation")

+    @Test

+    public void testURI_string_concatenate() {

 

-                

-                FunctionArgumentAttributeValue attrStrAbc = null;

-                FunctionArgumentAttributeValue attrStrSlashMno = null;

-                FunctionArgumentAttributeValue attrStrSlashInMiddle = null;

-                FunctionArgumentAttributeValue attrStrWithSpace = null;

+        // URI args

+        FunctionArgumentAttributeValue attrURI1 = null;

 

-                

-                try {

-                        attrURI1 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("http://someplace"));

-                

-                        

-                        attrStrAbc = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("Abc"));

-                        attrStrSlashMno = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("/Mno"));

-                        attrStrSlashInMiddle = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("hij/pqr"));

-                        attrStrWithSpace = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("x y z"));

-                        

 

-                } catch (Exception e) {

-                        fail("creating attributes e="+ e);

-                }

-                

-                // deprecation marking in the following line is correct - this function IS deprecated but still valid for XACML 3.0

-                FunctionDefinitionURIStringConcatenate fd = (FunctionDefinitionURIStringConcatenate) StdFunctions.FD_URI_STRING_CONCATENATE;

+        FunctionArgumentAttributeValue attrStrAbc = null;

+        FunctionArgumentAttributeValue attrStrSlashMno = null;

+        FunctionArgumentAttributeValue attrStrSlashInMiddle = null;

+        FunctionArgumentAttributeValue attrStrWithSpace = null;

 

-                // check identity and type of the thing created

-                assertEquals(XACML2.ID_FUNCTION_URI_STRING_CONCATENATE, fd.getId());

-                assertEquals(DataTypes.DT_ANYURI.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

 

-                

-                // add one string to uri

-                arguments.clear();

-                arguments.add(attrURI1);

-                arguments.add(attrStrAbc);

-                ExpressionResult res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(URI.class, res.getValue().getValue().getClass());

-                URI resValue = (URI)res.getValue().getValue();

-                assertEquals("http://someplaceAbc", resValue.toString());

-                

-                

-                // add 2 strings to uri

-                arguments.clear();

-                arguments.add(attrURI1);

-                arguments.add(attrStrAbc);

-                arguments.add(attrStrSlashMno);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(URI.class, res.getValue().getValue().getClass());

-                resValue = (URI)res.getValue().getValue();

-                assertEquals("http://someplaceAbc/Mno", resValue.toString());

-                

-                // slash in middle of string

-                arguments.clear();

-                arguments.add(attrURI1);

-                arguments.add(attrStrSlashInMiddle);

-                arguments.add(attrStrSlashMno);

-                res = fd.evaluate(null, arguments);

-                assertTrue(res.isOk());

-                assertEquals(URI.class, res.getValue().getValue().getClass());

-                resValue = (URI)res.getValue().getValue();

-                assertEquals("http://someplacehij/pqr/Mno", resValue.toString());

-                

-                // create bad uri

-                arguments.clear();

-                arguments.add(attrURI1);

-                arguments.add(attrStrWithSpace);

-                arguments.add(attrStrSlashMno);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:uri-string-concatenate Final string 'http://someplacex y z/Mno' not URI, Illegal character in authority at index 7: http://someplacex y z/Mno", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:uri-string-concatenate Expected 2 or more arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // one arg

-                arguments.clear();

-                arguments.add(attrURI1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:uri-string-concatenate Expected 2 or more arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // first arg not uri

-                arguments.clear();

-                arguments.add(attrStrAbc);

-                arguments.add(attrURI1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:uri-string-concatenate Expected data type 'anyURI' saw 'string' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                // 2nd arg not string

-                arguments.clear();

-                arguments.add(attrURI1);

-                arguments.add(attrURI1);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.isOk());

-                assertEquals("function:uri-string-concatenate Expected data type 'string' saw 'anyURI' at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        try {

+            attrURI1 = new FunctionArgumentAttributeValue(DataTypes.DT_ANYURI.createAttributeValue("http://someplace"));

+

+

+            attrStrAbc = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("Abc"));

+            attrStrSlashMno = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("/Mno"));

+            attrStrSlashInMiddle = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("hij/pqr"));

+            attrStrWithSpace = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("x y z"));

+

+

+        } catch (Exception e) {

+            fail("creating attributes e="+ e);

         }

-        

 

-        

+        // deprecation marking in the following line is correct - this function IS deprecated but still valid for XACML 3.0

+        FunctionDefinitionURIStringConcatenate fd = (FunctionDefinitionURIStringConcatenate) StdFunctions.FD_URI_STRING_CONCATENATE;

+

+        // check identity and type of the thing created

+        assertEquals(XACML2.ID_FUNCTION_URI_STRING_CONCATENATE, fd.getId());

+        assertEquals(DataTypes.DT_ANYURI.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+

+

+        // add one string to uri

+        arguments.clear();

+        arguments.add(attrURI1);

+        arguments.add(attrStrAbc);

+        ExpressionResult res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(URI.class, res.getValue().getValue().getClass());

+        URI resValue = (URI)res.getValue().getValue();

+        assertEquals("http://someplaceAbc", resValue.toString());

+

+

+        // add 2 strings to uri

+        arguments.clear();

+        arguments.add(attrURI1);

+        arguments.add(attrStrAbc);

+        arguments.add(attrStrSlashMno);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(URI.class, res.getValue().getValue().getClass());

+        resValue = (URI)res.getValue().getValue();

+        assertEquals("http://someplaceAbc/Mno", resValue.toString());

+

+        // slash in middle of string

+        arguments.clear();

+        arguments.add(attrURI1);

+        arguments.add(attrStrSlashInMiddle);

+        arguments.add(attrStrSlashMno);

+        res = fd.evaluate(null, arguments);

+        assertTrue(res.isOk());

+        assertEquals(URI.class, res.getValue().getValue().getClass());

+        resValue = (URI)res.getValue().getValue();

+        assertEquals("http://someplacehij/pqr/Mno", resValue.toString());

+

+        // create bad uri

+        arguments.clear();

+        arguments.add(attrURI1);

+        arguments.add(attrStrWithSpace);

+        arguments.add(attrStrSlashMno);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:uri-string-concatenate Final string 'http://someplacex y z/Mno' not URI, Illegal character in authority at index 7: http://someplacex y z/Mno", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:uri-string-concatenate Expected 2 or more arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // one arg

+        arguments.clear();

+        arguments.add(attrURI1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:uri-string-concatenate Expected 2 or more arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // first arg not uri

+        arguments.clear();

+        arguments.add(attrStrAbc);

+        arguments.add(attrURI1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:uri-string-concatenate Expected data type 'anyURI' saw 'string' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // 2nd arg not string

+        arguments.clear();

+        arguments.add(attrURI1);

+        arguments.add(attrURI1);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.isOk());

+        assertEquals("function:uri-string-concatenate Expected data type 'string' saw 'anyURI' at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionXPathTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionXPathTest.java
index 160853d..5e704da 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionXPathTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/functions/FunctionDefinitionXPathTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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 com.att.research.xacmlatt.pdp.std.functions;

 

 import static org.junit.Assert.assertEquals;

@@ -55,1073 +55,1077 @@
 

 /**

  * Test of PDP Functions (See XACML core spec section A.3)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class FunctionDefinitionXPathTest {

-        

-        //

-        // Strings for the Request contents

-        //

-        

-        String reqStrMainStart = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" 

-                        + "<Request xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" 

-                        + " http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"" 

-                        + " ReturnPolicyIdList=\"false\""

-                        + " CombinedDecision=\"false\""

-                        + " xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\""

-                        + " xmlns:md=\"http://www.medico.com/schemas/record\""

-                        + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"

-                        + "	<Attributes Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\">"

-                        + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">"

-                        + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Julius Hibbert</AttributeValue>"

-                        + "		</Attribute>"

-                        + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:conformance-test:test-attr\">"

-                        + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">   This  is IT!  </AttributeValue>"

-                        + "		</Attribute>"

-                        + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:conformance-test:test-attr\">"

-                        + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">   This  is IT!  </AttributeValue>"

-                        + "		</Attribute>"

-                        + "</Attributes>";

-              

-        String reqStrResourceStart =   "<Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">";

 

-        String reqStrContentMdRecord =

-                " <Content>" +

-                        "<md:record>" +

-                "<md:hospital_info>" +

-                   "<md:name>ABC Hospital</md:name>" +

-                    "<md:department>Surgery</md:department>" +

-                "</md:hospital_info>" +

-                "<md:patient_info>" +

-                    "<md:name>Bart Simpson</md:name>" +

-                    "<md:age>60</md:age>" +

-                    "<md:sex>male</md:sex>" +

-                    "<md:health_insurance>123456</md:health_insurance>" +

-                "</md:patient_info>" +

-                "<md:diagnosis_info>" +

-                    "<md:diagnosis>" +

-                        "<md:item type=\"primary\">Gastric Cancer</md:item>" +

-                        "<md:item type=\"secondary\">Hyper tension</md:item>" +

-                    "</md:diagnosis>" +

-                    "<md:pathological_diagnosis>" +

-                        "<md:diagnosis>" +

-                            "<md:item type=\"primary\">Well differentiated adeno carcinoma</md:item>" +

-                        "</md:diagnosis>" +

-                        "<md:date>2000-10-05</md:date>" +

-                        "<md:malignancy type=\"yes\"/>" +

-                    "</md:pathological_diagnosis>" +

-                "</md:diagnosis_info>  " +             

-           " </md:record>" +

-         "</Content>";

-        String reqStrMalformedContent = 

-                        " <Content>" +

-                                        "<md:record>" +

-                                "<md:hospital_info>" +

-                                   "<md:name>ABC Hospital</md:name>" +

-                                        "<md:malignancy type=\"yes\"/>" +

-                    "</Content>";

-        String reqStrResourceEnd = "    <Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:resource:resource-id\">"

-                        + "		<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#anyURI\">http://medico.com/record/patient/BartSimpson</AttributeValue>"

-                        + "  </Attribute>"

-                        + "</Attributes> ";

-        String reqStrActionStart =   "<Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\">";

+    //

+    // Strings for the Request contents

+    //

 

-        String reqStrActionEnd = "<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">"

-                        + "<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">read</AttributeValue>"

-                        + "</Attribute>"

-                        + "</Attributes> ";

-        String reqStrEnvironmentStartEnd = "  <Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\" />";

-        String reqStrMainEnd = " </Request>";

+    String reqStrMainStart = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"

+                             + "<Request xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"

+                             + " http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\""

+                             + " ReturnPolicyIdList=\"false\""

+                             + " CombinedDecision=\"false\""

+                             + " xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\""

+                             + " xmlns:md=\"http://www.medico.com/schemas/record\""

+                             + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"

+                             + "	<Attributes Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\">"

+                             + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\">"

+                             + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">Julius Hibbert</AttributeValue>"

+                             + "		</Attribute>"

+                             + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:conformance-test:test-attr\">"

+                             + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">   This  is IT!  </AttributeValue>"

+                             + "		</Attribute>"

+                             + "		<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:2.0:conformance-test:test-attr\">"

+                             + "			<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">   This  is IT!  </AttributeValue>"

+                             + "		</Attribute>"

+                             + "</Attributes>";

 

-        

-        // combined strings for convenience

-        String reqStrMainResourceStart = reqStrMainStart + reqStrResourceStart;

-        String reqStrResourceAllEnd = reqStrResourceEnd + reqStrActionStart + reqStrActionEnd + reqStrEnvironmentStartEnd + reqStrMainEnd;

-        

-        

-        /*

-         * variables useful in the following tests

-         */

-        List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

-        

-        

-        

-        // Name Spaces used in the XML as part of these examples (copied from the Conformance tests) - needed for compiling XPaths

-        NamespaceContext nameSpaceContext = new NamespaceContext() {

-            @Override

-            public Iterator<?> getPrefixes(String arg0) { return null;}

+    String reqStrResourceStart =   "<Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">";

 

-            @Override

-            public String getPrefix(String arg0) {return null;}

+    String reqStrContentMdRecord =

+        " <Content>" +

+        "<md:record>" +

+        "<md:hospital_info>" +

+        "<md:name>ABC Hospital</md:name>" +

+        "<md:department>Surgery</md:department>" +

+        "</md:hospital_info>" +

+        "<md:patient_info>" +

+        "<md:name>Bart Simpson</md:name>" +

+        "<md:age>60</md:age>" +

+        "<md:sex>male</md:sex>" +

+        "<md:health_insurance>123456</md:health_insurance>" +

+        "</md:patient_info>" +

+        "<md:diagnosis_info>" +

+        "<md:diagnosis>" +

+        "<md:item type=\"primary\">Gastric Cancer</md:item>" +

+        "<md:item type=\"secondary\">Hyper tension</md:item>" +

+        "</md:diagnosis>" +

+        "<md:pathological_diagnosis>" +

+        "<md:diagnosis>" +

+        "<md:item type=\"primary\">Well differentiated adeno carcinoma</md:item>" +

+        "</md:diagnosis>" +

+        "<md:date>2000-10-05</md:date>" +

+        "<md:malignancy type=\"yes\"/>" +

+        "</md:pathological_diagnosis>" +

+        "</md:diagnosis_info>  " +

+        " </md:record>" +

+        "</Content>";

+    String reqStrMalformedContent =

+        " <Content>" +

+        "<md:record>" +

+        "<md:hospital_info>" +

+        "<md:name>ABC Hospital</md:name>" +

+        "<md:malignancy type=\"yes\"/>" +

+        "</Content>";

+    String reqStrResourceEnd = "    <Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:resource:resource-id\">"

+                               + "		<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#anyURI\">http://medico.com/record/patient/BartSimpson</AttributeValue>"

+                               + "  </Attribute>"

+                               + "</Attributes> ";

+    String reqStrActionStart =   "<Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\">";

 

-            @Override

-            public String getNamespaceURI(String arg0) {

-                if("md".equals(arg0)) {

-                    return "http://www.medico.com/schemas/record";

-                } else if ("xacml-context".equals(arg0)) {

-                        return "urn:oasis:names:tc:xacml:3.0:context:schema:os";

-                } else if ("xsi".equals(arg0)) {

-                        return "http://www.w3.org/2001/XMLSchema-instance";

-                }

-                return null;

+    String reqStrActionEnd = "<Attribute IncludeInResult=\"false\" AttributeId=\"urn:oasis:names:tc:xacml:1.0:action:action-id\">"

+                             + "<AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">read</AttributeValue>"

+                             + "</Attribute>"

+                             + "</Attributes> ";

+    String reqStrEnvironmentStartEnd = "  <Attributes Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\" />";

+    String reqStrMainEnd = " </Request>";

+

+

+    // combined strings for convenience

+    String reqStrMainResourceStart = reqStrMainStart + reqStrResourceStart;

+    String reqStrResourceAllEnd = reqStrResourceEnd + reqStrActionStart + reqStrActionEnd + reqStrEnvironmentStartEnd + reqStrMainEnd;

+

+

+    /*

+     * variables useful in the following tests

+     */

+    List<FunctionArgument> arguments = new ArrayList<FunctionArgument>();

+

+

+

+    // Name Spaces used in the XML as part of these examples (copied from the Conformance tests) - needed for compiling XPaths

+    NamespaceContext nameSpaceContext = new NamespaceContext() {

+        @Override

+        public Iterator<?> getPrefixes(String arg0) {

+            return null;

+        }

+

+        @Override

+        public String getPrefix(String arg0) {

+            return null;

+        }

+

+        @Override

+        public String getNamespaceURI(String arg0) {

+            if("md".equals(arg0)) {

+                return "http://www.medico.com/schemas/record";

+            } else if ("xacml-context".equals(arg0)) {

+                return "urn:oasis:names:tc:xacml:3.0:context:schema:os";

+            } else if ("xsi".equals(arg0)) {

+                return "http://www.w3.org/2001/XMLSchema-instance";

             }

-        };

-        

-        

-        

-        //

-        // XPath Function Attributes available for use in tests  (representing appropriate fragment of Policy)

-        //

-        

-        FunctionArgumentAttributeValue attrXnull = null;

-        FunctionArgumentAttributeValue attrXEmpty = null;

-        FunctionArgumentAttributeValue attrXNoCategory = null;

-        FunctionArgumentAttributeValue attrXNoValue = null;

-        FunctionArgumentAttributeValue attrXSlashSlashMdRecord = null;

-        FunctionArgumentAttributeValue attrXSlashSlashStar = null;

-        FunctionArgumentAttributeValue attrXSlashSlashMdName = null;

-        FunctionArgumentAttributeValue attrXSlashSlashMdMalignancy = null;

-        FunctionArgumentAttributeValue attrXNotInRequest = null;

-        FunctionArgumentAttributeValue attrXSlashSlashMdRecordSlashStar = null;

-        FunctionArgumentAttributeValue attrXMdPatientInfo = null;

-        

-        FunctionArgumentAttributeValue attrBadType = null;

-

-        // String version of attrs for use in Deprecated functions

-        FunctionArgumentAttributeValue attrStrnull = null;

-        FunctionArgumentAttributeValue attrStrEmpty = null;

-        FunctionArgumentAttributeValue attrStrNoCategory = null;

-        FunctionArgumentAttributeValue attrStrNoValue = null;

-        FunctionArgumentAttributeValue attrStrSlashSlashMdRecord = null;

-        FunctionArgumentAttributeValue attrStrSlashSlashStar = null;

-        FunctionArgumentAttributeValue attrStrSlashSlashMdName = null;

-        FunctionArgumentAttributeValue attrStrSlashSlashMdMalignancy = null;

-        FunctionArgumentAttributeValue attrStrNotInRequest = null;

-        FunctionArgumentAttributeValue attrStrSlashSlashMdRecordSlashStar = null;

-        FunctionArgumentAttributeValue attrStrMdPatientInfo = null;

-        

-        

-        //

-        // REQUEST objects available for use in tests

-        //

-        Request requestEmpty = new StdRequest(StdStatus.STATUS_OK);

-        Request requestMdRecord = null;

-        Request requestDoubleResources = null;

-        Request requestResourceActionContent = null;

-        Request requestContentInAction = null;

-

-

-        

-        

-        /**

-         * Set up all variables in one place because it is complicated (lots of steps needed for each attribute)

-         */

-        public FunctionDefinitionXPathTest() {

-                try {

-                        XPathFactory xPathFactory = XPathFactory.newInstance();

-                        XPath xpath = xPathFactory.newXPath();

-                        xpath.setNamespaceContext(nameSpaceContext);

-                        

-                        // Create XPaths to use in expressions

-                        XPathExpressionWrapper xEmpty = new XPathExpressionWrapper("");

-                        XPathExpressionWrapper xSlashSlashMdRecord = new XPathExpressionWrapper(xpath.compile("//md:record"));

-                        XPathExpressionWrapper xSlashSlashStar = new XPathExpressionWrapper(xpath.compile("//*"));

-                        XPathExpressionWrapper xSlashSlashMdName = new XPathExpressionWrapper(xpath.compile("//md:name"));

-                        XPathExpressionWrapper xSlashSlashMdMalignancy = new XPathExpressionWrapper(xpath.compile("//md:malignancy"));

-                        XPathExpressionWrapper xNotInRequest = new XPathExpressionWrapper(xpath.compile("value_Not_in_request"));

-                        XPathExpressionWrapper xSlashSlashMdRecordSlashStar = new XPathExpressionWrapper(xpath.compile("//md:record/*"));

-                        XPathExpressionWrapper xMdPatientInfo = new XPathExpressionWrapper(xpath.compile("md:patient_info"));

-

-        

-                        

-                        // create Function Attributes out of the XPathExpressions

-                        attrXnull = new FunctionArgumentAttributeValue(null);

-                        attrXEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xEmpty));

-                        attrXNoCategory = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdRecord));

-                        attrXNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xEmpty,

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrXSlashSlashMdRecord = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdRecord,

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrXSlashSlashStar = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashStar,

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrXSlashSlashMdName = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdName,

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrXSlashSlashMdMalignancy = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdMalignancy,

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrXNotInRequest = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xNotInRequest,

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        

-                        attrXSlashSlashMdRecordSlashStar = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdRecordSlashStar,

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrXMdPatientInfo = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xMdPatientInfo,

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));	

-                        

-                        

-                        // Deprecated versions of args

-                        attrStrnull = new FunctionArgumentAttributeValue(null);

-                        attrStrEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

-                        attrStrNoCategory = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:record"));

-                        attrStrNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("",

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrStrSlashSlashMdRecord = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:record",

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrStrSlashSlashStar = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//*",

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrStrSlashSlashMdName = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:name",

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrStrSlashSlashMdMalignancy = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:malignancy",

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrStrNotInRequest = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("value_Not_in_request",

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        

-                        attrStrSlashSlashMdRecordSlashStar = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:record/*",

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

-                        attrStrMdPatientInfo = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("md:patient_info",

-                                        new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));	

-                        

-                        

-                        

-                        

-                        attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("some string"));

-                

-                        

-                        

-                        // Request objects

-                        // to create a Request object the easiest way is to put the xml into a file and use the DOMRequest to load it.

-                        

-                        // single Content in the Resources section (normal valid request)

-                        String reqString = reqStrMainResourceStart + reqStrContentMdRecord + reqStrResourceAllEnd;

-                                File tFile = File.createTempFile("functionJunit", "request");

-                                BufferedWriter bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        requestMdRecord = DOMRequest.load(tFile);

-                                tFile.delete();

-                                

-                        // Resources included twice

-                        reqString = reqStrMainResourceStart + reqStrContentMdRecord + reqStrResourceEnd + reqStrResourceStart + reqStrContentMdRecord +reqStrResourceAllEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        requestDoubleResources = DOMRequest.load(tFile);

-                                tFile.delete();

-                                        

-                                

-                        // content included in both Resource and Action - ok

-                        reqString = reqStrMainResourceStart + reqStrContentMdRecord + reqStrResourceEnd + reqStrActionStart + reqStrContentMdRecord + reqStrActionEnd + reqStrMainEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();	

-                        requestResourceActionContent = DOMRequest.load(tFile);

-                                tFile.delete();

-                                

-                        // Content included only in Action - missing content produces non-error result according to spec

-                        reqString = reqStrMainResourceStart + reqStrResourceEnd + reqStrActionStart + reqStrContentMdRecord + reqStrActionEnd + reqStrMainEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();		

-                        requestContentInAction = DOMRequest.load(tFile);

-                                tFile.delete();

-                        

-                                

-                                

-                        // Test that Bad XML is caught

-                        @SuppressWarnings("unused")

-                        Request requestContentMisplaced = null;

-                        @SuppressWarnings("unused")

-                        Request requestMalformedContent = null;

-                        @SuppressWarnings("unused")

-                        Request requestDoubleContent = null;

-

-                        

-                        // Content included twice - error

-                        reqString = reqStrMainResourceStart + reqStrContentMdRecord + reqStrContentMdRecord +reqStrResourceAllEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        try {

-                                requestDoubleContent = DOMRequest.load(tFile);

-                                        tFile.delete();

-                        } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

-                                // this is what it should do, so just continue

-                        } catch (Exception e) {

-                                fail("Unexpected exception for bad XML, e="+e);

-                        }	

-                                

-                        // Bad XML - Content not under a Category

-                        reqString = reqStrMainStart + reqStrContentMdRecord + reqStrResourceStart + reqStrResourceEnd + reqStrActionStart + reqStrActionEnd + reqStrMainEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        try {

-                                requestContentMisplaced = DOMRequest.load(tFile);

-                                        tFile.delete();

-                        } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

-                                // this is what it should do, so just continue

-                        } catch (Exception e) {

-                                fail("Unexpected exception for bad XML, e="+e);

-                        }

-                                

-                        // Bad XML - Content is not valid XML

-                        reqString = reqStrMainResourceStart + reqStrMalformedContent + reqStrResourceAllEnd;

-                                tFile = File.createTempFile("functionJunit", "request");

-                                bw = new BufferedWriter(new FileWriter(tFile));

-                                bw.append(reqString);

-                                bw.flush();

-                                bw.close();

-                        try {

-                                requestMalformedContent = DOMRequest.load(tFile);

-                                        tFile.delete();

-                        } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

-                                // this is what it should do, so just continue

-                        } catch (Exception e) {

-                                fail("Unexpected exception for bad XML, e="+e);

-                        }

-                        

-                } catch (Exception e) {

-                        fail("Constructor initializing variables, e="+ e + "  cause="+e.getCause());

-                }

-                

+            return null;

         }

-        

-

-        

-        

-        

-        

-        

-        

-        @Test

-        public void testXpath_node_count() {

+    };

 

 

-                

-                FunctionDefinitionXPath<?> fd = (FunctionDefinitionXPath<?>) StdFunctions.FD_XPATH_NODE_COUNT;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_XPATH_NODE_COUNT, fd.getId());

-                assertEquals(DataTypes.DT_XPATHEXPRESSION.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(1), fd.getNumArgs());

-                

 

-                // match all elements within context

-                arguments.clear();

-                arguments.add(attrXSlashSlashStar);

-                ExpressionResult res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                BigInteger resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("18"), resValue);

-        

-                // match exactly 1 element

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdMalignancy);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("1"), resValue);

-                

-                // match a few but not all

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("2"), resValue);

-                

-                

-                // verify variables using in other tests: count nodes immediately under md:record

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecordSlashStar);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("3"), resValue);

-                

-                // verify variables using in other tests: count number of records containing patient_info

-                arguments.clear();

-                arguments.add(attrXMdPatientInfo);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("1"), resValue);

-                

-                // verify variables using in other tests: count number of records containing md:name

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("2"), resValue);

-                

-                // verify variables using in other tests: count number of records containing md:malignancy

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdMalignancy);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("1"), resValue);

-                

-                

-                

-                

-                // match no element

-                arguments.clear();

-                arguments.add(attrXNotInRequest);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("0"), resValue);

-                

-                // Resources included twice

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestDoubleResources, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count More than one Content section for id 'urn:oasis:names:tc:xacml:3.0:attribute-category:resource'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+    //

+    // XPath Function Attributes available for use in tests  (representing appropriate fragment of Policy)

+    //

 

-                // Content in both Resource and Action categories (ok)

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestResourceActionContent, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("2"), resValue);

+    FunctionArgumentAttributeValue attrXnull = null;

+    FunctionArgumentAttributeValue attrXEmpty = null;

+    FunctionArgumentAttributeValue attrXNoCategory = null;

+    FunctionArgumentAttributeValue attrXNoValue = null;

+    FunctionArgumentAttributeValue attrXSlashSlashMdRecord = null;

+    FunctionArgumentAttributeValue attrXSlashSlashStar = null;

+    FunctionArgumentAttributeValue attrXSlashSlashMdName = null;

+    FunctionArgumentAttributeValue attrXSlashSlashMdMalignancy = null;

+    FunctionArgumentAttributeValue attrXNotInRequest = null;

+    FunctionArgumentAttributeValue attrXSlashSlashMdRecordSlashStar = null;

+    FunctionArgumentAttributeValue attrXMdPatientInfo = null;

 

-                // Content only in Action category (missing in Resources -> 0 according to spec)

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestContentInAction, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (BigInteger)res.getValue().getValue();

-                assertEquals(new BigInteger("0"), resValue);

+    FunctionArgumentAttributeValue attrBadType = null;

 

-                

+    // String version of attrs for use in Deprecated functions

+    FunctionArgumentAttributeValue attrStrnull = null;

+    FunctionArgumentAttributeValue attrStrEmpty = null;

+    FunctionArgumentAttributeValue attrStrNoCategory = null;

+    FunctionArgumentAttributeValue attrStrNoValue = null;

+    FunctionArgumentAttributeValue attrStrSlashSlashMdRecord = null;

+    FunctionArgumentAttributeValue attrStrSlashSlashStar = null;

+    FunctionArgumentAttributeValue attrStrSlashSlashMdName = null;

+    FunctionArgumentAttributeValue attrStrSlashSlashMdMalignancy = null;

+    FunctionArgumentAttributeValue attrStrNotInRequest = null;

+    FunctionArgumentAttributeValue attrStrSlashSlashMdRecordSlashStar = null;

+    FunctionArgumentAttributeValue attrStrMdPatientInfo = null;

 

-                

+

+    //

+    // REQUEST objects available for use in tests

+    //

+    Request requestEmpty = new StdRequest(StdStatus.STATUS_OK);

+    Request requestMdRecord = null;

+    Request requestDoubleResources = null;

+    Request requestResourceActionContent = null;

+    Request requestContentInAction = null;

+

+

+

+

+    /**

+     * Set up all variables in one place because it is complicated (lots of steps needed for each attribute)

+     */

+    public FunctionDefinitionXPathTest() {

+        try {

+            XPathFactory xPathFactory = XPathFactory.newInstance();

+            XPath xpath = xPathFactory.newXPath();

+            xpath.setNamespaceContext(nameSpaceContext);

+

+            // Create XPaths to use in expressions

+            XPathExpressionWrapper xEmpty = new XPathExpressionWrapper("");

+            XPathExpressionWrapper xSlashSlashMdRecord = new XPathExpressionWrapper(xpath.compile("//md:record"));

+            XPathExpressionWrapper xSlashSlashStar = new XPathExpressionWrapper(xpath.compile("//*"));

+            XPathExpressionWrapper xSlashSlashMdName = new XPathExpressionWrapper(xpath.compile("//md:name"));

+            XPathExpressionWrapper xSlashSlashMdMalignancy = new XPathExpressionWrapper(xpath.compile("//md:malignancy"));

+            XPathExpressionWrapper xNotInRequest = new XPathExpressionWrapper(xpath.compile("value_Not_in_request"));

+            XPathExpressionWrapper xSlashSlashMdRecordSlashStar = new XPathExpressionWrapper(xpath.compile("//md:record/*"));

+            XPathExpressionWrapper xMdPatientInfo = new XPathExpressionWrapper(xpath.compile("md:patient_info"));

+

+

+

+            // create Function Attributes out of the XPathExpressions

+            attrXnull = new FunctionArgumentAttributeValue(null);

+            attrXEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xEmpty));

+            attrXNoCategory = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdRecord));

+            attrXNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xEmpty,

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrXSlashSlashMdRecord = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdRecord,

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrXSlashSlashStar = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashStar,

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrXSlashSlashMdName = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdName,

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrXSlashSlashMdMalignancy = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdMalignancy,

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrXNotInRequest = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xNotInRequest,

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+

+            attrXSlashSlashMdRecordSlashStar = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xSlashSlashMdRecordSlashStar,

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrXMdPatientInfo = new FunctionArgumentAttributeValue(DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xMdPatientInfo,

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+

+

+            // Deprecated versions of args

+            attrStrnull = new FunctionArgumentAttributeValue(null);

+            attrStrEmpty = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue(""));

+            attrStrNoCategory = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:record"));

+            attrStrNoValue = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("",

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrStrSlashSlashMdRecord = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:record",

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrStrSlashSlashStar = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//*",

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrStrSlashSlashMdName = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:name",

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrStrSlashSlashMdMalignancy = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:malignancy",

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrStrNotInRequest = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("value_Not_in_request",

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+

+            attrStrSlashSlashMdRecordSlashStar = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("//md:record/*",

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+            attrStrMdPatientInfo = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("md:patient_info",

+                    new IdentifierImpl("urn:oasis:names:tc:xacml:3.0:attribute-category:resource" )));

+

+

+

+

+            attrBadType = new FunctionArgumentAttributeValue(DataTypes.DT_STRING.createAttributeValue("some string"));

+

+

+

+            // Request objects

+            // to create a Request object the easiest way is to put the xml into a file and use the DOMRequest to load it.

+

+            // single Content in the Resources section (normal valid request)

+            String reqString = reqStrMainResourceStart + reqStrContentMdRecord + reqStrResourceAllEnd;

+            File tFile = File.createTempFile("functionJunit", "request");

+            BufferedWriter bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            requestMdRecord = DOMRequest.load(tFile);

+            tFile.delete();

+

+            // Resources included twice

+            reqString = reqStrMainResourceStart + reqStrContentMdRecord + reqStrResourceEnd + reqStrResourceStart + reqStrContentMdRecord +reqStrResourceAllEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            requestDoubleResources = DOMRequest.load(tFile);

+            tFile.delete();

+

+

+            // content included in both Resource and Action - ok

+            reqString = reqStrMainResourceStart + reqStrContentMdRecord + reqStrResourceEnd + reqStrActionStart + reqStrContentMdRecord + reqStrActionEnd + reqStrMainEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            requestResourceActionContent = DOMRequest.load(tFile);

+            tFile.delete();

+

+            // Content included only in Action - missing content produces non-error result according to spec

+            reqString = reqStrMainResourceStart + reqStrResourceEnd + reqStrActionStart + reqStrContentMdRecord + reqStrActionEnd + reqStrMainEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            requestContentInAction = DOMRequest.load(tFile);

+            tFile.delete();

+

+

+

+            // Test that Bad XML is caught

+            @SuppressWarnings("unused")

+            Request requestContentMisplaced = null;

+            @SuppressWarnings("unused")

+            Request requestMalformedContent = null;

+            @SuppressWarnings("unused")

+            Request requestDoubleContent = null;

+

+

+            // Content included twice - error

+            reqString = reqStrMainResourceStart + reqStrContentMdRecord + reqStrContentMdRecord +reqStrResourceAllEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            try {

+                requestDoubleContent = DOMRequest.load(tFile);

+                tFile.delete();

+            } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

+                // this is what it should do, so just continue

+            } catch (Exception e) {

+                fail("Unexpected exception for bad XML, e="+e);

+            }

+

+            // Bad XML - Content not under a Category

+            reqString = reqStrMainStart + reqStrContentMdRecord + reqStrResourceStart + reqStrResourceEnd + reqStrActionStart + reqStrActionEnd + reqStrMainEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            try {

+                requestContentMisplaced = DOMRequest.load(tFile);

+                tFile.delete();

+            } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

+                // this is what it should do, so just continue

+            } catch (Exception e) {

+                fail("Unexpected exception for bad XML, e="+e);

+            }

+

+            // Bad XML - Content is not valid XML

+            reqString = reqStrMainResourceStart + reqStrMalformedContent + reqStrResourceAllEnd;

+            tFile = File.createTempFile("functionJunit", "request");

+            bw = new BufferedWriter(new FileWriter(tFile));

+            bw.append(reqString);

+            bw.flush();

+            bw.close();

+            try {

+                requestMalformedContent = DOMRequest.load(tFile);

+                tFile.delete();

+            } catch (com.att.research.xacml.std.dom.DOMStructureException e) {

+                // this is what it should do, so just continue

+            } catch (Exception e) {

+                fail("Unexpected exception for bad XML, e="+e);

+            }

+

+        } catch (Exception e) {

+            fail("Constructor initializing variables, e="+ e + "  cause="+e.getCause());

+        }

+

+    }

+

+

+

+

+

+

+

+

+    @Test

+    public void testXpath_node_count() {

+

+

+

+        FunctionDefinitionXPath<?> fd = (FunctionDefinitionXPath<?>) StdFunctions.FD_XPATH_NODE_COUNT;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_XPATH_NODE_COUNT, fd.getId());

+        assertEquals(DataTypes.DT_XPATHEXPRESSION.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_INTEGER.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(1), fd.getNumArgs());

+

+

+        // match all elements within context

+        arguments.clear();

+        arguments.add(attrXSlashSlashStar);

+        ExpressionResult res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        BigInteger resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("18"), resValue);

+

+        // match exactly 1 element

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdMalignancy);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("1"), resValue);

+

+        // match a few but not all

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("2"), resValue);

+

+

+        // verify variables using in other tests: count nodes immediately under md:record

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecordSlashStar);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("3"), resValue);

+

+        // verify variables using in other tests: count number of records containing patient_info

+        arguments.clear();

+        arguments.add(attrXMdPatientInfo);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("1"), resValue);

+

+        // verify variables using in other tests: count number of records containing md:name

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("2"), resValue);

+

+        // verify variables using in other tests: count number of records containing md:malignancy

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdMalignancy);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("1"), resValue);

+

+

+

+

+        // match no element

+        arguments.clear();

+        arguments.add(attrXNotInRequest);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("0"), resValue);

+

+        // Resources included twice

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestDoubleResources, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count More than one Content section for id 'urn:oasis:names:tc:xacml:3.0:attribute-category:resource'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // Content in both Resource and Action categories (ok)

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestResourceActionContent, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("2"), resValue);

+

+        // Content only in Action category (missing in Resources -> 0 according to spec)

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestContentInAction, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (BigInteger)res.getValue().getValue();

+        assertEquals(new BigInteger("0"), resValue);

+

+

+

+

 //TODO - any other tests????

-                

-                // null Evaluation Context

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count Got null EvaluationContext", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null Request

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(null, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count Got null Request in EvaluationContext", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null attribute

-                arguments.clear();

-                arguments.add(attrXnull);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count Got null attribute at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no value

-                arguments.clear();

-                arguments.add(attrXNoValue);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no category

-                arguments.clear();

-                arguments.add(attrXNoCategory);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count Got null Category at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

 

-                // too many args

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count Expected 1 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count Expected data type 'xpathExpression' saw 'string' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null args

-                arguments.clear();

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-count Got null argument at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        }

+        // null Evaluation Context

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count Got null EvaluationContext", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-        

-        @Test

-        public void testXpath_node_equal() {

+        // null Request

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(null, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count Got null Request in EvaluationContext", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                FunctionDefinitionXPath<?> fd = (FunctionDefinitionXPath<?>) StdFunctions.FD_XPATH_NODE_EQUAL;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_XPATH_NODE_EQUAL, fd.getId());

-                assertEquals(DataTypes.DT_XPATHEXPRESSION.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal success - exactly the same set

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdName);

-                ExpressionResult res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // success - second list is subset of first list

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecordSlashStar);

-                arguments.add(attrXMdPatientInfo);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // success - first list is subset of second list

-                arguments.clear();

-                arguments.add(attrXMdPatientInfo);

-                arguments.add(attrXSlashSlashMdRecordSlashStar);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // success - second list contains children of first list

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // success - first list contains children of second list

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

+        // null attribute

+        arguments.clear();

+        arguments.add(attrXnull);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count Got null attribute at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                

-                // two non-overlapping sets

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdMalignancy);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first list contains nothing

-                arguments.clear();

-                arguments.add(attrXNotInRequest);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // second list contains nothing

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXNotInRequest);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);		

-                

-                

-                

-//TODO	

-                //?????

-                ///??????? add real tests

-                //////

-                

-                

-                // Resources included twice

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestDoubleResources, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal More than one Content section for id 'urn:oasis:names:tc:xacml:3.0:attribute-category:resource'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

+        // no value

+        arguments.clear();

+        arguments.add(attrXNoValue);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // Content in both Resource and Action categories (ok)

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestResourceActionContent, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // no category

+        arguments.clear();

+        arguments.add(attrXNoCategory);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count Got null Category at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // Content only in Action category (missing in Resources -> 0 according to spec)

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestContentInAction, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                

-                // null Evaluation Context

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Got null EvaluationContext", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null Request

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(null, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Got null Request in EvaluationContext", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null attribute

-                arguments.clear();

-                arguments.add(attrXnull);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Got null attribute at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXnull);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Got null attribute at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no value

-                arguments.clear();

-                arguments.add(attrXNoValue);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXNoValue);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no category

-                arguments.clear();

-                arguments.add(attrXNoCategory);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Got null Category at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXNoCategory);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                arguments.add(attrXEmpty);

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrBadType);

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Expected data type 'xpathExpression' saw 'string' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Expected data type 'xpathExpression' saw 'string' at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null args

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Got null argument at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-equal Got null argument at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-        }

-        

-        

-        

-        

-        @Test

-        public void testXpath_node_match() {

 

-                

-                FunctionDefinitionXPath<?> fd = (FunctionDefinitionXPath<?>) StdFunctions.FD_XPATH_NODE_MATCH;

-                

-                // check identity and type of the thing created

-                assertEquals(XACML3.ID_FUNCTION_XPATH_NODE_MATCH, fd.getId());

-                assertEquals(DataTypes.DT_XPATHEXPRESSION.getId(), fd.getDataTypeArgs().getId());

-                assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

-                

-                // just to be safe...  If tests take too long these can probably be eliminated

-                assertFalse(fd.returnsBag());

-                assertEquals(new Integer(2), fd.getNumArgs());

-                

-                

-                // test normal success - exactly the same set

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdName);

-                ExpressionResult res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                Boolean resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // success - second list is subset of first list

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecordSlashStar);

-                arguments.add(attrXMdPatientInfo);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // success - first list is subset of second list

-                arguments.clear();

-                arguments.add(attrXMdPatientInfo);

-                arguments.add(attrXSlashSlashMdRecordSlashStar);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // success - second list contains children of first list

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

-                

-                // success - first list contains children of second list

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                

-                

-                // two non-overlapping sets

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdMalignancy);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // first list contains nothing

-                arguments.clear();

-                arguments.add(attrXNotInRequest);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                // second list contains nothing

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXNotInRequest);

-                res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);	

-                

-//TODO		

-                //?????

-                ///??????? add real tests

-                //////

-                

-                

-                // Resources included twice

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestDoubleResources, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match More than one Content section for id 'urn:oasis:names:tc:xacml:3.0:attribute-category:resource'", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

+        // too many args

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count Expected 1 arguments, got 2", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // Content in both Resource and Action categories (ok)

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestResourceActionContent, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertTrue(resValue);

+        // too few args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count Expected 1 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-                // Content only in Action category (missing in Resources -> 0 according to spec)

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdName);

-                arguments.add(attrXSlashSlashMdName);

-                res = fd.evaluate(new StdEvaluationContext(requestContentInAction, null, null), arguments);

-                assertTrue(res.isOk());

-                resValue = (Boolean)res.getValue().getValue();

-                assertFalse(resValue);

-                

-                

-                // null Evaluation Context

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Got null EvaluationContext", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null Request

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(null, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Got null Request in EvaluationContext", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null attribute

-                arguments.clear();

-                arguments.add(attrXnull);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Got null attribute at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXnull);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Got null attribute at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no value

-                arguments.clear();

-                arguments.add(attrXNoValue);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXNoValue);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // no category

-                arguments.clear();

-                arguments.add(attrXNoCategory);

-                arguments.add(attrXSlashSlashMdRecord);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Got null Category at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXSlashSlashMdRecord);

-                arguments.add(attrXNoCategory);

-                res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too many args

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                arguments.add(attrXEmpty);

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // too few args

-                arguments.clear();

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                        

-                // bad arg type

-                arguments.clear();

-                arguments.add(attrBadType);

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Expected data type 'xpathExpression' saw 'string' at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                arguments.add(attrBadType);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Expected data type 'xpathExpression' saw 'string' at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                // null args

-                arguments.clear();

-                arguments.add(attrXEmpty);

-                arguments.add(null);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Got null argument at arg index 1", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                arguments.clear();

-                arguments.add(null);

-                arguments.add(attrXEmpty);

-                res = fd.evaluate(null, arguments);

-                assertFalse(res.getStatus().isOk());

-                assertEquals( "function:xpath-node-match Got null argument at arg index 0", res.getStatus().getStatusMessage());

-                assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

-                

-                

-                

-        }

-        

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count Expected data type 'xpathExpression' saw 'string' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-        

-        //

-        // DEPRECATED versions that use String arguments rather than XPATHEXPRESSIONs

-        // are NOT supported due to ambiguity in the semantics between 2.0 (<Request> is root and has only one <Content> in resources)

-        //	and 3.0 (<Content> is root and there are multiple <Content> sections in any category)

-        //

-        

+        // null args

+        arguments.clear();

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-count Got null argument at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

 

-        

+    }

+

+

+    @Test

+    public void testXpath_node_equal() {

+

+

+        FunctionDefinitionXPath<?> fd = (FunctionDefinitionXPath<?>) StdFunctions.FD_XPATH_NODE_EQUAL;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_XPATH_NODE_EQUAL, fd.getId());

+        assertEquals(DataTypes.DT_XPATHEXPRESSION.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal success - exactly the same set

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdName);

+        ExpressionResult res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // success - second list is subset of first list

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecordSlashStar);

+        arguments.add(attrXMdPatientInfo);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // success - first list is subset of second list

+        arguments.clear();

+        arguments.add(attrXMdPatientInfo);

+        arguments.add(attrXSlashSlashMdRecordSlashStar);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // success - second list contains children of first list

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // success - first list contains children of second list

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+

+

+        // two non-overlapping sets

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdMalignancy);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first list contains nothing

+        arguments.clear();

+        arguments.add(attrXNotInRequest);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // second list contains nothing

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXNotInRequest);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+

+

+//TODO

+        //?????

+        ///??????? add real tests

+        //////

+

+

+        // Resources included twice

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestDoubleResources, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal More than one Content section for id 'urn:oasis:names:tc:xacml:3.0:attribute-category:resource'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+

+        // Content in both Resource and Action categories (ok)

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestResourceActionContent, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // Content only in Action category (missing in Resources -> 0 according to spec)

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestContentInAction, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+

+        // null Evaluation Context

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Got null EvaluationContext", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null Request

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(null, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Got null Request in EvaluationContext", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null attribute

+        arguments.clear();

+        arguments.add(attrXnull);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Got null attribute at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXnull);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Got null attribute at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no value

+        arguments.clear();

+        arguments.add(attrXNoValue);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXNoValue);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no category

+        arguments.clear();

+        arguments.add(attrXNoCategory);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Got null Category at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXNoCategory);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        arguments.add(attrXEmpty);

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too few args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrBadType);

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Expected data type 'xpathExpression' saw 'string' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Expected data type 'xpathExpression' saw 'string' at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null args

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Got null argument at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-equal Got null argument at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+    }

+

+

+

+

+    @Test

+    public void testXpath_node_match() {

+

+

+        FunctionDefinitionXPath<?> fd = (FunctionDefinitionXPath<?>) StdFunctions.FD_XPATH_NODE_MATCH;

+

+        // check identity and type of the thing created

+        assertEquals(XACML3.ID_FUNCTION_XPATH_NODE_MATCH, fd.getId());

+        assertEquals(DataTypes.DT_XPATHEXPRESSION.getId(), fd.getDataTypeArgs().getId());

+        assertEquals(DataTypes.DT_BOOLEAN.getId(), fd.getDataTypeId());

+

+        // just to be safe...  If tests take too long these can probably be eliminated

+        assertFalse(fd.returnsBag());

+        assertEquals(new Integer(2), fd.getNumArgs());

+

+

+        // test normal success - exactly the same set

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdName);

+        ExpressionResult res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        Boolean resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // success - second list is subset of first list

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecordSlashStar);

+        arguments.add(attrXMdPatientInfo);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // success - first list is subset of second list

+        arguments.clear();

+        arguments.add(attrXMdPatientInfo);

+        arguments.add(attrXSlashSlashMdRecordSlashStar);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // success - second list contains children of first list

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // success - first list contains children of second list

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+

+

+        // two non-overlapping sets

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdMalignancy);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // first list contains nothing

+        arguments.clear();

+        arguments.add(attrXNotInRequest);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+        // second list contains nothing

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXNotInRequest);

+        res = fd.evaluate(new StdEvaluationContext(requestMdRecord, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+//TODO

+        //?????

+        ///??????? add real tests

+        //////

+

+

+        // Resources included twice

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestDoubleResources, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match More than one Content section for id 'urn:oasis:names:tc:xacml:3.0:attribute-category:resource'", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+        // Content in both Resource and Action categories (ok)

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestResourceActionContent, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertTrue(resValue);

+

+        // Content only in Action category (missing in Resources -> 0 according to spec)

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdName);

+        arguments.add(attrXSlashSlashMdName);

+        res = fd.evaluate(new StdEvaluationContext(requestContentInAction, null, null), arguments);

+        assertTrue(res.isOk());

+        resValue = (Boolean)res.getValue().getValue();

+        assertFalse(resValue);

+

+

+        // null Evaluation Context

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Got null EvaluationContext", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null Request

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(null, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Got null Request in EvaluationContext", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null attribute

+        arguments.clear();

+        arguments.add(attrXnull);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Got null attribute at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXnull);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Got null attribute at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no value

+        arguments.clear();

+        arguments.add(attrXNoValue);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXNoValue);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // no category

+        arguments.clear();

+        arguments.add(attrXNoCategory);

+        arguments.add(attrXSlashSlashMdRecord);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Got null Category at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:syntax-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXSlashSlashMdRecord);

+        arguments.add(attrXNoCategory);

+        res = fd.evaluate(new StdEvaluationContext(requestEmpty, null, null), arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match XPathExpression returned null at index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too many args

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        arguments.add(attrXEmpty);

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Expected 2 arguments, got 3", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // too few args

+        arguments.clear();

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Expected 2 arguments, got 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Expected 2 arguments, got 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // bad arg type

+        arguments.clear();

+        arguments.add(attrBadType);

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Expected data type 'xpathExpression' saw 'string' at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        arguments.add(attrBadType);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Expected data type 'xpathExpression' saw 'string' at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        // null args

+        arguments.clear();

+        arguments.add(attrXEmpty);

+        arguments.add(null);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Got null argument at arg index 1", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+        arguments.clear();

+        arguments.add(null);

+        arguments.add(attrXEmpty);

+        res = fd.evaluate(null, arguments);

+        assertFalse(res.getStatus().isOk());

+        assertEquals( "function:xpath-node-match Got null argument at arg index 0", res.getStatus().getStatusMessage());

+        assertEquals("urn:oasis:names:tc:xacml:1.0:status:processing-error", res.getStatus().getStatusCode().getStatusCodeValue().stringValue());

+

+

+

+    }

+

+

+

+    //

+    // DEPRECATED versions that use String arguments rather than XPATHEXPRESSIONs

+    // are NOT supported due to ambiguity in the semantics between 2.0 (<Request> is root and has only one <Content> in resources)

+    //	and 3.0 (<Content> is root and there are multiple <Content> sections in any category)

+    //

+

+

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestCategoryTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestCategoryTest.java
index b62397b..6ae5d56 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestCategoryTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestCategoryTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -42,10 +42,10 @@
 /**

  * Test JSON Request convert to object - Category sub-component.  Does not include "Default" Categories (Subject, Action, Resource, Environment).

  * Basic existance/absence of Category is tested in RequestMainTest.

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * NOTE:

  * The "correct" way to verify that each JSON string gets translated into our internal Objects correctly is to look explicitly at each of the child objects

  * and verify that they are correct.  This would involve a lot of coding to get child of child of child and individually verify each property of each element.

@@ -54,4132 +54,4132 @@
  * This has two possible sources of error:

  * 	- toString might not include some sub-component, and

  * 	- the initial verification of the resulting string is done by hand and may have been incorrect.

- * 

+ *

  * @author glenngriffin

  *

  */

 public class RequestCategoryTest {

-        

-        // The request object output from each test conversion from JSON string

-        Request request;

 

-        

-        /*

-         * Request that uses all fields with both single and multiple  entries

-         */

-        String allFieldsRequest = 

-                        "{\"Request\": {" +

-                                        "\"ReturnPolicyIdList\" : true ," +

-                                        "\"CombinedDecision\" : true ," +

-                                        "\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\"," +

-                                        "\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar1\"]" +

-                                        "}]" +   

-                                  "}," +

-

-                                        "\"Category\": [" +

-                                                "{ " +

-                                                "\"CategoryId\": \"custom-category\", " +

-                                                "\"Id\" : \"customId\", " +

-                                                "\"Attribute\" : [" +

-                                                        "{" +

-                                                                "\"AttributeId\"		: \"document-id\", " +

-                                                                "\"DataType\"	: \"integer\", " +

-                                                                "\"Value\"	: 123 " +

-                                                                "}, " +

-                                                                "{" +

-                                                                "\"AttributeId\"		: \"document-url\", " +

-                                                                "\"DataType\"	: \"anyURI\", " +

-                                                                "\"Value\"	: \"http://somewhere.over.the.com/rainbow\" " +

-                                                        "}, " +

-                                                                "{" +

-                                                                "\"AttributeId\"		: \"page-list\", " +

-                                                                "\"Value\"	: [1, 2, 3, 4.5, 3, 2, 1] " +

-                                                        "} " +

-                                                "]" +

-                                            "}, " +

-                                            "{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "], " +

-                                            

-                                        "\"AccessSubject\":{ " +

-                                                "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" + 

-                                                        "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

-                                                        "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

-                                                        "</book></catalog>\"," +

-                                                "\"Attribute\" : []" +

-                                        "}, " +

-                                        

-                                        "\"Resource\" : {" +

-                                                "\"Content\" : \"PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPkdhbWJhcmRlbGxhLCBNYXR0aGV3PC9hdXRob3I+PHRpdGxlPlhNT" +

-                                                        "CBEZXZlbG9wZXIncyBHdWlkZTwvdGl0bGU+PGdlbnJlPkNvbXB1dGVyPC9nZW5yZT48cHJpY2U+NDQuOTU8L3ByaWNlPjxwdWJsaXNoX2RhdGU+MjAwMC0xMC0wMTwvcHVibGlzaF"+

-                                                        "9kYXRlPjxkZXNjcmlwdGlvbj5BbiBpbi1kZXB0aCBsb29rIGF0IGNyZWF0aW5nIGFwcGxpY2F0aW9ucyB3aXRoIFhNTC48L2Rlc2NyaXB0aW9uPjwvYm9vaz48L2NhdGFsb2c+\"" +

+    // The request object output from each test conversion from JSON string

+    Request request;

 

 

-                                        "} " +

+    /*

+     * Request that uses all fields with both single and multiple  entries

+     */

+    String allFieldsRequest =

+        "{\"Request\": {" +

+        "\"ReturnPolicyIdList\" : true ," +

+        "\"CombinedDecision\" : true ," +

+        "\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\"," +

+        "\"MultiRequests\" : {" +

+        "\"RequestReference\": [" +

+        "{ " +

+        "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+        "}," +

+        "{" +

+        "\"ReferenceId\" : [\"foo2\",\"bar1\"]" +

+        "}]" +

+        "}," +

 

-                                  

-                        "}}";

-        

-        /*

-         * The following example comes directly from the JSON Profile Spec

-         */

-        String exampleFromSpec = "{ " +

-                        "\"Request\" : { " +

-                                "\"AccessSubject\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Andreas\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Gamla Stan\" " +

-                                                "} " +

-                                        "] " +

-                                "}, " +

-                                "\"Action\" : { " +

-                                        "\"Attribute\":  " +

-                                                "{ " +

-                                                        "\"Id\" : \"action-id\", " +

-                                                        "\"Value\" : \"http://www.xacml.eu/buy\", " +

-                                                        "\"DataType\" : \"anyURI\" " +

-                                                "} " +

-                                "}, " +

-                                "\"Resource\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"book-title\", " +

-                                                        "\"Value\" : \"Learn German in 90 days\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"currency\", " +

-                                                        "\"Value\" : \"SEK\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"price\", " +

-                                                        "\"Value\" : 123.34 " +

-                                                "} " +

-                                                "] " +

-                                        "} " +

-                                "} " +

-                        "} ";

+        "\"Category\": [" +

+        "{ " +

+        "\"CategoryId\": \"custom-category\", " +

+        "\"Id\" : \"customId\", " +

+        "\"Attribute\" : [" +

+        "{" +

+        "\"AttributeId\"		: \"document-id\", " +

+        "\"DataType\"	: \"integer\", " +

+        "\"Value\"	: 123 " +

+        "}, " +

+        "{" +

+        "\"AttributeId\"		: \"document-url\", " +

+        "\"DataType\"	: \"anyURI\", " +

+        "\"Value\"	: \"http://somewhere.over.the.com/rainbow\" " +

+        "}, " +

+        "{" +

+        "\"AttributeId\"		: \"page-list\", " +

+        "\"Value\"	: [1, 2, 3, 4.5, 3, 2, 1] " +

+        "} " +

+        "]" +

+        "}, " +

+        "{ " +

+        "\"CategoryId\": \"another-custom-cat\", " +

+        "\"Id\" : \"anotherXmlId\", " +

+        "\"Attribute\" : []" +

+        "} " +

+        "], " +

 

-        

-        /*

-         * The following example comes directly from the JSON Profile Spec (modified to include a "</Catalog>" missing from both examples).

-         * It shows the two ways of handling XPath content, as escaped XML and as Base64 encoding.

-         */

-        String xPathExampleFromSpec = "{ " +

-                        "\"Request\" : { " +

-                                "\"Resource\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"urn:oasis:names:tc:xacml:3.0:content-selector\", " +

-                                            "\"DataType\" : \"xpathExpression\", " +

-                                            "\"Value\" : { " +

-                                                "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", " +

-                                                "\"Namespaces\" : [{ " +

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}, " +

-                                                    "{ " +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                    "} " +

-                                                "], " +

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" " +

-                                            "} " +

-                                        "} " +

-                                        "] " +

-                                "} " +

-                        "} " +

-                "} ";

+        "\"AccessSubject\":{ " +

+        "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" +

+        "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

+        "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

+        "</book></catalog>\"," +

+        "\"Attribute\" : []" +

+        "}, " +

+

+        "\"Resource\" : {" +

+        "\"Content\" : \"PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPkdhbWJhcmRlbGxhLCBNYXR0aGV3PC9hdXRob3I+PHRpdGxlPlhNT" +

+        "CBEZXZlbG9wZXIncyBHdWlkZTwvdGl0bGU+PGdlbnJlPkNvbXB1dGVyPC9nZW5yZT48cHJpY2U+NDQuOTU8L3ByaWNlPjxwdWJsaXNoX2RhdGU+MjAwMC0xMC0wMTwvcHVibGlzaF"+

+        "9kYXRlPjxkZXNjcmlwdGlvbj5BbiBpbi1kZXB0aCBsb29rIGF0IGNyZWF0aW5nIGFwcGxpY2F0aW9ucyB3aXRoIFhNTC48L2Rlc2NyaXB0aW9uPjwvYm9vaz48L2NhdGFsb2c+\"" +

 

 

-        

+        "} " +

+

+

+        "}}";

+

+    /*

+     * The following example comes directly from the JSON Profile Spec

+     */

+    String exampleFromSpec = "{ " +

+                             "\"Request\" : { " +

+                             "\"AccessSubject\" : { " +

+                             "\"Attribute\": [ " +

+                             "{ " +

+                             "\"Id\" : \"subject-id\", " +

+                             "\"Value\" : \"Andreas\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"location\", " +

+                             "\"Value\" : \"Gamla Stan\" " +

+                             "} " +

+                             "] " +

+                             "}, " +

+                             "\"Action\" : { " +

+                             "\"Attribute\":  " +

+                             "{ " +

+                             "\"Id\" : \"action-id\", " +

+                             "\"Value\" : \"http://www.xacml.eu/buy\", " +

+                             "\"DataType\" : \"anyURI\" " +

+                             "} " +

+                             "}, " +

+                             "\"Resource\" : { " +

+                             "\"Attribute\": [ " +

+                             "{ " +

+                             "\"Id\" : \"book-title\", " +

+                             "\"Value\" : \"Learn German in 90 days\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"currency\", " +

+                             "\"Value\" : \"SEK\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"price\", " +

+                             "\"Value\" : 123.34 " +

+                             "} " +

+                             "] " +

+                             "} " +

+                             "} " +

+                             "} ";

+

+

+    /*

+     * The following example comes directly from the JSON Profile Spec (modified to include a "</Catalog>" missing from both examples).

+     * It shows the two ways of handling XPath content, as escaped XML and as Base64 encoding.

+     */

+    String xPathExampleFromSpec = "{ " +

+                                  "\"Request\" : { " +

+                                  "\"Resource\" : { " +

+                                  "\"Attribute\": [ " +

+                                  "{ " +

+                                  "\"Id\" : \"urn:oasis:names:tc:xacml:3.0:content-selector\", " +

+                                  "\"DataType\" : \"xpathExpression\", " +

+                                  "\"Value\" : { " +

+                                  "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", " +

+                                  "\"Namespaces\" : [{ " +

+                                  "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                  "}, " +

+                                  "{ " +

+                                  "\"Prefix\" : \"md\", " +

+                                  "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                  "} " +

+                                  "], " +

+                                  "\"XPath\" : \"md:record/md:patient/md:patientDoB\" " +

+                                  "} " +

+                                  "} " +

+                                  "] " +

+                                  "} " +

+                                  "} " +

+                                  "} ";

+

+

+

 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

-        // Top-level of Category

-        @Test

-        public void testCategoryTopLevel() {	

-                

-                // empty Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Missing value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\" }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\" : }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category without CategoryId

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{}] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category with CategoryId value missing or =""

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\"] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"\" ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // CategoryId wrong type

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : true } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : 123 } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category with Id

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Id\" : \"customId\" } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category},xmlId=customId}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category with Id - wrong type

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Id\" : true } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Id\" : 123 } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Category without Id	

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\" } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Category with standard CategoryId

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\" } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category with extra unknown field

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", unknown } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"unknown\" : 123 } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category with multiple sub-Category objects using same CategoryId

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"category1\" }, {\"CategoryId\" : \"category1\" } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=category1}}{super={category=category1}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

+    // Top-level of Category

+    @Test

+    public void testCategoryTopLevel() {

+

+        // empty Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

 

-        

-        

-        // Tests related to Attributes

-        @Test

-        public void testCategoryAttributes() {	

-        

-                // Category with Attribute but none given ("Attribute" : [] )		

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-

-                // Category Attribute with empty attribute (missing both AttributeId and Id)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with AttributeId and no Value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"AttributeId\" : \"document-id\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute missing AttributeId but with Id		

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"AttributeId\" : \"document-id\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute missing AttributeId but with Id

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute including both AttributeId and Id with same value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"AttributeId\" : \"document-id\", " +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute missing both AttributeId and Id

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute AttributeId not string

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"AttributeId\" : true, " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"AttributeId\" : 123, " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute Id not string

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : true, " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : 123, " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Category Attribute with DataType

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"integer\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with DataType not string (e.g. "DataType" : 55.5 )

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: true, " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with unknown DataType

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"no such data type\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: 321, " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with multiple value array

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dayTimeDuration\", " +

-                                "\"Value\"	: [\"P3D\", \"P2DT12H34M\", \"PT15M\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=3hours=0minutes=0seconds=0millis=0},factionalSeconds=0.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=2hours=12minutes=34seconds=0millis=0},factionalSeconds=0.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=0hours=0minutes=15seconds=0millis=0},factionalSeconds=0.0}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute multiple value with null in array

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dayTimeDuration\", " +

-                                "\"Value\"	: [\"P3D\", , \"P15M\"] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with array value with no values ("Attribute": [ {"AttributeId" :"a", Value:[] } ] }  )

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dayTimeDuration\", " +

-                                "\"Value\"	: [ ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with no DataType and array with no values

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with Issuer

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                        "\"Issuer\" : \"University Press\", " +

-                                "\"DataType\"	: \"integer\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],issuer=University Press,includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with Issuer not string

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                        "\"Issuer\" : true, " +

-                                "\"DataType\"	: \"integer\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                        "\"Issuer\" : 4.56, " +

-                                "\"DataType\"	: \"integer\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with includeInResult=true

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: 123, " +

-                                "\"IncludeInResult\" : true " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=true}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with includeInResult = false

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: 123, " +

-                                "\"IncludeInResult\" : false " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with includeInResult not boolean

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: 123, " +

-                                "\"IncludeInResult\" : \"abc\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: 123, " +

-                                "\"IncludeInResult\" : 123.45 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+        // Missing value

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\" }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

 

-        

-        

-        // Tests related to DataTypes within Attributes

-        @Test

-        public void testCategoryAttributesDataTypesSimple() {	

-                

-                // Category Attribute using full Identifier for each data type

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: \"abc\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

-                                "\"Value\"	: true " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

-                                "\"Value\"	: 123.34 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

-                                "\"Value\"	: \"12:00:00Z\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

-                                "\"Value\"	: \"2002-10-10\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

-                                "\"Value\"	: \"2002-10-10T12:00:00Z\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

-                                "\"Value\"	: \"P23DT7H12M54S\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

-                                "\"Value\"	: \"P165Y8M\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

-                                "\"Value\"	: \"FA027B7D12CC34DDD20012AEEF\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

-                                "\"Value\"	: \"lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9y\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,-46,35,18,-29,2,35,-13,-29,-58,54,23,70,22,-58,-10,115,-29,-58,38,-10,-10,-78,6,-106,67,-46,38,38,-77,19,3,18,35,-29,-58,23,87,70,-122,-9]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

-                                "\"Value\"	: \"someone.else@A.COMPANY.com\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=someone.else,domainName=A.COMPANY.com}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

-                                "\"Value\"	: \"cn=Julius Hibbert, o=Medi Corporation, c=US\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

-                                "\"Value\"	: \"121.221.43.58:12345\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}," +

-                                                        "{" +

-                                                                "\"Prefix\" : \"md\", " +

-                                                                "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                        "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

-

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-

-                

-                // Category Attribute shorthand notation for each data type

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"string\", " +

-                                "\"Value\"	: \"abc\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"boolean\", " +

-                                "\"Value\"	: true " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"integer\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"double\", " +

-                                "\"Value\"	: 123.34 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"time\", " +

-                                "\"Value\"	: \"12:00:00Z\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"date\", " +

-                                "\"Value\"	: \"2002-10-10\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dateTime\", " +

-                                "\"Value\"	: \"2002-10-10T12:00:00Z\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dayTimeDuration\", " +

-                                "\"Value\"	: \"P23DT7H12M54S\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"yearMonthDuration\", " +

-                                "\"Value\"	: \"P165Y8M\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"anyURI\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"hexBinary\", " +

-                                "\"Value\"	: \"FA027B7D12CC34DDD20012AEEF\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"base64Binary\", " +

-                                "\"Value\"	: \"lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9y\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,-46,35,18,-29,2,35,-13,-29,-58,54,23,70,22,-58,-10,115,-29,-58,38,-10,-10,-78,6,-106,67,-46,38,38,-77,19,3,18,35,-29,-58,23,87,70,-122,-9]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"rfc822Name\", " +

-                                "\"Value\"	: \"someone.else@A.COMPANY.com\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=someone.else,domainName=A.COMPANY.com}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"x500Name\", " +

-                                "\"Value\"	: \"cn=Julius Hibbert, o=Medi Corporation, c=US\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"ipAddress\", " +

-                                "\"Value\"	: \"121.221.43.58:12345\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dnsName\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}," +

-                                                        "{" +

-                                                                "\"Prefix\" : \"md\", " +

-                                                                "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                        "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

-

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-

-                

-                

-                // infer data type - only integer, boolean and double are distinguishable from strings; everything else is treated as a string

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"abc\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: true " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: 123.34 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"12:00:00Z\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"2002-10-10\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"2002-10-10T12:00:00Z\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"P23DT7H12M54S\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"P165Y8M\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"FA027B7D12CC34DDD20012AEEF\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9y\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"someone.else@A.COMPANY.com\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.COMPANY.com}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

-                                "\"Value\"	: \"cn=Julius Hibbert, o=Medi Corporation, c=US\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"121.221.43.58:12345\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}," +

-                                                        "{" +

-                                                                "\"Prefix\" : \"md\", " +

-                                                                "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                        "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        // gets inferred to a String containing the whole structure under Value as a String

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value={XPathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource, Namespaces=[{Namespace=urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}, {Prefix=md, Namespace=urn:example:med:schemas:record}], XPath=md:record/md:patient/md:patientDoB}}],includeInResults=false}]}}]}", request.toString());

-

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\" : }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

-        

-        

-        @Test

-        public void testCategoryAttributesDataTypesNotMatchValue() {	

 

-                // Category Attribute with DataType not matching value type (JSON type derived from syntax)

-                // AUTO-CONVERSION from Boolean to String!

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: true " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: 123.34 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123.34}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

-                                "\"Value\"	: \"abc\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

-                                "\"Value\"	: 123.45 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: \"123\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: true " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: 123.45 " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

-                                "\"Value\"	: \"123.34\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

-                                "\"Value\"	: true " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // allow integer to auto-convert to double when DataType is given

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

-                                "\"Value\"	: 123 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.0}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // special JavaScript values not allowed except for -0 (inappropriate requirement in spec - check it anyway)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: \"NaN\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: \"INF\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: \"-INF\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // JavaScript 0 and -0 are ok

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: 0 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=0}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: -0 " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=0}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // All other data types are checked when we convert internally, so value must be syntactically correct

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Base64 convert does not throw an exception if the contents are not Base64, so cannot test for this.

-                // Any problem with the data will have to be discovered later when the data is used.

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

-                                "\"Value\"	: \"syntactically incorrect value\" " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-

-                // Cannot test XPathExpressions here.  The XPathExpression gets converted into a simple String value within the XPathExpression object,

-                // but it is not evaluated or compiled at that time.  Therefore we do not know whether or not the value is valid until it is used in a computation.

-

+        // Category without CategoryId

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{}] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

-        

-        @Test

-        public void testArrayDataTypes() {

-                

-                // array of size 0

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: [] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Category Attribute value array DataType given (repeat for all data types)

-                // Category Attribute using full Identifier for each data type

-                // Category Attribute shorthand notation for each data type

-                // Also tests for mixes of different JSON types (trying incorrect strings for XACML data types whenever possible)

-                // string

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: [\"abc\", \"def\", \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=def}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"string\", " +

-                                "\"Value\"	: [\"abc\", \"def\", \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=def}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT to DataType

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: [\"abc\", true, \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: [\"abc\",123, \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: [\"abc\", 34.34, \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=34.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // boolean

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

-                                "\"Value\"	: [true, true, false, true, false ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"boolean\", " +

-                                "\"Value\"	: [true, true, false, true, false ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

-                                "\"Value\"	: [true, \"abc\", false, true, false ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

-                                "\"Value\"	: [true, 123, false, true, false ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

-                                "\"Value\"	: [true, 12.34, false, true, false ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                

-                // integer

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: [123, 456, 765, 234] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=456}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=765}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=234}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"integer\", " +

-                                "\"Value\"	: [123, 456, 765, 234] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=456}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=765}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=234}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: [123, \"abc\", 765, 234] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: [123, true, 765, 234] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

-                                "\"Value\"	: [123, 34.56, 765, 234] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // double

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

-                                "\"Value\"	: [ 123.34, 543.54, 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.54}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"double\", " +

-                                "\"Value\"	: [ 123.34, 543.54, 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.54}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // special case - auto-convert integer to boolean

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

-                                "\"Value\"	: [ 123.34, 111122, 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=111122.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

-                                "\"Value\"	: [ 123.34, true, 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

-                                "\"Value\"	: [ 123.34, \"abb\", 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // time

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", \"12:00:00Z\", \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"time\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", \"12:00:00Z\", \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", \"not a time\", \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", true, \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", 123, \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", 12.34, \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // date

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

-                                "\"Value\"	: [\"2002-10-10\",\"2002-10-10\",\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"date\", " +

-                                "\"Value\"	: [\"2002-10-10\",\"2002-10-10\",\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

-                                "\"Value\"	: [\"2002-10-10\",\"not a date\",\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

-                                "\"Value\"	: [\"2002-10-10\",true,\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

-                                "\"Value\"	: [\"2002-10-10\",123,\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

-                                "\"Value\"	: [\"2002-10-10\",123.45,\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // dateTime

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dateTime\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",\"not a dateTime\",\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",true,\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",123,\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",12.34,\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // dayTimeDuration

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",\"P23DT7H12M54S\",\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dayTimeDuration\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",\"P23DT7H12M54S\",\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",\"not a duration\",\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",true,\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",123,\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",11.22,\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // yearMonth duration

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

-                                "\"Value\"	: [ \"P165Y8M\",\"P165Y8M\",\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"yearMonthDuration\", " +

-                                "\"Value\"	: [ \"P165Y8M\",\"P165Y8M\",\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

-                                "\"Value\"	: [ \"P165Y8M\",\"not a duration\",\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

-                                "\"Value\"	: [ \"P165Y8M\",true,\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

-                                "\"Value\"	: [ \"P165Y8M\",123,\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

-                                "\"Value\"	: [ \"P165Y8M\",11.22,\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // anyURI

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

-                                "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"anyURI\", " +

-                                "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

-                                "\"Value\"	: [ \"aValue\",true,\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

-                                "\"Value\"	: [ \"aValue\",123,\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

-                                "\"Value\"	: [ \"aValue\",11.111,\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=11.111}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // hexBinary

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"hexBinary\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",true,\"012AEEF\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",123,\"012AEEF\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",11.44,\"012AEEF\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // base64Binary

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

-                                "\"Value\"	: [ \"aG9y\",\"lvbj0iMS4xIj48YXV0aG9y\",\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,-46,35,18,-29,18,35,-29,-58,23,87,70,-122,-9]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"base64Binary\", " +

-                                "\"Value\"	: [ \"aG9y\",\"lvbj0iMS4xIj48YXV0aG9y\",\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,-46,35,18,-29,18,35,-29,-58,23,87,70,-122,-9]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

-                                "\"Value\"	: [ \"aG9y\",true,\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-74,-69,-98]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

-                                "\"Value\"	: [ \"aG9y\",1123,\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-41,93,-73]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

-                                "\"Value\"	: [ \"aG9y\",11.22,\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-41,93,-74]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // RFC822 name

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",\"one.else@A.COMPANY.com\",\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=sne.else,domainName=A.COMPANY.com}}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=one.else,domainName=A.COMPANY.com}}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=someone.else,domainName=A.CONY.com}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"rfc822Name\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",\"one.else@A.COMPANY.com\",\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=sne.else,domainName=A.COMPANY.com}}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=one.else,domainName=A.COMPANY.com}}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=someone.else,domainName=A.CONY.com}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",\"not a dns\",\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",true,\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",111,\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",11.22,\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // x500

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"x500Name\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"non-x500 string\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", true, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", 1111, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", 11.22, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // ipAddress

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"ipAddress\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",\"not an ip address\",\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",true,\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",1111,\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",11.22,\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // dnsName

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

-                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"dnsName\", " +

-                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

-                                "\"Value\"	: [ \"aValue\", true, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=true}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

-                                "\"Value\"	: [ \"aValue\", 1111, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

-                                "\"Value\"	: [ \"aValue\", 11.22, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // xPathExpression

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

-                                "\"Value\"	: [ "

-                                + "{" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}," +

-                                                        "{" +

-                                                                "\"Prefix\" : \"md\", " +

-                                                                "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                        "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}," +

-                        "{" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                                "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                                "}," +

-                                                                "{" +

-                                                                        "\"Prefix\" : \"md\", " +

-                                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                                "}], "+

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                                "}," +

-                                "{" +

-                                                "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                                "\"Namespaces\" : ["

-                                                        + "{ "+

-                                                                "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                                "}," +

-                                                                "{" +

-                                                                        "\"Prefix\" : \"md\", " +

-                                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                                "}], "+

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                                "}"

-                                + "] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

 

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

-                                "\"Value\"	: [ "

-                                + "{" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}," +

-                                                        "{" +

-                                                                "\"Prefix\" : \"md\", " +

-                                                                "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                        "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}," +

-                        "\"simpleString\"," +

-                                "{" +

-                                                "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                                "\"Namespaces\" : ["

-                                                        + "{ "+

-                                                                "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                                "}," +

-                                                                "{" +

-                                                                        "\"Prefix\" : \"md\", " +

-                                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                                "}], "+

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                                "}"

-                                + "] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

-                                "\"Value\"	: [ "

-                                + "{" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}," +

-                                                        "{" +

-                                                                "\"Prefix\" : \"md\", " +

-                                                                "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                        "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}," +

-                        "true," +

-                                "{" +

-                                                "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                                "\"Namespaces\" : ["

-                                                        + "{ "+

-                                                                "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                                "}," +

-                                                                "{" +

-                                                                        "\"Prefix\" : \"md\", " +

-                                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                                "}], "+

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                                "}"

-                                + "] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

-                                "\"Value\"	: [ "

-                                + "{" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}," +

-                                                        "{" +

-                                                                "\"Prefix\" : \"md\", " +

-                                                                "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                        "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}," +

-                        "123," +

-                                "{" +

-                                                "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                                "\"Namespaces\" : ["

-                                                        + "{ "+

-                                                                "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                                "}," +

-                                                                "{" +

-                                                                        "\"Prefix\" : \"md\", " +

-                                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                                "}], "+

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                                "}"

-                                + "] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

-                                "\"Value\"	: [ "

-                                + "{" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                                + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}," +

-                                                        "{" +

-                                                                "\"Prefix\" : \"md\", " +

-                                                                "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                        "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}," +

-                        "12.34," +

-                                "{" +

-                                                "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                                "\"Namespaces\" : ["

-                                                        + "{ "+

-                                                                "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                                "}," +

-                                                                "{" +

-                                                                        "\"Prefix\" : \"md\", " +

-                                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                                "}], "+

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                                "}"

-                                + "] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-

+        // Category with CategoryId value missing or =""

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\"] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

 

-        

-        

-        

-        

-        

-        @Test

-        public void testArrayNoDataTypes() {

-                

-                // array of size 0

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Category Attribute value array DataType Not given (repeat for all data types)

-                // Also tests for mixes of different JSON types (trying incorrect strings for XACML data types whenever possible)

-                // string

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [\"abc\", \"def\", \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=def}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT to DataType

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [\"abc\", true, \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [\"abc\",123, \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [\"abc\", 34.34, \"hig\", \"lmn\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=34.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // boolean

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [true, true, false, true, false ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [true, \"abc\", false, true, false ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [true, 123, false, true, false ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [true, 12.34, false, true, false ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                

-                // integer

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [123, 456, 765, 234] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=456}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=765}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=234}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [123, \"abc\", 765, 234] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [123, true, 765, 234] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-

-                

-                

-                // double

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ 123.34, 543.54, 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.54}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // special case - auto-convert integer to boolean

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ 123.34, 111122, 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=111122.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ 123.34, true, 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ 123.34, \"abb\", 3445.455, 4543,543 ] " +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // time - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", \"12:00:00Z\", \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", true, \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // SUCCESSFUL AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", 123, \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"12:00:00Z\", 12.34, \"12:00:00Z\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // date - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [\"2002-10-10\",\"2002-10-10\",\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [\"2002-10-10\",true,\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [\"2002-10-10\",123,\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [\"2002-10-10\",123.45,\"2002-10-10\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123.45}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // dateTime - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",true,\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",123,\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"2002-10-10T12:00:00Z\",12.34,\"2002-10-10T12:00:00Z\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // dayTimeDuration - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",\"P23DT7H12M54S\",\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                //AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",true,\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",123,\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"P23DT7H12M54S\",11.22,\"P23DT7H12M54S\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // yearMonth duration - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"P165Y8M\",\"P165Y8M\",\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"P165Y8M\",true,\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"P165Y8M\",123,\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"P165Y8M\",11.22,\"P165Y8M\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // anyURI - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\",true,\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\",123,\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\",11.111,\"aValue\"] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // hexBinary - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",true,\"012AEEF\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=012AEEF}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",123,\"012AEEF\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=012AEEF}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",11.44,\"012AEEF\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.44}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=012AEEF}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // base64Binary - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aG9y\",\"lvbj0iMS4xIj48YXV0aG9y\",\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbj0iMS4xIj48YXV0aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbjIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aG9y\",true,\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbjIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aG9y\",1123,\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbjIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aG9y\",11.22,\"lvbjIj48YXV0aG9y\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbjIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // RFC822 name - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",\"one.else@A.COMPANY.com\",\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=sne.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=one.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.CONY.com}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",true,\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=sne.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.CONY.com}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",111,\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=sne.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.CONY.com}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"sne.else@A.COMPANY.com\",11.22,\"someone.else@A.CONY.com\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=sne.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.CONY.com}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // x500 - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", true, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", 1111, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", 11.22, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // ipAddress - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",true,\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",1111,\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"121.221.43.58:12345\",11.22,\"121.221.43.58:12345\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // dnsName - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", true, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", 1111, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", 11.22, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // xPathExpression - defaults to String

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", true, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", 1111, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                // AUTO-CONVERT

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", 11.22, \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

-        

 

-        

-        @Test

-        public void testXPathExpression() {

-                // Category Attribute with XPathExpression including XPathCategory and XPath

-                // Category Attribute with XPathExpression with Namespaces with/without Prefix

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : ["

-                                          + "{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                "}," +

-                                                "{ "+

-                                                        "\"Prefix\" : \"lab\", " +

-                                                        "\"Namespace\" : \"http://somewhere/uri.html\" " +

-                                                "}," +

-                                                "{" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{lab,http://somewhere/uri.html}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with XPathExpression missing XPathCategory

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"Namespaces\" : [{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                "}," +

-                                                "{" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with XPathExpression missing XPath

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                "}," +

-                                                "{" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}] "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with XPathExpression without Namespaces

-                // (path does not contain namespace references)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"XPath\" : \"record/patient/patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=record/patient/patientDoB,Namespace=null,status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with XPathExpression with 0 Namespaces

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace=null,status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Category Attribute with XPathExpression with Namespaces without mandatory Namespace

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [{ "+

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                "}," +

-                                                "{" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [{ "+

-                                                "}," +

-                                                "{" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                                

-                // Category Attribute with XPathExpression with Namespaces with 2 namespaces using same prefix

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [{ "+

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                "}," +

-                                                "{" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with XPathExpression without Namespaces which are used within the XPathExpression (NOTE: Error is not syntactic and is not found by converter)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace=null,status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with XPathExpression containing simple value (must be object)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: \"simple Value\"" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with Namespaces containing simple value (must be object)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [ \"simpleValue\"," +

-                                                "{" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Category Attribute with Namespaces non-string Namespace

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [ {" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : 123 " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with Namespaces non-string prefix

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [ {" +

-                                                        "\"Prefix\" : 123, " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with Namespaces non-string XPathCategory

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : 123," +

-                                        "\"Namespaces\" : [ {" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}], "+

-                                        "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category Attribute with Namespaces non-string XPath

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"xpathExpression\", " +

-                                "\"Value\"	: {" +

-                                        "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

-                                        "\"Namespaces\" : [ {" +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                "}], "+

-                                        "\"XPath\" : 123 "+

-                        "}" +

-                                        "}] } ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"\" ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // CategoryId wrong type

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : true } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : 123 } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category with Id

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Id\" : \"customId\" } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category},xmlId=customId}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category with Id - wrong type

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Id\" : true } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Id\" : 123 } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

 

 

-        

-        @Test

-        public void testContent() {

-

-                // Category with Content in XML, escaped properly

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

-                                "}]," +

-                                        "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" + 

-                                                "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

-                                                "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

-                                                "</book></catalog>\"" +

-                                        "} ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]},contentRoot=[catalog: null]}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category with Content in XML, double quotes and back-slashes NOT escaped properly?

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

-                                "}]," +

-                                        "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" + 

-                                                "<book id=\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

-                                                "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

-                                                "</book></catalog>\"" +

-                                        "} ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category with Content in Base64

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

-                                "}]," +

-                                        "\"Content\" :  \"PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPkdhbWJhcmRlbGxhLCBNYXR0aGV3PC9hdXRob3I+PHRpdGxlPlhNT" +

-                                                        "CBEZXZlbG9wZXIncyBHdWlkZTwvdGl0bGU+PGdlbnJlPkNvbXB1dGVyPC9nZW5yZT48cHJpY2U+NDQuOTU8L3ByaWNlPjxwdWJsaXNoX2RhdGU+MjAwMC0xMC0wMTwvcHVibGlzaF"+

-                                                        "9kYXRlPjxkZXNjcmlwdGlvbj5BbiBpbi1kZXB0aCBsb29rIGF0IGNyZWF0aW5nIGFwcGxpY2F0aW9ucyB3aXRoIFhNTC48L2Rlc2NyaXB0aW9uPjwvYm9vaz48L2NhdGFsb2c+\"" +

-                                        "} ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]},contentRoot=[catalog: null]}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Category with Bad Content in Base64

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

-                                "}]," +

-                                        "\"Content\" :  \"PD94bWwgdmV\"" +

-                                        "} ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+        // Category without Id

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\" } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

 

-        

-        

-        @Test

-        public void testDuplicates() {

-                // duplicate of same element within Category array is ok

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: \"abc\" " +

-                                        "}] }, " +

-                                        "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                                "\"Value\"	: \"abc\" " +

-                                                        "}] } "

-                                        + "] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // duplicate Attribute

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [" +

-                                        "{\"CategoryId\" : \"custom-category\","

-                                        + " \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                                "\"Value\"	: \"abc\" " +

-                                                        "}], "

-                                        + " \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                                "\"Value\"	: \"abc\" " +

-                                                        "}] "

-                                                        + "} "

-                                        + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // dup id

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: \"abc\" " +

-                                        "}] } " 

-                                        + "] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // dup DataType

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: \"abc\" " +

-                                        "}] } " 

-                                        + "] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // dup Value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

-                                "\"Value\"	: \"abc\" " +

-                                "\"Value\"	: \"abc\" " +

-                                        "}] } " 

-                                        + "] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // duplicate Content

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{"

-                                        + "\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

-                                        "}]," +

-                                        "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" + 

-                                                        "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

-                                                        "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

-                                                        "</book></catalog>\" , " +

-                                                "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" + 

-                                                        "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

-                                                        "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

-                                                        "</book></catalog>\"" +

-                                        "} ] }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

+

+        // Category with standard CategoryId

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\" } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

 

-        

+        // Category with extra unknown field

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", unknown } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"unknown\" : 123 } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category with multiple sub-Category objects using same CategoryId

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"category1\" }, {\"CategoryId\" : \"category1\" } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=category1}}{super={category=category1}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

+

+    // Tests related to Attributes

+    @Test

+    public void testCategoryAttributes() {

+

+        // Category with Attribute but none given ("Attribute" : [] )

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with empty attribute (missing both AttributeId and Id)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with AttributeId and no Value

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"AttributeId\" : \"document-id\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute missing AttributeId but with Id

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"AttributeId\" : \"document-id\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute missing AttributeId but with Id

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute including both AttributeId and Id with same value

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"AttributeId\" : \"document-id\", " +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute missing both AttributeId and Id

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute AttributeId not string

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"AttributeId\" : true, " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"AttributeId\" : 123, " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute Id not string

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : true, " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : 123, " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Category Attribute with DataType

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"integer\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with DataType not string (e.g. "DataType" : 55.5 )

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: true, " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with unknown DataType

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"no such data type\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: 321, " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with multiple value array

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dayTimeDuration\", " +

+                                       "\"Value\"	: [\"P3D\", \"P2DT12H34M\", \"PT15M\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=3hours=0minutes=0seconds=0millis=0},factionalSeconds=0.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=2hours=12minutes=34seconds=0millis=0},factionalSeconds=0.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=0hours=0minutes=15seconds=0millis=0},factionalSeconds=0.0}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute multiple value with null in array

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dayTimeDuration\", " +

+                                       "\"Value\"	: [\"P3D\", , \"P15M\"] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with array value with no values ("Attribute": [ {"AttributeId" :"a", Value:[] } ] }  )

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dayTimeDuration\", " +

+                                       "\"Value\"	: [ ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with no DataType and array with no values

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with Issuer

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Issuer\" : \"University Press\", " +

+                                       "\"DataType\"	: \"integer\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],issuer=University Press,includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with Issuer not string

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Issuer\" : true, " +

+                                       "\"DataType\"	: \"integer\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Issuer\" : 4.56, " +

+                                       "\"DataType\"	: \"integer\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with includeInResult=true

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: 123, " +

+                                       "\"IncludeInResult\" : true " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=true}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with includeInResult = false

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: 123, " +

+                                       "\"IncludeInResult\" : false " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with includeInResult not boolean

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: 123, " +

+                                       "\"IncludeInResult\" : \"abc\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: 123, " +

+                                       "\"IncludeInResult\" : 123.45 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+    }

+

+

+

+    // Tests related to DataTypes within Attributes

+    @Test

+    public void testCategoryAttributesDataTypesSimple() {

+

+        // Category Attribute using full Identifier for each data type

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

+                                       "\"Value\"	: true " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

+                                       "\"Value\"	: 123.34 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

+                                       "\"Value\"	: \"12:00:00Z\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

+                                       "\"Value\"	: \"2002-10-10\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

+                                       "\"Value\"	: \"2002-10-10T12:00:00Z\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

+                                       "\"Value\"	: \"P23DT7H12M54S\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

+                                       "\"Value\"	: \"P165Y8M\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

+                                       "\"Value\"	: \"FA027B7D12CC34DDD20012AEEF\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

+                                       "\"Value\"	: \"lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9y\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,-46,35,18,-29,2,35,-13,-29,-58,54,23,70,22,-58,-10,115,-29,-58,38,-10,-10,-78,6,-106,67,-46,38,38,-77,19,3,18,35,-29,-58,23,87,70,-122,-9]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

+                                       "\"Value\"	: \"someone.else@A.COMPANY.com\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=someone.else,domainName=A.COMPANY.com}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

+                                       "\"Value\"	: \"cn=Julius Hibbert, o=Medi Corporation, c=US\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

+                                       "\"Value\"	: \"121.221.43.58:12345\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

+

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Category Attribute shorthand notation for each data type

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"boolean\", " +

+                                       "\"Value\"	: true " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"integer\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"double\", " +

+                                       "\"Value\"	: 123.34 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"time\", " +

+                                       "\"Value\"	: \"12:00:00Z\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"date\", " +

+                                       "\"Value\"	: \"2002-10-10\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dateTime\", " +

+                                       "\"Value\"	: \"2002-10-10T12:00:00Z\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dayTimeDuration\", " +

+                                       "\"Value\"	: \"P23DT7H12M54S\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"yearMonthDuration\", " +

+                                       "\"Value\"	: \"P165Y8M\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"anyURI\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"hexBinary\", " +

+                                       "\"Value\"	: \"FA027B7D12CC34DDD20012AEEF\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"base64Binary\", " +

+                                       "\"Value\"	: \"lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9y\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,-46,35,18,-29,2,35,-13,-29,-58,54,23,70,22,-58,-10,115,-29,-58,38,-10,-10,-78,6,-106,67,-46,38,38,-77,19,3,18,35,-29,-58,23,87,70,-122,-9]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"rfc822Name\", " +

+                                       "\"Value\"	: \"someone.else@A.COMPANY.com\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=someone.else,domainName=A.COMPANY.com}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"x500Name\", " +

+                                       "\"Value\"	: \"cn=Julius Hibbert, o=Medi Corporation, c=US\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"ipAddress\", " +

+                                       "\"Value\"	: \"121.221.43.58:12345\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dnsName\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

+

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+

+        // infer data type - only integer, boolean and double are distinguishable from strings; everything else is treated as a string

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: true " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: 123.34 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"12:00:00Z\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"2002-10-10\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"2002-10-10T12:00:00Z\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"P23DT7H12M54S\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"P165Y8M\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"FA027B7D12CC34DDD20012AEEF\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9y\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"someone.else@A.COMPANY.com\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.COMPANY.com}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

+                                       "\"Value\"	: \"cn=Julius Hibbert, o=Medi Corporation, c=US\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"121.221.43.58:12345\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            // gets inferred to a String containing the whole structure under Value as a String

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value={XPathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource, Namespaces=[{Namespace=urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}, {Prefix=md, Namespace=urn:example:med:schemas:record}], XPath=md:record/md:patient/md:patientDoB}}],includeInResults=false}]}}]}", request.toString());

+

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+    }

+

+

+

+    @Test

+    public void testCategoryAttributesDataTypesNotMatchValue() {

+

+        // Category Attribute with DataType not matching value type (JSON type derived from syntax)

+        // AUTO-CONVERSION from Boolean to String!

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: true " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: 123.34 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123.34}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

+                                       "\"Value\"	: 123.45 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: \"123\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: true " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: 123.45 " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

+                                       "\"Value\"	: \"123.34\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

+                                       "\"Value\"	: true " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // allow integer to auto-convert to double when DataType is given

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

+                                       "\"Value\"	: 123 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.0}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // special JavaScript values not allowed except for -0 (inappropriate requirement in spec - check it anyway)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: \"NaN\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: \"INF\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: \"-INF\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // JavaScript 0 and -0 are ok

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: 0 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=0}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: -0 " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=0}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // All other data types are checked when we convert internally, so value must be syntactically correct

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Base64 convert does not throw an exception if the contents are not Base64, so cannot test for this.

+        // Any problem with the data will have to be discovered later when the data is used.

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

+                                       "\"Value\"	: \"syntactically incorrect value\" " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Cannot test XPathExpressions here.  The XPathExpression gets converted into a simple String value within the XPathExpression object,

+        // but it is not evaluated or compiled at that time.  Therefore we do not know whether or not the value is valid until it is used in a computation.

+

+    }

+

+

+    @Test

+    public void testArrayDataTypes() {

+

+        // array of size 0

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: [] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Category Attribute value array DataType given (repeat for all data types)

+        // Category Attribute using full Identifier for each data type

+        // Category Attribute shorthand notation for each data type

+        // Also tests for mixes of different JSON types (trying incorrect strings for XACML data types whenever possible)

+        // string

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: [\"abc\", \"def\", \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=def}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"string\", " +

+                                       "\"Value\"	: [\"abc\", \"def\", \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=def}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT to DataType

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: [\"abc\", true, \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: [\"abc\",123, \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: [\"abc\", 34.34, \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=34.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // boolean

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

+                                       "\"Value\"	: [true, true, false, true, false ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"boolean\", " +

+                                       "\"Value\"	: [true, true, false, true, false ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

+                                       "\"Value\"	: [true, \"abc\", false, true, false ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

+                                       "\"Value\"	: [true, 123, false, true, false ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#boolean\", " +

+                                       "\"Value\"	: [true, 12.34, false, true, false ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+

+        // integer

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: [123, 456, 765, 234] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=456}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=765}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=234}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"integer\", " +

+                                       "\"Value\"	: [123, 456, 765, 234] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=456}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=765}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=234}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: [123, \"abc\", 765, 234] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: [123, true, 765, 234] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#integer\", " +

+                                       "\"Value\"	: [123, 34.56, 765, 234] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // double

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

+                                       "\"Value\"	: [ 123.34, 543.54, 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.54}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"double\", " +

+                                       "\"Value\"	: [ 123.34, 543.54, 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.54}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // special case - auto-convert integer to boolean

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

+                                       "\"Value\"	: [ 123.34, 111122, 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=111122.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

+                                       "\"Value\"	: [ 123.34, true, 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#double\", " +

+                                       "\"Value\"	: [ 123.34, \"abb\", 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // time

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", \"12:00:00Z\", \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"time\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", \"12:00:00Z\", \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#time,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", \"not a time\", \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", true, \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", 123, \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#time\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", 12.34, \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // date

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

+                                       "\"Value\"	: [\"2002-10-10\",\"2002-10-10\",\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"date\", " +

+                                       "\"Value\"	: [\"2002-10-10\",\"2002-10-10\",\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#date,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

+                                       "\"Value\"	: [\"2002-10-10\",\"not a date\",\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

+                                       "\"Value\"	: [\"2002-10-10\",true,\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

+                                       "\"Value\"	: [\"2002-10-10\",123,\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#date\", " +

+                                       "\"Value\"	: [\"2002-10-10\",123.45,\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // dateTime

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dateTime\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#dateTime,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",\"not a dateTime\",\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",true,\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",123,\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dateTime\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",12.34,\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // dayTimeDuration

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",\"P23DT7H12M54S\",\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dayTimeDuration\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",\"P23DT7H12M54S\",\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}{dataTypeId=http://www.w3.org/2001/XMLSchema#dayTimeDuration,value={super={durationSign=1years=0months=0days=23hours=7minutes=12seconds=54millis=0},factionalSeconds=54.0}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",\"not a duration\",\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",true,\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",123,\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#dayTimeDuration\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",11.22,\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // yearMonth duration

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",\"P165Y8M\",\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"yearMonthDuration\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",\"P165Y8M\",\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}{dataTypeId=http://www.w3.org/2001/XMLSchema#yearMonthDuration,value={super={durationSign=1years=165months=8days=0hours=0minutes=0seconds=0millis=0},monthsDuration=1988}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",\"not a duration\",\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",true,\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",123,\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#yearMonthDuration\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",11.22,\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // anyURI

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

+                                       "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"anyURI\", " +

+                                       "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

+                                       "\"Value\"	: [ \"aValue\",true,\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

+                                       "\"Value\"	: [ \"aValue\",123,\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#anyURI\", " +

+                                       "\"Value\"	: [ \"aValue\",11.111,\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=11.111}{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // hexBinary

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"hexBinary\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#hexBinary,value={data=[-6,2,123,125,18,-52,52,-35,-46,0,18,-82,-17]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",true,\"012AEEF\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",123,\"012AEEF\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#hexBinary\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",11.44,\"012AEEF\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // base64Binary

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

+                                       "\"Value\"	: [ \"aG9y\",\"lvbj0iMS4xIj48YXV0aG9y\",\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,-46,35,18,-29,18,35,-29,-58,23,87,70,-122,-9]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"base64Binary\", " +

+                                       "\"Value\"	: [ \"aG9y\",\"lvbj0iMS4xIj48YXV0aG9y\",\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,-46,35,18,-29,18,35,-29,-58,23,87,70,-122,-9]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

+                                       "\"Value\"	: [ \"aG9y\",true,\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-74,-69,-98]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

+                                       "\"Value\"	: [ \"aG9y\",1123,\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-41,93,-73]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#base64Binary\", " +

+                                       "\"Value\"	: [ \"aG9y\",11.22,\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[104,111,114]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-41,93,-74]}}{dataTypeId=http://www.w3.org/2001/XMLSchema#base64Binary,value={data=[-106,-10,-29,34,62,60,97,117,116,104,111,114]}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // RFC822 name

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",\"one.else@A.COMPANY.com\",\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=sne.else,domainName=A.COMPANY.com}}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=one.else,domainName=A.COMPANY.com}}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=someone.else,domainName=A.CONY.com}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"rfc822Name\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",\"one.else@A.COMPANY.com\",\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=sne.else,domainName=A.COMPANY.com}}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=one.else,domainName=A.COMPANY.com}}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name,value={localName=someone.else,domainName=A.CONY.com}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",\"not a dns\",\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",true,\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",111,\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",11.22,\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // x500

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"x500Name\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}{dataTypeId=urn:oasis:names:tc:xacml:1.0:data-type:x500Name,value=CN=Julius Hibbert, O=Medi Corporation, C=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"non-x500 string\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", true, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", 1111, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:1.0:data-type:x500Name\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", 11.22, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // ipAddress

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"ipAddress\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:ipAddress,value=121.221.43.58:12345-12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",\"not an ip address\",\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",true,\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",1111,\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:ipAddress\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",11.22,\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // dnsName

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"dnsName\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

+                                       "\"Value\"	: [ \"aValue\", true, \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=true}}{dataTypeId=urn:oasis:names:tc:xacml:2.0:data-type:dnsName,value={domainName=aValue}}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

+                                       "\"Value\"	: [ \"aValue\", 1111, \"aValue\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:2.0:data-type:dnsName\", " +

+                                       "\"Value\"	: [ \"aValue\", 11.22, \"aValue\" ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // xPathExpression

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

+                                       "\"Value\"	: [ "

+                                       + "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}," +

+                                       "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}," +

+                                       "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}"

+                                       + "] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

+                                       "\"Value\"	: [ "

+                                       + "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}," +

+                                       "\"simpleString\"," +

+                                       "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}"

+                                       + "] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

+                                       "\"Value\"	: [ "

+                                       + "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}," +

+                                       "true," +

+                                       "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}"

+                                       + "] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

+                                       "\"Value\"	: [ "

+                                       + "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}," +

+                                       "123," +

+                                       "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}"

+                                       + "] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\", " +

+                                       "\"Value\"	: [ "

+                                       + "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}," +

+                                       "12.34," +

+                                       "{" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}"

+                                       + "] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+    }

+

+

+

+

+

+

+

+    @Test

+    public void testArrayNoDataTypes() {

+

+        // array of size 0

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Category Attribute value array DataType Not given (repeat for all data types)

+        // Also tests for mixes of different JSON types (trying incorrect strings for XACML data types whenever possible)

+        // string

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [\"abc\", \"def\", \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=def}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT to DataType

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [\"abc\", true, \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [\"abc\",123, \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [\"abc\", 34.34, \"hig\", \"lmn\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=34.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=hig}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lmn}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // boolean

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [true, true, false, true, false ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#boolean,value=false}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [true, \"abc\", false, true, false ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [true, 123, false, true, false ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [true, 12.34, false, true, false ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+

+        // integer

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [123, 456, 765, 234] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=456}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=765}{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=234}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [123, \"abc\", 765, 234] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [123, true, 765, 234] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+

+        // double

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ 123.34, 543.54, 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.54}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // special case - auto-convert integer to boolean

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ 123.34, 111122, 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=111122.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3445.455}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4543.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=543.0}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ 123.34, true, 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ 123.34, \"abb\", 3445.455, 4543,543 ] " +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // time - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", \"12:00:00Z\", \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", true, \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // SUCCESSFUL AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", 123, \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"12:00:00Z\", 12.34, \"12:00:00Z\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // date - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [\"2002-10-10\",\"2002-10-10\",\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [\"2002-10-10\",true,\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [\"2002-10-10\",123,\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [\"2002-10-10\",123.45,\"2002-10-10\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123.45}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // dateTime - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\",\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",true,\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",123,\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"2002-10-10T12:00:00Z\",12.34,\"2002-10-10T12:00:00Z\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=12.34}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=2002-10-10T12:00:00Z}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // dayTimeDuration - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",\"P23DT7H12M54S\",\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        //AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",true,\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",123,\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"P23DT7H12M54S\",11.22,\"P23DT7H12M54S\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P23DT7H12M54S}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // yearMonth duration - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",\"P165Y8M\",\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",true,\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",123,\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"P165Y8M\",11.22,\"P165Y8M\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=P165Y8M}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // anyURI - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",true,\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",123,\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",11.111,\"aValue\"] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // hexBinary - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\",\"FA027B7D12CC34DDD20012AEEF\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",true,\"012AEEF\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=012AEEF}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",123,\"012AEEF\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=012AEEF}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"FA027B7D12CC34DDD20012AEEF\",11.44,\"012AEEF\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=FA027B7D12CC34DDD20012AEEF}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.44}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=012AEEF}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // base64Binary - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aG9y\",\"lvbj0iMS4xIj48YXV0aG9y\",\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbj0iMS4xIj48YXV0aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbjIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aG9y\",true,\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbjIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aG9y\",1123,\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1123}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbjIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aG9y\",11.22,\"lvbjIj48YXV0aG9y\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aG9y}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=lvbjIj48YXV0aG9y}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // RFC822 name - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",\"one.else@A.COMPANY.com\",\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=sne.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=one.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.CONY.com}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",true,\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=sne.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.CONY.com}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",111,\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=sne.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.CONY.com}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"sne.else@A.COMPANY.com\",11.22,\"someone.else@A.CONY.com\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=sne.else@A.COMPANY.com}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=someone.else@A.CONY.com}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // x500 - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\", \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", true, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", 1111, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"cn=Julius Hibbert, o=Medi Corporation, c=US\", 11.22, \"cn=Julius Hibbert, o=Medi Corporation, c=US\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=cn=Julius Hibbert, o=Medi Corporation, c=US}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // ipAddress - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",\"121.221.43.58:12345\",\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",true,\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",1111,\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"121.221.43.58:12345\",11.22,\"121.221.43.58:12345\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=121.221.43.58:12345}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // dnsName - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", true, \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", 1111, \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", 11.22, \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // xPathExpression - defaults to String

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", true, \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=true}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", 1111, \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=1111}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        // AUTO-CONVERT

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", 11.22, \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=11.22}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

+

+

+    @Test

+    public void testXPathExpression() {

+        // Category Attribute with XPathExpression including XPathCategory and XPath

+        // Category Attribute with XPathExpression with Namespaces with/without Prefix

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : ["

+                                       + "{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{ "+

+                                       "\"Prefix\" : \"lab\", " +

+                                       "\"Namespace\" : \"http://somewhere/uri.html\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{lab,http://somewhere/uri.html}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with XPathExpression missing XPathCategory

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"Namespaces\" : [{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with XPathExpression missing XPath

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}] "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with XPathExpression without Namespaces

+        // (path does not contain namespace references)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"XPath\" : \"record/patient/patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=record/patient/patientDoB,Namespace=null,status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with XPathExpression with 0 Namespaces

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace=null,status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Category Attribute with XPathExpression with Namespaces without mandatory Namespace

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [{ "+

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [{ "+

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with XPathExpression with Namespaces with 2 namespaces using same prefix

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [{ "+

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                       "}," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with XPathExpression without Namespaces which are used within the XPathExpression (NOTE: Error is not syntactic and is not found by converter)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace=null,status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with XPathExpression containing simple value (must be object)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: \"simple Value\"" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with Namespaces containing simple value (must be object)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [ \"simpleValue\"," +

+                                       "{" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Category Attribute with Namespaces non-string Namespace

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [ {" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : 123 " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with Namespaces non-string prefix

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [ {" +

+                                       "\"Prefix\" : 123, " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with Namespaces non-string XPathCategory

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : 123," +

+                                       "\"Namespaces\" : [ {" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : \"md:record/md:patient/md:patientDoB\" "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category Attribute with Namespaces non-string XPath

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"xpathExpression\", " +

+                                       "\"Value\"	: {" +

+                                       "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\"," +

+                                       "\"Namespaces\" : [ {" +

+                                       "\"Prefix\" : \"md\", " +

+                                       "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                       "}], "+

+                                       "\"XPath\" : 123 "+

+                                       "}" +

+                                       "}] } ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+    }

+

+

+

+    @Test

+    public void testContent() {

+

+        // Category with Content in XML, escaped properly

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

+                                       "}]," +

+                                       "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" +

+                                       "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

+                                       "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

+                                       "</book></catalog>\"" +

+                                       "} ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]},contentRoot=[catalog: null]}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category with Content in XML, double quotes and back-slashes NOT escaped properly?

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

+                                       "}]," +

+                                       "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" +

+                                       "<book id=\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

+                                       "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

+                                       "</book></catalog>\"" +

+                                       "} ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category with Content in Base64

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

+                                       "}]," +

+                                       "\"Content\" :  \"PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPkdhbWJhcmRlbGxhLCBNYXR0aGV3PC9hdXRob3I+PHRpdGxlPlhNT" +

+                                       "CBEZXZlbG9wZXIncyBHdWlkZTwvdGl0bGU+PGdlbnJlPkNvbXB1dGVyPC9nZW5yZT48cHJpY2U+NDQuOTU8L3ByaWNlPjxwdWJsaXNoX2RhdGU+MjAwMC0xMC0wMTwvcHVibGlzaF"+

+                                       "9kYXRlPjxkZXNjcmlwdGlvbj5BbiBpbi1kZXB0aCBsb29rIGF0IGNyZWF0aW5nIGFwcGxpY2F0aW9ucyB3aXRoIFhNTC48L2Rlc2NyaXB0aW9uPjwvYm9vaz48L2NhdGFsb2c+\"" +

+                                       "} ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]},contentRoot=[catalog: null]}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Category with Bad Content in Base64

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

+                                       "}]," +

+                                       "\"Content\" :  \"PD94bWwgdmV\"" +

+                                       "} ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+    }

+

+

+

+

+    @Test

+    public void testDuplicates() {

+        // duplicate of same element within Category array is ok

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] }, " +

+                                       "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] } "

+                                       + "] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=abc}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // duplicate Attribute

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [" +

+                                       "{\"CategoryId\" : \"custom-category\","

+                                       + " \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}], "

+                                       + " \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] "

+                                       + "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // dup id

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] } "

+                                       + "] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // dup DataType

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] } "

+                                       + "] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // dup Value

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"DataType\"	: \"http://www.w3.org/2001/XMLSchema#string\", " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "\"Value\"	: \"abc\" " +

+                                       "}] } "

+                                       + "] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // duplicate Content

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{"

+                                       + "\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\",\"aValue\",\"aValue\"] " +

+                                       "}]," +

+                                       "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" +

+                                       "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

+                                       "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

+                                       "</book></catalog>\" , " +

+                                       "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" +

+                                       "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

+                                       "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

+                                       "</book></catalog>\"" +

+                                       "} ] }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

+

 //TODO - Shorthand for CategoryId ????

-        

-        

+

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestConformanceTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestConformanceTest.java
index eca5229..994d425 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestConformanceTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestConformanceTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -55,10 +55,10 @@
 import com.att.research.xacml.std.json.JSONStructureException;

 /**

  * Test JSON Request convert to object - Conformance tests

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * NOTE:

  * The "correct" way to verify that each JSON string gets translated into our internal Objects correctly is to look explicitly at each of the child objects

  * and verify that they are correct.  This would involve a lot of coding to get child of child of child and individually verify each property of each element.

@@ -67,72 +67,72 @@
  * This has two possible sources of error:

  * 	- toString might not include some sub-component, and

  * 	- the initial verification of the resulting string is done by hand and may have been incorrect.

- * 

+ *

  * @author glenngriffin

  *

  */

 public class RequestConformanceTest {

-        

-        // where to find the conformance test XML files

-        private final String CONFORMANCE_DIRECTORY_PATH = "testsets/conformance/xacml3.0-ct-v.0.4";

-        

-        // The request object output from each test conversion from JSON string

-        Request request;

+

+    // where to find the conformance test XML files

+    private final String CONFORMANCE_DIRECTORY_PATH = "testsets/conformance/xacml3.0-ct-v.0.4";

+

+    // The request object output from each test conversion from JSON string

+    Request request;

 

 

-        

-        

-        

-        // test just one of each top-level element.

-        // For simple elements also test for incorrect type

-        @Test

-        public void testConformanceRequests() {

-                

-                List<File> filesInDirectory = null;

-                

-                File conformanceDirectory = null;

-                

-                File currentFile = null;

-                

-                try {

-                        conformanceDirectory = new File(CONFORMANCE_DIRECTORY_PATH);

-                        filesInDirectory = getRequestsInDirectory(conformanceDirectory);

-                } catch (Exception e) {

-                        fail("Unable to set up Conformance tests for dir '" + conformanceDirectory.getAbsolutePath()+"' e="+ e);

-                }

-                

-                // run through each XML file

-                //	- load the file from XML into an internal Request object

-                //	- generate the JSON representation of that Request object

-                //	- load that JSON representation into a new Request object

-                //	- compare the 2 Request objects

-                Request xmlRequest = null;

-                Request jsonRequest = null;

-                try {

-                        for (File f : filesInDirectory) {

-                                currentFile = f;

+

+

+

+    // test just one of each top-level element.

+    // For simple elements also test for incorrect type

+    @Test

+    public void testConformanceRequests() {

+

+        List<File> filesInDirectory = null;

+

+        File conformanceDirectory = null;

+

+        File currentFile = null;

+

+        try {

+            conformanceDirectory = new File(CONFORMANCE_DIRECTORY_PATH);

+            filesInDirectory = getRequestsInDirectory(conformanceDirectory);

+        } catch (Exception e) {

+            fail("Unable to set up Conformance tests for dir '" + conformanceDirectory.getAbsolutePath()+"' e="+ e);

+        }

+

+        // run through each XML file

+        //	- load the file from XML into an internal Request object

+        //	- generate the JSON representation of that Request object

+        //	- load that JSON representation into a new Request object

+        //	- compare the 2 Request objects

+        Request xmlRequest = null;

+        Request jsonRequest = null;

+        try {

+            for (File f : filesInDirectory) {

+                currentFile = f;

 

 //// This is a simple way to select just one file for debugging - comment out when not being used

 //if ( ! f.getName().equals("IIA023Request.xml")) {   continue;  }

 

 // during debugging it is helpful to know what file it is starting to work on

 //				System.out.println("starting file="+currentFile.getName());

-                                

-                                try {

-                                        // load XML into a Request object

-                                        xmlRequest = DOMRequest.load(f);

-                                        xmlRequest.getStatus();

-                                } catch (Exception e) {

-                                        // if XML does not load, just note it and continue with next file

-                                        System.out.println("XML file did not load: '" + f.getName() + "  e=" + e);

-                                        continue;

-                                }

-                                

+

+                try {

+                    // load XML into a Request object

+                    xmlRequest = DOMRequest.load(f);

+                    xmlRequest.getStatus();

+                } catch (Exception e) {

+                    // if XML does not load, just note it and continue with next file

+                    System.out.println("XML file did not load: '" + f.getName() + "  e=" + e);

+                    continue;

+                }

+

 //System.out.println(JSONRequest.toString(xmlRequest, false));

 

-                                // generate JSON from the Request

-                                String jsonString = JSONRequest.toString(xmlRequest, false);

-                                

+                // generate JSON from the Request

+                String jsonString = JSONRequest.toString(xmlRequest, false);

+

 

 // single-value elements

 //jsonString = "{\"Request\":{\"Category\":[{\"CategoryId\":\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\",\"Attribute\":["

@@ -164,15 +164,15 @@
 //		+ "]}],\"ReturnPolicyIdList\":false,\"CombinedDecision\":false}}";

 

 

-                                

-                                

-                                

-                                

+

+

+

+

 // array attributes WITH explicit data types

-                        

-                        

-                                

-                                

+

+

+

+

 // String for testing Arrays of Attribute values

 //jsonString = "{\"Request\":{\"Category\":[{\"CategoryId\":\"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\",\"Attribute\":["

 //		+ "{\"Issuer\":\"ConformanceTester\",\"Value\":[\"test string\",\"Julius Hibbert\",\"Julius Hibbert as string\"],\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"IncludeInResult\":true,\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject:subject-id\"},"

@@ -213,137 +213,137 @@
 //		+ "{\"Issuer\":\"ConformanceTester\",\"Value\":\"22:12:10Z\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#time\",\"IncludeInResult\":true,\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:environment:current-time\"}]}]"

 //		+ ",\"ReturnPolicyIdList\":false,\"CombinedDecision\":false}}";

 

-        

-                                

-                                

-                                // load JSON into a Request

-                                jsonRequest = JSONRequest.load(jsonString);

-                                

-                                // compare the two Request objects

-                                

-                                // check simple things first

-                                assertEquals("File '" + currentFile.getName() + "' CombinedDecision", xmlRequest.getCombinedDecision(), jsonRequest.getCombinedDecision());

-                                assertEquals("File '" + currentFile.getName() + "' getReturnPolicyIdList", xmlRequest.getReturnPolicyIdList(), jsonRequest.getReturnPolicyIdList());

-                                assertEquals("File '" + currentFile.getName() + "' requestDefaults", xmlRequest.getRequestDefaults(), jsonRequest.getRequestDefaults());

 

-                                // multiRequests (guaranteed to not be null)

-                                // We do NOT care about ordering, so compare the two collections inefficiently

-                                Collection<RequestReference> xmlCollection = xmlRequest.getMultiRequests();

-                                Collection<RequestReference> jsonCollection = jsonRequest.getMultiRequests();

-                                String errorMessage = null;

-                                if (jsonCollection.size() != xmlCollection.size()) {

-                                        errorMessage = "File '" + currentFile.getName() + "' MultiRequests not same size.  ";

-                                } else if (! jsonCollection.containsAll(xmlCollection)) {

-                                        errorMessage = "File '" + currentFile.getName() + "' MultiRequests have different contents.  ";

-                                }

-                                if (errorMessage != null) {

-                                        String xmlContents = "";

-                                        String jsonContents = "";

-                                        Iterator<RequestReference> rrIt = xmlCollection.iterator();

-                                        while (rrIt.hasNext()) {

-                                                xmlContents += "\n   " + rrIt.next().toString(); 

-                                        }

-                                        rrIt = jsonCollection.iterator();

-                                        while (rrIt.hasNext()) { 

-                                                jsonContents += "\n  " + rrIt.next().toString(); 

-                                        }

-                                        fail(errorMessage + "\nXML(" + xmlCollection.size() + ")='" + xmlContents + 

-                                                        "'  \nJSON(" + jsonCollection.size() + ")='" + jsonContents +

-                                                        "'" +

-                                                        "\njson='" + jsonString + "'");

-                                }

-                                

-                                // attributes (guaranteed to not be null)

-                                // We do NOT care about ordering, so compare the two collections inefficiently

-                                Collection<RequestAttributes> xmlAttrCollection = xmlRequest.getRequestAttributes();

-                                Collection<RequestAttributes> jsonAttrCollection = jsonRequest.getRequestAttributes();

-                                errorMessage = null;

-                                if (jsonAttrCollection.size() != xmlAttrCollection.size()) {

-                                        errorMessage = "File '" + currentFile.getName() + "' RequestAttributes not same size.  ";

-                                } else if (! jsonAttrCollection.containsAll(xmlAttrCollection)) {

-                                        String attrName = "";

-                                        Iterator<RequestAttributes> rait = xmlAttrCollection.iterator();

-                                        while (rait.hasNext()) {

-                                                RequestAttributes ra = rait.next();

-                                                if (jsonAttrCollection.contains(ra) == false) {

-                                                        attrName = ra.toString();

-                                                }

-                                        }

-                                        errorMessage = "File '" + currentFile.getName() + "' RequestAttributes have different contents.  JSON is missing attr=" + attrName;

-                                }

-                                if (errorMessage != null) {

-                                        String xmlContents = "";

-                                        String jsonContents = "";

-                                        Iterator<RequestAttributes> rrIt = xmlAttrCollection.iterator();

-                                        while (rrIt.hasNext()) {

-                                                RequestAttributes ras = rrIt.next();

-                                                xmlContents += "\n   " + ras.toString();

-                                                if (ras.getContentRoot() != null) {

-                                                        StringWriter writer = new StringWriter();

-                                                        Transformer transformer = null;

-                                                        try {

-                                                                transformer = TransformerFactory.newInstance().newTransformer();

-                                                                transformer.transform(new DOMSource(ras.getContentRoot()), new StreamResult(writer));

-                                                        } catch (Exception e) {

-                                                                throw new JSONStructureException("Unable to Content node to string; e="+e);

-                                                        }

 

-                                                        xmlContents += "\n        Content: " + writer.toString();

-                                                }

-                                        }

-                                        rrIt = jsonAttrCollection.iterator();

-                                        while (rrIt.hasNext()) { 

-                                                RequestAttributes ras = rrIt.next();

-                                                jsonContents += "\n   " + ras.toString();	

-                                                if (ras.getContentRoot() != null) {

-                                                        StringWriter writer = new StringWriter();

-                                                        Transformer transformer = null;

-                                                        try {

-                                                                transformer = TransformerFactory.newInstance().newTransformer();

-                                                                transformer.transform(new DOMSource(ras.getContentRoot()), new StreamResult(writer));

-                                                        } catch (Exception e) {

-                                                                throw new JSONStructureException("Unable to Content node to string; e="+e);

-                                                        }

 

-                                                        jsonContents += "\n        Content: " + writer.toString();

-                                                }

-                                        }

-                                        fail(errorMessage + "\nXML(" + xmlAttrCollection.size() + ")='" + xmlContents + 

-                                                        "'  \nJSON(" + jsonAttrCollection.size() + ")='" + jsonContents +

-                                                        "\njson='" + jsonString + "'");

-                                }

-                                

+                // load JSON into a Request

+                jsonRequest = JSONRequest.load(jsonString);

 

-                        }			

+                // compare the two Request objects

 

-                } catch (Exception e) {

-                        fail ("Failed test with '" + currentFile.getName() + "', e=" + e);

+                // check simple things first

+                assertEquals("File '" + currentFile.getName() + "' CombinedDecision", xmlRequest.getCombinedDecision(), jsonRequest.getCombinedDecision());

+                assertEquals("File '" + currentFile.getName() + "' getReturnPolicyIdList", xmlRequest.getReturnPolicyIdList(), jsonRequest.getReturnPolicyIdList());

+                assertEquals("File '" + currentFile.getName() + "' requestDefaults", xmlRequest.getRequestDefaults(), jsonRequest.getRequestDefaults());

+

+                // multiRequests (guaranteed to not be null)

+                // We do NOT care about ordering, so compare the two collections inefficiently

+                Collection<RequestReference> xmlCollection = xmlRequest.getMultiRequests();

+                Collection<RequestReference> jsonCollection = jsonRequest.getMultiRequests();

+                String errorMessage = null;

+                if (jsonCollection.size() != xmlCollection.size()) {

+                    errorMessage = "File '" + currentFile.getName() + "' MultiRequests not same size.  ";

+                } else if (! jsonCollection.containsAll(xmlCollection)) {

+                    errorMessage = "File '" + currentFile.getName() + "' MultiRequests have different contents.  ";

+                }

+                if (errorMessage != null) {

+                    String xmlContents = "";

+                    String jsonContents = "";

+                    Iterator<RequestReference> rrIt = xmlCollection.iterator();

+                    while (rrIt.hasNext()) {

+                        xmlContents += "\n   " + rrIt.next().toString();

+                    }

+                    rrIt = jsonCollection.iterator();

+                    while (rrIt.hasNext()) {

+                        jsonContents += "\n  " + rrIt.next().toString();

+                    }

+                    fail(errorMessage + "\nXML(" + xmlCollection.size() + ")='" + xmlContents +

+                         "'  \nJSON(" + jsonCollection.size() + ")='" + jsonContents +

+                         "'" +

+                         "\njson='" + jsonString + "'");

                 }

 

-                

-        }

-        

-        //

-        // HELPER to get list of all Request files in the given directory

-        //

-        

-        private List<File> getRequestsInDirectory(File directory) {

-                List<File> fileList = new ArrayList<File>();

-                

-                File[] fileArray = directory.listFiles();

-                for (File f : fileArray) {

-                        if (f.isDirectory()) {

-                                List<File> subDirList = getRequestsInDirectory(f);

-                                fileList.addAll(subDirList);

+                // attributes (guaranteed to not be null)

+                // We do NOT care about ordering, so compare the two collections inefficiently

+                Collection<RequestAttributes> xmlAttrCollection = xmlRequest.getRequestAttributes();

+                Collection<RequestAttributes> jsonAttrCollection = jsonRequest.getRequestAttributes();

+                errorMessage = null;

+                if (jsonAttrCollection.size() != xmlAttrCollection.size()) {

+                    errorMessage = "File '" + currentFile.getName() + "' RequestAttributes not same size.  ";

+                } else if (! jsonAttrCollection.containsAll(xmlAttrCollection)) {

+                    String attrName = "";

+                    Iterator<RequestAttributes> rait = xmlAttrCollection.iterator();

+                    while (rait.hasNext()) {

+                        RequestAttributes ra = rait.next();

+                        if (jsonAttrCollection.contains(ra) == false) {

+                            attrName = ra.toString();

                         }

-                        if (f.getName().endsWith("Request.xml")) {

-                                fileList.add(f);

-                        }

+                    }

+                    errorMessage = "File '" + currentFile.getName() + "' RequestAttributes have different contents.  JSON is missing attr=" + attrName;

                 }

-                return fileList;

-                

+                if (errorMessage != null) {

+                    String xmlContents = "";

+                    String jsonContents = "";

+                    Iterator<RequestAttributes> rrIt = xmlAttrCollection.iterator();

+                    while (rrIt.hasNext()) {

+                        RequestAttributes ras = rrIt.next();

+                        xmlContents += "\n   " + ras.toString();

+                        if (ras.getContentRoot() != null) {

+                            StringWriter writer = new StringWriter();

+                            Transformer transformer = null;

+                            try {

+                                transformer = TransformerFactory.newInstance().newTransformer();

+                                transformer.transform(new DOMSource(ras.getContentRoot()), new StreamResult(writer));

+                            } catch (Exception e) {

+                                throw new JSONStructureException("Unable to Content node to string; e="+e);

+                            }

+

+                            xmlContents += "\n        Content: " + writer.toString();

+                        }

+                    }

+                    rrIt = jsonAttrCollection.iterator();

+                    while (rrIt.hasNext()) {

+                        RequestAttributes ras = rrIt.next();

+                        jsonContents += "\n   " + ras.toString();

+                        if (ras.getContentRoot() != null) {

+                            StringWriter writer = new StringWriter();

+                            Transformer transformer = null;

+                            try {

+                                transformer = TransformerFactory.newInstance().newTransformer();

+                                transformer.transform(new DOMSource(ras.getContentRoot()), new StreamResult(writer));

+                            } catch (Exception e) {

+                                throw new JSONStructureException("Unable to Content node to string; e="+e);

+                            }

+

+                            jsonContents += "\n        Content: " + writer.toString();

+                        }

+                    }

+                    fail(errorMessage + "\nXML(" + xmlAttrCollection.size() + ")='" + xmlContents +

+                         "'  \nJSON(" + jsonAttrCollection.size() + ")='" + jsonContents +

+                         "\njson='" + jsonString + "'");

+                }

+

+

+            }

+

+        } catch (Exception e) {

+            fail ("Failed test with '" + currentFile.getName() + "', e=" + e);

         }

-        

+

+

+    }

+

+    //

+    // HELPER to get list of all Request files in the given directory

+    //

+

+    private List<File> getRequestsInDirectory(File directory) {

+        List<File> fileList = new ArrayList<File>();

+

+        File[] fileArray = directory.listFiles();

+        for (File f : fileArray) {

+            if (f.isDirectory()) {

+                List<File> subDirList = getRequestsInDirectory(f);

+                fileList.addAll(subDirList);

+            }

+            if (f.getName().endsWith("Request.xml")) {

+                fileList.add(f);

+            }

+        }

+        return fileList;

+

+    }

+

 }

 

 

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestDefaultCategoryTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestDefaultCategoryTest.java
index 4287850..f0f0bff 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestDefaultCategoryTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestDefaultCategoryTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -40,10 +40,10 @@
 import com.att.research.xacml.std.json.JSONStructureException;

 /**

  * Test JSON Request convert to object - Default Category object tests

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * NOTE:

  * The "correct" way to verify that each JSON string gets translated into our internal Objects correctly is to look explicitly at each of the child objects

  * and verify that they are correct.  This would involve a lot of coding to get child of child of child and individually verify each property of each element.

@@ -52,1387 +52,1387 @@
  * This has two possible sources of error:

  * 	- toString might not include some sub-component, and

  * 	- the initial verification of the resulting string is done by hand and may have been incorrect.

- * 

+ *

  * @author glenngriffin

  *

  */

 public class RequestDefaultCategoryTest {

-        

-        // The request object output from each test conversion from JSON string

-        Request request;

 

-        

-        /*

-         * Request that uses all fields with both single and multiple  entries

-         */

-        String allFieldsRequest = 

-                        "{\"Request\": {" +

-                                        "\"ReturnPolicyIdList\" : true ," +

-                                        "\"CombinedDecision\" : true ," +

-                                        "\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\"," +

-                                        "\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar1\"]" +

-                                        "}]" +   

-                                  "}," +

-

-                                        "\"Category\": [" +

-                                                "{ " +

-                                                "\"CategoryId\": \"custom-category\", " +

-                                                "\"Id\" : \"customId\", " +

-                                                "\"Attribute\" : [" +

-                                                        "{" +

-                                                                "\"AttributeId\"		: \"document-id\", " +

-                                                                "\"DataType\"	: \"integer\", " +

-                                                                "\"Value\"	: 123 " +

-                                                                "}, " +

-                                                                "{" +

-                                                                "\"AttributeId\"		: \"document-url\", " +

-                                                                "\"DataType\"	: \"anyURI\", " +

-                                                                "\"Value\"	: \"http://somewhere.over.the.com/rainbow\" " +

-                                                        "}, " +

-                                                                "{" +

-                                                                "\"AttributeId\"		: \"page-list\", " +

-                                                                "\"Value\"	: [1, 2, 3, 4.5, 3, 2, 1] " +

-                                                        "} " +

-                                                "]" +

-                                            "}, " +

-                                            "{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "], " +

-                                            

-                                        "\"AccessSubject\":{ " +

-                                                "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" + 

-                                                        "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

-                                                        "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

-                                                        "</book></catalog>\"," +

-                                                "\"Attribute\" : []" +

-                                        "}, " +

-                                        

-                                        "\"Resource\" : {" +

-                                                "\"Content\" : \"PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPkdhbWJhcmRlbGxhLCBNYXR0aGV3PC9hdXRob3I+PHRpdGxlPlhNT" +

-                                                        "CBEZXZlbG9wZXIncyBHdWlkZTwvdGl0bGU+PGdlbnJlPkNvbXB1dGVyPC9nZW5yZT48cHJpY2U+NDQuOTU8L3ByaWNlPjxwdWJsaXNoX2RhdGU+MjAwMC0xMC0wMTwvcHVibGlzaF"+

-                                                        "9kYXRlPjxkZXNjcmlwdGlvbj5BbiBpbi1kZXB0aCBsb29rIGF0IGNyZWF0aW5nIGFwcGxpY2F0aW9ucyB3aXRoIFhNTC48L2Rlc2NyaXB0aW9uPjwvYm9vaz48L2NhdGFsb2c+\"" +

+    // The request object output from each test conversion from JSON string

+    Request request;

 

 

-                                        "} " +

+    /*

+     * Request that uses all fields with both single and multiple  entries

+     */

+    String allFieldsRequest =

+        "{\"Request\": {" +

+        "\"ReturnPolicyIdList\" : true ," +

+        "\"CombinedDecision\" : true ," +

+        "\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\"," +

+        "\"MultiRequests\" : {" +

+        "\"RequestReference\": [" +

+        "{ " +

+        "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+        "}," +

+        "{" +

+        "\"ReferenceId\" : [\"foo2\",\"bar1\"]" +

+        "}]" +

+        "}," +

 

-                                  

-                        "}}";

-        

-        /*

-         * The following example comes directly from the JSON Profile Spec

-         */

-        String exampleFromSpec = "{ " +

-                        "\"Request\" : { " +

-                                "\"AccessSubject\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Andreas\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Gamla Stan\" " +

-                                                "} " +

-                                        "] " +

-                                "}, " +

-                                "\"Action\" : { " +

-                                        "\"Attribute\":  " +

-                                                "{ " +

-                                                        "\"Id\" : \"action-id\", " +

-                                                        "\"Value\" : \"http://www.xacml.eu/buy\", " +

-                                                        "\"DataType\" : \"anyURI\" " +

-                                                "} " +

-                                "}, " +

-                                "\"Resource\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"book-title\", " +

-                                                        "\"Value\" : \"Learn German in 90 days\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"currency\", " +

-                                                        "\"Value\" : \"SEK\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"price\", " +

-                                                        "\"Value\" : 123.34 " +

-                                                "} " +

-                                                "] " +

-                                        "} " +

-                                "} " +

-                        "} ";

+        "\"Category\": [" +

+        "{ " +

+        "\"CategoryId\": \"custom-category\", " +

+        "\"Id\" : \"customId\", " +

+        "\"Attribute\" : [" +

+        "{" +

+        "\"AttributeId\"		: \"document-id\", " +

+        "\"DataType\"	: \"integer\", " +

+        "\"Value\"	: 123 " +

+        "}, " +

+        "{" +

+        "\"AttributeId\"		: \"document-url\", " +

+        "\"DataType\"	: \"anyURI\", " +

+        "\"Value\"	: \"http://somewhere.over.the.com/rainbow\" " +

+        "}, " +

+        "{" +

+        "\"AttributeId\"		: \"page-list\", " +

+        "\"Value\"	: [1, 2, 3, 4.5, 3, 2, 1] " +

+        "} " +

+        "]" +

+        "}, " +

+        "{ " +

+        "\"CategoryId\": \"another-custom-cat\", " +

+        "\"Id\" : \"anotherXmlId\", " +

+        "\"Attribute\" : []" +

+        "} " +

+        "], " +

 

-        

-        /*

-         * The following example comes directly from the JSON Profile Spec (modified to include a "</Catalog>" missing from both examples).

-         * It shows the two ways of handling XPath content, as escaped XML and as Base64 encoding.

-         */

-        String xPathExampleFromSpec = "{ " +

-                        "\"Request\" : { " +

-                                "\"Resource\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"urn:oasis:names:tc:xacml:3.0:content-selector\", " +

-                                            "\"DataType\" : \"xpathExpression\", " +

-                                            "\"Value\" : { " +

-                                                "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", " +

-                                                "\"Namespaces\" : [{ " +

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}, " +

-                                                    "{ " +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                    "} " +

-                                                "], " +

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" " +

-                                            "} " +

-                                        "} " +

-                                        "] " +

-                                "} " +

-                        "} " +

-                "} ";

+        "\"AccessSubject\":{ " +

+        "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" +

+        "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

+        "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

+        "</book></catalog>\"," +

+        "\"Attribute\" : []" +

+        "}, " +

 

-        

-        // test Shorthand Category notation for elements not tested in their own section below.

-        // Categories that are more commonly used are fully tested. 

-        // Given that the functions within the categories are the same irrespective of the name of the category, 

-        // we assume that the contents of the category will work ok once the Shorthand notation is recognized, so all we need to test is the shorthand

-        // The ones that are tested in their own sections are:

-        //		AccessSubject

-        //		Action

-        //		Resource

-        //		Environment 

-        // test Subject

-        @Test

-        public void testCategoryShorthand() {

-        

-                // RecipientSubject present both as element within Category and as separate RecipientSubject element at same level as Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                                "}] }, "

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"RecipientSubject\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // IntermediarySubject present both as element within Category and as separate IntermediarySubject element at same level as Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                                "}] }, "

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"IntermediarySubject\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Codebase present both as element within Category and as separate Codebase element at same level as Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:codebase\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                                "}] }, "

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:codebase\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"Codebase\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                

-                // RequestingMachine present both as element within Category and as separate RequestingMachine element at same level as Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                                "}] }, "

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"RequestingMachine\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+        "\"Resource\" : {" +

+        "\"Content\" : \"PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPkdhbWJhcmRlbGxhLCBNYXR0aGV3PC9hdXRob3I+PHRpdGxlPlhNT" +

+        "CBEZXZlbG9wZXIncyBHdWlkZTwvdGl0bGU+PGdlbnJlPkNvbXB1dGVyPC9nZW5yZT48cHJpY2U+NDQuOTU8L3ByaWNlPjxwdWJsaXNoX2RhdGU+MjAwMC0xMC0wMTwvcHVibGlzaF"+

+        "9kYXRlPjxkZXNjcmlwdGlvbj5BbiBpbi1kZXB0aCBsb29rIGF0IGNyZWF0aW5nIGFwcGxpY2F0aW9ucyB3aXRoIFhNTC48L2Rlc2NyaXB0aW9uPjwvYm9vaz48L2NhdGFsb2c+\"" +

+

+

+        "} " +

+

+

+        "}}";

+

+    /*

+     * The following example comes directly from the JSON Profile Spec

+     */

+    String exampleFromSpec = "{ " +

+                             "\"Request\" : { " +

+                             "\"AccessSubject\" : { " +

+                             "\"Attribute\": [ " +

+                             "{ " +

+                             "\"Id\" : \"subject-id\", " +

+                             "\"Value\" : \"Andreas\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"location\", " +

+                             "\"Value\" : \"Gamla Stan\" " +

+                             "} " +

+                             "] " +

+                             "}, " +

+                             "\"Action\" : { " +

+                             "\"Attribute\":  " +

+                             "{ " +

+                             "\"Id\" : \"action-id\", " +

+                             "\"Value\" : \"http://www.xacml.eu/buy\", " +

+                             "\"DataType\" : \"anyURI\" " +

+                             "} " +

+                             "}, " +

+                             "\"Resource\" : { " +

+                             "\"Attribute\": [ " +

+                             "{ " +

+                             "\"Id\" : \"book-title\", " +

+                             "\"Value\" : \"Learn German in 90 days\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"currency\", " +

+                             "\"Value\" : \"SEK\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"price\", " +

+                             "\"Value\" : 123.34 " +

+                             "} " +

+                             "] " +

+                             "} " +

+                             "} " +

+                             "} ";

+

+

+    /*

+     * The following example comes directly from the JSON Profile Spec (modified to include a "</Catalog>" missing from both examples).

+     * It shows the two ways of handling XPath content, as escaped XML and as Base64 encoding.

+     */

+    String xPathExampleFromSpec = "{ " +

+                                  "\"Request\" : { " +

+                                  "\"Resource\" : { " +

+                                  "\"Attribute\": [ " +

+                                  "{ " +

+                                  "\"Id\" : \"urn:oasis:names:tc:xacml:3.0:content-selector\", " +

+                                  "\"DataType\" : \"xpathExpression\", " +

+                                  "\"Value\" : { " +

+                                  "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", " +

+                                  "\"Namespaces\" : [{ " +

+                                  "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                  "}, " +

+                                  "{ " +

+                                  "\"Prefix\" : \"md\", " +

+                                  "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                  "} " +

+                                  "], " +

+                                  "\"XPath\" : \"md:record/md:patient/md:patientDoB\" " +

+                                  "} " +

+                                  "} " +

+                                  "] " +

+                                  "} " +

+                                  "} " +

+                                  "} ";

+

+

+    // test Shorthand Category notation for elements not tested in their own section below.

+    // Categories that are more commonly used are fully tested.

+    // Given that the functions within the categories are the same irrespective of the name of the category,

+    // we assume that the contents of the category will work ok once the Shorthand notation is recognized, so all we need to test is the shorthand

+    // The ones that are tested in their own sections are:

+    //		AccessSubject

+    //		Action

+    //		Resource

+    //		Environment

+    // test Subject

+    @Test

+    public void testCategoryShorthand() {

+

+        // RecipientSubject present both as element within Category and as separate RecipientSubject element at same level as Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"RecipientSubject\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // IntermediarySubject present both as element within Category and as separate IntermediarySubject element at same level as Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"IntermediarySubject\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Codebase present both as element within Category and as separate Codebase element at same level as Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:codebase\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:codebase\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"Codebase\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:codebase,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

 

 

 

-

-

-        

-

-

-        

-

-

-        

-        

-        

-        

-        

-        // test AccessSubject

-        // Include test for backward compatibility with "Subject"

-        @Test

-        public void testAccessSubjectRequest() {

-                

-                // AccessSubject absent

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // AccessSubject as normal element under Category (with CategoryId==subject category id)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // multiple AccessSubjects under Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": ["

-                                        + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] }, "

-                                        + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: \"aValue\"" +

-                                        "}] } "

-                                        + "] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // AccessSubject present both as element within Category and as separate AccessSubject element at same level as Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                                "}] }, "

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"AccessSubject\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // AccessSubject present, no other Category element

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"AccessSubject\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Subject present, no other Category element (Backward Compatibility

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Subject\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // AccessSubject present, 1/multiple other Category element also present

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"AccessSubject\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // 2 AccessSubjects - duplicates fail

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"AccessSubject\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                        + 

-                                        "\"AccessSubject\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // AccessSubject with correct Category value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"AccessSubject\" : { " +

-                                                "\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\" ," +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // AccessSubject with wrong Category value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"AccessSubject\" : { " +

-                                                "\"CategoryId\" : \"notthesubject\" ," +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // AccessSubject with array of sub-object AccessSubjects (Multi Decision)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"AccessSubject\" : ["

-                                        + "{ " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "}, "

-                                        + "{ " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Arless\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Somewhere\" " +

-                                                "} " +

-                                        "] " +

-                                        "}, "

-                                        + "{ " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Barry\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Elsewhere\" " +

-                                                "} " +

-                                        "] " +

-                                        "} "

-                                + "]"

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Arless}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Somewhere}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Barry}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Elsewhere}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-

+        // RequestingMachine present both as element within Category and as separate RequestingMachine element at same level as Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"RequestingMachine\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

-        

-        

-        

-        

-        

-        

-        

-        

-        // Action ... duplicate all AccessSubject tests...

-        // test Action

-        @Test

-        public void testActionRequest() {

-                

-                // Action absent

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action as normal element under Category (with CategoryId==subject category id)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // multiple Actions under Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": ["

-                                        + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] }, "

-                                        + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: \"aValue\"" +

-                                        "}] } "

-                                        + "] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action present both as element within Category and as separate Action element at same level as Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                                "}] }, "

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"Action\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action present, no other Category element

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Action\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action present, 1/multiple other Category element also present

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"Action\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // 2 Actions - duplicates fail

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Action\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                        + 

-                                        "\"Action\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action with correct Category value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Action\" : { " +

-                                                "\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:action\" ," +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action with wrong Category value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Action\" : { " +

-                                                "\"CategoryId\" : \"notthesubject\" ," +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action with array of sub-object Actions (Multi Decision)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Action\" : ["

-                                        + "{ " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "}, "

-                                        + "{ " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Arless\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Somewhere\" " +

-                                                "} " +

-                                        "] " +

-                                        "}, "

-                                        + "{ " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Barry\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Elsewhere\" " +

-                                                "} " +

-                                        "] " +

-                                        "} "

-                                + "]"

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Arless}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Somewhere}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Barry}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Elsewhere}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+    }

 

-        }

-        

-        

-        

-        

-        // Resource ... duplicate all AccessSubject tests...

-        // test Resource

-        @Test

-        public void testResourceRequest() {

-                

-                // Resource absent

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource as normal element under Category (with CategoryId==subject category id)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // multiple Resources under Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": ["

-                                        + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] }, "

-                                        + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: \"aValue\"" +

-                                        "}] } "

-                                        + "] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource present both as element within Category and as separate Resource element at same level as Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                                "}] }, "

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"Resource\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource present, no other Category element

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Resource\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource present, 1/multiple other Category element also present

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"Resource\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // 2 Resources - duplicates fail

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Resource\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                        + 

-                                        "\"Resource\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource with correct Category value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Resource\" : { " +

-                                                "\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\" ," +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource with wrong Category value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Resource\" : { " +

-                                                "\"CategoryId\" : \"notthesubject\" ," +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource with array of sub-object Resources (Multi Decision)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Resource\" : ["

-                                        + "{ " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "}, "

-                                        + "{ " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Arless\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Somewhere\" " +

-                                                "} " +

-                                        "] " +

-                                        "}, "

-                                        + "{ " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Barry\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Elsewhere\" " +

-                                                "} " +

-                                        "] " +

-                                        "} "

-                                + "]"

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Arless}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Somewhere}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Barry}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Elsewhere}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

 

-        }

-        

-        

-        

-        

-        

-        

-        // Environment ... duplicate all AccessSubject tests ...

-        // test Environment

-        @Test

-        public void testEnvironmentRequest() {

-                

-                // Environment absent

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment as normal element under Category (with CategoryId==subject category id)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                "\"Id\" : \"document-id\", " +

-                                "\"Value\"	: \"aValue\" " +

-                                        "}] } ] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // multiple Environments under Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {\"Category\": ["

-                                        + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                        "}] }, "

-                                        + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                        "\"Id\" : \"document-id\", " +

-                                        "\"Value\"	: \"aValue\"" +

-                                        "}] } "

-                                        + "] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment present both as element within Category and as separate Environment element at same level as Category

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

-                                                "}] }, "

-                                                + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"Environment\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment present, no other Category element

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Environment\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment present, 1/multiple other Category element also present

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + "\"Category\": ["

-                                                + "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

-                                                "\"Id\" : \"document-id\", " +

-                                                "\"Value\"	: \"aValue\"" +

-                                                "}] } "

-                                                + "]," +

-                                        "\"Environment\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // 2 Environments - duplicates fail

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Environment\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                        + 

-                                        "\"Environment\" : { " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment with correct Category value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Environment\" : { " +

-                                                "\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\" ," +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment with wrong Category value

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Environment\" : { " +

-                                                "\"CategoryId\" : \"notthesubject\" ," +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "} " 

-                                + " }}");

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment with array of sub-object Environments (Multi Decision)

-                try {

-                        request = JSONRequest.load("{\"Request\" : {"

-                                        + 

-                                        "\"Environment\" : ["

-                                        + "{ " +

-                                                "\"Attribute\": [ " +

-                                                        "{ " +

-                                                                "\"Id\" : \"subject-id\", " +

-                                                                "\"Value\" : \"Andreas\" " +

-                                                        "}, " +

-                                                        "{ " +

-                                                                "\"Id\" : \"location\", " +

-                                                                "\"Value\" : \"Gamla Stan\" " +

-                                                        "} " +

-                                                "] " +

-                                        "}, "

-                                        + "{ " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Arless\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Somewhere\" " +

-                                                "} " +

-                                        "] " +

-                                        "}, "

-                                        + "{ " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Barry\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Elsewhere\" " +

-                                                "} " +

-                                        "] " +

-                                        "} "

-                                + "]"

-                                + " }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Arless}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Somewhere}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Barry}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Elsewhere}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

 

+

+

+

+

+

+

+

+

+

+

+

+

+

+    // test AccessSubject

+    // Include test for backward compatibility with "Subject"

+    @Test

+    public void testAccessSubjectRequest() {

+

+        // AccessSubject absent

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

 

-        

+        // AccessSubject as normal element under Category (with CategoryId==subject category id)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // multiple AccessSubjects under Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // AccessSubject present both as element within Category and as separate AccessSubject element at same level as Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"AccessSubject\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // AccessSubject present, no other Category element

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"AccessSubject\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Subject present, no other Category element (Backward Compatibility

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Subject\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // AccessSubject present, 1/multiple other Category element also present

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"AccessSubject\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // 2 AccessSubjects - duplicates fail

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"AccessSubject\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       +

+                                       "\"AccessSubject\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // AccessSubject with correct Category value

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"AccessSubject\" : { " +

+                                       "\"CategoryId\" : \"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject\" ," +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // AccessSubject with wrong Category value

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"AccessSubject\" : { " +

+                                       "\"CategoryId\" : \"notthesubject\" ," +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // AccessSubject with array of sub-object AccessSubjects (Multi Decision)

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"AccessSubject\" : ["

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "}, "

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Arless\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Somewhere\" " +

+                                       "} " +

+                                       "] " +

+                                       "}, "

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Barry\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Elsewhere\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + "]"

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Arless}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Somewhere}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Barry}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Elsewhere}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

+

+

+

+

+

+

+

+    // Action ... duplicate all AccessSubject tests...

+    // test Action

+    @Test

+    public void testActionRequest() {

+

+        // Action absent

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action as normal element under Category (with CategoryId==subject category id)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // multiple Actions under Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action present both as element within Category and as separate Action element at same level as Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"Action\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action present, no other Category element

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Action\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action present, 1/multiple other Category element also present

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"Action\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // 2 Actions - duplicates fail

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Action\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       +

+                                       "\"Action\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action with correct Category value

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Action\" : { " +

+                                       "\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:action\" ," +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action with wrong Category value

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Action\" : { " +

+                                       "\"CategoryId\" : \"notthesubject\" ," +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action with array of sub-object Actions (Multi Decision)

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Action\" : ["

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "}, "

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Arless\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Somewhere\" " +

+                                       "} " +

+                                       "] " +

+                                       "}, "

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Barry\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Elsewhere\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + "]"

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Arless}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Somewhere}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Barry}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Elsewhere}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

+

+

+    // Resource ... duplicate all AccessSubject tests...

+    // test Resource

+    @Test

+    public void testResourceRequest() {

+

+        // Resource absent

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource as normal element under Category (with CategoryId==subject category id)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // multiple Resources under Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource present both as element within Category and as separate Resource element at same level as Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"Resource\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource present, no other Category element

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Resource\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource present, 1/multiple other Category element also present

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"Resource\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // 2 Resources - duplicates fail

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Resource\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       +

+                                       "\"Resource\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource with correct Category value

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Resource\" : { " +

+                                       "\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\" ," +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource with wrong Category value

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Resource\" : { " +

+                                       "\"CategoryId\" : \"notthesubject\" ," +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource with array of sub-object Resources (Multi Decision)

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Resource\" : ["

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "}, "

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Arless\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Somewhere\" " +

+                                       "} " +

+                                       "] " +

+                                       "}, "

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Barry\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Elsewhere\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + "]"

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Arless}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Somewhere}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Barry}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Elsewhere}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

+

+

+

+

+    // Environment ... duplicate all AccessSubject tests ...

+    // test Environment

+    @Test

+    public void testEnvironmentRequest() {

+

+        // Environment absent

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment as normal element under Category (with CategoryId==subject category id)

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": [{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\" " +

+                                       "}] } ] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // multiple Environments under Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment present both as element within Category and as separate Environment element at same level as Category

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: [ \"aValue\", \"aValue\", \"aValue\" ] " +

+                                       "}] }, "

+                                       + "{\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"Environment\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=document-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment present, no other Category element

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Environment\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment present, 1/multiple other Category element also present

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       + "\"Category\": ["

+                                       + "{\"CategoryId\" : \"custom-category\", \"Attribute\" : [{" +

+                                       "\"Id\" : \"document-id\", " +

+                                       "\"Value\"	: \"aValue\"" +

+                                       "}] } "

+                                       + "]," +

+                                       "\"Environment\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=aValue}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // 2 Environments - duplicates fail

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Environment\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       +

+                                       "\"Environment\" : { " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment with correct Category value

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Environment\" : { " +

+                                       "\"CategoryId\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:environment\" ," +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment with wrong Category value

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Environment\" : { " +

+                                       "\"CategoryId\" : \"notthesubject\" ," +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + " }}");

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment with array of sub-object Environments (Multi Decision)

+        try {

+            request = JSONRequest.load("{\"Request\" : {"

+                                       +

+                                       "\"Environment\" : ["

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Andreas\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Gamla Stan\" " +

+                                       "} " +

+                                       "] " +

+                                       "}, "

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Arless\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Somewhere\" " +

+                                       "} " +

+                                       "] " +

+                                       "}, "

+                                       + "{ " +

+                                       "\"Attribute\": [ " +

+                                       "{ " +

+                                       "\"Id\" : \"subject-id\", " +

+                                       "\"Value\" : \"Barry\" " +

+                                       "}, " +

+                                       "{ " +

+                                       "\"Id\" : \"location\", " +

+                                       "\"Value\" : \"Elsewhere\" " +

+                                       "} " +

+                                       "] " +

+                                       "} "

+                                       + "]"

+                                       + " }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Arless}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Somewhere}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Barry}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Elsewhere}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestMainTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestMainTest.java
index 6fbc63a..3a553a2 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestMainTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/RequestMainTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -40,10 +40,10 @@
 import com.att.research.xacml.std.json.JSONStructureException;

 /**

  * Test JSON Request convert to object - High-level Request-as-a-whole tests including test that fills in all fields with multiple values (where appropriate)

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * NOTE:

  * The "correct" way to verify that each JSON string gets translated into our internal Objects correctly is to look explicitly at each of the child objects

  * and verify that they are correct.  This would involve a lot of coding to get child of child of child and individually verify each property of each element.

@@ -52,1036 +52,1036 @@
  * This has two possible sources of error:

  * 	- toString might not include some sub-component, and

  * 	- the initial verification of the resulting string is done by hand and may have been incorrect.

- * 

+ *

  * @author glenngriffin

  *

  */

 public class RequestMainTest {

-        

-        // The request object output from each test conversion from JSON string

-        Request request;

 

-        

-        /*

-         * Request that uses all fields with both single and multiple  entries

-         */

-        String allFieldsRequest = 

-                        "{\"Request\": {" +

-                                        "\"ReturnPolicyIdList\" : true ," +

-                                        "\"CombinedDecision\" : true ," +

-                                        "\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\"," +

-                                        "\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar1\"]" +

-                                        "}]" +   

-                                  "}," +

-

-                                        "\"Category\": [" +

-                                                "{ " +

-                                                "\"CategoryId\": \"custom-category\", " +

-                                                "\"Id\" : \"customId\", " +

-                                                "\"Attribute\" : [" +

-                                                        "{" +

-                                                                "\"AttributeId\"		: \"document-id\", " +

-                                                                "\"DataType\"	: \"integer\", " +

-                                                                "\"Value\"	: 123 " +

-                                                                "}, " +

-                                                                "{" +

-                                                                "\"AttributeId\"		: \"document-url\", " +

-                                                                "\"DataType\"	: \"anyURI\", " +

-                                                                "\"Value\"	: \"http://somewhere.over.the.com/rainbow\" " +

-                                                        "}, " +

-                                                                "{" +

-                                                                "\"AttributeId\"		: \"page-list\", " +

-                                                                "\"Value\"	: [1, 2, 3, 4.5, 3, 2, 1] " +

-                                                        "} " +

-                                                "]" +

-                                            "}, " +

-                                            "{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "], " +

-                                            

-                                        "\"AccessSubject\":{ " +

-                                                "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" + 

-                                                        "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

-                                                        "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

-                                                        "</book></catalog>\"," +

-                                                "\"Attribute\" : []" +

-                                        "}, " +

-                                        

-                                        "\"Resource\" : {" +

-                                                "\"Content\" : \"PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPkdhbWJhcmRlbGxhLCBNYXR0aGV3PC9hdXRob3I+PHRpdGxlPlhNT" +

-                                                        "CBEZXZlbG9wZXIncyBHdWlkZTwvdGl0bGU+PGdlbnJlPkNvbXB1dGVyPC9nZW5yZT48cHJpY2U+NDQuOTU8L3ByaWNlPjxwdWJsaXNoX2RhdGU+MjAwMC0xMC0wMTwvcHVibGlzaF"+

-                                                        "9kYXRlPjxkZXNjcmlwdGlvbj5BbiBpbi1kZXB0aCBsb29rIGF0IGNyZWF0aW5nIGFwcGxpY2F0aW9ucyB3aXRoIFhNTC48L2Rlc2NyaXB0aW9uPjwvYm9vaz48L2NhdGFsb2c+\"" +

+    // The request object output from each test conversion from JSON string

+    Request request;

 

 

-                                        "} " +

+    /*

+     * Request that uses all fields with both single and multiple  entries

+     */

+    String allFieldsRequest =

+        "{\"Request\": {" +

+        "\"ReturnPolicyIdList\" : true ," +

+        "\"CombinedDecision\" : true ," +

+        "\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\"," +

+        "\"MultiRequests\" : {" +

+        "\"RequestReference\": [" +

+        "{ " +

+        "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+        "}," +

+        "{" +

+        "\"ReferenceId\" : [\"foo2\",\"bar1\"]" +

+        "}]" +

+        "}," +

 

-                                  

-                        "}}";

-        

-        /*

-         * The following example comes directly from the JSON Profile Spec

-         */

-        String exampleFromSpec = "{ " +

-                        "\"Request\" : { " +

-                                "\"AccessSubject\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"subject-id\", " +

-                                                        "\"Value\" : \"Andreas\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"location\", " +

-                                                        "\"Value\" : \"Gamla Stan\" " +

-                                                "} " +

-                                        "] " +

-                                "}, " +

-                                "\"Action\" : { " +

-                                        "\"Attribute\":  " +

-                                                "{ " +

-                                                        "\"Id\" : \"action-id\", " +

-                                                        "\"Value\" : \"http://www.xacml.eu/buy\", " +

-                                                        "\"DataType\" : \"anyURI\" " +

-                                                "} " +

-                                "}, " +

-                                "\"Resource\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"book-title\", " +

-                                                        "\"Value\" : \"Learn German in 90 days\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"currency\", " +

-                                                        "\"Value\" : \"SEK\" " +

-                                                "}, " +

-                                                "{ " +

-                                                        "\"Id\" : \"price\", " +

-                                                        "\"Value\" : 123.34 " +

-                                                "} " +

-                                                "] " +

-                                        "} " +

-                                "} " +

-                        "} ";

+        "\"Category\": [" +

+        "{ " +

+        "\"CategoryId\": \"custom-category\", " +

+        "\"Id\" : \"customId\", " +

+        "\"Attribute\" : [" +

+        "{" +

+        "\"AttributeId\"		: \"document-id\", " +

+        "\"DataType\"	: \"integer\", " +

+        "\"Value\"	: 123 " +

+        "}, " +

+        "{" +

+        "\"AttributeId\"		: \"document-url\", " +

+        "\"DataType\"	: \"anyURI\", " +

+        "\"Value\"	: \"http://somewhere.over.the.com/rainbow\" " +

+        "}, " +

+        "{" +

+        "\"AttributeId\"		: \"page-list\", " +

+        "\"Value\"	: [1, 2, 3, 4.5, 3, 2, 1] " +

+        "} " +

+        "]" +

+        "}, " +

+        "{ " +

+        "\"CategoryId\": \"another-custom-cat\", " +

+        "\"Id\" : \"anotherXmlId\", " +

+        "\"Attribute\" : []" +

+        "} " +

+        "], " +

 

-        

-        /*

-         * The following example comes directly from the JSON Profile Spec (modified to include a "</Catalog>" missing from both examples).

-         * It shows the two ways of handling XPath content, as escaped XML and as Base64 encoding.

-         */

-        String xPathExampleFromSpec = "{ " +

-                        "\"Request\" : { " +

-                                "\"Resource\" : { " +

-                                        "\"Attribute\": [ " +

-                                                "{ " +

-                                                        "\"Id\" : \"urn:oasis:names:tc:xacml:3.0:content-selector\", " +

-                                            "\"DataType\" : \"xpathExpression\", " +

-                                            "\"Value\" : { " +

-                                                "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", " +

-                                                "\"Namespaces\" : [{ " +

-                                                        "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

-                                                        "}, " +

-                                                    "{ " +

-                                                        "\"Prefix\" : \"md\", " +

-                                                        "\"Namespace\" : \"urn:example:med:schemas:record\" " +

-                                                    "} " +

-                                                "], " +

-                                                "\"XPath\" : \"md:record/md:patient/md:patientDoB\" " +

-                                            "} " +

-                                        "} " +

-                                        "] " +

-                                "} " +

-                        "} " +

-                "} ";

+        "\"AccessSubject\":{ " +

+        "\"Content\" : \"<?xml version=\\\"1.0\\\"?><catalog>" +

+        "<book id=\\\"bk101\\\"><author>Gambardella, Matthew</author><title>XML Developer's Guide</title><genre>Computer</genre>" +

+        "<price>44.95</price><publish_date>2000-10-01</publish_date><description>An in-depth look at creating applications with XML.</description>"+

+        "</book></catalog>\"," +

+        "\"Attribute\" : []" +

+        "}, " +

 

-        

-        

-        // test various ways that request might be empty

-        @Test

-        public void testEmptyRequest() {

-                // null request

-                try {

-                        request = JSONRequest.load((String)null);

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // empty request

-                try {

-                        request = JSONRequest.load((String)"");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)" ");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // empty JSON request

-                try {

-                        request = JSONRequest.load((String)"{}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{{}}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // garbage input

-                try {

-                        request = JSONRequest.load((String)"Some non-JSON string");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{something non-JSON}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // bad syntax (Request with no content)

-                try {

-                        request = JSONRequest.load((String)"{\"Request\"}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // bad syntax (no :field after Request)

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // bad syntax (no " around Request)

-                try {

-                        request = JSONRequest.load((String)"{Request}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // empty content in Request

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : \"\"}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // content is not an object

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : \"CombinedDecision\" : true }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // too many } at end

-                // Jackson parser does not treat this as an error

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\"}}}}}");

-                        assertEquals("{requestDefaults={xpatherVersion=http://www.w3.org/TR/1999/REC-xpath-19991116},returnPolicyIdList=false,combinedDecision=false}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // too few } at end

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\" }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // misplaced } in middle

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : } \"http://www.w3.org/TR/1999/REC-xpath-19991116\"}}}}}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

+        "\"Resource\" : {" +

+        "\"Content\" : \"PD94bWwgdmVyc2lvbj0iMS4wIj8+PGNhdGFsb2c+PGJvb2sgaWQ9ImJrMTAxIj48YXV0aG9yPkdhbWJhcmRlbGxhLCBNYXR0aGV3PC9hdXRob3I+PHRpdGxlPlhNT" +

+        "CBEZXZlbG9wZXIncyBHdWlkZTwvdGl0bGU+PGdlbnJlPkNvbXB1dGVyPC9nZW5yZT48cHJpY2U+NDQuOTU8L3ByaWNlPjxwdWJsaXNoX2RhdGU+MjAwMC0xMC0wMTwvcHVibGlzaF"+

+        "9kYXRlPjxkZXNjcmlwdGlvbj5BbiBpbi1kZXB0aCBsb29rIGF0IGNyZWF0aW5nIGFwcGxpY2F0aW9ucyB3aXRoIFhNTC48L2Rlc2NyaXB0aW9uPjwvYm9vaz48L2NhdGFsb2c+\"" +

 

+

+        "} " +

+

+

+        "}}";

+

+    /*

+     * The following example comes directly from the JSON Profile Spec

+     */

+    String exampleFromSpec = "{ " +

+                             "\"Request\" : { " +

+                             "\"AccessSubject\" : { " +

+                             "\"Attribute\": [ " +

+                             "{ " +

+                             "\"Id\" : \"subject-id\", " +

+                             "\"Value\" : \"Andreas\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"location\", " +

+                             "\"Value\" : \"Gamla Stan\" " +

+                             "} " +

+                             "] " +

+                             "}, " +

+                             "\"Action\" : { " +

+                             "\"Attribute\":  " +

+                             "{ " +

+                             "\"Id\" : \"action-id\", " +

+                             "\"Value\" : \"http://www.xacml.eu/buy\", " +

+                             "\"DataType\" : \"anyURI\" " +

+                             "} " +

+                             "}, " +

+                             "\"Resource\" : { " +

+                             "\"Attribute\": [ " +

+                             "{ " +

+                             "\"Id\" : \"book-title\", " +

+                             "\"Value\" : \"Learn German in 90 days\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"currency\", " +

+                             "\"Value\" : \"SEK\" " +

+                             "}, " +

+                             "{ " +

+                             "\"Id\" : \"price\", " +

+                             "\"Value\" : 123.34 " +

+                             "} " +

+                             "] " +

+                             "} " +

+                             "} " +

+                             "} ";

+

+

+    /*

+     * The following example comes directly from the JSON Profile Spec (modified to include a "</Catalog>" missing from both examples).

+     * It shows the two ways of handling XPath content, as escaped XML and as Base64 encoding.

+     */

+    String xPathExampleFromSpec = "{ " +

+                                  "\"Request\" : { " +

+                                  "\"Resource\" : { " +

+                                  "\"Attribute\": [ " +

+                                  "{ " +

+                                  "\"Id\" : \"urn:oasis:names:tc:xacml:3.0:content-selector\", " +

+                                  "\"DataType\" : \"xpathExpression\", " +

+                                  "\"Value\" : { " +

+                                  "\"XPathCategory\" : \"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\", " +

+                                  "\"Namespaces\" : [{ " +

+                                  "\"Namespace\" : \"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" " +

+                                  "}, " +

+                                  "{ " +

+                                  "\"Prefix\" : \"md\", " +

+                                  "\"Namespace\" : \"urn:example:med:schemas:record\" " +

+                                  "} " +

+                                  "], " +

+                                  "\"XPath\" : \"md:record/md:patient/md:patientDoB\" " +

+                                  "} " +

+                                  "} " +

+                                  "] " +

+                                  "} " +

+                                  "} " +

+                                  "} ";

+

+

+

+    // test various ways that request might be empty

+    @Test

+    public void testEmptyRequest() {

+        // null request

+        try {

+            request = JSONRequest.load((String)null);

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

 

-        

-        // Test double braces around request

-        @Test

-        public void testDoubleBraces() {

-                

-                try {

-                        request = JSONRequest.load((String)"{{\"Request\" }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{{\"Request\" : }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{{\"Request\" : {\"CombinedDecision\" : true }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+        // empty request

+        try {

+            request = JSONRequest.load((String)"");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

-        

-        

-        // test elements missing from top-level Request and arrays where single elements should be

-        @Test

-        public void testMissingFields() {

-                

-                // Request containing empty array

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : []}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // array of one element

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : [{\"CombinedDecision\" : true }]}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // correctly formatted empty request gives request with defaults set

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : { }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // space in front of name (inside quotes)

-                try {

-                        request = JSONRequest.load((String)"{\" Request\" : {\"XPathVersion\" : \"http://some/other/default/uri\" }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // space at end of name (inside quotes)

-                try {

-                        request = JSONRequest.load((String)"{\"Request \" : {\"XPathVersion\" : \"http://some/other/default/uri\" }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // space in front of value (inside quotes) - valid String but not valid URI

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \" http://some/other/default/uri\" }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // space at end of value (inside quotes) - valid String but not valid URI

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://some/other/default/uri \" }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-        }

-        

-        

-        

-        // test just one of each top-level element.

-        // For simple elements also test for incorrect type

-        @Test

-        public void testTopLevelElements() {

-                

-                // empty request

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {}}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

 

-                

-                // ReturnPolicyIdList

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"ReturnPolicyIdList\" : true  }}");

-                        assertEquals("{returnPolicyIdList=true,combinedDecision=false}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"ReturnPolicyIdList\" : \"abc\"  }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"ReturnPolicyIdList\" : 123  }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // CombinedDecision

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : { \"CombinedDecision\" : true }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=true}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"CombinedDecision\" : \"abc\"  }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"CombinedDecision\" : 123  }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // XPathVersion

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://some/other/default/uri\" }}");

-                        assertEquals("{requestDefaults={xpatherVersion=http://some/other/default/uri},returnPolicyIdList=false,combinedDecision=false}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : true  }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : 123  }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"not a uri\" }}");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Category

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=another-custom-cat},xmlId=anotherXmlId}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // AccessSubject

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : { \"AccessSubject\":{ }}}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : { \"Action\":{ }}}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Resource\":{ }}}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Environment\":{ } }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequests

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]" +   

-                                  "} } }");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,multiRequests=[{requestAttributesReferences=[{referenceId=foo1}{referenceId=bar1}]}{requestAttributesReferences=[{referenceId=foo2}{referenceId=bar2}]}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequest with 1

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"bar2\"]" +

-                                        "}]" +   

-                                  "} } }");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,multiRequests=[{requestAttributesReferences=[{referenceId=bar2}]}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequest with RequestReferences with no ReferenceId

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{" +

-                                                "\"ReferenceId\" : []" +

-                                        "}]" +   

-                                  "} } }");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-

-                // MultiRequests with no RequestReference

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": []" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequests with something other than RequestReference

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"SomeOtherAttribute\": 123" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequests with single RequestReference rather than array

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": " +

-                                        "{" +

-                                                "\"ReferenceId\" : []" +

-                                        "}" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequests with RequestReference containing single element instead of array

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{" +

-                                                "\"ReferenceId\" : \"foo1\"" +

-                                        "}]" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{" +

-                                                "\"ReferenceId\" : {\"foo1\"}" +

-                                        "}]" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequests with component that is not a RequestReference

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"SomeOtherAttribute\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequests with component that is not a RequestReference

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]," +

-                                                "\"SomeOtherAttribute\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequest with unknown elements (in addition to RequestReference)

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                "\"SomeOtherAttribute\": 123," +   

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequest with RequestReferences with  ReferenceId NOT a string

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{" +

-                                                "\"ReferenceId\" : [ true ]" +

-                                        "}]" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{" +

-                                                "\"ReferenceId\" : [ 123 ]" +

-                                        "}]" +   

-                                  "} } }");

-                        fail("Request should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Cannot test with ReferenceId that is NOT referring to a Category object Id property because we may not have read the Category objects yet.

-                // Need to leave this up to the PDP.

-

-                

-                // extra elements in top-level

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {}, \"unknownElement\" : false, \"unk2\" : \"abc\", \"unk3\" : 123 }}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // extra elements in Request

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\", \"unknownElement\" : false }}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+        try {

+            request = JSONRequest.load((String)" ");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

-        

-        // Test with every field filled in with multiple values where appropriate

-        @Test

-        public void testAllFieldsRequest() {	

-        

-                // convert Response to JSON

-                try {

-                        request = JSONRequest.load(allFieldsRequest);

-                        assertEquals("{requestDefaults={xpatherVersion=http://www.w3.org/TR/1999/REC-xpath-19991116},returnPolicyIdList=true,combinedDecision=true,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}{attributeId=document-url,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=http://somewhere.over.the.com/rainbow}],includeInResults=false}{attributeId=page-list,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=1.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=2.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4.5}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=2.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=1.0}],includeInResults=false}]},xmlId=customId}{super={category=another-custom-cat},xmlId=anotherXmlId}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject},contentRoot=[catalog: null]}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource},contentRoot=[catalog: null]}],multiRequests=[{requestAttributesReferences=[{referenceId=foo1}{referenceId=bar1}]}{requestAttributesReferences=[{referenceId=foo2}{referenceId=bar1}]}]}"

-                                        , request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // convert example request from spec

-                try {

-                        request = JSONRequest.load(exampleFromSpec);

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=action-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=http://www.xacml.eu/buy}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=book-title,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Learn German in 90 days}],includeInResults=false}{attributeId=currency,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=SEK}],includeInResults=false}{attributeId=price,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // convert example request from spec containing XPAthExpression

-                try {

-                        request = JSONRequest.load(xPathExampleFromSpec);

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=urn:oasis:names:tc:xacml:3.0:content-selector,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-        

-        }

-        

-        

-        

-        // Duplicates - Each element duplicated

-        @Test

-        public void testDuplicates() {

-                // duplicate Request

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {}, \"Request\" : {}}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"ReturnPolicyIdList\" : true, \"ReturnPolicyIdList\" : true   }}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : { \"CombinedDecision\" : true, \"CombinedDecision\" : true }}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "],"

-                                        + "\"Category\": [{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "] }}");

-                        assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=another-custom-cat},xmlId=anotherXmlId}]}", request.toString());

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "] }}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "] }}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

-                                                "\"CategoryId\": \"another-custom-cat\", " +

-                                                "\"Id\" : \"anotherXmlId\", " +

-                                                "\"Attribute\" : []" +

-                                                "\"Attribute\" : []" +

-                                            "} " +

-                                        "] }}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // AccessSubject

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : { \"AccessSubject\":{ }, \"AccessSubject\":{ }}}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Action

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : { \"Action\":{ }, \"Action\":{ }}}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Resource

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Resource\":{ }, \"Resource\":{ }}}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Environment

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"Environment\":{ }, \"Environment\":{ } }}");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // MultiRequests

 

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]" +   

-                                  "},"

-                                  + "\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]" +   

-                                  "}  } }");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]," + 

-                                        "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]" +

-                                  "} } }");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                try {

-                        request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

-                                    "\"RequestReference\": [" +

-                                        "{ " +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                                "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

-                                        "}," +

-                                        "{" +

-                                                "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

-                                        "}]" +   

-                                  "} } }");

-                        fail("Unknown element should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

+        // empty JSON request

+        try {

+            request = JSONRequest.load((String)"{}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-        

+

+        try {

+            request = JSONRequest.load((String)"{{}}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // garbage input

+        try {

+            request = JSONRequest.load((String)"Some non-JSON string");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{something non-JSON}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // bad syntax (Request with no content)

+        try {

+            request = JSONRequest.load((String)"{\"Request\"}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // bad syntax (no :field after Request)

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // bad syntax (no " around Request)

+        try {

+            request = JSONRequest.load((String)"{Request}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // empty content in Request

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : \"\"}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // content is not an object

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : \"CombinedDecision\" : true }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // too many } at end

+        // Jackson parser does not treat this as an error

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\"}}}}}");

+            assertEquals("{requestDefaults={xpatherVersion=http://www.w3.org/TR/1999/REC-xpath-19991116},returnPolicyIdList=false,combinedDecision=false}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // too few } at end

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\" }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // misplaced } in middle

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : } \"http://www.w3.org/TR/1999/REC-xpath-19991116\"}}}}}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+    }

+

+

+

+    // Test double braces around request

+    @Test

+    public void testDoubleBraces() {

+

+        try {

+            request = JSONRequest.load((String)"{{\"Request\" }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{{\"Request\" : }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{{\"Request\" : {\"CombinedDecision\" : true }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+    }

+

+

+

+    // test elements missing from top-level Request and arrays where single elements should be

+    @Test

+    public void testMissingFields() {

+

+        // Request containing empty array

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : []}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // array of one element

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : [{\"CombinedDecision\" : true }]}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // correctly formatted empty request gives request with defaults set

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : { }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // space in front of name (inside quotes)

+        try {

+            request = JSONRequest.load((String)"{\" Request\" : {\"XPathVersion\" : \"http://some/other/default/uri\" }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // space at end of name (inside quotes)

+        try {

+            request = JSONRequest.load((String)"{\"Request \" : {\"XPathVersion\" : \"http://some/other/default/uri\" }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // space in front of value (inside quotes) - valid String but not valid URI

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \" http://some/other/default/uri\" }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // space at end of value (inside quotes) - valid String but not valid URI

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://some/other/default/uri \" }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

+

+    // test just one of each top-level element.

+    // For simple elements also test for incorrect type

+    @Test

+    public void testTopLevelElements() {

+

+        // empty request

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {}}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+

+        // ReturnPolicyIdList

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"ReturnPolicyIdList\" : true  }}");

+            assertEquals("{returnPolicyIdList=true,combinedDecision=false}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"ReturnPolicyIdList\" : \"abc\"  }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"ReturnPolicyIdList\" : 123  }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // CombinedDecision

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : { \"CombinedDecision\" : true }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=true}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"CombinedDecision\" : \"abc\"  }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"CombinedDecision\" : 123  }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // XPathVersion

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://some/other/default/uri\" }}");

+            assertEquals("{requestDefaults={xpatherVersion=http://some/other/default/uri},returnPolicyIdList=false,combinedDecision=false}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : true  }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : 123  }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"not a uri\" }}");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Category

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

+                                       "\"CategoryId\": \"another-custom-cat\", " +

+                                       "\"Id\" : \"anotherXmlId\", " +

+                                       "\"Attribute\" : []" +

+                                       "} " +

+                                       "] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=another-custom-cat},xmlId=anotherXmlId}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // AccessSubject

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : { \"AccessSubject\":{ }}}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : { \"Action\":{ }}}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Resource\":{ }}}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Environment\":{ } }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:environment}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequests

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]" +

+                                       "} } }");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,multiRequests=[{requestAttributesReferences=[{referenceId=foo1}{referenceId=bar1}]}{requestAttributesReferences=[{referenceId=foo2}{referenceId=bar2}]}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequest with 1

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"bar2\"]" +

+                                       "}]" +

+                                       "} } }");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,multiRequests=[{requestAttributesReferences=[{referenceId=bar2}]}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequest with RequestReferences with no ReferenceId

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{" +

+                                       "\"ReferenceId\" : []" +

+                                       "}]" +

+                                       "} } }");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // MultiRequests with no RequestReference

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": []" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequests with something other than RequestReference

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"SomeOtherAttribute\": 123" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequests with single RequestReference rather than array

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": " +

+                                       "{" +

+                                       "\"ReferenceId\" : []" +

+                                       "}" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequests with RequestReference containing single element instead of array

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{" +

+                                       "\"ReferenceId\" : \"foo1\"" +

+                                       "}]" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{" +

+                                       "\"ReferenceId\" : {\"foo1\"}" +

+                                       "}]" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequests with component that is not a RequestReference

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"SomeOtherAttribute\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequests with component that is not a RequestReference

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]," +

+                                       "\"SomeOtherAttribute\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequest with unknown elements (in addition to RequestReference)

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"SomeOtherAttribute\": 123," +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequest with RequestReferences with  ReferenceId NOT a string

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{" +

+                                       "\"ReferenceId\" : [ true ]" +

+                                       "}]" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{" +

+                                       "\"ReferenceId\" : [ 123 ]" +

+                                       "}]" +

+                                       "} } }");

+            fail("Request should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Cannot test with ReferenceId that is NOT referring to a Category object Id property because we may not have read the Category objects yet.

+        // Need to leave this up to the PDP.

+

+

+        // extra elements in top-level

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {}, \"unknownElement\" : false, \"unk2\" : \"abc\", \"unk3\" : 123 }}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // extra elements in Request

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"XPathVersion\" : \"http://www.w3.org/TR/1999/REC-xpath-19991116\", \"unknownElement\" : false }}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+    }

+

+

+    // Test with every field filled in with multiple values where appropriate

+    @Test

+    public void testAllFieldsRequest() {

+

+        // convert Response to JSON

+        try {

+            request = JSONRequest.load(allFieldsRequest);

+            assertEquals("{requestDefaults={xpatherVersion=http://www.w3.org/TR/1999/REC-xpath-19991116},returnPolicyIdList=true,combinedDecision=true,requestAttributes=[{super={category=custom-category,attributes=[{attributeId=document-id,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#integer,value=123}],includeInResults=false}{attributeId=document-url,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=http://somewhere.over.the.com/rainbow}],includeInResults=false}{attributeId=page-list,category=custom-category,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=1.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=2.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=4.5}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=3.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=2.0}{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=1.0}],includeInResults=false}]},xmlId=customId}{super={category=another-custom-cat},xmlId=anotherXmlId}{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject},contentRoot=[catalog: null]}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource},contentRoot=[catalog: null]}],multiRequests=[{requestAttributesReferences=[{referenceId=foo1}{referenceId=bar1}]}{requestAttributesReferences=[{referenceId=foo2}{referenceId=bar1}]}]}"

+                         , request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // convert example request from spec

+        try {

+            request = JSONRequest.load(exampleFromSpec);

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,attributes=[{attributeId=subject-id,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Andreas}],includeInResults=false}{attributeId=location,category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Gamla Stan}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,attributes=[{attributeId=action-id,category=urn:oasis:names:tc:xacml:3.0:attribute-category:action,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#anyURI,value=http://www.xacml.eu/buy}],includeInResults=false}]}}{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=book-title,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=Learn German in 90 days}],includeInResults=false}{attributeId=currency,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#string,value=SEK}],includeInResults=false}{attributeId=price,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=http://www.w3.org/2001/XMLSchema#double,value=123.34}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // convert example request from spec containing XPAthExpression

+        try {

+            request = JSONRequest.load(xPathExampleFromSpec);

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,attributes=[{attributeId=urn:oasis:names:tc:xacml:3.0:content-selector,category=urn:oasis:names:tc:xacml:3.0:attribute-category:resource,values=[{dataTypeId=urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression,value={path=md:record/md:patient/md:patientDoB,Namespace={[{md,urn:example:med:schemas:record}{urn:oasis:names:tc:xacml:3.0:core:schema:wd-17}]},status=null,xpathExpressionWrapped=null},xpathCategory=urn:oasis:names:tc:xacml:3.0:attribute-category:resource}],includeInResults=false}]}}]}", request.toString());

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+    }

+

+

+

+    // Duplicates - Each element duplicated

+    @Test

+    public void testDuplicates() {

+        // duplicate Request

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {}, \"Request\" : {}}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"ReturnPolicyIdList\" : true, \"ReturnPolicyIdList\" : true   }}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : { \"CombinedDecision\" : true, \"CombinedDecision\" : true }}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

+                                       "\"CategoryId\": \"another-custom-cat\", " +

+                                       "\"Id\" : \"anotherXmlId\", " +

+                                       "\"Attribute\" : []" +

+                                       "} " +

+                                       "],"

+                                       + "\"Category\": [{ " +

+                                       "\"CategoryId\": \"another-custom-cat\", " +

+                                       "\"Id\" : \"anotherXmlId\", " +

+                                       "\"Attribute\" : []" +

+                                       "} " +

+                                       "] }}");

+            assertEquals("{returnPolicyIdList=false,combinedDecision=false,requestAttributes=[{super={category=another-custom-cat},xmlId=anotherXmlId}]}", request.toString());

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

+                                       "\"CategoryId\": \"another-custom-cat\", " +

+                                       "\"CategoryId\": \"another-custom-cat\", " +

+                                       "\"Id\" : \"anotherXmlId\", " +

+                                       "\"Attribute\" : []" +

+                                       "} " +

+                                       "] }}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

+                                       "\"CategoryId\": \"another-custom-cat\", " +

+                                       "\"Id\" : \"anotherXmlId\", " +

+                                       "\"Id\" : \"anotherXmlId\", " +

+                                       "\"Attribute\" : []" +

+                                       "} " +

+                                       "] }}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Category\": [{ " +

+                                       "\"CategoryId\": \"another-custom-cat\", " +

+                                       "\"Id\" : \"anotherXmlId\", " +

+                                       "\"Attribute\" : []" +

+                                       "\"Attribute\" : []" +

+                                       "} " +

+                                       "] }}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // AccessSubject

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : { \"AccessSubject\":{ }, \"AccessSubject\":{ }}}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Action

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : { \"Action\":{ }, \"Action\":{ }}}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Resource

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Resource\":{ }, \"Resource\":{ }}}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Environment

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"Environment\":{ }, \"Environment\":{ } }}");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // MultiRequests

+

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]" +

+                                       "},"

+                                       + "\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]" +

+                                       "}  } }");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]," +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]" +

+                                       "} } }");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        try {

+            request = JSONRequest.load((String)"{\"Request\" : {\"MultiRequests\" : {" +

+                                       "\"RequestReference\": [" +

+                                       "{ " +

+                                       "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+                                       "\"ReferenceId\" : [\"foo1\",\"bar1\"]" +

+                                       "}," +

+                                       "{" +

+                                       "\"ReferenceId\" : [\"foo2\",\"bar2\"]" +

+                                       "}]" +

+                                       "} } }");

+            fail("Unknown element should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+    }

+

 

 }

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/ResponseConformanceTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/ResponseConformanceTest.java
index d38cf36..0d335da 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/ResponseConformanceTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/ResponseConformanceTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -52,305 +52,305 @@
 import com.att.research.xacml.util.ListUtil;

 /**

  * Test JSON Response convert to object - Conformance tests

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * Note: some of the validation tests comparing the XML-derived Results to the JSON-derived Results are high-level comparisons of Collections.

  *		When this class was first created that was sufficient to pass all Conformance tests.

  *		However if this sees a failure in a Conformance test, those validations may need to be upgraded to look at the individual data elements to see what is wrong.

- * 

+ *

  * @author glenngriffin

  *

  */

 public class ResponseConformanceTest {

-        

-        // where to find the conformance test XML files

-        private final String CONFORMANCE_DIRECTORY_PATH = "testsets/conformance/xacml3.0-ct-v.0.4";

-        

-        // The request object output from each test conversion from JSON string

-        Response response;

+

+    // where to find the conformance test XML files

+    private final String CONFORMANCE_DIRECTORY_PATH = "testsets/conformance/xacml3.0-ct-v.0.4";

+

+    // The request object output from each test conversion from JSON string

+    Response response;

 

 

-        

-        

-        

-        // test just one of each top-level element.

-        // For simple elements also test for incorrect type

-        @Test

-        public void testConformanceResponses() {

-                

-                List<File> filesInDirectory = null;

-                

-                File conformanceDirectory = null;

-                

-                File currentFile = null;

-                

-                try {

-                        conformanceDirectory = new File(CONFORMANCE_DIRECTORY_PATH);

-                        filesInDirectory = getRequestsInDirectory(conformanceDirectory);

-                } catch (Exception e) {

-                        fail("Unable to set up Conformance tests for dir '" + conformanceDirectory.getAbsolutePath()+"' e="+ e);

-                }

-                

-                // run through each XML file

-                //	- load the file from XML into an internal Response object

-                //	- generate the JSON representation of that Response object

-                //	- load that JSON representation into a new Response object

-                //	- compare the 2 Request objects

-                Response xmlResponse = null;

-                Response jsonResponse = null;

-                try {

-                        for (File f : filesInDirectory) {

-                                currentFile = f;

+

+

+

+    // test just one of each top-level element.

+    // For simple elements also test for incorrect type

+    @Test

+    public void testConformanceResponses() {

+

+        List<File> filesInDirectory = null;

+

+        File conformanceDirectory = null;

+

+        File currentFile = null;

+

+        try {

+            conformanceDirectory = new File(CONFORMANCE_DIRECTORY_PATH);

+            filesInDirectory = getRequestsInDirectory(conformanceDirectory);

+        } catch (Exception e) {

+            fail("Unable to set up Conformance tests for dir '" + conformanceDirectory.getAbsolutePath()+"' e="+ e);

+        }

+

+        // run through each XML file

+        //	- load the file from XML into an internal Response object

+        //	- generate the JSON representation of that Response object

+        //	- load that JSON representation into a new Response object

+        //	- compare the 2 Request objects

+        Response xmlResponse = null;

+        Response jsonResponse = null;

+        try {

+            for (File f : filesInDirectory) {

+                currentFile = f;

 

 //// This is a simple way to select just one file for debugging - comment out when not being used

 //if ( ! f.getName().equals("IIIA030Response.xml") && ! f.getName().equals("IIIA330Response.xml")) {   continue;  }

 

 // during debugging it is helpful to know what file it is starting to work on

 //				System.out.println("starting file="+currentFile.getName());

-                                

-                                try {

-                                        // load XML into a Response object

-                                        xmlResponse = DOMResponse.load(f);

-                                } catch (Exception e) {

-                                        // if XML does not load, just note it and continue with next file

-                                        System.out.println("XML file did not load: '" + f.getName() + "  e=" + e);

-                                        continue;

-                                }

-                                

-                                // some tests have JSON response files to load, most do not

-                                String jsonFileName = f.getName().replace(".xml", ".json");

-                                File jsonFile = new File(conformanceDirectory, jsonFileName);

-                                

-                                if (jsonFile.exists()) {

-//System.out.println("found file "+jsonFile.getName());

-                                        // json version exists in file, so load it

-                                        jsonResponse = JSONResponse.load(jsonFile);

-                                } else {

-                                        // json does not exist in file, so create it from the XML response using a String intermediate version

-                                        String jsonResponseString = JSONResponse.toString(xmlResponse, false);

-//System.out.println(jsonResponseString);	

-//System.out.println(JSONResponse.toString(xmlResponse, true));

-                                        

-                                        jsonResponse = JSONResponse.load(jsonResponseString);

-                                }			

-                                

-                                

-//System.out.println(JSONResponse.toString(xmlResponse, true));

 

-

-

-                                

-                                // compare the two Response objects

-                                

-                                // compare results

-                                assertEquals(xmlResponse.getResults().size(), jsonResponse.getResults().size());

-                                

-                                if (xmlResponse.getResults().size() == 0) {

-                                        fail("neither XML nor JSON response have any Results");

-                                }

-                                

-                                

-                                // Results are an un-ordered Collection.

-                                // There is no identifying information that is unique to a specific Result.

-                                // If there are more than one we cannot be sure which one corresponds with which.

-                                // The best we can do is say that one or more in the first list do not match any in the second list

-                                if (xmlResponse.getResults().size() > 1) {

-                                        for (Result xmlResult : xmlResponse.getResults()) {

-                                                boolean found = false;

-                                                for (Result jsonResult : jsonResponse.getResults()) {

-                                                        if (xmlResult.equals(jsonResult)) {

-                                                                found = true;

-                                                                break;

-                                                        }

-                                                }

-                                                if (found) {

-                                                        continue;

-                                                }

-                                                // no match found

-                                                System.out.println("No match for XML in " + f.getName());

-                                                System.out.println("XML =" + xmlResult.toString());

-                                                for (Result jsonResult : jsonResponse.getResults()) {

-                                                        System.out.println("JSON="+ jsonResult.toString());

-                                                }

-                                                fail("JSON Response has no match for XML Result: " + xmlResult.toString());

-                                        }

-                                        // we've done the best we can for multiple decisions, so go to next file

-                                        continue;

-                                }

-                                

-                                // single Result in each

-                                Result xmlResult = xmlResponse.getResults().iterator().next();

-                                Result jsonResult = jsonResponse.getResults().iterator().next();

-                                

-                                // The following sections have not given us trouble, so checking is very high-level.

-                                // If we see a problem in one of these elements, the single line will need to be replaced with detailed examination of the objects.

-                                assertEquals(f.getName() + " Decision", xmlResult.getDecision(), jsonResult.getDecision());

-                                assertEquals(f.getName() + " Status", xmlResult.getStatus(), jsonResult.getStatus());

-                                

-                                // Obligations

-                                if (xmlResult.getObligations() != jsonResult.getObligations()) {

-                                        Collection<Obligation> xmlObligations = xmlResult.getObligations();

-                                        Collection<Obligation> jsonObligations = jsonResult.getObligations();

-                                        // if both are null we do not get here

-                                        if (xmlObligations == null || jsonObligations == null) {

-                                                fail(f.getName() + " Obligations has null \nXML="+xmlObligations + "\nJSON="+jsonObligations);

-                                        }

-                                        if (ListUtil.equalsAllowNulls(xmlObligations, jsonObligations) == false) {

-                                                // collections are not equal, so need to examine further

-fail(f.getName() + " Obligation collections not equal\nXML="+xmlObligations + "\nJSON="+jsonObligations);

-                                        }

-                                }

-                                

-                                // AssociatedAdvice

-                                if (xmlResult.getAssociatedAdvice() != jsonResult.getAssociatedAdvice()) {

-                                        Collection<Advice> xmlAdvice = xmlResult.getAssociatedAdvice();

-                                        Collection<Advice> jsonAdvice = jsonResult.getAssociatedAdvice();

-                                        // if both are null we do not get here

-                                        if (xmlAdvice == null || jsonAdvice == null) {

-                                                fail(f.getName() + " Advice has null \nXML="+xmlAdvice + "\nJSON="+jsonAdvice);

-                                        }

-                                        if (ListUtil.equalsAllowNulls(xmlAdvice, jsonAdvice) == false) {

-                                                // collections are not equal, so need to examine further

-fail(f.getName() + " Advice collections not equal\nXML="+xmlAdvice + "\nJSON="+jsonAdvice);

-                                        }

-                                }

-                                

-                                

-                                

-                                // check Attributes in more detail

-                                Collection<AttributeCategory> xmlAttributes = xmlResult.getAttributes();

-                                Collection<AttributeCategory> jsonAttributes = jsonResult.getAttributes();

-                                if (xmlAttributes == null && jsonAttributes != null || 

-                                                xmlAttributes != null && jsonAttributes == null) {

-                                        fail(f.getName() + " XML Attributes="+xmlAttributes + "  but JSON Attributes=" + jsonAttributes);

-                                }

-                                if (xmlAttributes != null) {

-                                        // both are non-null

-                                        if (xmlAttributes.size() != jsonAttributes.size()) {

-                                                String xmlAttributesString = "XML categorys=";

-                                                for (AttributeCategory ac : xmlAttributes) {

-                                                        xmlAttributesString += " " + ac.getCategory().stringValue();

-                                                }

-                                                String jsonAttributesString = "JSON categorys=";

-                                                for (AttributeCategory ac : jsonAttributes) {

-                                                        jsonAttributesString += " " + ac.getCategory().stringValue();

-                                                }

-                                                fail(f.getName() + " XML and JSON have different number of Category elements: " + xmlAttributesString + ", " + jsonAttributesString);

-                                        }

-                                        

-                                        // Attribute collections are the same size but may be in different orders.

-                                        // for each XML category try to find the corresponding JSON category.

-                                        // ASSUME that each category only shows up once!!!!

-                                        for (AttributeCategory xmlAttributeCategory : xmlAttributes) {

-                                                boolean attributeCategoryFound = false;

-                                                for (AttributeCategory jsonAttributeCategory : jsonAttributes) {

-                                                        if (xmlAttributeCategory.equals(jsonAttributeCategory)) {

-                                                                attributeCategoryFound = true;

-                                                                break;

-                                                        }

-                                                        // not an exact match, but if same CategoryId then need to check individual Attribute objects

-                                                        if (xmlAttributeCategory.getCategory().equals(jsonAttributeCategory.getCategory())) {

-                                                                // same category

-                                                                if (xmlAttributeCategory.getAttributes().size() != jsonAttributeCategory.getAttributes().size()) {

-                                                                        System.out.println("XML =" + xmlAttributeCategory.getAttributes());

-                                                                        System.out.println("JSON=" + jsonAttributeCategory.getAttributes());

-                                                                        fail(f.getName() + " Attributes Category '" + xmlAttributeCategory.getCategory().stringValue() + "' size mismatch; XML="+

-                                                                                        xmlAttributeCategory.getAttributes().size() +", JSON=" + jsonAttributeCategory.getAttributes().size());

-                                                                }

-                                                                for (Attribute xmlAttr : xmlAttributeCategory.getAttributes()) {

-                                                                        boolean attributeFound = false;

-                                                                        for (Attribute jsonAttr : jsonAttributeCategory.getAttributes()) {

-                                                                                if (xmlAttr.equals(jsonAttr)) {

-                                                                                        attributeFound = true;

-                                                                                        break;

-                                                                                }

-                                                                        }

-

-                                                                        if (attributeFound) {

-                                                                                // check next XML attribute

-                                                                                continue;

-                                                                        }

-                                                                        System.out.println("Attribute not found in JSON, Category="+xmlAttributeCategory.getCategory());

-                                                                        System.out.println("XML Attribute ="+ xmlAttr);

-                                                                        System.out.println("JSON Attributes=" + jsonAttributeCategory.toString());

-                                                                        fail(f.getName() + " Attribute not found in JSON, Category=" + xmlAttributeCategory.getCategory() +

-                                                                                        "/nXML Attribute="+xmlAttr+

-                                                                                        "\nJSON Category Attributes="+jsonAttributeCategory.toString());

-                                                                }

-                                                                

-

-

-                                                        }

-                                                }

-                                                if (attributeCategoryFound) {

-                                                        continue;

-                                                }

-                                                fail("XML Category not found in JSON; xml="+xmlAttributeCategory.toString());

-                                        }

-                                        

-                                }

-                                

-                                // PolicyIdentifiers

-                                if (xmlResult.getPolicyIdentifiers() != jsonResult.getPolicyIdentifiers()) {

-                                        Collection<IdReference> xmlIdReferences = xmlResult.getPolicyIdentifiers();

-                                        Collection<IdReference> jsonIdReferences = jsonResult.getPolicyIdentifiers();

-                                        // if both are null we do not get here

-                                        if (xmlIdReferences == null || jsonIdReferences == null) {

-                                                fail(f.getName() + " PolicyIdentifiers has null \nXML="+xmlIdReferences + "\nJSON="+jsonIdReferences);

-                                        }

-                                        if (ListUtil.equalsAllowNulls(xmlIdReferences, jsonIdReferences) == false) {

-                                                // collections are not equal, so need to examine further

-fail(f.getName() + " PolicyIdentifiers collections not equal\nXML="+xmlIdReferences+ "\nJSON="+jsonIdReferences);

-                                        }

-                                }

-                                

-                                // PolicySetIdentifiers

-                                if (xmlResult.getPolicySetIdentifiers() != jsonResult.getPolicySetIdentifiers()) {

-                                        Collection<IdReference> xmlIdReferences = xmlResult.getPolicySetIdentifiers();

-                                        Collection<IdReference> jsonIdReferences = jsonResult.getPolicySetIdentifiers();

-                                        // if both are null we do not get here

-                                        if (xmlIdReferences == null || jsonIdReferences == null) {

-                                                fail(f.getName() + " PolicySetIdentifiers has null \nXML="+xmlIdReferences + "\nJSON="+jsonIdReferences);

-                                        }

-                                        if (ListUtil.equalsAllowNulls(xmlIdReferences, jsonIdReferences) == false) {

-                                                // collections are not equal, so need to examine further

-fail(f.getName() + " PolicySetIdentifiers collections not equal\nXML="+xmlIdReferences + "\nJSON="+jsonIdReferences);

-                                        }

-                                }

-                                                                

-

-                        }			

-

+                try {

+                    // load XML into a Response object

+                    xmlResponse = DOMResponse.load(f);

                 } catch (Exception e) {

-                        fail ("Failed test with '" + currentFile.getName() + "', e=" + e);

+                    // if XML does not load, just note it and continue with next file

+                    System.out.println("XML file did not load: '" + f.getName() + "  e=" + e);

+                    continue;

                 }

 

-                

-        }

-        

-        //

-        // HELPER to get list of all Request files in the given directory

-        //

-        

-        private List<File> getRequestsInDirectory(File directory) {

-                List<File> fileList = new ArrayList<File>();

-                

-                File[] fileArray = directory.listFiles();

-                for (File f : fileArray) {

-                        if (f.isDirectory()) {

-                                List<File> subDirList = getRequestsInDirectory(f);

-                                fileList.addAll(subDirList);

-                        }

-                        if (f.getName().endsWith("Response.xml")) {

-                                fileList.add(f);

-                        }

+                // some tests have JSON response files to load, most do not

+                String jsonFileName = f.getName().replace(".xml", ".json");

+                File jsonFile = new File(conformanceDirectory, jsonFileName);

+

+                if (jsonFile.exists()) {

+//System.out.println("found file "+jsonFile.getName());

+                    // json version exists in file, so load it

+                    jsonResponse = JSONResponse.load(jsonFile);

+                } else {

+                    // json does not exist in file, so create it from the XML response using a String intermediate version

+                    String jsonResponseString = JSONResponse.toString(xmlResponse, false);

+//System.out.println(jsonResponseString);

+//System.out.println(JSONResponse.toString(xmlResponse, true));

+

+                    jsonResponse = JSONResponse.load(jsonResponseString);

                 }

-                return fileList;

-                

+

+

+//System.out.println(JSONResponse.toString(xmlResponse, true));

+

+

+

+

+                // compare the two Response objects

+

+                // compare results

+                assertEquals(xmlResponse.getResults().size(), jsonResponse.getResults().size());

+

+                if (xmlResponse.getResults().size() == 0) {

+                    fail("neither XML nor JSON response have any Results");

+                }

+

+

+                // Results are an un-ordered Collection.

+                // There is no identifying information that is unique to a specific Result.

+                // If there are more than one we cannot be sure which one corresponds with which.

+                // The best we can do is say that one or more in the first list do not match any in the second list

+                if (xmlResponse.getResults().size() > 1) {

+                    for (Result xmlResult : xmlResponse.getResults()) {

+                        boolean found = false;

+                        for (Result jsonResult : jsonResponse.getResults()) {

+                            if (xmlResult.equals(jsonResult)) {

+                                found = true;

+                                break;

+                            }

+                        }

+                        if (found) {

+                            continue;

+                        }

+                        // no match found

+                        System.out.println("No match for XML in " + f.getName());

+                        System.out.println("XML =" + xmlResult.toString());

+                        for (Result jsonResult : jsonResponse.getResults()) {

+                            System.out.println("JSON="+ jsonResult.toString());

+                        }

+                        fail("JSON Response has no match for XML Result: " + xmlResult.toString());

+                    }

+                    // we've done the best we can for multiple decisions, so go to next file

+                    continue;

+                }

+

+                // single Result in each

+                Result xmlResult = xmlResponse.getResults().iterator().next();

+                Result jsonResult = jsonResponse.getResults().iterator().next();

+

+                // The following sections have not given us trouble, so checking is very high-level.

+                // If we see a problem in one of these elements, the single line will need to be replaced with detailed examination of the objects.

+                assertEquals(f.getName() + " Decision", xmlResult.getDecision(), jsonResult.getDecision());

+                assertEquals(f.getName() + " Status", xmlResult.getStatus(), jsonResult.getStatus());

+

+                // Obligations

+                if (xmlResult.getObligations() != jsonResult.getObligations()) {

+                    Collection<Obligation> xmlObligations = xmlResult.getObligations();

+                    Collection<Obligation> jsonObligations = jsonResult.getObligations();

+                    // if both are null we do not get here

+                    if (xmlObligations == null || jsonObligations == null) {

+                        fail(f.getName() + " Obligations has null \nXML="+xmlObligations + "\nJSON="+jsonObligations);

+                    }

+                    if (ListUtil.equalsAllowNulls(xmlObligations, jsonObligations) == false) {

+                        // collections are not equal, so need to examine further

+                        fail(f.getName() + " Obligation collections not equal\nXML="+xmlObligations + "\nJSON="+jsonObligations);

+                    }

+                }

+

+                // AssociatedAdvice

+                if (xmlResult.getAssociatedAdvice() != jsonResult.getAssociatedAdvice()) {

+                    Collection<Advice> xmlAdvice = xmlResult.getAssociatedAdvice();

+                    Collection<Advice> jsonAdvice = jsonResult.getAssociatedAdvice();

+                    // if both are null we do not get here

+                    if (xmlAdvice == null || jsonAdvice == null) {

+                        fail(f.getName() + " Advice has null \nXML="+xmlAdvice + "\nJSON="+jsonAdvice);

+                    }

+                    if (ListUtil.equalsAllowNulls(xmlAdvice, jsonAdvice) == false) {

+                        // collections are not equal, so need to examine further

+                        fail(f.getName() + " Advice collections not equal\nXML="+xmlAdvice + "\nJSON="+jsonAdvice);

+                    }

+                }

+

+

+

+                // check Attributes in more detail

+                Collection<AttributeCategory> xmlAttributes = xmlResult.getAttributes();

+                Collection<AttributeCategory> jsonAttributes = jsonResult.getAttributes();

+                if (xmlAttributes == null && jsonAttributes != null ||

+                        xmlAttributes != null && jsonAttributes == null) {

+                    fail(f.getName() + " XML Attributes="+xmlAttributes + "  but JSON Attributes=" + jsonAttributes);

+                }

+                if (xmlAttributes != null) {

+                    // both are non-null

+                    if (xmlAttributes.size() != jsonAttributes.size()) {

+                        String xmlAttributesString = "XML categorys=";

+                        for (AttributeCategory ac : xmlAttributes) {

+                            xmlAttributesString += " " + ac.getCategory().stringValue();

+                        }

+                        String jsonAttributesString = "JSON categorys=";

+                        for (AttributeCategory ac : jsonAttributes) {

+                            jsonAttributesString += " " + ac.getCategory().stringValue();

+                        }

+                        fail(f.getName() + " XML and JSON have different number of Category elements: " + xmlAttributesString + ", " + jsonAttributesString);

+                    }

+

+                    // Attribute collections are the same size but may be in different orders.

+                    // for each XML category try to find the corresponding JSON category.

+                    // ASSUME that each category only shows up once!!!!

+                    for (AttributeCategory xmlAttributeCategory : xmlAttributes) {

+                        boolean attributeCategoryFound = false;

+                        for (AttributeCategory jsonAttributeCategory : jsonAttributes) {

+                            if (xmlAttributeCategory.equals(jsonAttributeCategory)) {

+                                attributeCategoryFound = true;

+                                break;

+                            }

+                            // not an exact match, but if same CategoryId then need to check individual Attribute objects

+                            if (xmlAttributeCategory.getCategory().equals(jsonAttributeCategory.getCategory())) {

+                                // same category

+                                if (xmlAttributeCategory.getAttributes().size() != jsonAttributeCategory.getAttributes().size()) {

+                                    System.out.println("XML =" + xmlAttributeCategory.getAttributes());

+                                    System.out.println("JSON=" + jsonAttributeCategory.getAttributes());

+                                    fail(f.getName() + " Attributes Category '" + xmlAttributeCategory.getCategory().stringValue() + "' size mismatch; XML="+

+                                         xmlAttributeCategory.getAttributes().size() +", JSON=" + jsonAttributeCategory.getAttributes().size());

+                                }

+                                for (Attribute xmlAttr : xmlAttributeCategory.getAttributes()) {

+                                    boolean attributeFound = false;

+                                    for (Attribute jsonAttr : jsonAttributeCategory.getAttributes()) {

+                                        if (xmlAttr.equals(jsonAttr)) {

+                                            attributeFound = true;

+                                            break;

+                                        }

+                                    }

+

+                                    if (attributeFound) {

+                                        // check next XML attribute

+                                        continue;

+                                    }

+                                    System.out.println("Attribute not found in JSON, Category="+xmlAttributeCategory.getCategory());

+                                    System.out.println("XML Attribute ="+ xmlAttr);

+                                    System.out.println("JSON Attributes=" + jsonAttributeCategory.toString());

+                                    fail(f.getName() + " Attribute not found in JSON, Category=" + xmlAttributeCategory.getCategory() +

+                                         "/nXML Attribute="+xmlAttr+

+                                         "\nJSON Category Attributes="+jsonAttributeCategory.toString());

+                                }

+

+

+

+                            }

+                        }

+                        if (attributeCategoryFound) {

+                            continue;

+                        }

+                        fail("XML Category not found in JSON; xml="+xmlAttributeCategory.toString());

+                    }

+

+                }

+

+                // PolicyIdentifiers

+                if (xmlResult.getPolicyIdentifiers() != jsonResult.getPolicyIdentifiers()) {

+                    Collection<IdReference> xmlIdReferences = xmlResult.getPolicyIdentifiers();

+                    Collection<IdReference> jsonIdReferences = jsonResult.getPolicyIdentifiers();

+                    // if both are null we do not get here

+                    if (xmlIdReferences == null || jsonIdReferences == null) {

+                        fail(f.getName() + " PolicyIdentifiers has null \nXML="+xmlIdReferences + "\nJSON="+jsonIdReferences);

+                    }

+                    if (ListUtil.equalsAllowNulls(xmlIdReferences, jsonIdReferences) == false) {

+                        // collections are not equal, so need to examine further

+                        fail(f.getName() + " PolicyIdentifiers collections not equal\nXML="+xmlIdReferences+ "\nJSON="+jsonIdReferences);

+                    }

+                }

+

+                // PolicySetIdentifiers

+                if (xmlResult.getPolicySetIdentifiers() != jsonResult.getPolicySetIdentifiers()) {

+                    Collection<IdReference> xmlIdReferences = xmlResult.getPolicySetIdentifiers();

+                    Collection<IdReference> jsonIdReferences = jsonResult.getPolicySetIdentifiers();

+                    // if both are null we do not get here

+                    if (xmlIdReferences == null || jsonIdReferences == null) {

+                        fail(f.getName() + " PolicySetIdentifiers has null \nXML="+xmlIdReferences + "\nJSON="+jsonIdReferences);

+                    }

+                    if (ListUtil.equalsAllowNulls(xmlIdReferences, jsonIdReferences) == false) {

+                        // collections are not equal, so need to examine further

+                        fail(f.getName() + " PolicySetIdentifiers collections not equal\nXML="+xmlIdReferences + "\nJSON="+jsonIdReferences);

+                    }

+                }

+

+

+            }

+

+        } catch (Exception e) {

+            fail ("Failed test with '" + currentFile.getName() + "', e=" + e);

         }

-        

+

+

+    }

+

+    //

+    // HELPER to get list of all Request files in the given directory

+    //

+

+    private List<File> getRequestsInDirectory(File directory) {

+        List<File> fileList = new ArrayList<File>();

+

+        File[] fileArray = directory.listFiles();

+        for (File f : fileArray) {

+            if (f.isDirectory()) {

+                List<File> subDirList = getRequestsInDirectory(f);

+                fileList.addAll(subDirList);

+            }

+            if (f.getName().endsWith("Response.xml")) {

+                fileList.add(f);

+            }

+        }

+        return fileList;

+

+    }

+

 }

 

 

@@ -358,7 +358,7 @@
 

 

 /*

- * 

+ *

 This is a place to copy the really long output from test rigs that need to be manually edited for readability....

 

 

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/ResponseTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/ResponseTest.java
index 68fe34d..9f33d96 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/ResponseTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/std/json/ResponseTest.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -71,909 +71,911 @@
 

 /**

  * Test JSON Responses

- * 

+ *

  * TO RUN - use jUnit

  * In Eclipse select this file or the enclosing directory, right-click and select Run As/JUnit Test

- * 

+ *

  * @author glenngriffin

  *

  */

 public class ResponseTest {

 

-        String jsonResponse;

-        

-        StdMutableResponse response;

-        

-        StdMutableResult result;

-        

-        StdMutableStatus status;

-        

-        

-        // Note: Initially test responses without Obligations, Associated Advice, Attributes, or PolicyIdentifier

-        

-        

-        @Test

-        public void testEmptyAndDecisions() {

-                // null response

-                try {

-                        jsonResponse = JSONResponse.toString(null, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // empty response (no Result object)

-                response = new StdMutableResponse();

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // just decision, no status

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // just status (empty), no decision

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();		

-                result.setStatus(status);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // just status (non-empty), no decision

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

-                result.setStatus(status);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // test other decisions without Status

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.DENY);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Deny\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.NOTAPPLICABLE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"NotApplicable\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Indeterminate{D}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Indeterminate{DP}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Indeterminate{P}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+    String jsonResponse;

 

-                

-                // test Multiple Decisions - success

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                StdMutableResult result2 = new StdMutableResult();

-                result2.setDecision(Decision.DENY);

-                response.add(result2);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\"},{\"Decision\":\"Deny\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // test Multiple Decisions - one success and one error

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                result2 = new StdMutableResult();

-                result2.setDecision(Decision.INDETERMINATE);

-                response.add(result2);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\"},{\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+    StdMutableResponse response;

+

+    StdMutableResult result;

+

+    StdMutableStatus status;

+

+

+    // Note: Initially test responses without Obligations, Associated Advice, Attributes, or PolicyIdentifier

+

+

+    @Test

+    public void testEmptyAndDecisions() {

+        // null response

+        try {

+            jsonResponse = JSONResponse.toString(null, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

-                

 

-        

-        

-        // Test with every field filled in with multiple values where appropriate

-        @Test

-        public void testAllFieldsResponse() {	

-                

-                // fully-loaded multiple response

-                

-                StdMutableResponse response = new StdMutableResponse();

-                // create a Status object

-                StdMutableStatus status = new StdMutableStatus(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                status.setStatusMessage("some status message");

-                StdMutableStatusDetail statusDetailIn = new StdMutableStatusDetail();

-                StdMutableMissingAttributeDetail mad = new StdMutableMissingAttributeDetail();

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "doh"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_INTEGER.getId(), "5432"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                mad.setAttributeId(XACML3.ID_ACTION_PURPOSE);

-                mad.setCategory(XACML3.ID_ATTRIBUTE_CATEGORY_ACTION);

-                mad.setDataTypeId(XACML3.ID_DATATYPE_STRING);

-                mad.setIssuer("an Issuer");

-                statusDetailIn.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetailIn);

-                // create a single result object

-                StdMutableResult result = new StdMutableResult(status);

-                // set the decision

-                result.setDecision(Decision.INDETERMINATE);

-                // put the Result into the Response

-                response.add(result);

+        // empty response (no Result object)

+        response = new StdMutableResponse();

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

 

-                

-                // create a new Result with a different Decision

-                status = new StdMutableStatus(StdStatusCode.STATUS_CODE_OK);

-                result = new StdMutableResult(status);

-                result.setDecision(Decision.DENY);

-                

-                StdMutableObligation obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer2", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Ned")));

-                result.addObligation(obligation);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_SUBJECT_CATEGORY_INTERMEDIARY_SUBJECT);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer3", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer4", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Homer")));

-                result.addObligation(obligation);

-                

-                

-                StdMutableAdvice advice = new StdMutableAdvice();

-                advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu")));

-                advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                null, 

-                                XACML3.ID_SUBJECT, 

-                                "advice-issuerNoCategory", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Crusty")));

-                result.addAdvice(advice);

-                

-                

-                response.add(result);

-                

-                

-                // create a new Result with a different Decision

-                // add Child/minor status codes within the main status

-                StdStatusCode childChildChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildChildStatusCode"));

-                StdStatusCode childChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildStatusCode"), childChildChildStatusCode);

-                StdStatusCode child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"), childChildStatusCode);

-                StdStatusCode statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

-                

-                status = new StdMutableStatus(statusCode);

-                

-                

-                result = new StdMutableResult(status);

-                result.setDecision(Decision.PERMIT);

-                

-                

-                

-                

-                // add attribute list in result

-                Identifier categoryIdentifier = new IdentifierImpl("firstCategory");

-                Attribute[] attrList = {

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", false),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "EIssue", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrNoIssuer"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), null, true) };

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(attrList)));

-                categoryIdentifier = new IdentifierImpl("secondCategory");

-                Attribute[] secondAttrList = {

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent12"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu2"), "AIssue2", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent22"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Abc2"), "BIssue2", false),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent32"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Der2"), "CIssue2", true) };

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(secondAttrList)));

-                

-                

-                // add PolicyIdentifierList to result

-                StdIdReference policyIdentifier1 = null;

-                StdIdReference policyIdentifier2 = null;

-                StdIdReference policySetIdentifier1 = null;

-                StdIdReference policySetIdentifier2 = null;

-                try {

-                        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

-                        policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

-                        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

-                        policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

-                } catch (ParseException e1) {

-                        fail("creating policyIds, e="+e1);

-                }

-                

-                result.addPolicyIdentifier(policyIdentifier1);

-                result.addPolicyIdentifier(policyIdentifier2);

-        

-                result.addPolicySetIdentifier(policySetIdentifier1);

-                result.addPolicySetIdentifier(policySetIdentifier2);

-                

-                response.add(result);

-        

-                // convert Response to JSON

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-System.out.println(jsonResponse);

+

+        // just decision, no status

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // just status (empty), no decision

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        result.setStatus(status);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // just status (non-empty), no decision

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

+        result.setStatus(status);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // test other decisions without Status

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.DENY);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Deny\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.NOTAPPLICABLE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"NotApplicable\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Indeterminate{D}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Indeterminate{DP}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Indeterminate{P}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // test Multiple Decisions - success

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        StdMutableResult result2 = new StdMutableResult();

+        result2.setDecision(Decision.DENY);

+        response.add(result2);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\"},{\"Decision\":\"Deny\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // test Multiple Decisions - one success and one error

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        result2 = new StdMutableResult();

+        result2.setDecision(Decision.INDETERMINATE);

+        response.add(result2);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\"},{\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+    }

+

+

+

+

+    // Test with every field filled in with multiple values where appropriate

+    @Test

+    public void testAllFieldsResponse() {

+

+        // fully-loaded multiple response

+

+        StdMutableResponse response = new StdMutableResponse();

+        // create a Status object

+        StdMutableStatus status = new StdMutableStatus(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        status.setStatusMessage("some status message");

+        StdMutableStatusDetail statusDetailIn = new StdMutableStatusDetail();

+        StdMutableMissingAttributeDetail mad = new StdMutableMissingAttributeDetail();

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "doh"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_INTEGER.getId(), "5432"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        mad.setAttributeId(XACML3.ID_ACTION_PURPOSE);

+        mad.setCategory(XACML3.ID_ATTRIBUTE_CATEGORY_ACTION);

+        mad.setDataTypeId(XACML3.ID_DATATYPE_STRING);

+        mad.setIssuer("an Issuer");

+        statusDetailIn.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetailIn);

+        // create a single result object

+        StdMutableResult result = new StdMutableResult(status);

+        // set the decision

+        result.setDecision(Decision.INDETERMINATE);

+        // put the Result into the Response

+        response.add(result);

+

+

+        // create a new Result with a different Decision

+        status = new StdMutableStatus(StdStatusCode.STATUS_CODE_OK);

+        result = new StdMutableResult(status);

+        result.setDecision(Decision.DENY);

+

+        StdMutableObligation obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer2",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Ned")));

+        result.addObligation(obligation);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_SUBJECT_CATEGORY_INTERMEDIARY_SUBJECT);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer3",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer4",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Homer")));

+        result.addObligation(obligation);

+

+

+        StdMutableAdvice advice = new StdMutableAdvice();

+        advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu")));

+        advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          null,

+                                          XACML3.ID_SUBJECT,

+                                          "advice-issuerNoCategory",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Crusty")));

+        result.addAdvice(advice);

+

+

+        response.add(result);

+

+

+        // create a new Result with a different Decision

+        // add Child/minor status codes within the main status

+        StdStatusCode childChildChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildChildStatusCode"));

+        StdStatusCode childChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildStatusCode"), childChildChildStatusCode);

+        StdStatusCode child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"), childChildStatusCode);

+        StdStatusCode statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

+

+        status = new StdMutableStatus(statusCode);

+

+

+        result = new StdMutableResult(status);

+        result.setDecision(Decision.PERMIT);

+

+

+

+

+        // add attribute list in result

+        Identifier categoryIdentifier = new IdentifierImpl("firstCategory");

+        Attribute[] attrList = {

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", false),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "EIssue", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrNoIssuer"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), null, true)

+        };

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(attrList)));

+        categoryIdentifier = new IdentifierImpl("secondCategory");

+        Attribute[] secondAttrList = {

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent12"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu2"), "AIssue2", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent22"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Abc2"), "BIssue2", false),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent32"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Der2"), "CIssue2", true)

+        };

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(secondAttrList)));

+

+

+        // add PolicyIdentifierList to result

+        StdIdReference policyIdentifier1 = null;

+        StdIdReference policyIdentifier2 = null;

+        StdIdReference policySetIdentifier1 = null;

+        StdIdReference policySetIdentifier2 = null;

+        try {

+            policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

+            policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

+            policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

+            policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

+        } catch (ParseException e1) {

+            fail("creating policyIds, e="+e1);

+        }

+

+        result.addPolicyIdentifier(policyIdentifier1);

+        result.addPolicyIdentifier(policyIdentifier2);

+

+        result.addPolicySetIdentifier(policySetIdentifier1);

+        result.addPolicySetIdentifier(policySetIdentifier2);

+

+        response.add(result);

+

+        // convert Response to JSON

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            System.out.println(jsonResponse);

 //System.out.println(JSONResponse.toString(response, true));

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusMessage\":\"some status message\",\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\\\\\\\" AttributeId=\\\\\\\"urn:oasis:names:tc:xacml:2.0:action:purpose\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\" Issuer=\\\\\\\"an Issuer\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">doh</AttributeValue><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#integer\\\\\\\">5432</AttributeValue><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">meh</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"},{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer2\",\"Value\":\"Ned\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]},{\"Id\":\"urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer3\",\"Value\":\"Maggie\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer4\",\"Value\":\"Homer\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Deny\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"advice-issuer1\",\"Value\":\"Apu\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"advice-issuerNoCategory\",\"Value\":\"Crusty\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]},{\"Status\":{\"StatusCode\":{\"StatusCode\":{\"StatusCode\":{\"StatusCode\":{\"Value\":\"childChildChildStatusCode\"},\"Value\":\"childChildStatusCode\"},\"Value\":\"child1StatusCode\"},\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"CIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent3\"},{\"Issuer\":\"DIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent4\"},{\"Issuer\":\"EIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent5\"},{\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrNoIssuer\"}]},{\"CategoryId\":\"secondCategory\",\"Attribute\":[{\"Issuer\":\"AIssue2\",\"Value\":\"Apu2\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent12\"},{\"Issuer\":\"CIssue2\",\"Value\":\"Der2\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent32\"}]}],\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicyIdReference\":[{\"Id\":\"idRef1\",\"Version\":\"1.2.3\"},{\"Id\":\"idRef2_NoVersion\"}],\"PolicySetIdReference\":[{\"Id\":\"idSetRef1\",\"Version\":\"4.5.6.7.8.9.0\"},{\"Id\":\"idSetRef2_NoVersion\"}]}}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusMessage\":\"some status message\",\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:3.0:attribute-category:action\\\\\\\" AttributeId=\\\\\\\"urn:oasis:names:tc:xacml:2.0:action:purpose\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\" Issuer=\\\\\\\"an Issuer\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">doh</AttributeValue><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#integer\\\\\\\">5432</AttributeValue><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">meh</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"},{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer2\",\"Value\":\"Ned\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]},{\"Id\":\"urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer3\",\"Value\":\"Maggie\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer4\",\"Value\":\"Homer\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Deny\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"advice-issuer1\",\"Value\":\"Apu\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"advice-issuerNoCategory\",\"Value\":\"Crusty\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]},{\"Status\":{\"StatusCode\":{\"StatusCode\":{\"StatusCode\":{\"StatusCode\":{\"Value\":\"childChildChildStatusCode\"},\"Value\":\"childChildStatusCode\"},\"Value\":\"child1StatusCode\"},\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"CIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent3\"},{\"Issuer\":\"DIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent4\"},{\"Issuer\":\"EIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent5\"},{\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrNoIssuer\"}]},{\"CategoryId\":\"secondCategory\",\"Attribute\":[{\"Issuer\":\"AIssue2\",\"Value\":\"Apu2\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent12\"},{\"Issuer\":\"CIssue2\",\"Value\":\"Der2\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent32\"}]}],\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicyIdReference\":[{\"Id\":\"idRef1\",\"Version\":\"1.2.3\"},{\"Id\":\"idRef2_NoVersion\"}],\"PolicySetIdReference\":[{\"Id\":\"idSetRef1\",\"Version\":\"4.5.6.7.8.9.0\"},{\"Id\":\"idSetRef2_NoVersion\"}]}}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

         }

-        

-        

-        

-        

-        // combinations of Status values with Decision values

-        @Test

-        public void testDecisionStatusMatch() {

-                // the tests in this method use different values and do not change structures, so we can re-use the objects

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                result.setStatus(status);

-                response.add(result);

-                

-                // StatusCode = OK

-                status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

-                result.setDecision(Decision.PERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.DENY);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Decision\":\"Deny\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.NOTAPPLICABLE);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Decision\":\"NotApplicable\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                

-                

-                

-                

-                // StatusCode = SyntaxError

-                status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

-                result.setDecision(Decision.PERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.DENY);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.NOTAPPLICABLE);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"}},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"}},\"Decision\":\"Indeterminate{D}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"}},\"Decision\":\"Indeterminate{DP}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"}},\"Decision\":\"Indeterminate{P}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // StatusCode = ProcessingError

-                status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

-                result.setDecision(Decision.PERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.DENY);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.NOTAPPLICABLE);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"}},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"}},\"Decision\":\"Indeterminate{D}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"}},\"Decision\":\"Indeterminate{DP}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"}},\"Decision\":\"Indeterminate{P}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-                // StatusCode = MissingAttribute

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                result.setDecision(Decision.PERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.DENY);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.NOTAPPLICABLE);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                result.setDecision(Decision.INDETERMINATE);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENY);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate{D}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate{DP}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                result.setDecision(Decision.INDETERMINATE_PERMIT);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate{P}\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+    }

+

+

+

+

+    // combinations of Status values with Decision values

+    @Test

+    public void testDecisionStatusMatch() {

+        // the tests in this method use different values and do not change structures, so we can re-use the objects

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        result.setStatus(status);

+        response.add(result);

+

+        // StatusCode = OK

+        status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

+        result.setDecision(Decision.PERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.DENY);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Decision\":\"Deny\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.NOTAPPLICABLE);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"}},\"Decision\":\"NotApplicable\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

 

-        

-        

 

-        // tests related to Status and its components

-        @Test

-        public void testStatus() {

-                // Status with no StatusCode - error

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Status with StatusMessage when OK

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with StatusDetail when OK

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

-                StdMutableStatusDetail statusDetail = new StdMutableStatusDetail();

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Status with StatusMessage when SyntaxError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with empty StatusDetail when SyntaxError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

-                statusDetail = new StdMutableStatusDetail();

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                // Status with StatusMessage when ProcessingError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with empty StatusDetail when ProcessingError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

-                statusDetail = new StdMutableStatusDetail();

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

 

-                

-                // Status with StatusMessage when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with empty StatusDetail when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-                // Status with StatusDetail with empty detail when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                StdMutableMissingAttributeDetail mad = new StdMutableMissingAttributeDetail();

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Status with StatusDetail with valid detail with no value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with StatusDetail with valid detail with value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">meh</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Status with StatusDetail with array valid detail with value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">meh</AttributeValue><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">nu?</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // Status with StatusDetail with valid detail with Integer value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_INTEGER.getId());	

-                mad.addAttributeValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111)));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

+

+

+

+        // StatusCode = SyntaxError

+        status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

+        result.setDecision(Decision.PERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.DENY);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.NOTAPPLICABLE);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"}},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"}},\"Decision\":\"Indeterminate{D}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"}},\"Decision\":\"Indeterminate{DP}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"}},\"Decision\":\"Indeterminate{P}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // StatusCode = ProcessingError

+        status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

+        result.setDecision(Decision.PERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.DENY);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.NOTAPPLICABLE);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"}},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"}},\"Decision\":\"Indeterminate{D}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"}},\"Decision\":\"Indeterminate{DP}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"}},\"Decision\":\"Indeterminate{P}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+        // StatusCode = MissingAttribute

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        result.setDecision(Decision.PERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.DENY);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.NOTAPPLICABLE);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+        result.setDecision(Decision.INDETERMINATE);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENY);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate{D}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_DENYPERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate{DP}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+        result.setDecision(Decision.INDETERMINATE_PERMIT);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate{P}\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+    }

+

+

+

+

+    // tests related to Status and its components

+    @Test

+    public void testStatus() {

+        // Status with no StatusCode - error

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Status with StatusMessage when OK

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with StatusDetail when OK

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_OK);

+        StdMutableStatusDetail statusDetail = new StdMutableStatusDetail();

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Status with StatusMessage when SyntaxError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:syntax-error\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with empty StatusDetail when SyntaxError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

+        statusDetail = new StdMutableStatusDetail();

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Status with StatusMessage when ProcessingError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:processing-error\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with empty StatusDetail when ProcessingError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

+        statusDetail = new StdMutableStatusDetail();

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+        // Status with StatusMessage when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with empty StatusDetail when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"}},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+        // Status with StatusDetail with empty detail when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        StdMutableMissingAttributeDetail mad = new StdMutableMissingAttributeDetail();

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Status with StatusDetail with valid detail with no value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with StatusDetail with valid detail with value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">meh</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Status with StatusDetail with array valid detail with value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">meh</AttributeValue><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\">nu?</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // Status with StatusDetail with valid detail with Integer value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_INTEGER.getId());

+        mad.addAttributeValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111)));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

 //			assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#integer\\\\\\\">1111</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        java.io.StringWriter sw = new java.io.StringWriter();

-                        java.io.PrintWriter pw = new java.io.PrintWriter(sw);

-                        e.printStackTrace(pw);

+        } catch (Exception e) {

+            java.io.StringWriter sw = new java.io.StringWriter();

+            java.io.PrintWriter pw = new java.io.PrintWriter(sw);

+            e.printStackTrace(pw);

 

 

-                        fail("operation failed, e="+e + sw.toString());

-                }

-                

-                // Status with StatusDetail with array valid detail with Integer value when MissingAttribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111)));

-                mad.addAttributeValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(2222)));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#integer\\\\\\\">1111</AttributeValue><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#integer\\\\\\\">2222</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

+            fail("operation failed, e="+e + sw.toString());

+        }

+

+        // Status with StatusDetail with array valid detail with Integer value when MissingAttribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_MISSING_ATTRIBUTE);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111)));

+        mad.addAttributeValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(2222)));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:missing-attribute\"},\"StatusDetail\":\"<MissingAttributeDetail Category=\\\\\\\"urn:oasis:names:tc:xacml:1.0:action\\\\\\\" AttributeId=\\\\\\\"mad\\\\\\\" DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#string\\\\\\\"><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#integer\\\\\\\">1111</AttributeValue><AttributeValue DataType=\\\\\\\"http://www.w3.org/2001/XMLSchema#integer\\\\\\\">2222</AttributeValue></MissingAttributeDetail>\"},\"Decision\":\"Indeterminate\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

 //		StringNamespaceContext snc = new StringNamespaceContext();

 //		try {

 //			snc.add("defaultURI");

@@ -993,7 +995,7 @@
 //		mad = new StdMutableMissingAttributeDetail();

 //		mad.setAttributeId(new IdentifierImpl("mad"));

 //		mad.setCategory(XACML3.ID_ACTION);

-//		mad.setDataTypeId(DataTypes.DT_STRING.getId());	

+//		mad.setDataTypeId(DataTypes.DT_STRING.getId());

 //		mad.addAttributeValue(new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategoryId")));

 //		statusDetail.addMissingAttributeDetail(mad);

 //		status.setStatusDetail(statusDetail);

@@ -1006,7 +1008,7 @@
 //		} catch (Exception e) {

 //			fail("operation failed, e="+e);

 //		}

-//		

+//

 //		// Status with StatusDetail with array valid detail with XPathExpression value when MissingAttribute

 //		response = new StdMutableResponse();

 //		result = new StdMutableResult();

@@ -1016,7 +1018,7 @@
 //		mad = new StdMutableMissingAttributeDetail();

 //		mad.setAttributeId(new IdentifierImpl("mad"));

 //		mad.setCategory(XACML3.ID_ACTION);

-//		mad.setDataTypeId(DataTypes.DT_STRING.getId());	

+//		mad.setDataTypeId(DataTypes.DT_STRING.getId());

 //		mad.addAttributeValue(new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategoryId1")));

 //		mad.addAttributeValue(new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategoryId2")));

 //		statusDetail.addMissingAttributeDetail(mad);

@@ -1030,1264 +1032,1265 @@
 //		} catch (Exception e) {

 //			fail("operation failed, e="+e);

 //		}

-                

-//TODO - try with other data types, esp XPathExpression		

-                

-                // Status with StatusDetail with array valid detail with value when SyntaxError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Status with StatusDetail with array valid detail with value when ProcessingError

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

-                statusDetail = new StdMutableStatusDetail();

-                mad = new StdMutableMissingAttributeDetail();

-                mad.setAttributeId(new IdentifierImpl("mad"));

-                mad.setCategory(XACML3.ID_ACTION);

-                mad.setDataTypeId(DataTypes.DT_STRING.getId());	

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

-                mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

-                statusDetail.addMissingAttributeDetail(mad);

-                status.setStatusDetail(statusDetail);

-                result.setStatus(status);

-                result.setDecision(Decision.INDETERMINATE);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                

-                // Status with nested child StatusCodes (child status containing child status containing...)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                StdStatusCode child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"));

-                StdStatusCode statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

-                status = new StdMutableStatus(statusCode);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"StatusCode\":{\"Value\":\"child1StatusCode\"},\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                status = new StdMutableStatus();

-                StdStatusCode childChildChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildChildStatusCode"));

-                StdStatusCode childChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildStatusCode"), childChildChildStatusCode);

-                child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"), childChildStatusCode);

-                statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

-                status = new StdMutableStatus(statusCode);

-                status.setStatusMessage("I'm ok, you're ok");

-                result.setStatus(status);

-                result.setDecision(Decision.PERMIT);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"StatusCode\":{\"StatusCode\":{\"StatusCode\":{\"Value\":\"childChildChildStatusCode\"},\"Value\":\"childChildStatusCode\"},\"Value\":\"child1StatusCode\"},\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

 

+//TODO - try with other data types, esp XPathExpression

+

+        // Status with StatusDetail with array valid detail with value when SyntaxError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_SYNTAX_ERROR);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Status with StatusDetail with array valid detail with value when ProcessingError

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        status.setStatusCode(StdStatusCode.STATUS_CODE_PROCESSING_ERROR);

+        statusDetail = new StdMutableStatusDetail();

+        mad = new StdMutableMissingAttributeDetail();

+        mad.setAttributeId(new IdentifierImpl("mad"));

+        mad.setCategory(XACML3.ID_ACTION);

+        mad.setDataTypeId(DataTypes.DT_STRING.getId());

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "meh"));

+        mad.addAttributeValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "nu?"));

+        statusDetail.addMissingAttributeDetail(mad);

+        status.setStatusDetail(statusDetail);

+        result.setStatus(status);

+        result.setDecision(Decision.INDETERMINATE);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

         }

 

 

-        

-        @Test

-        public void testObligations() {

-                

-                // create an XPathExpression for use later

-                StringNamespaceContext snc = new StringNamespaceContext();

-                try {

-                        snc.add("defaultURI");

-                        snc.add("md", "referenceForMD");

-                } catch (Exception e) {

-                        fail("unable to create NamespaceContext e="+e);

-                }

-                XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

-                XPathExpressionWrapper xpathExpressionWrapper2 = new XPathExpressionWrapper(snc, "//md:hospital");

-                

-                StdMutableObligation obligation;

 

-                // test Obligation single decision no attributes

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // obligation missing Id

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                

-                //	AttributeAssignment	- with AttributeId, Value,  Category, DataType, Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                //	AttributeAssignment	- with AttributeId, Value, no Category, DataType, Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                null, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                //	AttributeAssignment	- Missing AttributeId

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                null, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                //	AttributeAssignment	- Missing Value

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                null));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // AttributeAssignment - missing DataType

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(null, "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // AttributeAssignment - missing issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // AttributeAssignment - Integer type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111))));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":1111,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // AttributeAssignment - XPathExpression type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:record\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-

-                //

-                // Technically arrays cannot occur in Obligations and Advice elements.  The XML spec boils down to the following definition:

-                //		<Obligation (attributes of the obligation) >

-                //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

-                //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

-                //			:

-                //		</Obligation

-                //	which means that there may be multiple AttributeAssignments but each one has only one value.

-                //	This differs from the Attributes section in which each <Attribute> may have multiple <AttributeValue> elements.

-                // For Obligations and Advice we can simulate an array by having multiple AttributeAssignment elements with the same Category, Id and Issuer.

-                //

-

-                

-                //	AttributeAssignment	- Multiple values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Lisa")));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Lisa\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Maggie\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                //	AttributeAssignment	- Multiple Integer values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111))));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(2222))));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "obligation-issuer1", 

-                                new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(3333))));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":1111,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer1\",\"Value\":2222,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer1\",\"Value\":3333,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // Multiple XPathExpression values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                obligation = new StdMutableObligation();

-                obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

-                obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper2, new IdentifierImpl("SimpleXPathCategory"))));

-                result.addObligation(obligation);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:record\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:hospital\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }	

-                

+        // Status with nested child StatusCodes (child status containing child status containing...)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        StdStatusCode child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"));

+        StdStatusCode statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

+        status = new StdMutableStatus(statusCode);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"StatusCode\":{\"Value\":\"child1StatusCode\"},\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

         }

-        

-        

-        

-        

-        @Test

-        public void testAdvice() {

-                

-                // create an XPathExpression for use later

-                StringNamespaceContext snc = new StringNamespaceContext();

-                try {

-                        snc.add("defaultURI");

-                        snc.add("md", "referenceForMD");

-                } catch (Exception e) {

-                        fail("unable to create NamespaceContext e="+e);

-                }

-                XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

-                XPathExpressionWrapper xpathExpressionWrapper2 = new XPathExpressionWrapper(snc, "//md:hospital");

-                

-                StdMutableAdvice Advice;

-

-                // test Advice single decision no attributes

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Advice missing Id

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                

-                

-                //	AttributeAssignment	- with AttributeId, Value,  Category, DataType, Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                //	AttributeAssignment	- with AttributeId, Value, no Category, DataType, Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                null, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Bart\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                //	AttributeAssignment	- Missing AttributeId

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                null, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                //	AttributeAssignment	- Missing Value

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                null));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // AttributeAssignment - missing DataType

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(null, "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // AttributeAssignment - missing issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // AttributeAssignment - Integer type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111))));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":1111,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // AttributeAssignment - XPathExpression type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:record\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-

-                //

-                // Technically arrays cannot occur in Obligations and Advice elements.  The XML spec boils down to the following definition:

-                //		<Obligation (attributes of the obligation) >

-                //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

-                //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

-                //			:

-                //		</Obligation

-                //	which means that there may be multiple AttributeAssignments but each one has only one value.

-                //	This differs from the Attributes section in which each <Attribute> may have multiple <AttributeValue> elements.

-                // For Obligations and Advice we can simulate an array by having multiple AttributeAssignment elements with the same Category, Id and Issuer.

-                //

-                

-                //	AttributeAssignment	- Multiple values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Lisa")));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Lisa\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Maggie\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                //	AttributeAssignment	- Multiple Integer values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111))));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(2222))));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                "Advice-issuer1", 

-                                new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(3333))));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":1111,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"Advice-issuer1\",\"Value\":2222,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"Advice-issuer1\",\"Value\":3333,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // Multiple XPathExpression values with same Category and Id (one way of doing array)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                Advice = new StdMutableAdvice();

-                Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

-                Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

-                                XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE, 

-                                XACML3.ID_SUBJECT, 

-                                null, 

-                                new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper2, new IdentifierImpl("SimpleXPathCategory"))));

-                result.addAdvice(Advice);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:record\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:hospital\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        status = new StdMutableStatus();

+        StdStatusCode childChildChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildChildStatusCode"));

+        StdStatusCode childChildStatusCode = new StdStatusCode(new IdentifierImpl("childChildStatusCode"), childChildChildStatusCode);

+        child1StatusCode = new StdStatusCode(new IdentifierImpl("child1StatusCode"), childChildStatusCode);

+        statusCode = new StdStatusCode(XACML3.ID_STATUS_OK, child1StatusCode);

+        status = new StdMutableStatus(statusCode);

+        status.setStatusMessage("I'm ok, you're ok");

+        result.setStatus(status);

+        result.setDecision(Decision.PERMIT);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Status\":{\"StatusCode\":{\"StatusCode\":{\"StatusCode\":{\"StatusCode\":{\"Value\":\"childChildChildStatusCode\"},\"Value\":\"childChildStatusCode\"},\"Value\":\"child1StatusCode\"},\"Value\":\"urn:oasis:names:tc:xacml:1.0:status:ok\"},\"StatusMessage\":\"I'm ok, you're ok\"},\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

         }

-        

-        

-        

-        

-        

 

-        

-        

+    }

 

-        

-        // Attributes tests

-        @Test

-        public void testAttributes() {

-                

-                // create an XPathExpression for use later

-                StringNamespaceContext snc = new StringNamespaceContext();

-                try {

-                        snc.add("defaultURI");

-                        snc.add("md", "referenceForMD");

-                } catch (Exception e) {

-                        fail("unable to create NamespaceContext e="+e);

-                }

-                XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

-                

-                

-                Identifier categoryIdentifier;

-                List<Attribute> attrList = new ArrayList<Attribute>();

-                StdMutableAttribute mutableAttribute;

-                

-                // Attr list with no entries

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // one Attribute

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // multiple attributes

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "EIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"BIssue\",\"Value\":\"P10Y4M\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\",\"AttributeId\":\"attrIdent2\"},{\"Issuer\":\"CIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent3\"},{\"Issuer\":\"DIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent4\"},{\"Issuer\":\"EIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent5\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // IncludeInResult=false/true

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", false));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // Missing AttributeId (mandatory)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, null, new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Missing mandatory Value

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), null), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // Missing optional Issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), null, true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // missing optional DataType

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(null, "Apu"), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // same id, same type different issuer

-                // (This is not an array of values because issuer is different)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"), "BIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Simpson"), "CIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"BIssue\",\"Value\":\"Bart\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"CIssue\",\"Value\":\"Simpson\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // same id, same type different issuer

-                // (This is effectively an array of values, but we return them as separate values to the client)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Simpson"), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":\"Bart\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":\"Simpson\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // same Id, different types, same issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":\"P10Y4M\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                // same Id, different types, different issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "EIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), null, true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"BIssue\",\"Value\":\"P10Y4M\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"CIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"DIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"EIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent1\"},{\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

 

-                // different Id, different types, same issuer

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "AIssue"), "BIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "AIssue", true));

-                        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"BIssue\",\"Value\":\"AIssue\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\",\"AttributeId\":\"attrIdent2\"},{\"Issuer\":\"AIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent3\"},{\"Issuer\":\"AIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent4\"},{\"Issuer\":\"AIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent5\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // one Attribute of type XPathExpression (the only complex data type)

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategory")), "AIssue", true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"xpathCategory\",\"XPath\":\"//md:record\"},\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // multiple sets of values

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                attrList.clear();

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", false));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "EIssue", true));

-                attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrNoIssuer"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), null, true));

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                categoryIdentifier = new IdentifierImpl("secondCategory");

-                Attribute[] secondAttrList = {

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent12"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu2"), "AIssue2", true),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent22"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Abc2"), "BIssue2", false),

-                                new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent32"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Der2"), "CIssue2", true) };

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(secondAttrList)));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"CIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent3\"},{\"Issuer\":\"DIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent4\"},{\"Issuer\":\"EIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent5\"},{\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrNoIssuer\"}]},{\"CategoryId\":\"secondCategory\",\"Attribute\":[{\"Issuer\":\"AIssue2\",\"Value\":\"Apu2\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent12\"},{\"Issuer\":\"CIssue2\",\"Value\":\"Der2\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent32\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // array of values - same type

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                attrList.clear();

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

 

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"));

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"));

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Homer"));

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Ned"));

-                        

-                attrList.add(mutableAttribute);

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":[\"Apu\",\"Bart\",\"Homer\",\"Ned\"],\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // array of values - compatible different types

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                attrList.clear();

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

+    @Test

+    public void testObligations() {

 

-                        mutableAttribute.addValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)));

-                        mutableAttribute.addValue(new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432));

-                        mutableAttribute.addValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)));

-                attrList.add(mutableAttribute);

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":[4567,765.432,4567],\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // array of values - incompatible different types

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                attrList.clear();

-                categoryIdentifier = new IdentifierImpl("firstCategory");

-                mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

-

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"));

-                        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"));

-                        mutableAttribute.addValue(new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432));

-                        mutableAttribute.addValue(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true));

-                        mutableAttribute.addValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)));

-                        mutableAttribute.addValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)));

-                attrList.add(mutableAttribute);

-                result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

+        // create an XPathExpression for use later

+        StringNamespaceContext snc = new StringNamespaceContext();

+        try {

+            snc.add("defaultURI");

+            snc.add("md", "referenceForMD");

+        } catch (Exception e) {

+            fail("unable to create NamespaceContext e="+e);

         }

-        

-        

-        

-        

-        

-        // PolicyIdentifier tests

-        @Test

-        public void testPolicyIdentifier() {

-                

-                StdIdReference policyIdentifier1 = null;

-                StdIdReference policyIdentifier2 = null;

-                StdIdReference policySetIdentifier1 = null;

-                StdIdReference policySetIdentifier2 = null;

-                

-                // multiple PolicyIdentifiers of both types

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                try {

-                        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

-                        policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

-                        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

-                        policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

-                } catch (ParseException e1) {

-                        fail("creating policyIds, e="+e1);

-                }

-                result.addPolicyIdentifier(policyIdentifier1);

-                result.addPolicyIdentifier(policyIdentifier2);

-                result.addPolicySetIdentifier(policySetIdentifier1);

-                result.addPolicySetIdentifier(policySetIdentifier2);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicyIdReference\":[{\"Id\":\"idRef1\",\"Version\":\"1.2.3\"},{\"Id\":\"idRef2_NoVersion\"}],\"PolicySetIdReference\":[{\"Id\":\"idSetRef1\",\"Version\":\"4.5.6.7.8.9.0\"},{\"Id\":\"idSetRef2_NoVersion\"}]}}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // PolicyIdentifier exists but has no IdReferences

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                policyIdentifier1 = null;

-                result.addPolicyIdentifier(policyIdentifier1);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // PolicySetIdentifier exists but has not IdReferences

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                policySetIdentifier1 = null;

-                result.addPolicyIdentifier(policySetIdentifier1);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        fail("Operation should throw exception");

-                } catch (JSONStructureException e) {

-                        // correct response

-                } catch (Exception e) {

-                        fail ("Failed convert from JSON to object: " + e);

-                }

-                

-                // PolicyIdentifier with PolicyIdReference and no PolicySetIdReference

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                try {

-                        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

-                } catch (ParseException e1) {

-                        fail("creating policyIds, e="+e1);

-                }

-                result.addPolicyIdentifier(policyIdentifier1);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicyIdReference\":[{\"Id\":\"idRef1\",\"Version\":\"1.2.3\"}]}}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                

-                // PolicyIdentifier with no PolicyIdReference and with PolicySetIdReference

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

-                try {

-                        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

-                } catch (ParseException e1) {

-                        fail("creating policyIds, e="+e1);

-                }

-                result.addPolicySetIdentifier(policySetIdentifier1);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicySetIdReference\":[{\"Id\":\"idSetRef1\",\"Version\":\"4.5.6.7.8.9.0\"}]}}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

-                

-                

-                // IdReferences without version

-                response = new StdMutableResponse();

-                result = new StdMutableResult();

-                result.setDecision(Decision.PERMIT);

+        XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

+        XPathExpressionWrapper xpathExpressionWrapper2 = new XPathExpressionWrapper(snc, "//md:hospital");

 

-                        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), null);

-                        policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

-                        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"));

-                        policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

+        StdMutableObligation obligation;

 

-                result.addPolicyIdentifier(policyIdentifier1);

-                result.addPolicyIdentifier(policyIdentifier2);

-                result.addPolicySetIdentifier(policySetIdentifier1);

-                result.addPolicySetIdentifier(policySetIdentifier2);

-                response.add(result);

-                try {

-                        jsonResponse = JSONResponse.toString(response, false);

-                        assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicyIdReference\":[{\"Id\":\"idRef1\"},{\"Id\":\"idRef2_NoVersion\"}],\"PolicySetIdReference\":[{\"Id\":\"idSetRef1\"},{\"Id\":\"idSetRef2_NoVersion\"}]}}]}", jsonResponse);

-                } catch (Exception e) {

-                        fail("operation failed, e="+e);

-                }

+        // test Obligation single decision no attributes

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

         }

 

+        // obligation missing Id

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+

+        //	AttributeAssignment	- with AttributeId, Value,  Category, DataType, Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        //	AttributeAssignment	- with AttributeId, Value, no Category, DataType, Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              null,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        //	AttributeAssignment	- Missing AttributeId

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              null,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        //	AttributeAssignment	- Missing Value

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              null));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // AttributeAssignment - missing DataType

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(null, "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // AttributeAssignment - missing issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // AttributeAssignment - Integer type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111))));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":1111,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // AttributeAssignment - XPathExpression type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:record\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+

+        //

+        // Technically arrays cannot occur in Obligations and Advice elements.  The XML spec boils down to the following definition:

+        //		<Obligation (attributes of the obligation) >

+        //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

+        //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

+        //			:

+        //		</Obligation

+        //	which means that there may be multiple AttributeAssignments but each one has only one value.

+        //	This differs from the Attributes section in which each <Attribute> may have multiple <AttributeValue> elements.

+        // For Obligations and Advice we can simulate an array by having multiple AttributeAssignment elements with the same Category, Id and Issuer.

+        //

+

+

+        //	AttributeAssignment	- Multiple values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Lisa")));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Lisa\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer1\",\"Value\":\"Maggie\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        //	AttributeAssignment	- Multiple Integer values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111))));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(2222))));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              "obligation-issuer1",

+                                              new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(3333))));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"obligation-issuer1\",\"Value\":1111,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer1\",\"Value\":2222,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"obligation-issuer1\",\"Value\":3333,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // Multiple XPathExpression values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        obligation = new StdMutableObligation();

+        obligation.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

+        obligation.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                              XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                              XACML3.ID_SUBJECT,

+                                              null,

+                                              new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper2, new IdentifierImpl("SimpleXPathCategory"))));

+        result.addObligation(obligation);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Obligations\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:record\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:hospital\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+    }

+

+

+

+

+    @Test

+    public void testAdvice() {

+

+        // create an XPathExpression for use later

+        StringNamespaceContext snc = new StringNamespaceContext();

+        try {

+            snc.add("defaultURI");

+            snc.add("md", "referenceForMD");

+        } catch (Exception e) {

+            fail("unable to create NamespaceContext e="+e);

+        }

+        XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

+        XPathExpressionWrapper xpathExpressionWrapper2 = new XPathExpressionWrapper(snc, "//md:hospital");

+

+        StdMutableAdvice Advice;

+

+        // test Advice single decision no attributes

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\"}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Advice missing Id

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+

+

+        //	AttributeAssignment	- with AttributeId, Value,  Category, DataType, Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        //	AttributeAssignment	- with AttributeId, Value, no Category, DataType, Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          null,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Bart\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        //	AttributeAssignment	- Missing AttributeId

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          null,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        //	AttributeAssignment	- Missing Value

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          null));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // AttributeAssignment - missing DataType

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(null, "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // AttributeAssignment - missing issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // AttributeAssignment - Integer type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111))));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":1111,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // AttributeAssignment - XPathExpression type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:record\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+

+        //

+        // Technically arrays cannot occur in Obligations and Advice elements.  The XML spec boils down to the following definition:

+        //		<Obligation (attributes of the obligation) >

+        //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

+        //			<AttributeAssignment (attributes of this assignment) >value</AttributeAssignment>

+        //			:

+        //		</Obligation

+        //	which means that there may be multiple AttributeAssignments but each one has only one value.

+        //	This differs from the Attributes section in which each <Attribute> may have multiple <AttributeValue> elements.

+        // For Obligations and Advice we can simulate an array by having multiple AttributeAssignment elements with the same Category, Id and Issuer.

+        //

+

+        //	AttributeAssignment	- Multiple values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart")));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Lisa")));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Maggie")));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Bart\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Lisa\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"Advice-issuer1\",\"Value\":\"Maggie\",\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        //	AttributeAssignment	- Multiple Integer values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(1111))));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(2222))));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          "Advice-issuer1",

+                                          new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(3333))));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Issuer\":\"Advice-issuer1\",\"Value\":1111,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"Advice-issuer1\",\"Value\":2222,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Issuer\":\"Advice-issuer1\",\"Value\":3333,\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // Multiple XPathExpression values with same Category and Id (one way of doing array)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        Advice = new StdMutableAdvice();

+        Advice.setId(XACML3.ID_ACTION_IMPLIED_ACTION);

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("SimpleXPathCategory"))));

+        Advice.addAttributeAssignment(new StdMutableAttributeAssignment(

+                                          XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE,

+                                          XACML3.ID_SUBJECT,

+                                          null,

+                                          new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper2, new IdentifierImpl("SimpleXPathCategory"))));

+        result.addAdvice(Advice);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"AssociatedAdvice\":[{\"Id\":\"urn:oasis:names:tc:xacml:1.0:action:implied-action\",\"AttributeAssignment\":[{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:record\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"},{\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"SimpleXPathCategory\",\"XPath\":\"//md:hospital\"},\"Category\":\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\",\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"urn:oasis:names:tc:xacml:1.0:subject\"}]}]}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+    }

+

+

+

+

+

+

+

+

+

+

+    // Attributes tests

+    @Test

+    public void testAttributes() {

+

+        // create an XPathExpression for use later

+        StringNamespaceContext snc = new StringNamespaceContext();

+        try {

+            snc.add("defaultURI");

+            snc.add("md", "referenceForMD");

+        } catch (Exception e) {

+            fail("unable to create NamespaceContext e="+e);

+        }

+        XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(snc, "//md:record");

+

+

+        Identifier categoryIdentifier;

+        List<Attribute> attrList = new ArrayList<Attribute>();

+        StdMutableAttribute mutableAttribute;

+

+        // Attr list with no entries

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // one Attribute

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // multiple attributes

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "EIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"BIssue\",\"Value\":\"P10Y4M\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\",\"AttributeId\":\"attrIdent2\"},{\"Issuer\":\"CIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent3\"},{\"Issuer\":\"DIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent4\"},{\"Issuer\":\"EIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent5\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // IncludeInResult=false/true

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", false));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // Missing AttributeId (mandatory)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, null, new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Missing mandatory Value

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), null), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // Missing optional Issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), null, true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // missing optional DataType

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(null, "Apu"), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // same id, same type different issuer

+        // (This is not an array of values because issuer is different)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"), "BIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Simpson"), "CIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"BIssue\",\"Value\":\"Bart\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"CIssue\",\"Value\":\"Simpson\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // same id, same type different issuer

+        // (This is effectively an array of values, but we return them as separate values to the client)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Simpson"), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":\"Bart\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":\"Simpson\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // same Id, different types, same issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":\"P10Y4M\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"AIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // same Id, different types, different issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "EIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), null, true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"BIssue\",\"Value\":\"P10Y4M\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"CIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"DIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"EIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent1\"},{\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+        // different Id, different types, same issuer

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "AIssue"), "BIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"BIssue\",\"Value\":\"AIssue\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#yearMonthDuration\",\"AttributeId\":\"attrIdent2\"},{\"Issuer\":\"AIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent3\"},{\"Issuer\":\"AIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent4\"},{\"Issuer\":\"AIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent5\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // one Attribute of type XPathExpression (the only complex data type)

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<XPathExpressionWrapper>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, new IdentifierImpl("xpathCategory")), "AIssue", true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":{\"Namespaces\":[{\"Namespace\":\"referenceForMD\",\"Prefix\":\"md\"},{\"Namespace\":\"defaultURI\"}],\"XPathCategory\":\"xpathCategory\",\"XPath\":\"//md:record\"},\"DataType\":\"urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // multiple sets of values

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        attrList.clear();

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"), "AIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent2"), new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"), "BIssue", false));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent3"), new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432), "CIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent4"), new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true), "DIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent5"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), "EIssue", true));

+        attrList.add(new StdAttribute(categoryIdentifier, new IdentifierImpl("attrNoIssuer"), new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)), null, true));

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        categoryIdentifier = new IdentifierImpl("secondCategory");

+        Attribute[] secondAttrList = {

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent12"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu2"), "AIssue2", true),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent22"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Abc2"), "BIssue2", false),

+            new StdAttribute(categoryIdentifier, new IdentifierImpl("attrIdent32"), new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Der2"), "CIssue2", true)

+        };

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, Arrays.asList(secondAttrList)));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":\"Apu\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"},{\"Issuer\":\"CIssue\",\"Value\":765.432,\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent3\"},{\"Issuer\":\"DIssue\",\"Value\":true,\"DataType\":\"http://www.w3.org/2001/XMLSchema#boolean\",\"AttributeId\":\"attrIdent4\"},{\"Issuer\":\"EIssue\",\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrIdent5\"},{\"Value\":4567,\"DataType\":\"http://www.w3.org/2001/XMLSchema#integer\",\"AttributeId\":\"attrNoIssuer\"}]},{\"CategoryId\":\"secondCategory\",\"Attribute\":[{\"Issuer\":\"AIssue2\",\"Value\":\"Apu2\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent12\"},{\"Issuer\":\"CIssue2\",\"Value\":\"Der2\",\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent32\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // array of values - same type

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        attrList.clear();

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

+

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"));

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Bart"));

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Homer"));

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Ned"));

+

+        attrList.add(mutableAttribute);

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":[\"Apu\",\"Bart\",\"Homer\",\"Ned\"],\"DataType\":\"http://www.w3.org/2001/XMLSchema#string\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // array of values - compatible different types

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        attrList.clear();

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

+

+        mutableAttribute.addValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)));

+        mutableAttribute.addValue(new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432));

+        mutableAttribute.addValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)));

+        attrList.add(mutableAttribute);

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Category\":[{\"CategoryId\":\"firstCategory\",\"Attribute\":[{\"Issuer\":\"AIssue\",\"Value\":[4567,765.432,4567],\"DataType\":\"http://www.w3.org/2001/XMLSchema#double\",\"AttributeId\":\"attrIdent1\"}]}],\"Decision\":\"Permit\"}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // array of values - incompatible different types

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        attrList.clear();

+        categoryIdentifier = new IdentifierImpl("firstCategory");

+        mutableAttribute = new StdMutableAttribute(categoryIdentifier, new IdentifierImpl("attrIdent1"), (Collection<AttributeValue<?>>)null, "AIssue", true);

+

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_STRING.getId(), "Apu"));

+        mutableAttribute.addValue(new StdAttributeValue<String>(DataTypes.DT_YEARMONTHDURATION.getId(), "P10Y4M"));

+        mutableAttribute.addValue(new StdAttributeValue<Double>(DataTypes.DT_DOUBLE.getId(), 765.432));

+        mutableAttribute.addValue(new StdAttributeValue<Boolean>(DataTypes.DT_BOOLEAN.getId(), true));

+        mutableAttribute.addValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)));

+        mutableAttribute.addValue(new StdAttributeValue<BigInteger>(DataTypes.DT_INTEGER.getId(), BigInteger.valueOf(4567)));

+        attrList.add(mutableAttribute);

+        result.addAttributeCategory(new StdAttributeCategory(categoryIdentifier, attrList));

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+    }

+

+

+

+

+

+    // PolicyIdentifier tests

+    @Test

+    public void testPolicyIdentifier() {

+

+        StdIdReference policyIdentifier1 = null;

+        StdIdReference policyIdentifier2 = null;

+        StdIdReference policySetIdentifier1 = null;

+        StdIdReference policySetIdentifier2 = null;

+

+        // multiple PolicyIdentifiers of both types

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        try {

+            policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

+            policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

+            policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

+            policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

+        } catch (ParseException e1) {

+            fail("creating policyIds, e="+e1);

+        }

+        result.addPolicyIdentifier(policyIdentifier1);

+        result.addPolicyIdentifier(policyIdentifier2);

+        result.addPolicySetIdentifier(policySetIdentifier1);

+        result.addPolicySetIdentifier(policySetIdentifier2);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicyIdReference\":[{\"Id\":\"idRef1\",\"Version\":\"1.2.3\"},{\"Id\":\"idRef2_NoVersion\"}],\"PolicySetIdReference\":[{\"Id\":\"idSetRef1\",\"Version\":\"4.5.6.7.8.9.0\"},{\"Id\":\"idSetRef2_NoVersion\"}]}}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // PolicyIdentifier exists but has no IdReferences

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        policyIdentifier1 = null;

+        result.addPolicyIdentifier(policyIdentifier1);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // PolicySetIdentifier exists but has not IdReferences

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        policySetIdentifier1 = null;

+        result.addPolicyIdentifier(policySetIdentifier1);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            fail("Operation should throw exception");

+        } catch (JSONStructureException e) {

+            // correct response

+        } catch (Exception e) {

+            fail ("Failed convert from JSON to object: " + e);

+        }

+

+        // PolicyIdentifier with PolicyIdReference and no PolicySetIdReference

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        try {

+            policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), StdVersion.newInstance("1.2.3"));

+        } catch (ParseException e1) {

+            fail("creating policyIds, e="+e1);

+        }

+        result.addPolicyIdentifier(policyIdentifier1);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicyIdReference\":[{\"Id\":\"idRef1\",\"Version\":\"1.2.3\"}]}}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+

+        // PolicyIdentifier with no PolicyIdReference and with PolicySetIdReference

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+        try {

+            policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"), StdVersion.newInstance("4.5.6.7.8.9.0"));

+        } catch (ParseException e1) {

+            fail("creating policyIds, e="+e1);

+        }

+        result.addPolicySetIdentifier(policySetIdentifier1);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicySetIdReference\":[{\"Id\":\"idSetRef1\",\"Version\":\"4.5.6.7.8.9.0\"}]}}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+

+

+        // IdReferences without version

+        response = new StdMutableResponse();

+        result = new StdMutableResult();

+        result.setDecision(Decision.PERMIT);

+

+        policyIdentifier1 = new StdIdReference(new IdentifierImpl("idRef1"), null);

+        policyIdentifier2 = new StdIdReference(new IdentifierImpl("idRef2_NoVersion"));

+        policySetIdentifier1 = new StdIdReference(new IdentifierImpl("idSetRef1"));

+        policySetIdentifier2 = new StdIdReference(new IdentifierImpl("idSetRef2_NoVersion"));

+

+        result.addPolicyIdentifier(policyIdentifier1);

+        result.addPolicyIdentifier(policyIdentifier2);

+        result.addPolicySetIdentifier(policySetIdentifier1);

+        result.addPolicySetIdentifier(policySetIdentifier2);

+        response.add(result);

+        try {

+            jsonResponse = JSONResponse.toString(response, false);

+            assertEquals("{\"Response\":[{\"Decision\":\"Permit\",\"PolicyIdentifier\":{\"PolicyIdReference\":[{\"Id\":\"idRef1\"},{\"Id\":\"idRef2_NoVersion\"}],\"PolicySetIdReference\":[{\"Id\":\"idSetRef1\"},{\"Id\":\"idSetRef2_NoVersion\"}]}}]}", jsonResponse);

+        } catch (Exception e) {

+            fail("operation failed, e="+e);

+        }

+    }

+

 

 //TODO - the JSON and XML spec imply that the Result Attributes may include the Content (It is part of the UML)

-        

-        

-        // test indentation???

-        

-        // order does not matter??

-        

+

+

+    // test indentation???

+

+    // order does not matter??

+

 }

 

 

diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/TestBase.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/TestBase.java
index 6c88182..c9944fe 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/TestBase.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/TestBase.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -93,699 +93,699 @@
 
 /**
  * This is a base class for setting up a test environment. Using properties files, it contains the
- * necessary information for 
+ * necessary information for
  * 1. defining and providing attributes
  * 2. defining and instantiating the PDP engine
  * 3. creating PEP requests and calling the PDP engine
- * 
+ *
  * @author pameladragosh
  *
  */
 public class TestBase extends SimpleFileVisitor<Path> {
-        private static final Log logger	= LogFactory.getLog(TestBase.class);
-        
-        public class HelpException extends Exception {
-                private static final long serialVersionUID = 1L;
-                
+    private static final Log logger	= LogFactory.getLog(TestBase.class);
+
+    public class HelpException extends Exception {
+        private static final long serialVersionUID = 1L;
+
+    }
+
+    /**
+     * This private class holds information for properties defined for attribute
+     * generation. The user can configure the properties file such that attributes
+     * can be automatically generated and added into each request.
+     *
+     * @author pameladragosh
+     *
+     */
+    class Generator {
+        Path file;
+        InputStream is;
+        BufferedReader reader;
+        List<StdMutableAttribute> attributes = new ArrayList<StdMutableAttribute>();
+
+        public Generator(Path path) {
+            this.file = path;
         }
-        
+
         /**
-         * This private class holds information for properties defined for attribute
-         * generation. The user can configure the properties file such that attributes
-         * can be automatically generated and added into each request.
-         * 
-         * @author pameladragosh
+         * read - reads in the next line of data
          *
+         * @return	String - a line from the csv containing attribute data
          */
-        class Generator {
-                Path file;
-                InputStream is;
-                BufferedReader reader;
-                List<StdMutableAttribute> attributes = new ArrayList<StdMutableAttribute>();
-                
-                public Generator(Path path) {
-                        this.file = path;
-                }
-
-                /**
-                 * read - reads in the next line of data
-                 * 
-                 * @return	String - a line from the csv containing attribute data
-                 */
-                public String	read() {
-                        String str = null;
-                        if (is == null) {
-                                try {
-                                        is = Files.newInputStream(file);
-                                } catch (IOException e) {
-                                        logger.error(e);
-                                        return null;
-                                }
-                        }
-                        if (reader == null) {
-                                reader = new BufferedReader(new InputStreamReader(this.is));
-                        }
-                        try {
-                                str = reader.readLine();
-                                if (str == null) {
-                                        //
-                                        // No more strings, close up
-                                        //
-                                        this.close();
-                                }
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug(str);
-                                }
-                        } catch (IOException e) {
-                                logger.error(e);
-                        }
-                        return str;
-                }
-                
-                public void 	close() {
-                        if (this.reader != null) {
-                                try {
-                                        this.reader.close();
-                                } catch (IOException idontcare) {
-                                } finally {
-                                        this.reader = null;
-                                        this.is = null;
-                                }
-                        }
-                }
-                
-        }
-        
-        public static final String PROP_GENERATOR = "xacml.attribute.generator";
-        
-        public static final String OPTION_HELP = "help";
-        public static final String OPTION_TESTDIR = "dir";
-        public static final String OPTION_TESTREST = "rest";
-        public static final String OPTION_TESTURL = "url";
-        public static final String OPTION_TESTOUTPUT = "output";
-        public static final String OPTION_LOOP = "loop";
-        public static final String OPTION_TESTNUMBERS = "testNumbers";
-
-        public static final String DEFAULT_RESTURL = "https://localhost:8443/pdp/";
-        
-        public static Options options = new Options();
-        static {
-                options.addOption(new Option(OPTION_HELP, false, "Prints help."));
-                options.addOption(new Option(OPTION_TESTDIR, true, "Directory path where all the test properties and data are located."));
-                options.addOption(new Option(OPTION_TESTREST, false, "Test against RESTful PDP."));
-                options.addOption(new Option(OPTION_TESTURL, true, "URL to the RESTful PDP. Default is " + DEFAULT_RESTURL));
-                options.addOption(new Option(OPTION_TESTOUTPUT, true, "Specify a different location for dumping responses."));
-                options.addOption(new Option(OPTION_LOOP, true, "Number of times to loop through the tests. Default is 1. A value of -1 runs indefinitely."));
-                options.addOption(new Option(OPTION_TESTNUMBERS, true, "Comma-separated list of numbers found in the names of the test files to be run.  Numbers must exactly match the file name, e.g. '02'.  Used to limit testing to specific set of tests."));
-        }
-        
-        protected String directory = null;
-        protected Path output = null;
-        protected boolean isREST;
-        protected URL restURL = null;
-        protected int loop = 1;
-        protected PDPEngine engine = null;
-        protected List<Generator> generators = new ArrayList<Generator>();
-        protected static DataTypeFactory dataTypeFactory		= null;
-        
-        private long	permits = 0;
-        private long	denies = 0;
-        private long	notapplicables = 0;
-        private long	indeterminates = 0;
-        
-        private long	expectedPermits = 0;
-        private long	expectedDenies = 0;
-        private long	expectedNotApplicables = 0;
-        private long	expectedIndeterminates = 0;
-        
-        private long	generatedpermits = 0;
-        private long	generateddenies = 0;
-        private long	generatednotapplicables = 0;
-        private long	generatedindeterminates = 0;
-        
-        private long	responseMatches = 0;
-        private long	responseNotMatches = 0;
-        
-        private String[]	testNumbersArray = null;
-        
-        protected final Pattern pattern = Pattern.compile("Request[.]\\d+[.](Permit|Deny|NA|Indeterminate|Generate|Unknown)\\.(json|xml)");
-        
-        public static boolean isJSON(Path file) {
-                return file.toString().endsWith(".json");
-        }
-        
-        public static boolean isXML(Path file) {
-                return file.toString().endsWith(".xml");
-        }
-        
-        public TestBase(String[] args) throws ParseException, MalformedURLException, HelpException {
-                //
-                // Finish Initialization
-                //
-                this.restURL = new URL(DEFAULT_RESTURL);
-                //
-                // Parse arguments
-                //
-                this.parseCommands(args);
-        }
-        
-        /**
-         * Parse in the command line arguments that the following parameters:
-         * 
-         * @param args - command line arguments
-         * @throws org.apache.commons.cli.ParseException
-         * @throws java.net.MalformedURLException
-         * @throws com.att.research.xacmlatt.pdp.test.TestBase.HelpException
-         */
-        protected void parseCommands(String[] args) throws ParseException, MalformedURLException, HelpException {
-                //
-                // Parse the command line options
-                //
-                CommandLine cl;
-                cl = new GnuParser().parse(options, args);
-                //
-                // Check for what we have
-                //
-                if (cl.hasOption(OPTION_HELP)) {
-                new HelpFormatter().printHelp("Usage: -dir testdirectory OPTIONS",
-                                options);
-                throw new HelpException();
-                }
-                if (cl.hasOption(OPTION_TESTDIR)) {
-                        this.directory = cl.getOptionValue(OPTION_TESTDIR);
-                } else {
-                        throw new IllegalArgumentException("You must specify a test directory. -dir path/to/some/where");
-                }
-                if (cl.hasOption(OPTION_TESTREST)) {
-                        this.isREST = true;
-                } else {
-                        this.isREST = false;
-                }
-                if (cl.hasOption(OPTION_TESTURL)) {
-                        this.restURL = new URL(cl.getOptionValue(OPTION_TESTURL));
-                }
-                if (cl.hasOption(OPTION_TESTOUTPUT)) {
-                        this.output = Paths.get(cl.getOptionValue(OPTION_TESTOUTPUT));
-                } else {
-                        this.output = Paths.get(this.directory, "results");
-                }
-                if (cl.hasOption(OPTION_LOOP)) {
-                        this.loop = Integer.parseInt(cl.getOptionValue(OPTION_LOOP));
-                }
-                if (cl.hasOption(OPTION_TESTNUMBERS)) {
-                        String testNumberString = cl.getOptionValue(OPTION_TESTNUMBERS);
-                        testNumbersArray = testNumberString.split(",");
-                        //
-                        // reset strings to include dots so they exactly match pattern in file name
-                        //
-                        for (int i = 0; i < testNumbersArray.length; i++) {
-                                testNumbersArray[i] = "." + testNumbersArray[i] + ".";
-                        }
-                }
-        }
-        
-        /**
-         * Using the command line options that were parsed, configures our test instance.
-         * 
-         * @throws com.att.research.xacml.util.FactoryException
-         */
-        protected void configure() throws FactoryException {
-                //
-                // Setup the xacml.properties file
-                //
-                if (this.directory == null) {
-                        throw new IllegalArgumentException("Must supply a path to a test directory.");
-                }
-                Path pathDir = Paths.get(this.directory, "xacml.properties");
-                if (Files.notExists(pathDir)) {
-                        throw new IllegalArgumentException(pathDir.toString() + " does not exist.");
-                }
-                //
-                // Set it as the System variable so the XACML factories know where the properties are
-                // loaded from.
-                //
-                System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME, pathDir.toString());
-                //
-                // Now we can create the data type factory
-                //
-                dataTypeFactory	= DataTypeFactory.newInstance();
-                //
-                // Load in what generators we are to create
-                //
-                String generators = XACMLProperties.getProperty(PROP_GENERATOR);
-                if (generators != null) {
-                        //
-                        // Parse the generators
-                        //
-                        for (String generator : Splitter.on(',').trimResults().omitEmptyStrings().split(generators)) {
-                                this.configureGenerator(generator);
-                        }
-                }
-                //
-                // If we are embedded, create our engine
-                //
-                if (this.isREST == false) {
-                        PDPEngineFactory factory = PDPEngineFactory.newInstance();
-                        this.engine = factory.newEngine();
-                }
-                //
-                // Remove all the responses from the results directory
-                //
-                this.removeResults();
-        }
-        
-        /**
-         * Removes all the Response* files from the results directory.
-         * 
-         */
-        public void	removeResults() {
+        public String	read() {
+            String str = null;
+            if (is == null) {
                 try {
-                        //
-                        // Determine where the results are supposed to be written to
-                        //
-                        Path resultsPath;
-                        if (this.output != null) {
-                                resultsPath = this.output;
-                        } else {
-                                resultsPath = Paths.get(this.directory.toString(), "results");
-                        }
-                        //
-                        // Walk the files
-                        //
-                        Files.walkFileTree(resultsPath, new SimpleFileVisitor<Path>() {
-
-                                @Override
-                                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-                                        if (file.getFileName().toString().startsWith("Response")) {
-                                                Files.delete(file);
-                                        }
-                                        return super.visitFile(file, attrs);
-                                }				
-                        });
+                    is = Files.newInputStream(file);
                 } catch (IOException e) {
-                        logger.error("Failed to removeRequests from " + this.directory + " " + e);
+                    logger.error(e);
+                    return null;
                 }
-        }
-        
-        /**
-         * Configure's a specific generator instance from the properties file.
-         * 
-         * @param generator
-         */
-        protected void configureGenerator(String generator) {
-                String prefix = PROP_GENERATOR + "." + generator;
-                String file = XACMLProperties.getProperty(prefix + ".file");
-                //
-                // Create a generator object
-                //
-                Generator gen = new Generator(Paths.get(this.directory, file));
-                this.generators.add(gen);
-                //
-                // Grab attributes
-                //
-                String attributes = XACMLProperties.getProperty(prefix + ".attributes");
-                for (String attribute : Splitter.on(',').trimResults().omitEmptyStrings().split(attributes)) {
-                        String attributePrefix = prefix + ".attributes." + attribute;
-                        //
-                        // Create an attribute value. It is simply a placeholder for the field within
-                        // the CSV that contains the actual attribute value. It mainly holds the data type
-                        //
-                        Identifier datatype = new IdentifierImpl(XACMLProperties.getProperty(attributePrefix + ".datatype"));
-                        Integer field = Integer.parseInt(XACMLProperties.getProperty(attributePrefix + ".field"));
-                        StdAttributeValue<?> value = new StdAttributeValue<>(datatype, field);
-                        //
-                        // Get the rest of the attribute properties
-                        //
-                        Identifier category = new IdentifierImpl(XACMLProperties.getProperty(attributePrefix + ".category"));
-                        Identifier id = new IdentifierImpl(XACMLProperties.getProperty(attributePrefix + ".id"));
-                        String issuer = XACMLProperties.getProperty(attributePrefix + ".issuer");
-                        boolean include = Boolean.parseBoolean(XACMLProperties.getProperty(attributePrefix + ".include", "false"));
-                        //
-                        // Now we have a skeleton attribute
-                        //
-                        gen.attributes.add(new StdMutableAttribute(category, id, value, issuer, include));
+            }
+            if (reader == null) {
+                reader = new BufferedReader(new InputStreamReader(this.is));
+            }
+            try {
+                str = reader.readLine();
+                if (str == null) {
+                    //
+                    // No more strings, close up
+                    //
+                    this.close();
                 }
-        }
-        
-        /**
-         * This runs() the test instance. It first configure's itself and then walks the
-         * requests directory issue each request to the PDP engine.
-         * 
-         * @throws java.io.IOException
-         * @throws com.att.research.xacml.util.FactoryException
-         * 
-         */
-        public void run() throws IOException, FactoryException {
-                //
-                // Configure ourselves
-                //
-                this.configure();
-                //
-                // Loop and run
-                //
-                int runs = 1;
-                do {
-                        long lTimeStart = System.currentTimeMillis();
-                        logger.info("Run number: " + runs);
-                        //
-                        // Walk the request directory
-                        //
-                        Files.walkFileTree(Paths.get(this.directory.toString(), "requests"), this);
-                        long lTimeEnd = System.currentTimeMillis();
-                        logger.info("Run elapsed time: " + (lTimeEnd - lTimeStart) + "ms");
-                        //
-                        // Dump the stats
-                        //
-                        this.dumpStats();
-                        this.resetStats();
-                        //
-                        // Increment
-                        //
-                        runs++;
-                } while ((this.loop == -1 ? true : runs <= this.loop));
-        }
-        
-        @Override
-        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-                //
-                // Sanity check the file name
-                //
-                Matcher matcher = this.pattern.matcher(file.getFileName().toString());
-                if (matcher.matches()) {
-                        //
-                        // if user has limited which files to use, check that here
-                        //
-                        if (testNumbersArray != null) {
-                                String fileNameString = file.getFileName().toString();
-                                boolean found = false;
-                                for (String numberString : testNumbersArray) {
-                                        if (fileNameString.contains(numberString)) {
-                                                found = true;
-                                                break;
-                                        }
-                                }
-                                if (found == false) {
-                                        //
-                                        // this test is not in the list to be run, so skip it
-                                        //
-                                        return super.visitFile(file, attrs);
-                                }
-                        }
-                        try {
-                                //
-                                // Pull what this request is supposed to be
-                                //
-                                String group = null;
-                                int count = matcher.groupCount();
-                                if (count >= 1) {
-                                        group = matcher.group(count-1);
-                                }
-                                //
-                                // Send it
-                                //
-                                this.sendRequest(file, group);
-                        } catch (Exception e) {
-                                logger.error(e);
-                                e.printStackTrace();
-                        }
+                if (logger.isDebugEnabled()) {
+                    logger.debug(str);
                 }
-                return super.visitFile(file, attrs);
-        }
-        
-        /**
-         * When a request file is encountered, this method is called send the request to the PDP engine. It will also dump
-         * the response object. If the group equals "Generate", then it will loop and send the request with generated attributes
-         * until that list is empty.
-         * 
-         * @param file - Request file. Eg. Request-01-Permit.json
-         * @param group - This is the parsed out string of the request file that defines if it is a Permit/Deny/Generate etc.
-         * @throws Exception
-         */
-        protected void sendRequest(Path file, String group) throws Exception {
-                logger.info(file.toString());
-                int requestCount = 0;
-                do {
-                        //
-                        // Generate the request
-                        //
-                        Request request = this.generateRequest(file, group);
-                        //
-                        // Was something generated?
-                        //
-                        if (request == null) {
-                                //
-                                // Get out of the loop
-                                //
-                                logger.info("NULL request generated.");
-                                break;
-                        }
-                        logger.info(request);
-                        //
-                        // Call the PDP
-                        //
-                        Response response = this.callPDP(request);
-                        //
-                        // Process the response
-                        //
-                        this.processResponse(file, request, response, group, requestCount);
-                        //
-                        // Is this a generated request?
-                        //
-                        if (group.equals("Generate")) {
-                                //
-                                // Yes, increment counter and move
-                                // on to the next generated request.
-                                //
-                                requestCount++;
-                        } else {
-                                //
-                                // Nope, exit the loop
-                                //
-                                break;
-                        }
-                } while (group.equals("Generate"));
-        }
-        
-        /**
-         * Sends the request object to the PDP engine. Either the embedded engine or the RESTful engine.
-         * 
-         * @param request - XACML request object
-         * @return Response - returns the XACML response object
-         */
-        protected Response callPDP(Request request) {
-                //
-                // Send it to the PDP
-                //
-                Response response = null;
-                if (this.isREST) {
-                        try {
-                                String jsonString = JSONRequest.toString(request, false);
-                                //
-                                // Call RESTful PDP
-                                //
-                                response = this.callRESTfulPDP(new ByteArrayInputStream(jsonString.getBytes()));
-                        } catch (Exception e) {
-                                logger.error("Error in sending RESTful request: " + e, e);
-                        }
-                } else {
-                        //
-                        // Embedded call to PDP
-                        //
-                        long lTimeStart = System.currentTimeMillis();
-                        try {
-                                response = this.engine.decide(request);
-                        } catch (PDPException e) {
-                                logger.error(e);
-                        }
-                        long lTimeEnd = System.currentTimeMillis();
-                        logger.info("Elapsed Time: " + (lTimeEnd - lTimeStart) + "ms");
-                }
-                return response;
-        }
-        
-        /**
-         * Reads the request file into a Request object based on its type.
-         * 
-         * If the request has "Generate" in its filename, then this function will add
-         * generated attributes into the request.
-         * 
-         * @param file - Request file. Eg. Request-01-Permit.json
-         * @param group - This is the parsed out string of the request file that defines if it is a Permit/Deny/Generate etc.
-         * @return
-         * @throws com.att.research.xacml.std.json.JSONStructureException
-         * @throws com.att.research.xacml.std.dom.DOMStructureException
-         * @throws com.att.research.xacml.api.pep.PEPException
-         */
-        protected Request generateRequest(Path file, String group) throws JSONStructureException, DOMStructureException, PEPException {
-                //
-                // Convert to a XACML Request Object
-                //
-                Request request = null;
-                if (TestBase.isJSON(file)) {
-                        request = JSONRequest.load(file.toFile());
-                } else if (TestBase.isXML(file)) {
-                        request = DOMRequest.load(file.toFile());
-                }
-                if (request == null) {
-                        throw new PEPException("Invalid Request File: " + file.toString());
-                }
-                //
-                // Only if this request has "Generate"
-                // Request.XX.Generate.[json|xml]
-                //
-                if (group.equals("Generate")) {
-                        //
-                        // Add attributes to it
-                        //
-                        request = this.onNextRequest(request);
-                }
-                //
-                // Done
-                //
-                return request;
+            } catch (IOException e) {
+                logger.error(e);
+            }
+            return str;
         }
 
-        /**
-         * Called to add in generated attributes into the request.
-         * 
-         * @param request
-         * @return
-         */
-        protected Request onNextRequest(Request request) {
-                //
-                // If we have no generators, just return
-                //
-                if (this.generators.isEmpty()) {
-                        return request;
-                }
-                //
-                // Copy the request attributes
-                //
-                List<StdMutableRequestAttributes> attributes = new ArrayList<StdMutableRequestAttributes>();
-                for (RequestAttributes a : request.getRequestAttributes()) {
-                        attributes.add(new StdMutableRequestAttributes(a));
-                }
-                //
-                // Iterate the generators
-                //
-                for (Generator generator : this.generators) {
-                        //
-                        // Read a row in
-                        //
-                        String line = generator.read();
-                        //
-                        // Was something read?
-                        //
-                        if (line == null) {
-                                //
-                                // No more rows to read, return null
-                                //
-                                return null;
-                        }
-                        //
-                        // Split the line
-                        //
-                        List<String> fields = Lists.newArrayList(Splitter.on(',').trimResults().split(line));
-                        //
-                        // Now work on the attributes
-                        //
-                        for (StdMutableAttribute attribute : generator.attributes) {
-                                //
-                                // Grab the attribute holder, which holds the datatype and field. There should
-                                // be only ONE object in the collection.
-                                //
-                                AttributeValue<?> value = attribute.getValues().iterator().next();
-                                Integer field = (Integer) value.getValue();
-                                //
-                                // Is the field number valid?
-                                //
-                                if (field >= fields.size()) {
-                                        logger.error("Not enough fields: " + field + "(" + fields.size() + ")");
-                                        return null;
-                                }
-                                //
-                                // Determine what datatype it is
-                                //
-                                DataType<?> dataTypeExtended	= dataTypeFactory.getDataType(value.getDataTypeId());
-                                if (dataTypeExtended == null) {
-                                        logger.error("Failed to determine datatype");
-                                        return null;
-                                }
-                                //
-                                // Create the attribute value
-                                //
-                                try {
-                                        AttributeValue<?> attributeValue = dataTypeExtended.createAttributeValue(fields.get(field));					
-                                        //
-                                        // Create the attribute
-                                        //
-                                        StdMutableAttribute newAttribute = new StdMutableAttribute(attribute.getCategory(),
-                                                                                                                                                                attribute.getAttributeId(),
-                                                                                                                                                                attributeValue,
-                                                                                                                                                                attribute.getIssuer(),
-                                                                                                                                                                attribute.getIncludeInResults());
-                                        boolean added = false;
-                                        for (StdMutableRequestAttributes a : attributes) {
-                                                //
-                                                // Does the category exist?
-                                                //
-                                                if (a.getCategory().equals(attribute.getCategory())) {
-                                                        //
-                                                        // Yes - add in the new attribute value
-                                                        //
-                                                        a.add(newAttribute);
-                                                        added = true;
-                                                        break;
-                                                }
-                                        }
-                                        if (added == false) {
-                                                //
-                                                // New category - create it and add it in
-                                                //
-                                                StdMutableRequestAttributes a = new StdMutableRequestAttributes(); 
-                                                a.setCategory(newAttribute.getCategory());
-                                                a.add(newAttribute);
-                                                attributes.add(a);
-                                        }
-                                } catch (DataTypeException e) {
-                                        logger.error(e);
-                                        return null;
-                                }
-                        }
-                }
-                //
-                // Now form our final request
-                //
-                StdMutableRequest newRequest = new StdMutableRequest();
-                newRequest.setCombinedDecision(request.getCombinedDecision());
-                newRequest.setRequestDefaults(request.getRequestDefaults());
-                newRequest.setReturnPolicyIdList(request.getReturnPolicyIdList());
-                newRequest.setStatus(request.getStatus());
-                for (StdMutableRequestAttributes a : attributes) {
-                        newRequest.add(a);
-                }
-                return newRequest;
-        }
-
-        /**
-         * This makes an HTTP POST call to a running PDP RESTful servlet to get a decision.
-         * 
-         * @param file
-         * @return
-         */
-        protected Response callRESTfulPDP(InputStream is) {
-                Response response = null;
-                HttpURLConnection connection = null;
+        public void 	close() {
+            if (this.reader != null) {
                 try {
+                    this.reader.close();
+                } catch (IOException idontcare) {
+                } finally {
+                    this.reader = null;
+                    this.is = null;
+                }
+            }
+        }
 
+    }
+
+    public static final String PROP_GENERATOR = "xacml.attribute.generator";
+
+    public static final String OPTION_HELP = "help";
+    public static final String OPTION_TESTDIR = "dir";
+    public static final String OPTION_TESTREST = "rest";
+    public static final String OPTION_TESTURL = "url";
+    public static final String OPTION_TESTOUTPUT = "output";
+    public static final String OPTION_LOOP = "loop";
+    public static final String OPTION_TESTNUMBERS = "testNumbers";
+
+    public static final String DEFAULT_RESTURL = "https://localhost:8443/pdp/";
+
+    public static Options options = new Options();
+    static {
+        options.addOption(new Option(OPTION_HELP, false, "Prints help."));
+        options.addOption(new Option(OPTION_TESTDIR, true, "Directory path where all the test properties and data are located."));
+        options.addOption(new Option(OPTION_TESTREST, false, "Test against RESTful PDP."));
+        options.addOption(new Option(OPTION_TESTURL, true, "URL to the RESTful PDP. Default is " + DEFAULT_RESTURL));
+        options.addOption(new Option(OPTION_TESTOUTPUT, true, "Specify a different location for dumping responses."));
+        options.addOption(new Option(OPTION_LOOP, true, "Number of times to loop through the tests. Default is 1. A value of -1 runs indefinitely."));
+        options.addOption(new Option(OPTION_TESTNUMBERS, true, "Comma-separated list of numbers found in the names of the test files to be run.  Numbers must exactly match the file name, e.g. '02'.  Used to limit testing to specific set of tests."));
+    }
+
+    protected String directory = null;
+    protected Path output = null;
+    protected boolean isREST;
+    protected URL restURL = null;
+    protected int loop = 1;
+    protected PDPEngine engine = null;
+    protected List<Generator> generators = new ArrayList<Generator>();
+    protected static DataTypeFactory dataTypeFactory		= null;
+
+    private long	permits = 0;
+    private long	denies = 0;
+    private long	notapplicables = 0;
+    private long	indeterminates = 0;
+
+    private long	expectedPermits = 0;
+    private long	expectedDenies = 0;
+    private long	expectedNotApplicables = 0;
+    private long	expectedIndeterminates = 0;
+
+    private long	generatedpermits = 0;
+    private long	generateddenies = 0;
+    private long	generatednotapplicables = 0;
+    private long	generatedindeterminates = 0;
+
+    private long	responseMatches = 0;
+    private long	responseNotMatches = 0;
+
+    private String[]	testNumbersArray = null;
+
+    protected final Pattern pattern = Pattern.compile("Request[.]\\d+[.](Permit|Deny|NA|Indeterminate|Generate|Unknown)\\.(json|xml)");
+
+    public static boolean isJSON(Path file) {
+        return file.toString().endsWith(".json");
+    }
+
+    public static boolean isXML(Path file) {
+        return file.toString().endsWith(".xml");
+    }
+
+    public TestBase(String[] args) throws ParseException, MalformedURLException, HelpException {
+        //
+        // Finish Initialization
+        //
+        this.restURL = new URL(DEFAULT_RESTURL);
+        //
+        // Parse arguments
+        //
+        this.parseCommands(args);
+    }
+
+    /**
+     * Parse in the command line arguments that the following parameters:
+     *
+     * @param args - command line arguments
+     * @throws org.apache.commons.cli.ParseException
+     * @throws java.net.MalformedURLException
+     * @throws com.att.research.xacmlatt.pdp.test.TestBase.HelpException
+     */
+    protected void parseCommands(String[] args) throws ParseException, MalformedURLException, HelpException {
+        //
+        // Parse the command line options
+        //
+        CommandLine cl;
+        cl = new GnuParser().parse(options, args);
+        //
+        // Check for what we have
+        //
+        if (cl.hasOption(OPTION_HELP)) {
+            new HelpFormatter().printHelp("Usage: -dir testdirectory OPTIONS",
+                                          options);
+            throw new HelpException();
+        }
+        if (cl.hasOption(OPTION_TESTDIR)) {
+            this.directory = cl.getOptionValue(OPTION_TESTDIR);
+        } else {
+            throw new IllegalArgumentException("You must specify a test directory. -dir path/to/some/where");
+        }
+        if (cl.hasOption(OPTION_TESTREST)) {
+            this.isREST = true;
+        } else {
+            this.isREST = false;
+        }
+        if (cl.hasOption(OPTION_TESTURL)) {
+            this.restURL = new URL(cl.getOptionValue(OPTION_TESTURL));
+        }
+        if (cl.hasOption(OPTION_TESTOUTPUT)) {
+            this.output = Paths.get(cl.getOptionValue(OPTION_TESTOUTPUT));
+        } else {
+            this.output = Paths.get(this.directory, "results");
+        }
+        if (cl.hasOption(OPTION_LOOP)) {
+            this.loop = Integer.parseInt(cl.getOptionValue(OPTION_LOOP));
+        }
+        if (cl.hasOption(OPTION_TESTNUMBERS)) {
+            String testNumberString = cl.getOptionValue(OPTION_TESTNUMBERS);
+            testNumbersArray = testNumberString.split(",");
+            //
+            // reset strings to include dots so they exactly match pattern in file name
+            //
+            for (int i = 0; i < testNumbersArray.length; i++) {
+                testNumbersArray[i] = "." + testNumbersArray[i] + ".";
+            }
+        }
+    }
+
+    /**
+     * Using the command line options that were parsed, configures our test instance.
+     *
+     * @throws com.att.research.xacml.util.FactoryException
+     */
+    protected void configure() throws FactoryException {
+        //
+        // Setup the xacml.properties file
+        //
+        if (this.directory == null) {
+            throw new IllegalArgumentException("Must supply a path to a test directory.");
+        }
+        Path pathDir = Paths.get(this.directory, "xacml.properties");
+        if (Files.notExists(pathDir)) {
+            throw new IllegalArgumentException(pathDir.toString() + " does not exist.");
+        }
+        //
+        // Set it as the System variable so the XACML factories know where the properties are
+        // loaded from.
+        //
+        System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME, pathDir.toString());
+        //
+        // Now we can create the data type factory
+        //
+        dataTypeFactory	= DataTypeFactory.newInstance();
+        //
+        // Load in what generators we are to create
+        //
+        String generators = XACMLProperties.getProperty(PROP_GENERATOR);
+        if (generators != null) {
+            //
+            // Parse the generators
+            //
+            for (String generator : Splitter.on(',').trimResults().omitEmptyStrings().split(generators)) {
+                this.configureGenerator(generator);
+            }
+        }
+        //
+        // If we are embedded, create our engine
+        //
+        if (this.isREST == false) {
+            PDPEngineFactory factory = PDPEngineFactory.newInstance();
+            this.engine = factory.newEngine();
+        }
+        //
+        // Remove all the responses from the results directory
+        //
+        this.removeResults();
+    }
+
+    /**
+     * Removes all the Response* files from the results directory.
+     *
+     */
+    public void	removeResults() {
+        try {
+            //
+            // Determine where the results are supposed to be written to
+            //
+            Path resultsPath;
+            if (this.output != null) {
+                resultsPath = this.output;
+            } else {
+                resultsPath = Paths.get(this.directory.toString(), "results");
+            }
+            //
+            // Walk the files
+            //
+            Files.walkFileTree(resultsPath, new SimpleFileVisitor<Path>() {
+
+                @Override
+                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+                    if (file.getFileName().toString().startsWith("Response")) {
+                        Files.delete(file);
+                    }
+                    return super.visitFile(file, attrs);
+                }
+            });
+        } catch (IOException e) {
+            logger.error("Failed to removeRequests from " + this.directory + " " + e);
+        }
+    }
+
+    /**
+     * Configure's a specific generator instance from the properties file.
+     *
+     * @param generator
+     */
+    protected void configureGenerator(String generator) {
+        String prefix = PROP_GENERATOR + "." + generator;
+        String file = XACMLProperties.getProperty(prefix + ".file");
+        //
+        // Create a generator object
+        //
+        Generator gen = new Generator(Paths.get(this.directory, file));
+        this.generators.add(gen);
+        //
+        // Grab attributes
+        //
+        String attributes = XACMLProperties.getProperty(prefix + ".attributes");
+        for (String attribute : Splitter.on(',').trimResults().omitEmptyStrings().split(attributes)) {
+            String attributePrefix = prefix + ".attributes." + attribute;
+            //
+            // Create an attribute value. It is simply a placeholder for the field within
+            // the CSV that contains the actual attribute value. It mainly holds the data type
+            //
+            Identifier datatype = new IdentifierImpl(XACMLProperties.getProperty(attributePrefix + ".datatype"));
+            Integer field = Integer.parseInt(XACMLProperties.getProperty(attributePrefix + ".field"));
+            StdAttributeValue<?> value = new StdAttributeValue<>(datatype, field);
+            //
+            // Get the rest of the attribute properties
+            //
+            Identifier category = new IdentifierImpl(XACMLProperties.getProperty(attributePrefix + ".category"));
+            Identifier id = new IdentifierImpl(XACMLProperties.getProperty(attributePrefix + ".id"));
+            String issuer = XACMLProperties.getProperty(attributePrefix + ".issuer");
+            boolean include = Boolean.parseBoolean(XACMLProperties.getProperty(attributePrefix + ".include", "false"));
+            //
+            // Now we have a skeleton attribute
+            //
+            gen.attributes.add(new StdMutableAttribute(category, id, value, issuer, include));
+        }
+    }
+
+    /**
+     * This runs() the test instance. It first configure's itself and then walks the
+     * requests directory issue each request to the PDP engine.
+     *
+     * @throws java.io.IOException
+     * @throws com.att.research.xacml.util.FactoryException
+     *
+     */
+    public void run() throws IOException, FactoryException {
+        //
+        // Configure ourselves
+        //
+        this.configure();
+        //
+        // Loop and run
+        //
+        int runs = 1;
+        do {
+            long lTimeStart = System.currentTimeMillis();
+            logger.info("Run number: " + runs);
+            //
+            // Walk the request directory
+            //
+            Files.walkFileTree(Paths.get(this.directory.toString(), "requests"), this);
+            long lTimeEnd = System.currentTimeMillis();
+            logger.info("Run elapsed time: " + (lTimeEnd - lTimeStart) + "ms");
+            //
+            // Dump the stats
+            //
+            this.dumpStats();
+            this.resetStats();
+            //
+            // Increment
+            //
+            runs++;
+        } while ((this.loop == -1 ? true : runs <= this.loop));
+    }
+
+    @Override
+    public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+        //
+        // Sanity check the file name
+        //
+        Matcher matcher = this.pattern.matcher(file.getFileName().toString());
+        if (matcher.matches()) {
+            //
+            // if user has limited which files to use, check that here
+            //
+            if (testNumbersArray != null) {
+                String fileNameString = file.getFileName().toString();
+                boolean found = false;
+                for (String numberString : testNumbersArray) {
+                    if (fileNameString.contains(numberString)) {
+                        found = true;
+                        break;
+                    }
+                }
+                if (found == false) {
+                    //
+                    // this test is not in the list to be run, so skip it
+                    //
+                    return super.visitFile(file, attrs);
+                }
+            }
+            try {
+                //
+                // Pull what this request is supposed to be
+                //
+                String group = null;
+                int count = matcher.groupCount();
+                if (count >= 1) {
+                    group = matcher.group(count-1);
+                }
+                //
+                // Send it
+                //
+                this.sendRequest(file, group);
+            } catch (Exception e) {
+                logger.error(e);
+                e.printStackTrace();
+            }
+        }
+        return super.visitFile(file, attrs);
+    }
+
+    /**
+     * When a request file is encountered, this method is called send the request to the PDP engine. It will also dump
+     * the response object. If the group equals "Generate", then it will loop and send the request with generated attributes
+     * until that list is empty.
+     *
+     * @param file - Request file. Eg. Request-01-Permit.json
+     * @param group - This is the parsed out string of the request file that defines if it is a Permit/Deny/Generate etc.
+     * @throws Exception
+     */
+    protected void sendRequest(Path file, String group) throws Exception {
+        logger.info(file.toString());
+        int requestCount = 0;
+        do {
+            //
+            // Generate the request
+            //
+            Request request = this.generateRequest(file, group);
+            //
+            // Was something generated?
+            //
+            if (request == null) {
+                //
+                // Get out of the loop
+                //
+                logger.info("NULL request generated.");
+                break;
+            }
+            logger.info(request);
+            //
+            // Call the PDP
+            //
+            Response response = this.callPDP(request);
+            //
+            // Process the response
+            //
+            this.processResponse(file, request, response, group, requestCount);
+            //
+            // Is this a generated request?
+            //
+            if (group.equals("Generate")) {
+                //
+                // Yes, increment counter and move
+                // on to the next generated request.
+                //
+                requestCount++;
+            } else {
+                //
+                // Nope, exit the loop
+                //
+                break;
+            }
+        } while (group.equals("Generate"));
+    }
+
+    /**
+     * Sends the request object to the PDP engine. Either the embedded engine or the RESTful engine.
+     *
+     * @param request - XACML request object
+     * @return Response - returns the XACML response object
+     */
+    protected Response callPDP(Request request) {
+        //
+        // Send it to the PDP
+        //
+        Response response = null;
+        if (this.isREST) {
+            try {
+                String jsonString = JSONRequest.toString(request, false);
+                //
+                // Call RESTful PDP
+                //
+                response = this.callRESTfulPDP(new ByteArrayInputStream(jsonString.getBytes()));
+            } catch (Exception e) {
+                logger.error("Error in sending RESTful request: " + e, e);
+            }
+        } else {
+            //
+            // Embedded call to PDP
+            //
+            long lTimeStart = System.currentTimeMillis();
+            try {
+                response = this.engine.decide(request);
+            } catch (PDPException e) {
+                logger.error(e);
+            }
+            long lTimeEnd = System.currentTimeMillis();
+            logger.info("Elapsed Time: " + (lTimeEnd - lTimeStart) + "ms");
+        }
+        return response;
+    }
+
+    /**
+     * Reads the request file into a Request object based on its type.
+     *
+     * If the request has "Generate" in its filename, then this function will add
+     * generated attributes into the request.
+     *
+     * @param file - Request file. Eg. Request-01-Permit.json
+     * @param group - This is the parsed out string of the request file that defines if it is a Permit/Deny/Generate etc.
+     * @return
+     * @throws com.att.research.xacml.std.json.JSONStructureException
+     * @throws com.att.research.xacml.std.dom.DOMStructureException
+     * @throws com.att.research.xacml.api.pep.PEPException
+     */
+    protected Request generateRequest(Path file, String group) throws JSONStructureException, DOMStructureException, PEPException {
+        //
+        // Convert to a XACML Request Object
+        //
+        Request request = null;
+        if (TestBase.isJSON(file)) {
+            request = JSONRequest.load(file.toFile());
+        } else if (TestBase.isXML(file)) {
+            request = DOMRequest.load(file.toFile());
+        }
+        if (request == null) {
+            throw new PEPException("Invalid Request File: " + file.toString());
+        }
+        //
+        // Only if this request has "Generate"
+        // Request.XX.Generate.[json|xml]
+        //
+        if (group.equals("Generate")) {
+            //
+            // Add attributes to it
+            //
+            request = this.onNextRequest(request);
+        }
+        //
+        // Done
+        //
+        return request;
+    }
+
+    /**
+     * Called to add in generated attributes into the request.
+     *
+     * @param request
+     * @return
+     */
+    protected Request onNextRequest(Request request) {
+        //
+        // If we have no generators, just return
+        //
+        if (this.generators.isEmpty()) {
+            return request;
+        }
+        //
+        // Copy the request attributes
+        //
+        List<StdMutableRequestAttributes> attributes = new ArrayList<StdMutableRequestAttributes>();
+        for (RequestAttributes a : request.getRequestAttributes()) {
+            attributes.add(new StdMutableRequestAttributes(a));
+        }
+        //
+        // Iterate the generators
+        //
+        for (Generator generator : this.generators) {
+            //
+            // Read a row in
+            //
+            String line = generator.read();
+            //
+            // Was something read?
+            //
+            if (line == null) {
+                //
+                // No more rows to read, return null
+                //
+                return null;
+            }
+            //
+            // Split the line
+            //
+            List<String> fields = Lists.newArrayList(Splitter.on(',').trimResults().split(line));
+            //
+            // Now work on the attributes
+            //
+            for (StdMutableAttribute attribute : generator.attributes) {
+                //
+                // Grab the attribute holder, which holds the datatype and field. There should
+                // be only ONE object in the collection.
+                //
+                AttributeValue<?> value = attribute.getValues().iterator().next();
+                Integer field = (Integer) value.getValue();
+                //
+                // Is the field number valid?
+                //
+                if (field >= fields.size()) {
+                    logger.error("Not enough fields: " + field + "(" + fields.size() + ")");
+                    return null;
+                }
+                //
+                // Determine what datatype it is
+                //
+                DataType<?> dataTypeExtended	= dataTypeFactory.getDataType(value.getDataTypeId());
+                if (dataTypeExtended == null) {
+                    logger.error("Failed to determine datatype");
+                    return null;
+                }
+                //
+                // Create the attribute value
+                //
+                try {
+                    AttributeValue<?> attributeValue = dataTypeExtended.createAttributeValue(fields.get(field));
+                    //
+                    // Create the attribute
+                    //
+                    StdMutableAttribute newAttribute = new StdMutableAttribute(attribute.getCategory(),
+                            attribute.getAttributeId(),
+                            attributeValue,
+                            attribute.getIssuer(),
+                            attribute.getIncludeInResults());
+                    boolean added = false;
+                    for (StdMutableRequestAttributes a : attributes) {
                         //
-                        // Open up the connection
+                        // Does the category exist?
                         //
-                        connection = (HttpURLConnection) this.restURL.openConnection();
-                        connection.setRequestProperty("Content-Type", "application/json");
+                        if (a.getCategory().equals(attribute.getCategory())) {
+                            //
+                            // Yes - add in the new attribute value
+                            //
+                            a.add(newAttribute);
+                            added = true;
+                            break;
+                        }
+                    }
+                    if (added == false) {
                         //
-                        // Setup our method and headers
+                        // New category - create it and add it in
                         //
+                        StdMutableRequestAttributes a = new StdMutableRequestAttributes();
+                        a.setCategory(newAttribute.getCategory());
+                        a.add(newAttribute);
+                        attributes.add(a);
+                    }
+                } catch (DataTypeException e) {
+                    logger.error(e);
+                    return null;
+                }
+            }
+        }
+        //
+        // Now form our final request
+        //
+        StdMutableRequest newRequest = new StdMutableRequest();
+        newRequest.setCombinedDecision(request.getCombinedDecision());
+        newRequest.setRequestDefaults(request.getRequestDefaults());
+        newRequest.setReturnPolicyIdList(request.getReturnPolicyIdList());
+        newRequest.setStatus(request.getStatus());
+        for (StdMutableRequestAttributes a : attributes) {
+            newRequest.add(a);
+        }
+        return newRequest;
+    }
+
+    /**
+     * This makes an HTTP POST call to a running PDP RESTful servlet to get a decision.
+     *
+     * @param file
+     * @return
+     */
+    protected Response callRESTfulPDP(InputStream is) {
+        Response response = null;
+        HttpURLConnection connection = null;
+        try {
+
+            //
+            // Open up the connection
+            //
+            connection = (HttpURLConnection) this.restURL.openConnection();
+            connection.setRequestProperty("Content-Type", "application/json");
+            //
+            // Setup our method and headers
+            //
             connection.setRequestMethod("POST");
             connection.setUseCaches(false);
             //
@@ -796,14 +796,14 @@
             // So we need to handle this ourselves.
             //
             connection.setInstanceFollowRedirects(false);
-                        connection.setDoOutput(true);
-                        connection.setDoInput(true);
-                        //
-                        // Send the request
-                        //
-                        try (OutputStream os = connection.getOutputStream()) {
-                                IOUtils.copy(is, os);
-                        }
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            //
+            // Send the request
+            //
+            try (OutputStream os = connection.getOutputStream()) {
+                IOUtils.copy(is, os);
+            }
             //
             // Do the connect
             //
@@ -812,283 +812,283 @@
                 //
                 // Read the response
                 //
-                        ContentType contentType = null;
-                        try {
-                                contentType = ContentType.parse(connection.getContentType());
-                                
-                                if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_JSON.getMimeType())) {
-                                response = JSONResponse.load(connection.getInputStream());
-                                } else if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_XML.getMimeType()) ||
-                                                contentType.getMimeType().equalsIgnoreCase("application/xacml+xml") ) {
-                                response = DOMResponse.load(connection.getInputStream());
-                                } else {
-                                logger.error("unknown content-type: " + contentType);
-                        }
+                ContentType contentType = null;
+                try {
+                    contentType = ContentType.parse(connection.getContentType());
+
+                    if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_JSON.getMimeType())) {
+                        response = JSONResponse.load(connection.getInputStream());
+                    } else if (contentType.getMimeType().equalsIgnoreCase(ContentType.APPLICATION_XML.getMimeType()) ||
+                               contentType.getMimeType().equalsIgnoreCase("application/xacml+xml") ) {
+                        response = DOMResponse.load(connection.getInputStream());
+                    } else {
+                        logger.error("unknown content-type: " + contentType);
+                    }
 
                 } catch (Exception e) {
-                                String message = "Parsing Content-Type: " + connection.getContentType() + ", error=" + e.getMessage();
-                                logger.error(message, e);
-                        }
+                    String message = "Parsing Content-Type: " + connection.getContentType() + ", error=" + e.getMessage();
+                    logger.error(message, e);
+                }
 
             } else {
                 logger.error(connection.getResponseCode() + " " + connection.getResponseMessage());
             }
-                } catch (Exception e) {
-                        logger.error(e);
-                }
-                
-                return response;
+        } catch (Exception e) {
+            logger.error(e);
         }
-        
-        /**
-         * This processes a response. Saves the response out to disk. If there is a corresponding response file for the request located
-         * in the "responses" sub-directory, then this method will compare that response file with what the engine returned to see if it
-         * matched.
-         * 
-         * @param requestFile
-         * @param request
-         * @param response
-         * @param group
-         * @param count
-         * @throws Exception
-         */
-        protected void processResponse(Path requestFile, Request request, Response response, String group, int count) throws Exception {
+
+        return response;
+    }
+
+    /**
+     * This processes a response. Saves the response out to disk. If there is a corresponding response file for the request located
+     * in the "responses" sub-directory, then this method will compare that response file with what the engine returned to see if it
+     * matched.
+     *
+     * @param requestFile
+     * @param request
+     * @param response
+     * @param group
+     * @param count
+     * @throws Exception
+     */
+    protected void processResponse(Path requestFile, Request request, Response response, String group, int count) throws Exception {
+        //
+        // Construct the output filename
+        //
+        Path responseFile = null;
+        Path resultFile = null;
+        int num = requestFile.getNameCount();
+        if (num < 2) {
+            logger.error("Too few dir's in request filename.");
+            throw new Exception("Too few dir's in request filename. Format should be Request.[0-9]+.{Permit|Deny|NA|Indeterminate}.{json|xml}");
+        }
+        String filename = requestFile.getFileName().toString();
+        if (group.equals("Generate")) {
+            //
+            // Using count variable, construct a filename
+            //
+            //		i.e. Response.03.Generate.{count}.json
+            //
+            filename = "Response" + filename.substring(filename.indexOf('.'), filename.lastIndexOf('.')) + String.format("%03d", count) + filename.substring(filename.lastIndexOf('.'));
+        } else {
+            //
+            // Construct filename
+            //
+            filename = "Response" + filename.substring(filename.indexOf('.'));
+        }
+        //
+        // Determine equivalent response file path
+        //
+        responseFile = Paths.get(requestFile.subpath(0, num - 2).toString(), "responses");
+        if (Files.notExists(responseFile)) {
+            //
+            // Create it
+            //
+            logger.warn(responseFile.toString() + " does NOT exist, creating...");
+            try {
+                Files.createDirectories(responseFile);
+            } catch (IOException e) {
+                logger.error(e);
+                throw new Exception("Cannot proceed without an output directory.");
+            }
+        }
+        responseFile = Paths.get(responseFile.toString(), filename);
+        //
+        // Determine path to write result file
+        //
+        if (this.output != null) {
+            //
+            // User specified an output path
+            //
+            resultFile = this.output;
+        } else {
+            //
+            // Default path
+            //
+            resultFile = Paths.get(requestFile.subpath(0, num - 2).toString(), "results");
+        }
+        //
+        // Check if the path exists
+        //
+        if (Files.notExists(resultFile)) {
+            //
+            // Create it
+            //
+            logger.warn(resultFile.toString() + " does NOT exist, creating...");
+            try {
+                Files.createDirectories(resultFile);
+            } catch (IOException e) {
+                logger.error(e);
+                throw new Exception("Cannot proceed without an output directory.");
+            }
+        }
+        //
+        // Add the filename to the path
+        //
+        resultFile = Paths.get(resultFile.toString(), filename);
+        //
+        // Check if there is an equivalent response in the response
+        // directory. If so, compare our response result with that one.
+        //
+        boolean succeeded = true;
+        if (responseFile != null && Files.exists(responseFile)) {
+            //
+            // Do comparison
+            //
+            Response expectedResponse = null;
+            if (TestBase.isJSON(responseFile)) {
+                expectedResponse = JSONResponse.load(responseFile);
+            } else if (TestBase.isXML(responseFile)) {
+                expectedResponse = DOMResponse.load(responseFile);
+            }
+            if (expectedResponse != null) {
                 //
-                // Construct the output filename
+                // Do the compare
                 //
-                Path responseFile = null;
-                Path resultFile = null;
-                int num = requestFile.getNameCount();
-                if (num < 2) {
-                        logger.error("Too few dir's in request filename.");
-                        throw new Exception("Too few dir's in request filename. Format should be Request.[0-9]+.{Permit|Deny|NA|Indeterminate}.{json|xml}");
+                if (response == null) {
+                    logger.error("NULL response returned.");
+                    this.responseNotMatches++;
+                    succeeded = false;
+                } else {
+                    if (response.equals(expectedResponse)) {
+                        logger.info("Response matches expected response.");
+                        this.responseMatches++;
+                    } else {
+                        logger.error("Response does not match expected response.");
+                        logger.error("Expected: ");
+                        logger.error(expectedResponse.toString());
+                        this.responseNotMatches++;
+                        succeeded = false;
+                    }
                 }
-                String filename = requestFile.getFileName().toString();
+            }
+        }
+        //
+        // Write the response to the result file
+        //
+        logger.info("Request: " + requestFile.getFileName() + " response is: " + (response == null ? "null" : response.toString()));
+        if (resultFile != null && response != null) {
+            if (TestBase.isJSON(resultFile)) {
+                Files.write(resultFile, JSONResponse.toString(response, true).getBytes());
+            } else if (TestBase.isXML(resultFile)) {
+                Files.write(resultFile, DOMResponse.toString(response, true).getBytes());
+            }
+        }
+        //
+        // Stats
+        //
+        if (group.equals("Permit")) {
+            this.expectedPermits++;
+        } else if (group.equals("Deny")) {
+            this.expectedDenies++;
+        } else if (group.equals("NA")) {
+            this.expectedNotApplicables++;
+        } else if (group.equals("Indeterminate")) {
+            this.expectedIndeterminates++;
+        }
+        if (response != null) {
+            for (Result result : response.getResults()) {
+                Decision decision = result.getDecision();
                 if (group.equals("Generate")) {
-                        //
-                        // Using count variable, construct a filename
-                        //
-                        //		i.e. Response.03.Generate.{count}.json
-                        //
-                        filename = "Response" + filename.substring(filename.indexOf('.'), filename.lastIndexOf('.')) + String.format("%03d", count) + filename.substring(filename.lastIndexOf('.'));
-                } else {
-                        //
-                        // Construct filename
-                        //
-                        filename = "Response" + filename.substring(filename.indexOf('.'));
+                    if (decision.equals(Decision.PERMIT)) {
+                        this.generatedpermits++;
+                    } else if (decision.equals(Decision.DENY)) {
+                        this.generateddenies++;
+                    } else if (decision.equals(Decision.NOTAPPLICABLE)) {
+                        this.generatednotapplicables++;
+                    } else if (decision.equals(Decision.INDETERMINATE)) {
+                        this.generatedindeterminates++;
+                    }
+                    continue;
                 }
-                //
-                // Determine equivalent response file path
-                //
-                responseFile = Paths.get(requestFile.subpath(0, num - 2).toString(), "responses");
-                if (Files.notExists(responseFile)) {
-                        //
-                        // Create it
-                        //
-                        logger.warn(responseFile.toString() + " does NOT exist, creating...");
-                        try {
-                                Files.createDirectories(responseFile);
-                        } catch (IOException e) {
-                                logger.error(e);
-                                throw new Exception("Cannot proceed without an output directory.");
-                        }
+                if (decision.equals(Decision.PERMIT)) {
+                    this.permits++;
+                    if (group.equals("Permit") == false) {
+                        succeeded = false;
+                        logger.error("Expected " + group + " got " + decision);
+                    }
+                } else if (decision.equals(Decision.DENY)) {
+                    this.denies++;
+                    if (group.equals("Deny") == false) {
+                        succeeded = false;
+                        logger.error("Expected " + group + " got " + decision);
+                    }
+                } else if (decision.equals(Decision.NOTAPPLICABLE)) {
+                    this.notapplicables++;
+                    if (group.equals("NA") == false) {
+                        succeeded = false;
+                        logger.error("Expected " + group + " got " + decision);
+                    }
+                } else if (decision.equals(Decision.INDETERMINATE)) {
+                    this.indeterminates++;
+                    if (group.equals("Indeterminate") == false) {
+                        succeeded = false;
+                        logger.error("Expected " + group + " got " + decision);
+                    }
                 }
-                responseFile = Paths.get(responseFile.toString(), filename);
-                //
-                // Determine path to write result file
-                //
-                if (this.output != null) {
-                        //
-                        // User specified an output path
-                        //
-                        resultFile = this.output;
-                } else {
-                        //
-                        // Default path
-                        //
-                        resultFile = Paths.get(requestFile.subpath(0, num - 2).toString(), "results");
-                }
-                //
-                // Check if the path exists
-                //
-                if (Files.notExists(resultFile)) {
-                        //
-                        // Create it
-                        //
-                        logger.warn(resultFile.toString() + " does NOT exist, creating...");
-                        try {
-                                Files.createDirectories(resultFile);
-                        } catch (IOException e) {
-                                logger.error(e);
-                                throw new Exception("Cannot proceed without an output directory.");
-                        }
-                }
-                //
-                // Add the filename to the path
-                //
-                resultFile = Paths.get(resultFile.toString(), filename);
-                //
-                // Check if there is an equivalent response in the response
-                // directory. If so, compare our response result with that one.
-                //
-                boolean succeeded = true;
-                if (responseFile != null && Files.exists(responseFile)) {
-                        //
-                        // Do comparison
-                        //
-                        Response expectedResponse = null;
-                        if (TestBase.isJSON(responseFile)) {
-                                expectedResponse = JSONResponse.load(responseFile);
-                        } else if (TestBase.isXML(responseFile)) {
-                                expectedResponse = DOMResponse.load(responseFile);
-                        }
-                        if (expectedResponse != null) {
-                                //
-                                // Do the compare
-                                //
-                                if (response == null) {
-                                        logger.error("NULL response returned.");
-                                        this.responseNotMatches++;
-                                        succeeded = false;
-                                } else {
-                                        if (response.equals(expectedResponse)) {
-                                                logger.info("Response matches expected response.");
-                                                this.responseMatches++;
-                                        } else {
-                                                logger.error("Response does not match expected response.");
-                                                logger.error("Expected: ");
-                                                logger.error(expectedResponse.toString());
-                                                this.responseNotMatches++;
-                                                succeeded = false;
-                                        }
-                                }
-                        }
-                }
-                //
-                // Write the response to the result file
-                //
-                logger.info("Request: " + requestFile.getFileName() + " response is: " + (response == null ? "null" : response.toString()));
-                if (resultFile != null && response != null) {
-                        if (TestBase.isJSON(resultFile)) {
-                                Files.write(resultFile, JSONResponse.toString(response, true).getBytes());
-                        } else if (TestBase.isXML(resultFile)) {
-                                Files.write(resultFile, DOMResponse.toString(response, true).getBytes());
-                        }
-                }
-                //
-                // Stats
-                //		
-                if (group.equals("Permit")) {
-                        this.expectedPermits++;
-                } else if (group.equals("Deny")) {
-                        this.expectedDenies++;
-                } else if (group.equals("NA")) {
-                        this.expectedNotApplicables++;
-                } else if (group.equals("Indeterminate")) {
-                        this.expectedIndeterminates++;
-                }
-                if (response != null) {
-                        for (Result result : response.getResults()) {
-                                Decision decision = result.getDecision();
-                                if (group.equals("Generate")) {
-                                        if (decision.equals(Decision.PERMIT)) {
-                                                this.generatedpermits++;
-                                        } else if (decision.equals(Decision.DENY)) {
-                                                this.generateddenies++;
-                                        } else if (decision.equals(Decision.NOTAPPLICABLE)) {
-                                                this.generatednotapplicables++;
-                                        } else if (decision.equals(Decision.INDETERMINATE)) {
-                                                this.generatedindeterminates++;
-                                        }
-                                        continue;
-                                }
-                                if (decision.equals(Decision.PERMIT)) {
-                                        this.permits++;
-                                        if (group.equals("Permit") == false) {
-                                                succeeded = false;
-                                                logger.error("Expected " + group + " got " + decision);
-                                        }
-                                } else if (decision.equals(Decision.DENY)) {
-                                        this.denies++;
-                                        if (group.equals("Deny") == false) {
-                                                succeeded = false;
-                                                logger.error("Expected " + group + " got " + decision);
-                                        }
-                                } else if (decision.equals(Decision.NOTAPPLICABLE)) {
-                                        this.notapplicables++;
-                                        if (group.equals("NA") == false) {
-                                                succeeded = false;
-                                                logger.error("Expected " + group + " got " + decision);
-                                        }
-                                } else if (decision.equals(Decision.INDETERMINATE)) {
-                                        this.indeterminates++;
-                                        if (group.equals("Indeterminate") == false) {
-                                                succeeded = false;
-                                                logger.error("Expected " + group + " got " + decision);
-                                        }
-                                }
-                        }
-                }
-                if (succeeded) {
-                        logger.info("REQUEST SUCCEEDED");
-                } else {
-                        logger.info("REQUEST FAILED");
-                }
+            }
         }
+        if (succeeded) {
+            logger.info("REQUEST SUCCEEDED");
+        } else {
+            logger.info("REQUEST FAILED");
+        }
+    }
 
-        protected void	dumpStats() {
-                StringBuilder dump = new StringBuilder();
-                dump.append(System.lineSeparator());
-                dump.append("Permits: " + this.permits + " Expected: " + this.expectedPermits);
-                dump.append(System.lineSeparator());
-                dump.append("Denies: " + this.denies + " Expected: " + this.expectedDenies);
-                dump.append(System.lineSeparator());
-                dump.append("NA: " + this.notapplicables + " Expected: " + this.expectedNotApplicables);
-                dump.append(System.lineSeparator());
-                dump.append("Indeterminates: " + this.indeterminates + " Expected: " + this.expectedIndeterminates);
-                dump.append(System.lineSeparator());
-                dump.append("Generated Permits: " + this.generatedpermits);
-                dump.append(System.lineSeparator());
-                dump.append("Generated Denies: " + this.generateddenies);
-                dump.append(System.lineSeparator());
-                dump.append("Generated NA: " + this.generatednotapplicables);
-                dump.append(System.lineSeparator());
-                dump.append("Generated Indeterminates: " + this.generatedindeterminates);
-                dump.append(System.lineSeparator());
-                dump.append("Responses Matched: " + this.responseMatches);
-                dump.append(System.lineSeparator());
-                dump.append("Responses NOT Matched: " + this.responseNotMatches);
-                
-                if (this.permits != this.expectedPermits ||
-                        this.denies != this.expectedDenies ||
-                        this.notapplicables != this.expectedNotApplicables ||
-                        this.indeterminates != this.expectedIndeterminates ||
-                        this.responseNotMatches > 0) {
-                        logger.fatal(dump.toString());
-                } else {
-                        logger.info(dump.toString());
-                }
-        }
-        
-        protected void	resetStats() {
-                this.permits = 0;
-                this.denies = 0;
-                this.notapplicables = 0;
-                this.indeterminates = 0;
-                this.generatedpermits = 0;
-                this.generateddenies = 0;
-                this.generatednotapplicables = 0;
-                this.generatedindeterminates = 0;
-                this.responseMatches = 0;
-                this.responseNotMatches = 0;
-        }
+    protected void	dumpStats() {
+        StringBuilder dump = new StringBuilder();
+        dump.append(System.lineSeparator());
+        dump.append("Permits: " + this.permits + " Expected: " + this.expectedPermits);
+        dump.append(System.lineSeparator());
+        dump.append("Denies: " + this.denies + " Expected: " + this.expectedDenies);
+        dump.append(System.lineSeparator());
+        dump.append("NA: " + this.notapplicables + " Expected: " + this.expectedNotApplicables);
+        dump.append(System.lineSeparator());
+        dump.append("Indeterminates: " + this.indeterminates + " Expected: " + this.expectedIndeterminates);
+        dump.append(System.lineSeparator());
+        dump.append("Generated Permits: " + this.generatedpermits);
+        dump.append(System.lineSeparator());
+        dump.append("Generated Denies: " + this.generateddenies);
+        dump.append(System.lineSeparator());
+        dump.append("Generated NA: " + this.generatednotapplicables);
+        dump.append(System.lineSeparator());
+        dump.append("Generated Indeterminates: " + this.generatedindeterminates);
+        dump.append(System.lineSeparator());
+        dump.append("Responses Matched: " + this.responseMatches);
+        dump.append(System.lineSeparator());
+        dump.append("Responses NOT Matched: " + this.responseNotMatches);
 
-        public static void main(String[] args) {
-                try {
-                        new TestBase(args).run();
-                } catch (ParseException | IOException | FactoryException e) {
-                        logger.error(e);
-                } catch (HelpException e) {
-                }		
+        if (this.permits != this.expectedPermits ||
+                this.denies != this.expectedDenies ||
+                this.notapplicables != this.expectedNotApplicables ||
+                this.indeterminates != this.expectedIndeterminates ||
+                this.responseNotMatches > 0) {
+            logger.fatal(dump.toString());
+        } else {
+            logger.info(dump.toString());
         }
+    }
+
+    protected void	resetStats() {
+        this.permits = 0;
+        this.denies = 0;
+        this.notapplicables = 0;
+        this.indeterminates = 0;
+        this.generatedpermits = 0;
+        this.generateddenies = 0;
+        this.generatednotapplicables = 0;
+        this.generatedindeterminates = 0;
+        this.responseMatches = 0;
+        this.responseNotMatches = 0;
+    }
+
+    public static void main(String[] args) {
+        try {
+            new TestBase(args).run();
+        } catch (ParseException | IOException | FactoryException e) {
+            logger.error(e);
+        } catch (HelpException e) {
+        }
+    }
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/annotations/TestAnnotation.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/annotations/TestAnnotation.java
index 26dc477..3e84d4c 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/annotations/TestAnnotation.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/annotations/TestAnnotation.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -68,185 +68,186 @@
 /**
  * This example application shows how to use annotations for Java classes to create requests to send to the
  * engine.
- * 
+ *
  * @author pameladragosh
  *
  */
 public class TestAnnotation extends TestBase {
-        private static final Log logger	= LogFactory.getLog(TestAnnotation.class);
-        
-        private int	num;
-        
+    private static final Log logger	= LogFactory.getLog(TestAnnotation.class);
+
+    private int	num;
+
+    /**
+     * This is a sample class that uses annotations. In addition to demonstrating how to use XACML annotations,
+     * it also demonstrates the various Java objects that can be used and how the request parser will
+     * resolve each object's datatype.
+     *
+     * @author pameladragosh
+     *
+     */
+    @XACMLRequest(ReturnPolicyIdList=true)
+    public class MyRequestAttributes {
+
+        public MyRequestAttributes(String user, String action, String resource) {
+            this.userID = user;
+            this.action = action;
+            this.resource = resource;
+            this.today = new Date();
+            this.yesterday = Calendar.getInstance();
+            this.yesterday.add(Calendar.DAY_OF_MONTH, -1);
+        }
+
+        @XACMLSubject(includeInResults=true)
+        String	userID;
+
+        @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id-qualifier")
+        boolean admin = false;
+
+        @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:key-info", issuer="com:foo:security")
+        HexBinary publicKey = new HexBinary(new byte[] {'1', '0'});
+
+        @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:authentication-time")
+        ISO8601Time	authenticationTime = new ISO8601Time(8, 0, 0, 0);
+
         /**
-         * This is a sample class that uses annotations. In addition to demonstrating how to use XACML annotations,
-         * it also demonstrates the various Java objects that can be used and how the request parser will
-         * resolve each object's datatype.
-         * 
-         * @author pameladragosh
-         *
+         * Here our base object is "Object", but it is reflected as a Java "String". The parser
+         * will then use the XACML http://www.w3.org/2001/XMLSchema#string as the datatype.
          */
-        @XACMLRequest(ReturnPolicyIdList=true)
-        public class MyRequestAttributes {
-                
-                public MyRequestAttributes(String user, String action, String resource) {
-                        this.userID = user;
-                        this.action = action;
-                        this.resource = resource;
-                        this.today = new Date();
-                        this.yesterday = Calendar.getInstance();
-                        this.yesterday.add(Calendar.DAY_OF_MONTH, -1);
-                }
+        @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:authentication-method")
+        Object authenticationMethod = new String("RSA Public Key");
 
-                @XACMLSubject(includeInResults=true)
-                String	userID;
-                
-                @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id-qualifier")
-                boolean admin = false;
-                
-                @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:key-info", issuer="com:foo:security")
-                HexBinary publicKey = new HexBinary(new byte[] {'1', '0'});
-                
-                @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:authentication-time")
-                ISO8601Time	authenticationTime = new ISO8601Time(8, 0, 0, 0);
-                
-                /**
-                 * Here our base object is "Object", but it is reflected as a Java "String". The parser
-                 * will then use the XACML http://www.w3.org/2001/XMLSchema#string as the datatype.
-                 */
-                @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:authentication-method")
-                Object authenticationMethod = new String("RSA Public Key");
-                
-                /**
-                 * Here our base object is "String", but we use the annotation for datatype to clarify
-                 * that the real XACML data type is http://www.w3.org/2001/XMLSchema#time. The parser will
-                 * use the data type factory to convert the "String" to a "ISO8601Time" Java object.
-                 */
-                @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:request-time", datatype="http://www.w3.org/2001/XMLSchema#time")
-                String requestTime = new String("13:20:00-05:00");
-                
-                @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:session-start-time")
-                ISO8601DateTime sessionStart = new ISO8601DateTime(TimeZone.getDefault().getID(), 2014, 1, 1, 10, 0, 0, 0);
-                
-                @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:3.0:subject:authn-locality:ip-address")
-                IPAddress ip = new IPv4Address(new short[] {123, 134, 156, 255 }, null, null);
-                
-                @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:3.0:subject:authn-locality:dns-name")
-                String dnsName = "localhost";
-                
-                @XACMLAction()
-                String	action;
-                
-                @XACMLAction(attributeId="urn:oasis:names:tc:xacml:1.0:action:implied-action")
-                long	impliedAction;
-                
-                @XACMLResource()
-                String	resource;
-                
-                @XACMLEnvironment()
-                Date		today;
-                
-                @XACMLEnvironment()
-                Calendar	yesterday;
-                
-                /**
-                 * This field demonstrates how the parser can detect collections and build a bag of values.
-                 */
-                @XACMLAttribute(attributeId="foo:bar:attribute")
-                Collection<Double>		fooBar = Arrays.asList(2.5, 3.5);
-                
-                /**
-                 * The XACMLAttribute annotation allows one to specify all the 
-                 */
-                @XACMLAttribute(category="foo:bar:category", attributeId="foo:bar:attribute2")
-                double		fooBar2 = 3.999;
-                
-                /**
-                 * This field demonstrates how the parser can detect arrays and build a bag of values.
-                 */
-                @XACMLAttribute(category="foo:bar:category", attributeId="foo:bar:attribute:many")
-                URI[]		fooBarMany = new URI[] {URI.create("file://opt/app/test"), URI.create("https://localhost:8443/")};
-                
-        };
+        /**
+         * Here our base object is "String", but we use the annotation for datatype to clarify
+         * that the real XACML data type is http://www.w3.org/2001/XMLSchema#time. The parser will
+         * use the data type factory to convert the "String" to a "ISO8601Time" Java object.
+         */
+        @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:request-time", datatype="http://www.w3.org/2001/XMLSchema#time")
+        String requestTime = new String("13:20:00-05:00");
 
-        @XACMLRequest(
-                Defaults="http://www.w3.org/TR/1999/Rec-xpath-19991116",
-                multiRequest=@XACMLMultiRequest(values={
-                        @XACMLRequestReference(values={"subject1", "action", "resource"}),
-                        @XACMLRequestReference(values={"subject2", "action", "resource"})})
-        )
-        public class MyMultiRequestAttributes {
-                
-                @XACMLSubject(id="subject1")
-                String	userID1 = "John";
-                
-                @XACMLSubject(id="subject2")
-                String	userID2 = "Ringo";
+        @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:1.0:subject:session-start-time")
+        ISO8601DateTime sessionStart = new ISO8601DateTime(TimeZone.getDefault().getID(), 2014, 1, 1, 10, 0, 0, 0);
 
-                @XACMLAction(id="action")
-                String	action = "access";
+        @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:3.0:subject:authn-locality:ip-address")
+        IPAddress ip = new IPv4Address(new short[] {123, 134, 156, 255 }, null, null);
 
-                @XACMLResource(id="resource")
-                String	resource = "www.mywebsite.com";
+        @XACMLSubject(attributeId="urn:oasis:names:tc:xacml:3.0:subject:authn-locality:dns-name")
+        String dnsName = "localhost";
+
+        @XACMLAction()
+        String	action;
+
+        @XACMLAction(attributeId="urn:oasis:names:tc:xacml:1.0:action:implied-action")
+        long	impliedAction;
+
+        @XACMLResource()
+        String	resource;
+
+        @XACMLEnvironment()
+        Date		today;
+
+        @XACMLEnvironment()
+        Calendar	yesterday;
+
+        /**
+         * This field demonstrates how the parser can detect collections and build a bag of values.
+         */
+        @XACMLAttribute(attributeId="foo:bar:attribute")
+        Collection<Double>		fooBar = Arrays.asList(2.5, 3.5);
+
+        /**
+         * The XACMLAttribute annotation allows one to specify all the
+         */
+        @XACMLAttribute(category="foo:bar:category", attributeId="foo:bar:attribute2")
+        double		fooBar2 = 3.999;
+
+        /**
+         * This field demonstrates how the parser can detect arrays and build a bag of values.
+         */
+        @XACMLAttribute(category="foo:bar:category", attributeId="foo:bar:attribute:many")
+        URI[]		fooBarMany = new URI[] {URI.create("file://opt/app/test"), URI.create("https://localhost:8443/")};
+
+    };
+
+    @XACMLRequest(
+        Defaults="http://www.w3.org/TR/1999/Rec-xpath-19991116",
+    multiRequest=@XACMLMultiRequest(values= {
+        @XACMLRequestReference(values={"subject1", "action", "resource"}),
+        @XACMLRequestReference(values={"subject2", "action", "resource"})
+    })
+    )
+    public class MyMultiRequestAttributes {
+
+        @XACMLSubject(id="subject1")
+        String	userID1 = "John";
+
+        @XACMLSubject(id="subject2")
+        String	userID2 = "Ringo";
+
+        @XACMLAction(id="action")
+        String	action = "access";
+
+        @XACMLResource(id="resource")
+        String	resource = "www.mywebsite.com";
+    }
+
+    public TestAnnotation(String[] args) throws MalformedURLException, ParseException, HelpException {
+        super(args);
+    }
+
+    @Override
+    public void run() throws IOException, FactoryException {
+        //
+        // We are not going to iterate any existing request files. So we will override
+        // any TestBase code that assumes there are request files present.
+        //
+        //
+        // Configure ourselves
+        //
+        this.configure();
+        //
+        // Cycle through creating a few objects
+        //
+        this.num = 0;
+        this.doRequest(new MyRequestAttributes("John", "access", "www.mywebsite.com"));
+        this.num++;
+        this.doRequest(new MyRequestAttributes("Ringo", "access", "www.mywebsite.com"));
+        this.num++;
+        this.doRequest(new MyMultiRequestAttributes());
+        this.num++;
+    }
+
+    private void doRequest(Object info) {
+        try {
+            Response response = this.callPDP(RequestParser.parseRequest(info));
+            Path resultFile;
+            if (this.output != null) {
+                resultFile = Paths.get(this.output.toString(), "Response." + String.format("%03d", this.num) + ".json");
+            } else {
+                resultFile = Paths.get(this.directory, "results", "Response." + String.format("%03d", this.num) + ".json");
+            }
+            //
+            // Write the response to the result file
+            //
+            logger.info("Response is: " + response.toString());
+            if (resultFile != null) {
+                Files.write(resultFile, response.toString().getBytes());
+            }
+        } catch (IllegalArgumentException | IllegalAccessException | DataTypeException | IOException e) {
+            logger.error(e);
+            e.printStackTrace();
         }
+    }
 
-        public TestAnnotation(String[] args) throws MalformedURLException, ParseException, HelpException {
-                super(args);
+    public static void main(String[] args) {
+        try {
+            new TestAnnotation(args).run();
+        } catch (ParseException | IOException | FactoryException e) {
+            logger.error(e);
+        } catch (HelpException e) {
+            //
+            // ignore this, its thrown just to exit the application
+            // after dumping help to stdout.
+            //
         }
-
-        @Override
-        public void run() throws IOException, FactoryException {
-                //
-                // We are not going to iterate any existing request files. So we will override
-                // any TestBase code that assumes there are request files present.
-                //
-                //
-                // Configure ourselves
-                //
-                this.configure();
-                //
-                // Cycle through creating a few objects
-                //
-                this.num = 0;
-                this.doRequest(new MyRequestAttributes("John", "access", "www.mywebsite.com"));
-                this.num++;
-                this.doRequest(new MyRequestAttributes("Ringo", "access", "www.mywebsite.com"));
-                this.num++;
-                this.doRequest(new MyMultiRequestAttributes());
-                this.num++;
-        }
-
-        private void doRequest(Object info) {
-                try {
-                        Response response = this.callPDP(RequestParser.parseRequest(info));
-                        Path resultFile;
-                        if (this.output != null) {
-                                resultFile = Paths.get(this.output.toString(), "Response." + String.format("%03d", this.num) + ".json");
-                        } else {
-                                resultFile = Paths.get(this.directory, "results", "Response." + String.format("%03d", this.num) + ".json");
-                        }
-                        //
-                        // Write the response to the result file
-                        //
-                        logger.info("Response is: " + response.toString());
-                        if (resultFile != null) {
-                                Files.write(resultFile, response.toString().getBytes());
-                        }
-                } catch (IllegalArgumentException | IllegalAccessException | DataTypeException | IOException e) {
-                        logger.error(e);
-                        e.printStackTrace();
-                }
-        }
-        
-        public static void main(String[] args) {
-                try {
-                        new TestAnnotation(args).run();
-                } catch (ParseException | IOException | FactoryException e) {
-                        logger.error(e);
-                } catch (HelpException e) {
-                        //
-                        // ignore this, its thrown just to exit the application
-                        // after dumping help to stdout.
-                        //
-                }		
-        }
+    }
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/Conformance.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/Conformance.java
index 7dee24e..c2ed0ae 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/Conformance.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/Conformance.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -53,10 +53,10 @@
 /**
  * Conformance is an application that runs a <code>ConformanceTestSet</code> and dumps results comparing the actual and
  * expected results.
- * 
+ *
  * TO RUN in Eclipse:
  * This is run as a Java Application.
- * You must first create a Run/Debug Configuration: 
+ * You must first create a Run/Debug Configuration:
  * 		Under the Argument tab, in Program Arguments you must set the -i or --input command line argument.
  *	 	You should also direct the output to a file using -o or --output. (default is Console)
  *		See the init() method in this file for other useful arguments.
@@ -66,580 +66,580 @@
  * 		You must also set the VM arguments:
  * 			-Dxacml.properties=testsets/conformance/xacml.properties .
  * 			-Dlog4j.configuration=.\logging.properties
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class Conformance {
-        private ConformanceScopeResolver scopeResolver;
-        private ConformanceTestEngine testEngine;
-        private ConformanceTestSet testSet			= new ConformanceTestSet();
-        private File outputFile;
-        private PrintWriter outputFileWriter;
-        
-        private List<String> testNamesToRun = new ArrayList<String>();
-        
-        private boolean verbose;
-        private boolean failuresOnly;
-        private boolean strict;
-        private boolean stopOnFirstError;
-        
-        private int testsRun;
-        private int decisionsMatch;
-        private int statusCodesMatch;
-        private int attributesMatch;
-        private int policyIdsMatch;
-        private int policySetIdsMatch;
-        private int associatedAdviceMatch;
-        private int obligationsMatch;
-        private int unknownFunctions;
-        
-        
+    private ConformanceScopeResolver scopeResolver;
+    private ConformanceTestEngine testEngine;
+    private ConformanceTestSet testSet			= new ConformanceTestSet();
+    private File outputFile;
+    private PrintWriter outputFileWriter;
 
-        
-        protected synchronized ConformanceScopeResolver getScopeResolver() {
-                if (this.scopeResolver == null) {
-                        this.scopeResolver	= new ConformanceScopeResolver();
-                        
-                        /*
-                         * TODO:
-                         * Add the known scopes for the 2.0 conformance test.  This could be made more general by allowing loading
-                         * from a properties file eventually.
-                         */
-                        try {
-                                URI ID_SCOPE_ROOT	= new URI("urn:root");
-                                URI ID_SCOPE_CHILD1	= new URI("urn:root:child1");
-                                URI ID_SCOPE_CHILD2	= new URI("urn:root:child2");
-                                URI ID_SCOPE_C1D1	= new URI("urn:root:child1:descendant1");
-                                URI ID_SCOPE_C1D2	= new URI("urn:root:child1:descendant2");
-                                URI ID_SCOPE_C2D1	= new URI("urn:root:child2:descendant1");
-                                URI ID_SCOPE_C2D2	= new URI("urn:root:child2:descendant2");
-                                
-                                this.scopeResolver.add(ID_SCOPE_ROOT, ID_SCOPE_CHILD1);
-                                this.scopeResolver.add(ID_SCOPE_CHILD1, ID_SCOPE_C1D1);
-                                this.scopeResolver.add(ID_SCOPE_CHILD1, ID_SCOPE_C1D2);
-                                this.scopeResolver.add(ID_SCOPE_ROOT, ID_SCOPE_CHILD2);
-                                this.scopeResolver.add(ID_SCOPE_CHILD2, ID_SCOPE_C2D1);
-                                this.scopeResolver.add(ID_SCOPE_CHILD2, ID_SCOPE_C2D2);
-                        } catch (Exception ex) {
-                                ex.printStackTrace(System.err);
-                        }
-                        
-                }
-                return this.scopeResolver;
-        }
-        
-        private void close() throws IOException {
-                if (this.outputFileWriter != null) {
-                        this.outputFileWriter.close();
-                }
-        }
-        
-        private boolean init(String[] args) {
-                boolean lenientRequests	= true;
-                boolean lenientPolicies	= false;
-                // default is to not run any non-first-time iterations
-                int iterations			= -1;
-                String testSetDirectoryNames = "";
-                for (int i = 0 ; i < args.length ; ) {
-                        
-                        if (args[i].equals("-h") || args[i].equals("--help") || args[i].equals("-help")) {
-                                printHelp();
-                                return false;
-                        }
-                        
-                        
-                        // where the XML Request/Response files are located
-                        if (args[i].equals("-i") || args[i].equals("--input")) {
-                                i++;
-                                while (i < args.length && !args[i].startsWith("-")) {
-                                        testSetDirectoryNames += " " + args[i];
-                                        try {
-                                                testSet.addConformanceTestSet(ConformanceTestSet.loadDirectory(new File(args[i])));
-                                        } catch (Exception ex) {
-                                                ex.printStackTrace(System.err);
-                                                return false;
-                                        }
-                                        i++;
-                                }
+    private List<String> testNamesToRun = new ArrayList<String>();
 
-                        // File path name where output will be put - default is stdout == Console
-                        } else if (args[i].equals("-o") || args[i].equals("--output")) {
-                                if (i+1 < args.length) {
-                                        this.outputFile	= new File(args[i+1]);
-                                        i	+= 2;
-                                } else {
-                                        System.err.println("Missing argument to " + args[i] + " command line option");
-                                        return false;
-                                }
-                        // A list of specific test names (e.g.: -t IIA001 IIA007 IIIE301) - default is to run all tests
-                        } else if (args[i].equals("-t") || args[i].equals("--tests")) {
-                                i++;
-                                while (i < args.length && !args[i].startsWith("-")) {
-                                        testNamesToRun.add(args[i]);
-                                        i++;
-                                }
-                                if (testNamesToRun.size() == 0) {
-                                        System.err.println("Missing test names after -t or --tests argument");
-                                        return false;
-                                }
-                        // Include full details in the response, both the expected reqsponse (from file) and the actual response
-                        } else if (args[i].equals("-v") || args[i].equals("--verbose")) {
-                                this.verbose	= true;
-                                i++;
-                        // Report only failures (success is silent)
-                        } else if (args[i].equals("-f") || args[i].equals("--failures")) {
-                                this.failuresOnly	= true;
-                                i++;
-                        // When set, the XML must not contain extra attibutes/elements.  Default is "lenient" where unexpected entries are ignored
-                        } else if (args[i].equals("-s") || args[i].equals("--strict")) {
-                                this.strict	= true;
-                                i++;
-                        // (self explanatory)
-                        } else if (args[i].equals("--stop-on-error")) {
-                                this.stopOnFirstError	= true;
-                                i++;
-                        } else if (args[i].equals("--lenient")) {
-                                lenientPolicies	= true;
-                                lenientRequests	= true;
-                                i++;
-                        } else if (args[i].equals("--lenient-policies")) {
-                                lenientPolicies	= true;
-                                i++;
-                        } else if (args[i].equals("--lenient-requests")) {
-                                lenientRequests	= true;
-                                i++;
-                        } else if (args[i].equals("--strict-policies")) {
-                                lenientPolicies	= false;
-                                i++;
-                        } else if (args[i].equals("--strict-requests")) {
-                                lenientRequests	= false;
-                                i++;
-                        } else if (args[i].equals("--iterations")) {
-                                // this is a count of how many ADDITIONAL times the decide() should be called.
-                                // The first time decide() is called it takes a long time to set up,
-                                // so to get an accurate number for how fast a single Request is handled we need to ignore the time for the first run
-                                // and timings for 1 or more non-first-time calls to decide().
-                                if (i+1 < args.length) {
-                                        try {
-                                                iterations	= Integer.parseInt(args[i+1]);
-                                                i	+= 2;
-                                        } catch (NumberFormatException ex) {
-                                                System.err.println("Invalid iteration count '" + args[i+1] + "'");
-                                                return false;
-                                        }
-                                } else {
-                                        System.err.println("Missing argument to " + args[i] + " command line option");
-                                        return false;					
-                                }
-                                if (iterations < 1) {
-                                        System.err.println("Cannot use --iterations " + iterations + ".  Must use an integer greater than 0");
-                                        return false;
-                                }
-                        } else {
-                                System.err.println("Unknown command line option " + args[i]);
-                                return false;
-                        }
-                }
-        
-                this.testEngine	= new ConformanceTestEngine(this.getScopeResolver(), lenientRequests, lenientPolicies, iterations);
+    private boolean verbose;
+    private boolean failuresOnly;
+    private boolean strict;
+    private boolean stopOnFirstError;
 
-                if (testSetDirectoryNames.length() == 0) {
-                        System.err.println("No test set directory given (need -i or --iniput command line option)");
-                        return false;
-                }
-                if (testSet.getListConformanceTests().size() == 0) {
-                        System.err.println("No tests in given directories: " + testSetDirectoryNames);
-                }
-                
-                if (testNamesToRun.size() > 0) {
-                        String s = "";
-                        for (String name : testNamesToRun) {
-                                s += ", " + name;
-                        }
-                        System.out.println("Tests limited to: " + s.substring(1));
-                }
-                
-                if (this.outputFile == null) {
-                        this.outputFileWriter	= new PrintWriter(System.out);
-                } else {
-                        try {
-                                this.outputFileWriter	= new PrintWriter(new FileOutputStream(this.outputFile));
-                        } catch (IOException ex) {
-                                System.err.println("Cannot open " + this.outputFile.getAbsolutePath() + " for writing.");
-                                return false;
-                        }
-                }
-                
-                return true;
-        }
-        
-        private void printHelp() {
-                System.out.println("usage: Conformance --input <tests_directory> OPTIONS");
-                System.out.println("");
-                System.out.println(" -f, --failures		Only include failed tests in the output.  \n"+
-                                                        "			Default is to include all test's results in the output file.");
-                System.out.println("");
-                System.out.println(" -h, --help		Prints help.");
-                        
-                System.out.println("");
-                System.out.println(" -i, --input <dir>	Directory containing the XML Request/Response files.  \n"+
-                                                        "			This may be multiple space-separated directory paths.  REQUIRED");
-                
-                System.out.println("");
-                System.out.println(" --iterations		The number of times to run through the set of tests in the input directory.");
-                
-                System.out.println("");
-                System.out.println(" --lenient		Allow both Requests and Policies to have unexpected elements, no data in <Content>, etc. \n"+
-                                                        "			Default is to not allow anything that is not explicitly listed in the XACML spec.");
-                
-                System.out.println("");
-                System.out.println(" --lenient-policies	Allow Policies to have unexpected elements, no data in <Content>, etc.  \n" +
-                                                        "			Default is to not allow anything that is not explicitly listed in the XACML spec.");
-                
-                System.out.println("");
-                System.out.println(" --lenient-requests	Allow Requests to have unexpected elements, no data in <Content>, etc.  \n" +
-                                                        "			Default is to not allow anything that is not explicitly listed in the XACML spec.");
-                
-                System.out.println("");
-                System.out.println(" -o, --output <dir>	Directory where the output results file will be put.");
-                
-                System.out.println("");
-                System.out.println(" -s, --strict		Check both the Decision and all other parts of the Response (Attributes, Obligations and Advice). \n "+
-                                                        "			Default is to check just the Decision.");
-                
-                System.out.println("");
-                System.out.println(" --stop-on-error	Stop running conformance tests the first time one fails.  Default is to continue through all tests.");
+    private int testsRun;
+    private int decisionsMatch;
+    private int statusCodesMatch;
+    private int attributesMatch;
+    private int policyIdsMatch;
+    private int policySetIdsMatch;
+    private int associatedAdviceMatch;
+    private int obligationsMatch;
+    private int unknownFunctions;
 
-                System.out.println("");
-                System.out.println(" --strict-policies	Require Policies to have no unexpected elements, data in <Content>, etc.  \n" +
-                                                        "			This is the default, but can be used to override Policies when option --lenient is used.");
-                
-                System.out.println("");
-                System.out.println(" --strict-requests	Require Requests to have no unexpected elements, data in <Content>, etc.  \n" +
-                                                        "			This is the default, but can be used to override Requests when option --lenient is used.");
-                
-                System.out.println("");
-                System.out.println(" -t, --tests <list of test names>	A space-separated list of specific tests to be run. \n" +
-                                                        "			These are just the names of the tests as in 'IIA001 IIC178'.  \n" +
-                                                        "			Default is to run all tests in the input directory.");
-                
-                System.out.println("");
-                System.out.println(" -v, --verbose 		The entire expected and actual Response objects in the output.  \n"+
-                                                        "			Default is just a summary line.");
-                
+
+
+
+    protected synchronized ConformanceScopeResolver getScopeResolver() {
+        if (this.scopeResolver == null) {
+            this.scopeResolver	= new ConformanceScopeResolver();
+
+            /*
+             * TODO:
+             * Add the known scopes for the 2.0 conformance test.  This could be made more general by allowing loading
+             * from a properties file eventually.
+             */
+            try {
+                URI ID_SCOPE_ROOT	= new URI("urn:root");
+                URI ID_SCOPE_CHILD1	= new URI("urn:root:child1");
+                URI ID_SCOPE_CHILD2	= new URI("urn:root:child2");
+                URI ID_SCOPE_C1D1	= new URI("urn:root:child1:descendant1");
+                URI ID_SCOPE_C1D2	= new URI("urn:root:child1:descendant2");
+                URI ID_SCOPE_C2D1	= new URI("urn:root:child2:descendant1");
+                URI ID_SCOPE_C2D2	= new URI("urn:root:child2:descendant2");
+
+                this.scopeResolver.add(ID_SCOPE_ROOT, ID_SCOPE_CHILD1);
+                this.scopeResolver.add(ID_SCOPE_CHILD1, ID_SCOPE_C1D1);
+                this.scopeResolver.add(ID_SCOPE_CHILD1, ID_SCOPE_C1D2);
+                this.scopeResolver.add(ID_SCOPE_ROOT, ID_SCOPE_CHILD2);
+                this.scopeResolver.add(ID_SCOPE_CHILD2, ID_SCOPE_C2D1);
+                this.scopeResolver.add(ID_SCOPE_CHILD2, ID_SCOPE_C2D2);
+            } catch (Exception ex) {
+                ex.printStackTrace(System.err);
+            }
+
         }
-        
-        private boolean failed(ConformanceTestResult conformanceTestResult) {
-                ResponseMatchResult responseMatchResult	= conformanceTestResult.getResponseMatchResult();
-                if (responseMatchResult == null) {
-                        return true;
-                }
-                if (!responseMatchResult.decisionsMatch() || !responseMatchResult.statusCodesMatch()) {
-                        return true;
-                } else if (this.strict) {
-                        if (!responseMatchResult.associatedAdviceMatches() ||
-                                !responseMatchResult.attributesMatch() ||
-                                !responseMatchResult.obligationsMatch() ||
-                                !responseMatchResult.policyIdentifiersMatch() ||
-                                !responseMatchResult.policySetIdentifiersMatch()
-                                        ) {
-                                return true;
-                        }
-                }
+        return this.scopeResolver;
+    }
+
+    private void close() throws IOException {
+        if (this.outputFileWriter != null) {
+            this.outputFileWriter.close();
+        }
+    }
+
+    private boolean init(String[] args) {
+        boolean lenientRequests	= true;
+        boolean lenientPolicies	= false;
+        // default is to not run any non-first-time iterations
+        int iterations			= -1;
+        String testSetDirectoryNames = "";
+        for (int i = 0 ; i < args.length ; ) {
+
+            if (args[i].equals("-h") || args[i].equals("--help") || args[i].equals("-help")) {
+                printHelp();
                 return false;
-        }
-        
-        private void dump(AttributeAssignment attributeAssignment) {
-                this.outputFileWriter.println("\t\t\t\tAttributeAssignment:");
-                if (attributeAssignment.getCategory() != null) {
-                        this.outputFileWriter.println("\t\t\t\t\tCategory: " + attributeAssignment.getCategory().stringValue());
+            }
+
+
+            // where the XML Request/Response files are located
+            if (args[i].equals("-i") || args[i].equals("--input")) {
+                i++;
+                while (i < args.length && !args[i].startsWith("-")) {
+                    testSetDirectoryNames += " " + args[i];
+                    try {
+                        testSet.addConformanceTestSet(ConformanceTestSet.loadDirectory(new File(args[i])));
+                    } catch (Exception ex) {
+                        ex.printStackTrace(System.err);
+                        return false;
+                    }
+                    i++;
                 }
-                if (attributeAssignment.getAttributeId() != null) {
-                        this.outputFileWriter.println("\t\t\t\t\tAttributeId: " + attributeAssignment.getAttributeId().stringValue());
-                }
-                if (attributeAssignment.getDataTypeId() != null) {
-                        this.outputFileWriter.println("\t\t\t\t\tDataType: " + attributeAssignment.getDataTypeId().stringValue());
-                }
-                if (attributeAssignment.getIssuer() != null) {
-                        this.outputFileWriter.println("\t\t\t\t\tIssuer: " + attributeAssignment.getIssuer());
-                }
-                if (attributeAssignment.getAttributeValue() != null && attributeAssignment.getAttributeValue().getValue() != null) {
-                        this.outputFileWriter.println("\t\t\t\t\tValue: " + attributeAssignment.getAttributeValue().getValue().toString());
-                }
-        }
-        
-        private void dump(Attribute attribute) {
-                this.outputFileWriter.println("\t\t\t\t\tAttribute: " + (attribute.getAttributeId() == null ? "" : attribute.getAttributeId().stringValue()));
-                if (attribute.getIssuer() != null) {
-                        this.outputFileWriter.println("\t\t\t\t\t\tIssuer: " + attribute.getIssuer());
-                }
-                Iterator<AttributeValue<?>> iterAttributeValues	= attribute.getValues().iterator();
-                if (iterAttributeValues.hasNext()) {
-                        this.outputFileWriter.println("\t\t\t\t\t\tValues: ");
-                        while (iterAttributeValues.hasNext()) {
-                                this.outputFileWriter.print("\t\t\t\t\t\t\t");
-                                AttributeValue<?> attributeValue	= iterAttributeValues.next();
-                                if (attributeValue.getDataTypeId() != null) {
-                                        this.outputFileWriter.print("DataType: " + attributeValue.getDataTypeId().stringValue() + " ");
-                                }
-                                if (attributeValue.getValue() != null) {
-                                        this.outputFileWriter.print("Value: " + attributeValue.getValue().toString());
-                                }
-                                this.outputFileWriter.println();
-                        }
-                }
-        }
-        
-        private void dump(AttributeCategory attributeCategory) {
-                this.outputFileWriter.println("\t\t\tAttributeCategory: " + (attributeCategory.getCategory() == null ? "" : attributeCategory.getCategory().stringValue()));
-                Collection<Attribute> listAttributes	= attributeCategory.getAttributes();
-                if (listAttributes.size() > 0) {
-                        this.outputFileWriter.println("\t\t\t\tAttributes:");
-                        for (Attribute attribute: listAttributes) {
-                                this.dump(attribute);
-                        }
-                }
-        }
-        
-        private void dump(Result result) {
-                this.outputFileWriter.println("\t\t======== Result ==========");
-                this.outputFileWriter.println("\t\tDecision: " + (result.getDecision() == null ? "null" : result.getDecision().name()));
-                if (result.getStatus() == null) {
-                        this.outputFileWriter.println("\t\tStatus: null");
+
+                // File path name where output will be put - default is stdout == Console
+            } else if (args[i].equals("-o") || args[i].equals("--output")) {
+                if (i+1 < args.length) {
+                    this.outputFile	= new File(args[i+1]);
+                    i	+= 2;
                 } else {
-                        this.outputFileWriter.println("\t\tStatus:");
-                        if (result.getStatus().getStatusCode() != null) {
-                                this.outputFileWriter.println("\t\t\tStatusCode: " + result.getStatus().getStatusCode().toString());
-                        }
-                        if (result.getStatus().getStatusMessage() != null) {
-                                this.outputFileWriter.println("\t\t\tStatusMessage: " + result.getStatus().getStatusMessage());
-                        }
-                        if (result.getStatus().getStatusDetail() != null) {
-                                this.outputFileWriter.println("\t\t\tStatusDetail: " + result.getStatus().getStatusDetail().toString());
-                        }
+                    System.err.println("Missing argument to " + args[i] + " command line option");
+                    return false;
                 }
-                Collection<Advice> listAdvice	= result.getAssociatedAdvice();
-                if (listAdvice.size() > 0) {
-                        this.outputFileWriter.println("\t\tAdvice:");
-                        for (Advice advice : listAdvice) {
-                                if (advice.getId() != null) {
-                                        this.outputFileWriter.println("\t\t\tId: " + advice.getId().stringValue());
-                                }
-                                Collection<AttributeAssignment> attributeAssignments	= advice.getAttributeAssignments();
-                                if (attributeAssignments.size() > 0) {
-                                        this.outputFileWriter.println("\t\t\tAttributeAssignments:");
-                                        for (AttributeAssignment attributeAssignment: attributeAssignments) {
-                                                this.dump(attributeAssignment);
-                                        }
-                                }				
-                        }
+                // A list of specific test names (e.g.: -t IIA001 IIA007 IIIE301) - default is to run all tests
+            } else if (args[i].equals("-t") || args[i].equals("--tests")) {
+                i++;
+                while (i < args.length && !args[i].startsWith("-")) {
+                    testNamesToRun.add(args[i]);
+                    i++;
                 }
-                Collection<Obligation> listObligations	= result.getObligations();
-                if (listObligations.size() > 0) {
-                        for (Obligation obligation: listObligations) {
-                                if (obligation.getId() != null) {
-                                        this.outputFileWriter.println("\t\t\tId: " + obligation.getId().stringValue());
-                                }
-                                Collection<AttributeAssignment> attributeAssignments	= obligation.getAttributeAssignments();
-                                if (attributeAssignments.size() > 0) {
-                                        this.outputFileWriter.println("\t\t\tAttributeAssignments:");
-                                        for (AttributeAssignment attributeAssignment : attributeAssignments) {
-                                                this.dump(attributeAssignment);
-                                        }
-                                }				
-                        }
+                if (testNamesToRun.size() == 0) {
+                    System.err.println("Missing test names after -t or --tests argument");
+                    return false;
                 }
-                Collection<AttributeCategory> listAttributeCategories	= result.getAttributes();
-                if (listAttributeCategories.size() > 0) {
-                        this.outputFileWriter.println("\t\tAttributes:");
-                        for (AttributeCategory attributeCategory : listAttributeCategories) {
-                                this.dump(attributeCategory);
-                        }
-                }
-                Collection<IdReference> listIdReferences;
-                if ((listIdReferences = result.getPolicyIdentifiers()).size() > 0) {
-                        this.outputFileWriter.println("\t\tPolicyIds:");
-                        for (IdReference idReference : listIdReferences) {
-                                this.outputFileWriter.println("\t\t\t" + idReference.toString());				
-                        }
-                }
-                if ((listIdReferences = result.getPolicySetIdentifiers()).size() > 0) {
-                        this.outputFileWriter.println("\t\tPolicySetIds:");
-                        for (IdReference idReference : listIdReferences) {
-                                this.outputFileWriter.println("\t\t\t" + idReference.toString());				
-                        }
-                }
-        }
-        
-        private void dump(String label, Response response) {
-                this.outputFileWriter.println("\t========== " + label + "==========");
-                if (response == null) {
-                        this.outputFileWriter.println("null");
-                        return;
-                }
-                
-                for (Result result : response.getResults()) {
-                        this.dump(result);
-                }
-        }
-        
-        private void dump(ConformanceTestResult conformanceTestResult) {
-                
-                ResponseMatchResult responseMatchResult	= conformanceTestResult.getResponseMatchResult();
-                if (this.verbose) {
-                        this.outputFileWriter.println("========== Test " + conformanceTestResult.getConformanceTest().getTestName() + " ==========");
-                        this.dump("Expected Response", conformanceTestResult.getExpectedResponse());
-                        this.dump("Actual Response", conformanceTestResult.getActualResponse());
-                        if (responseMatchResult != null) {
-                                this.outputFileWriter.println("\t========== Matching ==========");
-                                this.outputFileWriter.println("\tDecisions Match? " + responseMatchResult.decisionsMatch());
-                                this.outputFileWriter.println("\tStatus Codes Match? " + responseMatchResult.statusCodesMatch());
-                                this.outputFileWriter.println("\tAttributes Match? " + responseMatchResult.attributesMatch());
-                                this.outputFileWriter.println("\tPolicyIds Match? " + responseMatchResult.policyIdentifiersMatch());
-                                this.outputFileWriter.println("\tPolicySetIds Match? " + responseMatchResult.policySetIdentifiersMatch());
-                                this.outputFileWriter.println("\tAssociated Advice Match? " + responseMatchResult.associatedAdviceMatches());
-                                this.outputFileWriter.println("\tObligations Match? " + responseMatchResult.obligationsMatch());
-                                this.outputFileWriter.println("========== End ==========");				
-                        }
+                // Include full details in the response, both the expected reqsponse (from file) and the actual response
+            } else if (args[i].equals("-v") || args[i].equals("--verbose")) {
+                this.verbose	= true;
+                i++;
+                // Report only failures (success is silent)
+            } else if (args[i].equals("-f") || args[i].equals("--failures")) {
+                this.failuresOnly	= true;
+                i++;
+                // When set, the XML must not contain extra attibutes/elements.  Default is "lenient" where unexpected entries are ignored
+            } else if (args[i].equals("-s") || args[i].equals("--strict")) {
+                this.strict	= true;
+                i++;
+                // (self explanatory)
+            } else if (args[i].equals("--stop-on-error")) {
+                this.stopOnFirstError	= true;
+                i++;
+            } else if (args[i].equals("--lenient")) {
+                lenientPolicies	= true;
+                lenientRequests	= true;
+                i++;
+            } else if (args[i].equals("--lenient-policies")) {
+                lenientPolicies	= true;
+                i++;
+            } else if (args[i].equals("--lenient-requests")) {
+                lenientRequests	= true;
+                i++;
+            } else if (args[i].equals("--strict-policies")) {
+                lenientPolicies	= false;
+                i++;
+            } else if (args[i].equals("--strict-requests")) {
+                lenientRequests	= false;
+                i++;
+            } else if (args[i].equals("--iterations")) {
+                // this is a count of how many ADDITIONAL times the decide() should be called.
+                // The first time decide() is called it takes a long time to set up,
+                // so to get an accurate number for how fast a single Request is handled we need to ignore the time for the first run
+                // and timings for 1 or more non-first-time calls to decide().
+                if (i+1 < args.length) {
+                    try {
+                        iterations	= Integer.parseInt(args[i+1]);
+                        i	+= 2;
+                    } catch (NumberFormatException ex) {
+                        System.err.println("Invalid iteration count '" + args[i+1] + "'");
+                        return false;
+                    }
                 } else {
-                        String testName	= conformanceTestResult.getConformanceTest().getTestName();
-                        if (responseMatchResult != null) {
-                                Iterator<ResultMatchResult> iterResultMatches	= responseMatchResult.getResultMatchResults();
-                                if (iterResultMatches == null || !iterResultMatches.hasNext()) {
-                                        this.outputFileWriter.println(testName);
-                                } else {
-                                        while (iterResultMatches.hasNext()) {
-                                                ResultMatchResult resultMatchResult	= iterResultMatches.next();
-                                                this.outputFileWriter.printf("%s,%s,%s,%s,%s,%s,%s,%s,%d,%d\n",
-                                                                testName,
-                                                                resultMatchResult.decisionsMatch(),
-                                                                resultMatchResult.statusCodesMatch(),
-                                                                resultMatchResult.attributesMatch(),
-                                                                resultMatchResult.policyIdentifiersMatch(),
-                                                                resultMatchResult.policySetIdentifiersMatch(),
-                                                                resultMatchResult.associatedAdviceMatches(),
-                                                                resultMatchResult.obligationsMatch(),
-                                                                conformanceTestResult.getFirstCallTime(),
-                                                                conformanceTestResult.getAverageTotalLoopTime()
-                                                                );
-                                        }
-                                }
-                        }
+                    System.err.println("Missing argument to " + args[i] + " command line option");
+                    return false;
                 }
-                this.outputFileWriter.flush();
-        }
-        
-        private boolean run(ConformanceTest conformanceTest) throws Exception {
-                this.testsRun++;
-                ConformanceTestResult conformanceTestResult	= this.testEngine.run(conformanceTest);
-                boolean bFailed								= true;
-                if (conformanceTestResult != null) {
-                        ResponseMatchResult responseMatchResult	= conformanceTestResult.getResponseMatchResult();
-                        if (responseMatchResult != null) {
-                                if (responseMatchResult.decisionsMatch()) {
-                                        this.decisionsMatch++;
-                                        this.statusCodesMatch	+= (responseMatchResult.statusCodesMatch() ? 1 : 0);
-                                        this.attributesMatch	+= (responseMatchResult.attributesMatch() ? 1 : 0);
-                                        this.policyIdsMatch		+= (responseMatchResult.policyIdentifiersMatch() ? 1 : 0);
-                                        this.policySetIdsMatch	+= (responseMatchResult.policySetIdentifiersMatch() ? 1 : 0);
-                                        this.associatedAdviceMatch	+= (responseMatchResult.associatedAdviceMatches() ? 1 : 0);
-                                        this.obligationsMatch		+= (responseMatchResult.obligationsMatch() ? 1 : 0);
-                                }
-                                this.unknownFunctions		+= (responseMatchResult.unknownFunction() ? 1 : 0);
-                                bFailed	= this.failed(conformanceTestResult);
-                                if (bFailed || !this.failuresOnly) {
-                                        this.dump(conformanceTestResult);
-                                }
-                        } else if (conformanceTestResult.getError() != null) {
-                                this.outputFileWriter.println(conformanceTestResult.getError());
-                        }
+                if (iterations < 1) {
+                    System.err.println("Cannot use --iterations " + iterations + ".  Must use an integer greater than 0");
+                    return false;
                 }
-                return (!bFailed || !this.stopOnFirstError);
-        }
-        
-        private void run() throws Exception {
-                long tStart	= System.currentTimeMillis();
-                
-                if (!this.verbose) {
-                        this.outputFileWriter.println("Test,Decision,Status,Attributes,PolicyIds,PolicySetIds,Advice,Obligations");
-                }
-                Iterator<ConformanceTest> iterConformanceTests	= this.testSet.getConformanceTests();
-                boolean bContinue								= true;
-                while (bContinue && iterConformanceTests.hasNext()) {
-//			bContinue	= this.run(iterConformanceTests.next());
-                        ConformanceTest test = iterConformanceTests.next();
-                        if (testNamesToRun.size() > 0) {
-                                if ( ! testNamesToRun.contains(test.getTestName())) {
-                                        continue;
-                                }
-                        }
-                        bContinue	= this.run(test);
-                }
-                
-                long tElapsed	= System.currentTimeMillis() - tStart;
-                
-                if (this.verbose) {
-                        this.outputFileWriter.println("Tests run = " + this.testsRun);
-                        this.outputFileWriter.println("Decisions match = " + this.decisionsMatch);
-                        this.outputFileWriter.println("Status Codes match = " + this.statusCodesMatch);
-                        this.outputFileWriter.println("Attributes match = " + this.attributesMatch);
-                        this.outputFileWriter.println("PolicyIds match = " + this.policyIdsMatch);
-                        this.outputFileWriter.println("PolicySetIds match = " + this.policySetIdsMatch);
-                        this.outputFileWriter.println("Associated Advice match = " + this.associatedAdviceMatch);
-                        this.outputFileWriter.println("Obligations match = " + this.obligationsMatch);
-                        this.outputFileWriter.println("Unknown functions = " + this.unknownFunctions);
-                } else {
-                        this.outputFileWriter.printf("Total (%d),%d,%d,%d,%d,%d,%d,%d,%d\n",
-                                        this.testsRun,
-                                        this.decisionsMatch,
-                                        this.statusCodesMatch,
-                                        this.attributesMatch,
-                                        this.policyIdsMatch,
-                                        this.policySetIdsMatch,
-                                        this.associatedAdviceMatch,
-                                        this.obligationsMatch,
-                                        this.unknownFunctions);
-                }
-                
-                if (tElapsed > 0) {
-                        long tHours		= tElapsed / (60*60*1000);
-                        tElapsed		= tElapsed - tHours * 60 * 60 *1000;
-                        long tMinutes	= tElapsed / (60*1000);
-                        tElapsed		= tElapsed - tMinutes * 60 * 1000;
-                        long tSeconds	= tElapsed / 1000;
-                        tElapsed		= tElapsed - tSeconds * 1000;
-                        
-                        this.outputFileWriter.printf("Elapsed time = %02d:%02d:%02d.%03d\n", tHours, tMinutes, tSeconds, tElapsed);
-                        this.outputFileWriter.printf("First decide time in nano-seconds %d\n", this.testEngine.getFirstDecideTime());
-                        this.outputFileWriter.printf("Total Multiple decide time in nano-seconds %d\n", this.testEngine.getDecideTimeMultiple());
-                        
-                        this.outputFileWriter.printf("\nAverage First decide time in nano-seconds %d\n", this.testEngine.getAvgFirstDecideTime());
-                        this.outputFileWriter.printf("Average decide time after first call in nano-seconds %d\n", this.testEngine.getAvgDecideTimeMultiple());
-                }
-        }
-        
-        public Conformance() {
+            } else {
+                System.err.println("Unknown command line option " + args[i]);
+                return false;
+            }
         }
 
-        public static void main(String[] args) {
-                Conformance conformance	= new Conformance();
-                try {
-                        if (conformance.init(args)) {
-                                conformance.run();
-                        }
-                        
-                } catch (Exception ex) {
-                        ex.printStackTrace(System.err);
-                        System.exit(1);
-                } finally {
-                        try {
-                                conformance.close();
-                        } catch (IOException ex) {
-                                ex.printStackTrace(System.err);
-                        }
-                }
-                System.exit(0);
+        this.testEngine	= new ConformanceTestEngine(this.getScopeResolver(), lenientRequests, lenientPolicies, iterations);
+
+        if (testSetDirectoryNames.length() == 0) {
+            System.err.println("No test set directory given (need -i or --iniput command line option)");
+            return false;
         }
+        if (testSet.getListConformanceTests().size() == 0) {
+            System.err.println("No tests in given directories: " + testSetDirectoryNames);
+        }
+
+        if (testNamesToRun.size() > 0) {
+            String s = "";
+            for (String name : testNamesToRun) {
+                s += ", " + name;
+            }
+            System.out.println("Tests limited to: " + s.substring(1));
+        }
+
+        if (this.outputFile == null) {
+            this.outputFileWriter	= new PrintWriter(System.out);
+        } else {
+            try {
+                this.outputFileWriter	= new PrintWriter(new FileOutputStream(this.outputFile));
+            } catch (IOException ex) {
+                System.err.println("Cannot open " + this.outputFile.getAbsolutePath() + " for writing.");
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    private void printHelp() {
+        System.out.println("usage: Conformance --input <tests_directory> OPTIONS");
+        System.out.println("");
+        System.out.println(" -f, --failures		Only include failed tests in the output.  \n"+
+                           "			Default is to include all test's results in the output file.");
+        System.out.println("");
+        System.out.println(" -h, --help		Prints help.");
+
+        System.out.println("");
+        System.out.println(" -i, --input <dir>	Directory containing the XML Request/Response files.  \n"+
+                           "			This may be multiple space-separated directory paths.  REQUIRED");
+
+        System.out.println("");
+        System.out.println(" --iterations		The number of times to run through the set of tests in the input directory.");
+
+        System.out.println("");
+        System.out.println(" --lenient		Allow both Requests and Policies to have unexpected elements, no data in <Content>, etc. \n"+
+                           "			Default is to not allow anything that is not explicitly listed in the XACML spec.");
+
+        System.out.println("");
+        System.out.println(" --lenient-policies	Allow Policies to have unexpected elements, no data in <Content>, etc.  \n" +
+                           "			Default is to not allow anything that is not explicitly listed in the XACML spec.");
+
+        System.out.println("");
+        System.out.println(" --lenient-requests	Allow Requests to have unexpected elements, no data in <Content>, etc.  \n" +
+                           "			Default is to not allow anything that is not explicitly listed in the XACML spec.");
+
+        System.out.println("");
+        System.out.println(" -o, --output <dir>	Directory where the output results file will be put.");
+
+        System.out.println("");
+        System.out.println(" -s, --strict		Check both the Decision and all other parts of the Response (Attributes, Obligations and Advice). \n "+
+                           "			Default is to check just the Decision.");
+
+        System.out.println("");
+        System.out.println(" --stop-on-error	Stop running conformance tests the first time one fails.  Default is to continue through all tests.");
+
+        System.out.println("");
+        System.out.println(" --strict-policies	Require Policies to have no unexpected elements, data in <Content>, etc.  \n" +
+                           "			This is the default, but can be used to override Policies when option --lenient is used.");
+
+        System.out.println("");
+        System.out.println(" --strict-requests	Require Requests to have no unexpected elements, data in <Content>, etc.  \n" +
+                           "			This is the default, but can be used to override Requests when option --lenient is used.");
+
+        System.out.println("");
+        System.out.println(" -t, --tests <list of test names>	A space-separated list of specific tests to be run. \n" +
+                           "			These are just the names of the tests as in 'IIA001 IIC178'.  \n" +
+                           "			Default is to run all tests in the input directory.");
+
+        System.out.println("");
+        System.out.println(" -v, --verbose 		The entire expected and actual Response objects in the output.  \n"+
+                           "			Default is just a summary line.");
+
+    }
+
+    private boolean failed(ConformanceTestResult conformanceTestResult) {
+        ResponseMatchResult responseMatchResult	= conformanceTestResult.getResponseMatchResult();
+        if (responseMatchResult == null) {
+            return true;
+        }
+        if (!responseMatchResult.decisionsMatch() || !responseMatchResult.statusCodesMatch()) {
+            return true;
+        } else if (this.strict) {
+            if (!responseMatchResult.associatedAdviceMatches() ||
+                    !responseMatchResult.attributesMatch() ||
+                    !responseMatchResult.obligationsMatch() ||
+                    !responseMatchResult.policyIdentifiersMatch() ||
+                    !responseMatchResult.policySetIdentifiersMatch()
+               ) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private void dump(AttributeAssignment attributeAssignment) {
+        this.outputFileWriter.println("\t\t\t\tAttributeAssignment:");
+        if (attributeAssignment.getCategory() != null) {
+            this.outputFileWriter.println("\t\t\t\t\tCategory: " + attributeAssignment.getCategory().stringValue());
+        }
+        if (attributeAssignment.getAttributeId() != null) {
+            this.outputFileWriter.println("\t\t\t\t\tAttributeId: " + attributeAssignment.getAttributeId().stringValue());
+        }
+        if (attributeAssignment.getDataTypeId() != null) {
+            this.outputFileWriter.println("\t\t\t\t\tDataType: " + attributeAssignment.getDataTypeId().stringValue());
+        }
+        if (attributeAssignment.getIssuer() != null) {
+            this.outputFileWriter.println("\t\t\t\t\tIssuer: " + attributeAssignment.getIssuer());
+        }
+        if (attributeAssignment.getAttributeValue() != null && attributeAssignment.getAttributeValue().getValue() != null) {
+            this.outputFileWriter.println("\t\t\t\t\tValue: " + attributeAssignment.getAttributeValue().getValue().toString());
+        }
+    }
+
+    private void dump(Attribute attribute) {
+        this.outputFileWriter.println("\t\t\t\t\tAttribute: " + (attribute.getAttributeId() == null ? "" : attribute.getAttributeId().stringValue()));
+        if (attribute.getIssuer() != null) {
+            this.outputFileWriter.println("\t\t\t\t\t\tIssuer: " + attribute.getIssuer());
+        }
+        Iterator<AttributeValue<?>> iterAttributeValues	= attribute.getValues().iterator();
+        if (iterAttributeValues.hasNext()) {
+            this.outputFileWriter.println("\t\t\t\t\t\tValues: ");
+            while (iterAttributeValues.hasNext()) {
+                this.outputFileWriter.print("\t\t\t\t\t\t\t");
+                AttributeValue<?> attributeValue	= iterAttributeValues.next();
+                if (attributeValue.getDataTypeId() != null) {
+                    this.outputFileWriter.print("DataType: " + attributeValue.getDataTypeId().stringValue() + " ");
+                }
+                if (attributeValue.getValue() != null) {
+                    this.outputFileWriter.print("Value: " + attributeValue.getValue().toString());
+                }
+                this.outputFileWriter.println();
+            }
+        }
+    }
+
+    private void dump(AttributeCategory attributeCategory) {
+        this.outputFileWriter.println("\t\t\tAttributeCategory: " + (attributeCategory.getCategory() == null ? "" : attributeCategory.getCategory().stringValue()));
+        Collection<Attribute> listAttributes	= attributeCategory.getAttributes();
+        if (listAttributes.size() > 0) {
+            this.outputFileWriter.println("\t\t\t\tAttributes:");
+            for (Attribute attribute: listAttributes) {
+                this.dump(attribute);
+            }
+        }
+    }
+
+    private void dump(Result result) {
+        this.outputFileWriter.println("\t\t======== Result ==========");
+        this.outputFileWriter.println("\t\tDecision: " + (result.getDecision() == null ? "null" : result.getDecision().name()));
+        if (result.getStatus() == null) {
+            this.outputFileWriter.println("\t\tStatus: null");
+        } else {
+            this.outputFileWriter.println("\t\tStatus:");
+            if (result.getStatus().getStatusCode() != null) {
+                this.outputFileWriter.println("\t\t\tStatusCode: " + result.getStatus().getStatusCode().toString());
+            }
+            if (result.getStatus().getStatusMessage() != null) {
+                this.outputFileWriter.println("\t\t\tStatusMessage: " + result.getStatus().getStatusMessage());
+            }
+            if (result.getStatus().getStatusDetail() != null) {
+                this.outputFileWriter.println("\t\t\tStatusDetail: " + result.getStatus().getStatusDetail().toString());
+            }
+        }
+        Collection<Advice> listAdvice	= result.getAssociatedAdvice();
+        if (listAdvice.size() > 0) {
+            this.outputFileWriter.println("\t\tAdvice:");
+            for (Advice advice : listAdvice) {
+                if (advice.getId() != null) {
+                    this.outputFileWriter.println("\t\t\tId: " + advice.getId().stringValue());
+                }
+                Collection<AttributeAssignment> attributeAssignments	= advice.getAttributeAssignments();
+                if (attributeAssignments.size() > 0) {
+                    this.outputFileWriter.println("\t\t\tAttributeAssignments:");
+                    for (AttributeAssignment attributeAssignment: attributeAssignments) {
+                        this.dump(attributeAssignment);
+                    }
+                }
+            }
+        }
+        Collection<Obligation> listObligations	= result.getObligations();
+        if (listObligations.size() > 0) {
+            for (Obligation obligation: listObligations) {
+                if (obligation.getId() != null) {
+                    this.outputFileWriter.println("\t\t\tId: " + obligation.getId().stringValue());
+                }
+                Collection<AttributeAssignment> attributeAssignments	= obligation.getAttributeAssignments();
+                if (attributeAssignments.size() > 0) {
+                    this.outputFileWriter.println("\t\t\tAttributeAssignments:");
+                    for (AttributeAssignment attributeAssignment : attributeAssignments) {
+                        this.dump(attributeAssignment);
+                    }
+                }
+            }
+        }
+        Collection<AttributeCategory> listAttributeCategories	= result.getAttributes();
+        if (listAttributeCategories.size() > 0) {
+            this.outputFileWriter.println("\t\tAttributes:");
+            for (AttributeCategory attributeCategory : listAttributeCategories) {
+                this.dump(attributeCategory);
+            }
+        }
+        Collection<IdReference> listIdReferences;
+        if ((listIdReferences = result.getPolicyIdentifiers()).size() > 0) {
+            this.outputFileWriter.println("\t\tPolicyIds:");
+            for (IdReference idReference : listIdReferences) {
+                this.outputFileWriter.println("\t\t\t" + idReference.toString());
+            }
+        }
+        if ((listIdReferences = result.getPolicySetIdentifiers()).size() > 0) {
+            this.outputFileWriter.println("\t\tPolicySetIds:");
+            for (IdReference idReference : listIdReferences) {
+                this.outputFileWriter.println("\t\t\t" + idReference.toString());
+            }
+        }
+    }
+
+    private void dump(String label, Response response) {
+        this.outputFileWriter.println("\t========== " + label + "==========");
+        if (response == null) {
+            this.outputFileWriter.println("null");
+            return;
+        }
+
+        for (Result result : response.getResults()) {
+            this.dump(result);
+        }
+    }
+
+    private void dump(ConformanceTestResult conformanceTestResult) {
+
+        ResponseMatchResult responseMatchResult	= conformanceTestResult.getResponseMatchResult();
+        if (this.verbose) {
+            this.outputFileWriter.println("========== Test " + conformanceTestResult.getConformanceTest().getTestName() + " ==========");
+            this.dump("Expected Response", conformanceTestResult.getExpectedResponse());
+            this.dump("Actual Response", conformanceTestResult.getActualResponse());
+            if (responseMatchResult != null) {
+                this.outputFileWriter.println("\t========== Matching ==========");
+                this.outputFileWriter.println("\tDecisions Match? " + responseMatchResult.decisionsMatch());
+                this.outputFileWriter.println("\tStatus Codes Match? " + responseMatchResult.statusCodesMatch());
+                this.outputFileWriter.println("\tAttributes Match? " + responseMatchResult.attributesMatch());
+                this.outputFileWriter.println("\tPolicyIds Match? " + responseMatchResult.policyIdentifiersMatch());
+                this.outputFileWriter.println("\tPolicySetIds Match? " + responseMatchResult.policySetIdentifiersMatch());
+                this.outputFileWriter.println("\tAssociated Advice Match? " + responseMatchResult.associatedAdviceMatches());
+                this.outputFileWriter.println("\tObligations Match? " + responseMatchResult.obligationsMatch());
+                this.outputFileWriter.println("========== End ==========");
+            }
+        } else {
+            String testName	= conformanceTestResult.getConformanceTest().getTestName();
+            if (responseMatchResult != null) {
+                Iterator<ResultMatchResult> iterResultMatches	= responseMatchResult.getResultMatchResults();
+                if (iterResultMatches == null || !iterResultMatches.hasNext()) {
+                    this.outputFileWriter.println(testName);
+                } else {
+                    while (iterResultMatches.hasNext()) {
+                        ResultMatchResult resultMatchResult	= iterResultMatches.next();
+                        this.outputFileWriter.printf("%s,%s,%s,%s,%s,%s,%s,%s,%d,%d\n",
+                                                     testName,
+                                                     resultMatchResult.decisionsMatch(),
+                                                     resultMatchResult.statusCodesMatch(),
+                                                     resultMatchResult.attributesMatch(),
+                                                     resultMatchResult.policyIdentifiersMatch(),
+                                                     resultMatchResult.policySetIdentifiersMatch(),
+                                                     resultMatchResult.associatedAdviceMatches(),
+                                                     resultMatchResult.obligationsMatch(),
+                                                     conformanceTestResult.getFirstCallTime(),
+                                                     conformanceTestResult.getAverageTotalLoopTime()
+                                                    );
+                    }
+                }
+            }
+        }
+        this.outputFileWriter.flush();
+    }
+
+    private boolean run(ConformanceTest conformanceTest) throws Exception {
+        this.testsRun++;
+        ConformanceTestResult conformanceTestResult	= this.testEngine.run(conformanceTest);
+        boolean bFailed								= true;
+        if (conformanceTestResult != null) {
+            ResponseMatchResult responseMatchResult	= conformanceTestResult.getResponseMatchResult();
+            if (responseMatchResult != null) {
+                if (responseMatchResult.decisionsMatch()) {
+                    this.decisionsMatch++;
+                    this.statusCodesMatch	+= (responseMatchResult.statusCodesMatch() ? 1 : 0);
+                    this.attributesMatch	+= (responseMatchResult.attributesMatch() ? 1 : 0);
+                    this.policyIdsMatch		+= (responseMatchResult.policyIdentifiersMatch() ? 1 : 0);
+                    this.policySetIdsMatch	+= (responseMatchResult.policySetIdentifiersMatch() ? 1 : 0);
+                    this.associatedAdviceMatch	+= (responseMatchResult.associatedAdviceMatches() ? 1 : 0);
+                    this.obligationsMatch		+= (responseMatchResult.obligationsMatch() ? 1 : 0);
+                }
+                this.unknownFunctions		+= (responseMatchResult.unknownFunction() ? 1 : 0);
+                bFailed	= this.failed(conformanceTestResult);
+                if (bFailed || !this.failuresOnly) {
+                    this.dump(conformanceTestResult);
+                }
+            } else if (conformanceTestResult.getError() != null) {
+                this.outputFileWriter.println(conformanceTestResult.getError());
+            }
+        }
+        return (!bFailed || !this.stopOnFirstError);
+    }
+
+    private void run() throws Exception {
+        long tStart	= System.currentTimeMillis();
+
+        if (!this.verbose) {
+            this.outputFileWriter.println("Test,Decision,Status,Attributes,PolicyIds,PolicySetIds,Advice,Obligations");
+        }
+        Iterator<ConformanceTest> iterConformanceTests	= this.testSet.getConformanceTests();
+        boolean bContinue								= true;
+        while (bContinue && iterConformanceTests.hasNext()) {
+//			bContinue	= this.run(iterConformanceTests.next());
+            ConformanceTest test = iterConformanceTests.next();
+            if (testNamesToRun.size() > 0) {
+                if ( ! testNamesToRun.contains(test.getTestName())) {
+                    continue;
+                }
+            }
+            bContinue	= this.run(test);
+        }
+
+        long tElapsed	= System.currentTimeMillis() - tStart;
+
+        if (this.verbose) {
+            this.outputFileWriter.println("Tests run = " + this.testsRun);
+            this.outputFileWriter.println("Decisions match = " + this.decisionsMatch);
+            this.outputFileWriter.println("Status Codes match = " + this.statusCodesMatch);
+            this.outputFileWriter.println("Attributes match = " + this.attributesMatch);
+            this.outputFileWriter.println("PolicyIds match = " + this.policyIdsMatch);
+            this.outputFileWriter.println("PolicySetIds match = " + this.policySetIdsMatch);
+            this.outputFileWriter.println("Associated Advice match = " + this.associatedAdviceMatch);
+            this.outputFileWriter.println("Obligations match = " + this.obligationsMatch);
+            this.outputFileWriter.println("Unknown functions = " + this.unknownFunctions);
+        } else {
+            this.outputFileWriter.printf("Total (%d),%d,%d,%d,%d,%d,%d,%d,%d\n",
+                                         this.testsRun,
+                                         this.decisionsMatch,
+                                         this.statusCodesMatch,
+                                         this.attributesMatch,
+                                         this.policyIdsMatch,
+                                         this.policySetIdsMatch,
+                                         this.associatedAdviceMatch,
+                                         this.obligationsMatch,
+                                         this.unknownFunctions);
+        }
+
+        if (tElapsed > 0) {
+            long tHours		= tElapsed / (60*60*1000);
+            tElapsed		= tElapsed - tHours * 60 * 60 *1000;
+            long tMinutes	= tElapsed / (60*1000);
+            tElapsed		= tElapsed - tMinutes * 60 * 1000;
+            long tSeconds	= tElapsed / 1000;
+            tElapsed		= tElapsed - tSeconds * 1000;
+
+            this.outputFileWriter.printf("Elapsed time = %02d:%02d:%02d.%03d\n", tHours, tMinutes, tSeconds, tElapsed);
+            this.outputFileWriter.printf("First decide time in nano-seconds %d\n", this.testEngine.getFirstDecideTime());
+            this.outputFileWriter.printf("Total Multiple decide time in nano-seconds %d\n", this.testEngine.getDecideTimeMultiple());
+
+            this.outputFileWriter.printf("\nAverage First decide time in nano-seconds %d\n", this.testEngine.getAvgFirstDecideTime());
+            this.outputFileWriter.printf("Average decide time after first call in nano-seconds %d\n", this.testEngine.getAvgDecideTimeMultiple());
+        }
+    }
+
+    public Conformance() {
+    }
+
+    public static void main(String[] args) {
+        Conformance conformance	= new Conformance();
+        try {
+            if (conformance.init(args)) {
+                conformance.run();
+            }
+
+        } catch (Exception ex) {
+            ex.printStackTrace(System.err);
+            System.exit(1);
+        } finally {
+            try {
+                conformance.close();
+            } catch (IOException ex) {
+                ex.printStackTrace(System.err);
+            }
+        }
+        System.exit(0);
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformancePIPEngine.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformancePIPEngine.java
index 2edfc76..b14a061 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformancePIPEngine.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformancePIPEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -69,185 +69,185 @@
  * ConformancePIPEngine implements the {@link com.att.research.xacml.api.pip.PIPFinder} interface to find attributes
  * loaded from a text file containing the following fields:
  * 	category-id,attribute-id,datatype-id,issuer,value
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ConformancePIPEngine implements ConfigurableEngine {
-        public static final String PROP_DESCRIPTION	= ".description";
-        public static final String PROP_FILE		= ".file";
-        
-        private static final Log logger	= LogFactory.getLog(ConformancePIPEngine.class);
-        
-        private String name;
-        private String description;
-        private Map<String,PIPResponse> cache	= new HashMap<String,PIPResponse>();
-        private List<Attribute> listAttributes	= new ArrayList<Attribute>();
-        private DataTypeFactory dataTypeFactory;
-        
-        public ConformancePIPEngine() {
-                
+    public static final String PROP_DESCRIPTION	= ".description";
+    public static final String PROP_FILE		= ".file";
+
+    private static final Log logger	= LogFactory.getLog(ConformancePIPEngine.class);
+
+    private String name;
+    private String description;
+    private Map<String,PIPResponse> cache	= new HashMap<String,PIPResponse>();
+    private List<Attribute> listAttributes	= new ArrayList<Attribute>();
+    private DataTypeFactory dataTypeFactory;
+
+    public ConformancePIPEngine() {
+
+    }
+
+    protected DataTypeFactory getDataTypeFactory() throws FactoryException {
+        if (this.dataTypeFactory == null) {
+            this.dataTypeFactory	= DataTypeFactory.newInstance();
         }
-        
-        protected DataTypeFactory getDataTypeFactory() throws FactoryException {
-                if (this.dataTypeFactory == null) {
-                        this.dataTypeFactory	= DataTypeFactory.newInstance();
-                }
-                return this.dataTypeFactory;
+        return this.dataTypeFactory;
+    }
+
+    protected static String generateKey(PIPRequest pipRequest) {
+        StringBuilder stringBuilder	= new StringBuilder(pipRequest.getCategory().toString());
+        stringBuilder.append('+');
+        stringBuilder.append(pipRequest.getAttributeId().toString());
+        stringBuilder.append('+');
+        stringBuilder.append(pipRequest.getDataTypeId().toString());
+        String issuer	= pipRequest.getIssuer();
+        if (issuer != null) {
+            stringBuilder.append('+');
+            stringBuilder.append(issuer);
         }
-        
-        protected static String generateKey(PIPRequest pipRequest) {
-                StringBuilder stringBuilder	= new StringBuilder(pipRequest.getCategory().toString());
-                stringBuilder.append('+');
-                stringBuilder.append(pipRequest.getAttributeId().toString());
-                stringBuilder.append('+');
-                stringBuilder.append(pipRequest.getDataTypeId().toString());
-                String issuer	= pipRequest.getIssuer();
-                if (issuer != null) {
-                        stringBuilder.append('+');
-                        stringBuilder.append(issuer);
-                }
-                return stringBuilder.toString();
+        return stringBuilder.toString();
+    }
+
+    protected void store(String[] fields) throws FactoryException {
+        DataTypeFactory thisDataTypeFactory	= this.getDataTypeFactory();
+        Identifier identifierCategory		= new IdentifierImpl(fields[0]);
+        Identifier identifierAttribute		= new IdentifierImpl(fields[1]);
+        Identifier identifierDataType		= new IdentifierImpl(fields[2]);
+        String issuer						= (fields.length == 5 ? fields[3] : null);
+        String value						= fields[fields.length - 1];
+
+        DataType<?> dataType				= thisDataTypeFactory.getDataType(identifierDataType);
+        if (dataType == null) {
+            logger.error("Unknown data type " + identifierDataType.stringValue());
+            return;
         }
-        
-        protected void store(String[] fields) throws FactoryException {
-                DataTypeFactory thisDataTypeFactory	= this.getDataTypeFactory();
-                Identifier identifierCategory		= new IdentifierImpl(fields[0]);
-                Identifier identifierAttribute		= new IdentifierImpl(fields[1]);
-                Identifier identifierDataType		= new IdentifierImpl(fields[2]);
-                String issuer						= (fields.length == 5 ? fields[3] : null);
-                String value						= fields[fields.length - 1];
-                
-                DataType<?> dataType				= thisDataTypeFactory.getDataType(identifierDataType);
-                if (dataType == null) {
-                        logger.error("Unknown data type " + identifierDataType.stringValue());
-                        return;
-                }
-                
-                AttributeValue<?> attributeValue	= null;
-                try {
-                        attributeValue	= dataType.createAttributeValue(value);
-                } catch (DataTypeException ex) {
-                        throw new FactoryException("DataTypeException creating AttributeValue", ex);
-                }
-                Attribute attribute					= new StdMutableAttribute(identifierCategory, identifierAttribute, attributeValue, issuer, false);
-                this.listAttributes.add(attribute);
+
+        AttributeValue<?> attributeValue	= null;
+        try {
+            attributeValue	= dataType.createAttributeValue(value);
+        } catch (DataTypeException ex) {
+            throw new FactoryException("DataTypeException creating AttributeValue", ex);
         }
-        
-        public void loadAttributes(File fileAttributes) throws IOException, ParseException, FactoryException {
-                if (fileAttributes != null) {
-                        if (!fileAttributes.exists()) {
-                                throw new FileNotFoundException("Attributes file " + fileAttributes.getAbsolutePath() + " not found.");
-                        } else if (!fileAttributes.canRead()) {
-                                throw new IOException("Attributes file " + fileAttributes.getAbsolutePath() + " is not readable.");
+        Attribute attribute					= new StdMutableAttribute(identifierCategory, identifierAttribute, attributeValue, issuer, false);
+        this.listAttributes.add(attribute);
+    }
+
+    public void loadAttributes(File fileAttributes) throws IOException, ParseException, FactoryException {
+        if (fileAttributes != null) {
+            if (!fileAttributes.exists()) {
+                throw new FileNotFoundException("Attributes file " + fileAttributes.getAbsolutePath() + " not found.");
+            } else if (!fileAttributes.canRead()) {
+                throw new IOException("Attributes file " + fileAttributes.getAbsolutePath() + " is not readable.");
+            }
+
+            BufferedReader bufferedReader	= null;
+            try {
+                bufferedReader	= new BufferedReader(new InputStreamReader(new FileInputStream(fileAttributes)));
+                String line;
+                while ((line = bufferedReader.readLine()) != null) {
+                    if (line.length() > 0) {
+                        String[] fields	= line.split("[|]",-1);
+                        if (fields.length < 4) {
+                            logger.warn("Not enough fields in record \"" + line + "\"");
+                            continue;
                         }
-                        
-                        BufferedReader bufferedReader	= null;
-                        try {
-                                bufferedReader	= new BufferedReader(new InputStreamReader(new FileInputStream(fileAttributes)));
-                                String line;
-                                while ((line = bufferedReader.readLine()) != null) {
-                                        if (line.length() > 0) {
-                                                String[] fields	= line.split("[|]",-1);
-                                                if (fields.length < 4) {
-                                                        logger.warn("Not enough fields in record \"" + line + "\"");
-                                                        continue;
-                                                }
-                                                this.store(fields);
-                                                
-                                        }
-                                }
-                        } finally {
-                                if (bufferedReader != null) {
-                                        bufferedReader.close();
-                                }
-                        }
-                }
-        }
-        
-        protected Attribute findAttribute(PIPRequest pipRequest) {
-                Attribute attributeResult			= null;
-                Iterator<Attribute> iterAttributes	= this.listAttributes.iterator();
-                while ((attributeResult == null) && iterAttributes.hasNext()) {
-                        Attribute attributeTest	= iterAttributes.next();
-                        if (pipRequest.getCategory().equals(attributeTest.getCategory()) &&
-                                pipRequest.getAttributeId().equals(attributeTest.getAttributeId()) &&
-                                (pipRequest.getIssuer() == null || pipRequest.getIssuer().equals(attributeTest.getIssuer()))) {
-                                attributeResult	= attributeTest;
-                        }
-                }
-                return attributeResult;
-        }
+                        this.store(fields);
 
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
-                String pipRequestKey	= generateKey(pipRequest);
-                PIPResponse pipResponse	= this.cache.get(pipRequestKey);
-                if (pipResponse != null) {
-                        return pipResponse;
+                    }
                 }
-                Attribute attributeMatch	= this.findAttribute(pipRequest);
-                if (attributeMatch == null) {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
+            } finally {
+                if (bufferedReader != null) {
+                    bufferedReader.close();
                 }
-                /*
-                 * Iterate through the values and only return the ones that match the requested data type
-                 */
-                List<AttributeValue<?>> matchingValues	= new ArrayList<AttributeValue<?>>();
-                Iterator<AttributeValue<?>> iterAttributeValues	= attributeMatch.getValues().iterator();
-                while (iterAttributeValues.hasNext()) {
-                        AttributeValue<?> attributeValue	= iterAttributeValues.next();
-                        if (pipRequest.getDataTypeId().equals(attributeValue.getDataTypeId())) {
-                                matchingValues.add(attributeValue);
-                        }
-                }
-                if (matchingValues.size() > 0) {
-                        Attribute attributeResponse	= new StdMutableAttribute(attributeMatch.getCategory(), attributeMatch.getAttributeId(), matchingValues, attributeMatch.getIssuer(), false);
-                        pipResponse					= new StdPIPResponse(attributeResponse);
-                        this.cache.put(pipRequestKey, pipResponse);
-                }
-                return pipResponse;
+            }
         }
+    }
 
-        @Override
-        public String getName() {
-                return this.name;
+    protected Attribute findAttribute(PIPRequest pipRequest) {
+        Attribute attributeResult			= null;
+        Iterator<Attribute> iterAttributes	= this.listAttributes.iterator();
+        while ((attributeResult == null) && iterAttributes.hasNext()) {
+            Attribute attributeTest	= iterAttributes.next();
+            if (pipRequest.getCategory().equals(attributeTest.getCategory()) &&
+                    pipRequest.getAttributeId().equals(attributeTest.getAttributeId()) &&
+                    (pipRequest.getIssuer() == null || pipRequest.getIssuer().equals(attributeTest.getIssuer()))) {
+                attributeResult	= attributeTest;
+            }
         }
+        return attributeResult;
+    }
 
-        @Override
-        public String getDescription() {
-                return this.description;
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
+        String pipRequestKey	= generateKey(pipRequest);
+        PIPResponse pipResponse	= this.cache.get(pipRequestKey);
+        if (pipResponse != null) {
+            return pipResponse;
         }
+        Attribute attributeMatch	= this.findAttribute(pipRequest);
+        if (attributeMatch == null) {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
+        }
+        /*
+         * Iterate through the values and only return the ones that match the requested data type
+         */
+        List<AttributeValue<?>> matchingValues	= new ArrayList<AttributeValue<?>>();
+        Iterator<AttributeValue<?>> iterAttributeValues	= attributeMatch.getValues().iterator();
+        while (iterAttributeValues.hasNext()) {
+            AttributeValue<?> attributeValue	= iterAttributeValues.next();
+            if (pipRequest.getDataTypeId().equals(attributeValue.getDataTypeId())) {
+                matchingValues.add(attributeValue);
+            }
+        }
+        if (matchingValues.size() > 0) {
+            Attribute attributeResponse	= new StdMutableAttribute(attributeMatch.getCategory(), attributeMatch.getAttributeId(), matchingValues, attributeMatch.getIssuer(), false);
+            pipResponse					= new StdPIPResponse(attributeResponse);
+            this.cache.put(pipRequestKey, pipResponse);
+        }
+        return pipResponse;
+    }
 
-        @Override
-        public void configure(String id, Properties properties) throws PIPException {
-                this.name	= id;
-                this.description	= properties.getProperty(id + PROP_DESCRIPTION);
-                if (this.description == null) {
-                        this.description	= "PIPEngine for the Conformance tests that loads attributes from a CSV file";
-                }
-                String pipFile		= properties.getProperty(id + PROP_FILE);
-                if (pipFile != null) {
-                        try {
-                                this.loadAttributes(new File(pipFile));
-                        } catch (Exception ex) {
-                                logger.error("Exception loading PIP file " + pipFile, ex);
-                                throw new PIPException("Exception loading PIP file " + pipFile, ex);
-                        }
-                }
-        }
+    @Override
+    public String getName() {
+        return this.name;
+    }
 
-        @Override
-        public Collection<PIPRequest> attributesRequired() {
-                return Collections.emptyList();
-        }
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
 
-        @Override
-        public Collection<PIPRequest> attributesProvided() {
-                //
-                // We could return everything in our list
-                //
-                return Collections.emptyList();
+    @Override
+    public void configure(String id, Properties properties) throws PIPException {
+        this.name	= id;
+        this.description	= properties.getProperty(id + PROP_DESCRIPTION);
+        if (this.description == null) {
+            this.description	= "PIPEngine for the Conformance tests that loads attributes from a CSV file";
         }
+        String pipFile		= properties.getProperty(id + PROP_FILE);
+        if (pipFile != null) {
+            try {
+                this.loadAttributes(new File(pipFile));
+            } catch (Exception ex) {
+                logger.error("Exception loading PIP file " + pipFile, ex);
+                throw new PIPException("Exception loading PIP file " + pipFile, ex);
+            }
+        }
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesRequired() {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesProvided() {
+        //
+        // We could return everything in our list
+        //
+        return Collections.emptyList();
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceRepository.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceRepository.java
index 4e358cf..fcd4344 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceRepository.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceRepository.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,93 +46,93 @@
 /**
  * ConformanceRepository represents one or more policies for a single policy test, which will include one or more root policies, and
  * zero or more referenced policies.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class ConformanceRepository {
-        private List<File> rootPolicies			= new ArrayList<File>();
-        private List<File> referencedPolicies	= new ArrayList<File>();
-        
-        private void setXACMLProperty(String propertyName, List<File> listFiles) {
-                Iterator<File> iterFiles			= listFiles.iterator();
-                StringBuilder stringBuilderIdList	= new StringBuilder();
-                while (iterFiles.hasNext()) {
-                        File file	= iterFiles.next();
-                        if (stringBuilderIdList.length() > 0) {
-                                stringBuilderIdList.append(',');
-                        }
-                        stringBuilderIdList.append(file.getName());
-                        
-                        XACMLProperties.setProperty(file.getName() + StdPolicyFinderFactory.PROP_FILE, file.getAbsolutePath());
+    private List<File> rootPolicies			= new ArrayList<File>();
+    private List<File> referencedPolicies	= new ArrayList<File>();
+
+    private void setXACMLProperty(String propertyName, List<File> listFiles) {
+        Iterator<File> iterFiles			= listFiles.iterator();
+        StringBuilder stringBuilderIdList	= new StringBuilder();
+        while (iterFiles.hasNext()) {
+            File file	= iterFiles.next();
+            if (stringBuilderIdList.length() > 0) {
+                stringBuilderIdList.append(',');
+            }
+            stringBuilderIdList.append(file.getName());
+
+            XACMLProperties.setProperty(file.getName() + StdPolicyFinderFactory.PROP_FILE, file.getAbsolutePath());
+        }
+        XACMLProperties.setProperty(propertyName, stringBuilderIdList.toString());
+    }
+
+    public ConformanceRepository() {
+    }
+
+    public void setXACMLProperties() {
+        if (this.rootPolicies.size() > 0) {
+            this.setXACMLProperty(XACMLProperties.PROP_ROOTPOLICIES, this.rootPolicies);
+        }
+        if (this.referencedPolicies.size() > 0) {
+            this.setXACMLProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, this.referencedPolicies);
+        }
+    }
+
+    private void loadProperty(File fileDir, Properties properties, String propertyName, List<File> listFiles) {
+        String fileNameList	= properties.getProperty(propertyName);
+        if (fileNameList != null) {
+            String[] fileNameArray	= fileNameList.split("[,]",0);
+            if (fileNameArray != null && fileNameArray.length > 0) {
+                for (String fileName : fileNameArray) {
+                    File file	= new File(fileDir, fileName);
+                    if (file.exists() && file.canRead()) {
+                        listFiles.add(file);
+                    }
                 }
-                XACMLProperties.setProperty(propertyName, stringBuilderIdList.toString());
+            }
         }
-        
-        public ConformanceRepository() {
+    }
+
+    public void load(File fileRepository) throws IOException {
+        Properties propertiesRepository	= new Properties();
+        try (InputStream is = new FileInputStream(fileRepository)) {
+            propertiesRepository.load(is);
         }
-        
-        public void setXACMLProperties() {
-                if (this.rootPolicies.size() > 0) {
-                        this.setXACMLProperty(XACMLProperties.PROP_ROOTPOLICIES, this.rootPolicies);
-                }
-                if (this.referencedPolicies.size() > 0) {
-                        this.setXACMLProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, this.referencedPolicies);
-                }
+        this.loadProperty(fileRepository.getParentFile(), propertiesRepository, XACMLProperties.PROP_ROOTPOLICIES, this.rootPolicies);
+        this.loadProperty(fileRepository.getParentFile(), propertiesRepository, XACMLProperties.PROP_REFERENCEDPOLICIES, this.referencedPolicies);
+    }
+
+    public void addRootPolicy(File filePolicy) {
+        this.rootPolicies.add(filePolicy);
+    }
+
+    public boolean hasRootPolicy() {
+        return (this.rootPolicies.size() > 0);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        boolean needComma			= false;
+
+        if (this.rootPolicies != null && this.rootPolicies.size() > 0) {
+            stringBuilder.append("rootPolicies=");
+            stringBuilder.append(StringUtils.toString(this.rootPolicies.iterator()));
+            needComma	= true;
         }
-        
-        private void loadProperty(File fileDir, Properties properties, String propertyName, List<File> listFiles) {
-                String fileNameList	= properties.getProperty(propertyName);
-                if (fileNameList != null) {
-                        String[] fileNameArray	= fileNameList.split("[,]",0);
-                        if (fileNameArray != null && fileNameArray.length > 0) {
-                                for (String fileName : fileNameArray) {
-                                        File file	= new File(fileDir, fileName);
-                                        if (file.exists() && file.canRead()) {
-                                                listFiles.add(file);
-                                        }
-                                }
-                        }
-                }
+        if (this.referencedPolicies != null && this.referencedPolicies.size() > 0) {
+            if (needComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("referencedPolicies=");
+            stringBuilder.append(StringUtils.toString(this.referencedPolicies.iterator()));
+            needComma	= true;
         }
-        
-        public void load(File fileRepository) throws IOException {
-                Properties propertiesRepository	= new Properties();
-                try (InputStream is = new FileInputStream(fileRepository)) {
-                        propertiesRepository.load(is);
-                }
-                this.loadProperty(fileRepository.getParentFile(), propertiesRepository, XACMLProperties.PROP_ROOTPOLICIES, this.rootPolicies);
-                this.loadProperty(fileRepository.getParentFile(), propertiesRepository, XACMLProperties.PROP_REFERENCEDPOLICIES, this.referencedPolicies);
-        }
-        
-        public void addRootPolicy(File filePolicy) {
-                this.rootPolicies.add(filePolicy);
-        }
-        
-        public boolean hasRootPolicy() {
-                return (this.rootPolicies.size() > 0);
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                boolean needComma			= false;
-                
-                if (this.rootPolicies != null && this.rootPolicies.size() > 0) {
-                        stringBuilder.append("rootPolicies=");
-                        stringBuilder.append(StringUtils.toString(this.rootPolicies.iterator()));
-                        needComma	= true;
-                }
-                if (this.referencedPolicies != null && this.referencedPolicies.size() > 0) {
-                        if (needComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("referencedPolicies=");
-                        stringBuilder.append(StringUtils.toString(this.referencedPolicies.iterator()));
-                        needComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
-        
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceScopeResolver.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceScopeResolver.java
index 77643ec..4b8a4e5 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceScopeResolver.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceScopeResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -55,78 +55,78 @@
 /**
  * ConformanceScopeResolver implements {@link com.att.research.xacml.pdp.ScopeResolver} for the conformance tests
  * using a fixed set of hierarchical resources defined in a map.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class ConformanceScopeResolver implements ScopeResolver {
-        private Log logger									= LogFactory.getLog(ConformanceScopeResolver.class);
-        private Map<URI, List<URI>> mapIdentifierToChildren	= new HashMap<URI,List<URI>>();
-        
-        public ConformanceScopeResolver() {
+    private Log logger									= LogFactory.getLog(ConformanceScopeResolver.class);
+    private Map<URI, List<URI>> mapIdentifierToChildren	= new HashMap<URI,List<URI>>();
+
+    public ConformanceScopeResolver() {
+    }
+
+    public void add(URI identifierRoot, URI identifierChild) {
+        List<URI> listChildrenRoot	= this.mapIdentifierToChildren.get(identifierRoot);
+        if (listChildrenRoot == null) {
+            listChildrenRoot	= new ArrayList<URI>();
+            this.mapIdentifierToChildren.put(identifierRoot, listChildrenRoot);
         }
-        
-        public void add(URI identifierRoot, URI identifierChild) {
-                List<URI> listChildrenRoot	= this.mapIdentifierToChildren.get(identifierRoot);
-                if (listChildrenRoot == null) {
-                        listChildrenRoot	= new ArrayList<URI>();
-                        this.mapIdentifierToChildren.put(identifierRoot, listChildrenRoot);
+        listChildrenRoot.add(identifierChild);
+    }
+
+    private void addChildren(Attribute attributeResourceId, URI urnResourceIdValue, boolean bDescendants, List<Attribute> listAttributes) {
+        List<URI> listChildren	= this.mapIdentifierToChildren.get(urnResourceIdValue);
+        if (listChildren != null) {
+            for (URI uriChild : listChildren) {
+                AttributeValue<URI> attributeValueURI	= null;
+                try {
+                    attributeValueURI	= DataTypes.DT_ANYURI.createAttributeValue(uriChild);
+                    if (attributeValueURI != null) {
+                        listAttributes.add(new StdMutableAttribute(attributeResourceId.getCategory(), attributeResourceId.getAttributeId(), attributeValueURI, attributeResourceId.getIssuer(), attributeResourceId.getIncludeInResults()));
+                    }
+                } catch (Exception ex) {
+                    this.logger.error("Exception converting URI to an AttributeValue");
                 }
-                listChildrenRoot.add(identifierChild);
-        }
-        
-        private void addChildren(Attribute attributeResourceId, URI urnResourceIdValue, boolean bDescendants, List<Attribute> listAttributes) {
-                List<URI> listChildren	= this.mapIdentifierToChildren.get(urnResourceIdValue);
-                if (listChildren != null) {
-                        for (URI uriChild : listChildren) {
-                                AttributeValue<URI> attributeValueURI	= null;
-                                try {
-                                        attributeValueURI	= DataTypes.DT_ANYURI.createAttributeValue(uriChild);
-                                        if (attributeValueURI != null) {
-                                                listAttributes.add(new StdMutableAttribute(attributeResourceId.getCategory(), attributeResourceId.getAttributeId(), attributeValueURI, attributeResourceId.getIssuer(), attributeResourceId.getIncludeInResults()));
-                                        }
-                                } catch (Exception ex) {
-                                        this.logger.error("Exception converting URI to an AttributeValue");
-                                }
-                                if (bDescendants) {
-                                        this.addChildren(attributeResourceId, uriChild, bDescendants, listAttributes);
-                                }
-                        }
+                if (bDescendants) {
+                    this.addChildren(attributeResourceId, uriChild, bDescendants, listAttributes);
                 }
+            }
         }
-        
-        private void addChildren(Attribute attributeResourceId, boolean bDescendants, List<Attribute> listAttributes) {
-                /*
-                 * Iterate over the values that are URNs
-                 */
-                Iterator<AttributeValue<URI>> iterAttributeValueURNs	= attributeResourceId.findValues(DataTypes.DT_ANYURI);
-                if (iterAttributeValueURNs != null) {
-                        while (iterAttributeValueURNs.hasNext()) {
-                                this.addChildren(attributeResourceId, iterAttributeValueURNs.next().getValue(), bDescendants, listAttributes);
-                        }
-                }
+    }
+
+    private void addChildren(Attribute attributeResourceId, boolean bDescendants, List<Attribute> listAttributes) {
+        /*
+         * Iterate over the values that are URNs
+         */
+        Iterator<AttributeValue<URI>> iterAttributeValueURNs	= attributeResourceId.findValues(DataTypes.DT_ANYURI);
+        if (iterAttributeValueURNs != null) {
+            while (iterAttributeValueURNs.hasNext()) {
+                this.addChildren(attributeResourceId, iterAttributeValueURNs.next().getValue(), bDescendants, listAttributes);
+            }
         }
-        
-        @Override
-        public ScopeResolverResult resolveScope(Attribute attributeResourceId, ScopeQualifier scopeQualifier) throws ScopeResolverException {
-                List<Attribute> listAttributes	= new ArrayList<Attribute>();
-                switch(scopeQualifier) {
-                case CHILDREN:
-                        listAttributes.add(attributeResourceId);
-                        this.addChildren(attributeResourceId, false, listAttributes);
-                        break;
-                case DESCENDANTS:
-                        listAttributes.add(attributeResourceId);
-                        this.addChildren(attributeResourceId, true, listAttributes);
-                        break;
-                case IMMEDIATE:
-                        listAttributes.add(attributeResourceId);
-                        break;
-                default:
-                        this.logger.error("Unknown ScopeQualifier: " + scopeQualifier.name());
-                        return new StdScopeResolverResult(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Unknown ScopeQualifier " + scopeQualifier.name()));
-                }
-                return new StdScopeResolverResult(listAttributes);
+    }
+
+    @Override
+    public ScopeResolverResult resolveScope(Attribute attributeResourceId, ScopeQualifier scopeQualifier) throws ScopeResolverException {
+        List<Attribute> listAttributes	= new ArrayList<Attribute>();
+        switch(scopeQualifier) {
+        case CHILDREN:
+            listAttributes.add(attributeResourceId);
+            this.addChildren(attributeResourceId, false, listAttributes);
+            break;
+        case DESCENDANTS:
+            listAttributes.add(attributeResourceId);
+            this.addChildren(attributeResourceId, true, listAttributes);
+            break;
+        case IMMEDIATE:
+            listAttributes.add(attributeResourceId);
+            break;
+        default:
+            this.logger.error("Unknown ScopeQualifier: " + scopeQualifier.name());
+            return new StdScopeResolverResult(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Unknown ScopeQualifier " + scopeQualifier.name()));
         }
+        return new StdScopeResolverResult(listAttributes);
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTest.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTest.java
index 82b5830..9fd8278 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTest.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,82 +34,82 @@
 
 /**
  * ConformanceTest represents a collection of XACML files with a root Policy document, optional referenced Policy documents, a Request, and a Response.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class ConformanceTest {
-        private String testName;
-        private File request;
-        private File response;
-        private ConformanceRepository repository;
-        
-        public ConformanceTest(String name, ConformanceRepository conformanceRepository, File fileRequest, File fileResponse) {
-                this.testName	= name;
-                this.request	= fileRequest;
-                this.response	= fileResponse;
-                this.repository	= conformanceRepository;
+    private String testName;
+    private File request;
+    private File response;
+    private ConformanceRepository repository;
+
+    public ConformanceTest(String name, ConformanceRepository conformanceRepository, File fileRequest, File fileResponse) {
+        this.testName	= name;
+        this.request	= fileRequest;
+        this.response	= fileResponse;
+        this.repository	= conformanceRepository;
+    }
+
+    public ConformanceTest(String name) {
+        this.testName	= name;
+    }
+
+    public String getTestName() {
+        return this.testName;
+    }
+    public void setTestName(String s) {
+        this.testName	= s;
+    }
+    public ConformanceRepository getRepository() {
+        if (this.repository == null) {
+            this.repository	= new ConformanceRepository();
         }
-        
-        public ConformanceTest(String name) {
-                this.testName	= name;
+        return this.repository;
+    }
+    public File getRequest() {
+        return this.request;
+    }
+    public void setRequest(File f) {
+        this.request	= f;
+    }
+    public File getResponse() {
+        return this.response;
+    }
+    public void setResponse(File f) {
+        this.response	= f;
+    }
+
+    public boolean isComplete() {
+        return this.getTestName() != null && this.getRepository() != null && this.getRepository().hasRootPolicy() && this.getRequest() != null && this.getResponse() != null;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder();
+        boolean needColon			= false;
+        if (this.getTestName() != null) {
+            stringBuilder.append(this.getTestName());
+            needColon	= true;
         }
-        
-        public String getTestName() {
-                return this.testName;
+        if (this.getRepository() != null) {
+
         }
-        public void setTestName(String s) {
-                this.testName	= s;
+        if (this.getRequest() != null) {
+            if (needColon) {
+                stringBuilder.append(':');
+            }
+            stringBuilder.append(this.getRequest().getName());
+            needColon	= true;
         }
-        public ConformanceRepository getRepository() {
-                if (this.repository == null) {
-                        this.repository	= new ConformanceRepository();
-                }
-                return this.repository;
+        if (this.getResponse() != null) {
+            if (needColon) {
+                stringBuilder.append(':');
+            }
+            stringBuilder.append(this.getResponse().getName());
+            needColon	= true;
         }
-        public File getRequest() {
-                return this.request;
-        }
-        public void setRequest(File f) {
-                this.request	= f;
-        }
-        public File getResponse() {
-                return this.response;
-        }
-        public void setResponse(File f) {
-                this.response	= f;
-        }
-        
-        public boolean isComplete() {
-                return this.getTestName() != null && this.getRepository() != null && this.getRepository().hasRootPolicy() && this.getRequest() != null && this.getResponse() != null;
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder();
-                boolean needColon			= false;
-                if (this.getTestName() != null) {
-                        stringBuilder.append(this.getTestName());
-                        needColon	= true;
-                }
-                if (this.getRepository() != null) {
-                        
-                }
-                if (this.getRequest() != null) {
-                        if (needColon) {
-                                stringBuilder.append(':');
-                        }
-                        stringBuilder.append(this.getRequest().getName());
-                        needColon	= true;
-                }
-                if (this.getResponse() != null) {
-                        if (needColon) {
-                                stringBuilder.append(':');
-                        }
-                        stringBuilder.append(this.getResponse().getName());
-                        needColon	= true;
-                }
-                return stringBuilder.toString();
-        }
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestEngine.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestEngine.java
index 1bd392f..91dc25a 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestEngine.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,186 +45,186 @@
 
 /**
  * ConformanceTestEngine handles the creation of the PDPEngine for a ConformanceTest instance.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class ConformanceTestEngine {
-        private Log logger	= LogFactory.getLog(ConformanceTestEngine.class);
-        
-        private PDPEngineFactory pdpEngineFactory;
-        private ScopeResolver scopeResolver;
-        private boolean lenientRequests;
-        private boolean lenientPolicies;
-        private int iterations			= 1;
-        
-        // total of all first calls to decide()
-        private long firstDecideTime;
-        private int numberOfFirstDecides = 0;
-        
-        // total of all non-first-calls to decide()
-        private long decideTimeMultiple;
-        
-        // total of average time each test case uses for a Request
-        // (sum of : for each test case, average of all non-first-call calls to decide() )
-        private long avgDecideTimeMultiple = 0;
-        
-        protected PDPEngineFactory getPDPEngineFactory() throws FactoryException {
-                if (this.pdpEngineFactory == null) {
-                        this.pdpEngineFactory	= PDPEngineFactory.newInstance();
-                        this.pdpEngineFactory.setScopeResolver(this.scopeResolver);
-                }
-                return this.pdpEngineFactory;
+    private Log logger	= LogFactory.getLog(ConformanceTestEngine.class);
+
+    private PDPEngineFactory pdpEngineFactory;
+    private ScopeResolver scopeResolver;
+    private boolean lenientRequests;
+    private boolean lenientPolicies;
+    private int iterations			= 1;
+
+    // total of all first calls to decide()
+    private long firstDecideTime;
+    private int numberOfFirstDecides = 0;
+
+    // total of all non-first-calls to decide()
+    private long decideTimeMultiple;
+
+    // total of average time each test case uses for a Request
+    // (sum of : for each test case, average of all non-first-call calls to decide() )
+    private long avgDecideTimeMultiple = 0;
+
+    protected PDPEngineFactory getPDPEngineFactory() throws FactoryException {
+        if (this.pdpEngineFactory == null) {
+            this.pdpEngineFactory	= PDPEngineFactory.newInstance();
+            this.pdpEngineFactory.setScopeResolver(this.scopeResolver);
         }
-        
-        public ConformanceTestEngine(ScopeResolver scopeResolverIn, boolean lenientRequestsIn, boolean lenientPoliciesIn, int iterationsIn) {
-                this.scopeResolver		= scopeResolverIn;
-                this.lenientRequests	= lenientRequestsIn;
-                this.lenientPolicies	= lenientPoliciesIn;
-                this.iterations			= iterationsIn;
+        return this.pdpEngineFactory;
+    }
+
+    public ConformanceTestEngine(ScopeResolver scopeResolverIn, boolean lenientRequestsIn, boolean lenientPoliciesIn, int iterationsIn) {
+        this.scopeResolver		= scopeResolverIn;
+        this.lenientRequests	= lenientRequestsIn;
+        this.lenientPolicies	= lenientPoliciesIn;
+        this.iterations			= iterationsIn;
+    }
+
+    public ConformanceTestResult run(ConformanceTest conformanceTest) {
+        if (conformanceTest.getRequest() == null || conformanceTest.getResponse() == null || conformanceTest.getRepository() == null) {
+            logger.error("Incomplete Conformance Test: " + conformanceTest.getTestName());
         }
-        
-        public ConformanceTestResult run(ConformanceTest conformanceTest) {
-                if (conformanceTest.getRequest() == null || conformanceTest.getResponse() == null || conformanceTest.getRepository() == null) {
-                        logger.error("Incomplete Conformance Test: " + conformanceTest.getTestName());
-                }
-                PDPEngineFactory thisPDPEngineFactory	= null;
-                try {
-                        thisPDPEngineFactory	= this.getPDPEngineFactory();
-                } catch (FactoryException ex) {
-                        return new ConformanceTestResult(conformanceTest, ex);
-                }
-                
-                ConformanceTestResult conformanceTestResult	= new ConformanceTestResult(conformanceTest, iterations);
-                
-                /*
-                 * Load the request
-                 */
-                Request request			= null;
-                boolean isLenient		= DOMProperties.isLenient();
-                try {
-                        DOMProperties.setLenient(this.lenientRequests);
-                        try {
-                                request		= DOMRequest.load(conformanceTest.getRequest());
-                                conformanceTestResult.setRequest(request);
-                        } catch (Exception ex) {
-                                logger.error("Exception loading Request file " + conformanceTest.getRequest().getAbsolutePath(), ex);
-                                conformanceTestResult.setError(ex);
-                                return conformanceTestResult;
-                                
-                        }
-                        
-                        /*
-                         * Load the expected response
-                         */
-                        Response response		= null;
-                        try {
-                                response	= DOMResponse.load(conformanceTest.getResponse());
-                                conformanceTestResult.setExpectedResponse(response);
-                        } catch (Exception ex) {
-                                logger.error("Exception loading Response file " + conformanceTest.getResponse().getAbsolutePath(), ex);
-                                conformanceTestResult.setError(ex);
-                                return conformanceTestResult;
-                        }
-                        
-                        /*
-                         * Set up the configuration for the policy finder
-                         */
-                        conformanceTest.getRepository().setXACMLProperties();
-                        DOMProperties.setLenient(this.lenientPolicies);
-                        
-                        /*
-                         * Create the engine
-                         */
-                        PDPEngine pdpEngine		= null;
-                        try {
-                                // pdpEngine	= thisPDPEngineFactory.newEngine(conformanceTest.getRootPolicy(), conformanceTest.getReferencedPolicies(), pipFinderEngine);
-                                pdpEngine		= thisPDPEngineFactory.newEngine();
-                        } catch (Exception ex) {
-                                logger.error("Exception getting PDP engine instance", ex);
-                                conformanceTestResult.setError(ex);
-                                return conformanceTestResult;
-                        }
-                        if (pdpEngine == null) {
-                                logger.error("Null PDP engine");
-                                conformanceTestResult.setError(new NullPointerException("Null engine"));
-                                return conformanceTestResult;
-                        }
-                        
-                        /*
-                         * Run the request
-                         */
-                        long startTime, endTime;
-                        long curDecideTime	= this.firstDecideTime;
-                        try {
-                                startTime	= System.nanoTime();
-                                response	= pdpEngine.decide(request);
-                                endTime = System.nanoTime();
+        PDPEngineFactory thisPDPEngineFactory	= null;
+        try {
+            thisPDPEngineFactory	= this.getPDPEngineFactory();
+        } catch (FactoryException ex) {
+            return new ConformanceTestResult(conformanceTest, ex);
+        }
+
+        ConformanceTestResult conformanceTestResult	= new ConformanceTestResult(conformanceTest, iterations);
+
+        /*
+         * Load the request
+         */
+        Request request			= null;
+        boolean isLenient		= DOMProperties.isLenient();
+        try {
+            DOMProperties.setLenient(this.lenientRequests);
+            try {
+                request		= DOMRequest.load(conformanceTest.getRequest());
+                conformanceTestResult.setRequest(request);
+            } catch (Exception ex) {
+                logger.error("Exception loading Request file " + conformanceTest.getRequest().getAbsolutePath(), ex);
+                conformanceTestResult.setError(ex);
+                return conformanceTestResult;
+
+            }
+
+            /*
+             * Load the expected response
+             */
+            Response response		= null;
+            try {
+                response	= DOMResponse.load(conformanceTest.getResponse());
+                conformanceTestResult.setExpectedResponse(response);
+            } catch (Exception ex) {
+                logger.error("Exception loading Response file " + conformanceTest.getResponse().getAbsolutePath(), ex);
+                conformanceTestResult.setError(ex);
+                return conformanceTestResult;
+            }
+
+            /*
+             * Set up the configuration for the policy finder
+             */
+            conformanceTest.getRepository().setXACMLProperties();
+            DOMProperties.setLenient(this.lenientPolicies);
+
+            /*
+             * Create the engine
+             */
+            PDPEngine pdpEngine		= null;
+            try {
+                // pdpEngine	= thisPDPEngineFactory.newEngine(conformanceTest.getRootPolicy(), conformanceTest.getReferencedPolicies(), pipFinderEngine);
+                pdpEngine		= thisPDPEngineFactory.newEngine();
+            } catch (Exception ex) {
+                logger.error("Exception getting PDP engine instance", ex);
+                conformanceTestResult.setError(ex);
+                return conformanceTestResult;
+            }
+            if (pdpEngine == null) {
+                logger.error("Null PDP engine");
+                conformanceTestResult.setError(new NullPointerException("Null engine"));
+                return conformanceTestResult;
+            }
+
+            /*
+             * Run the request
+             */
+            long startTime, endTime;
+            long curDecideTime	= this.firstDecideTime;
+            try {
+                startTime	= System.nanoTime();
+                response	= pdpEngine.decide(request);
+                endTime = System.nanoTime();
 //System.out.println(endTime  - startTime);
-                                // add to total
-                                this.firstDecideTime	+= endTime - startTime;
-                                this.numberOfFirstDecides++;
-                                // remember just this test
-                                conformanceTestResult.setFirstCallTime(endTime - startTime);
-                                conformanceTestResult.setActualResponse(response);
-                        } catch (Exception ex) {
-                                logger.error("Exception in decide", ex);
-                                conformanceTestResult.setError(ex);
-                                return conformanceTestResult;
-                        }
-                        if (response == null) {
-                                logger.error("Null Response");
-                                conformanceTestResult.setError(new NullPointerException("Null Response"));
-                                return conformanceTestResult;			
-                        }
-                        
-                        long localLoopTime = 0;
-                        try {
-                                // if user requested non-first-call calls to decide() to get performance info, run them now.
-                                // We can ignore the result since we are only interested in how long they take to process the Request.
-                                for (int i = 0 ; i < this.iterations ; i++) {
-                                        startTime	= System.nanoTime();
-                                        pdpEngine.decide(request);
-                                        endTime = System.nanoTime();
-//System.out.println(endTime - startTime);					
-                                        // add to the global total for all tests
-                                        this.decideTimeMultiple	+= (endTime - startTime);
-                                        // remember just this one test's info
-                                        localLoopTime += (endTime - startTime);
-                                }
-                        } catch (Exception ex) {
-                                logger.error("Exception in iterated decide", ex);
-                                return conformanceTestResult;
-                        }
+                // add to total
+                this.firstDecideTime	+= endTime - startTime;
+                this.numberOfFirstDecides++;
+                // remember just this test
+                conformanceTestResult.setFirstCallTime(endTime - startTime);
+                conformanceTestResult.setActualResponse(response);
+            } catch (Exception ex) {
+                logger.error("Exception in decide", ex);
+                conformanceTestResult.setError(ex);
+                return conformanceTestResult;
+            }
+            if (response == null) {
+                logger.error("Null Response");
+                conformanceTestResult.setError(new NullPointerException("Null Response"));
+                return conformanceTestResult;
+            }
 
-                        // add to total average for non-first-call times for all test cases
-                        avgDecideTimeMultiple += (localLoopTime / iterations);
-//System.out.println("localLoop="+localLoopTime + "   it="+iterations + "   avg=" + (localLoopTime / iterations) );
-                        // remember average time for just this test
-                        conformanceTestResult.setAverageTotalLoopTime(localLoopTime/iterations);
-                        
-                        long elapsedDecideTime	= this.firstDecideTime - curDecideTime;
-                        logger.info("Decide Time: " + elapsedDecideTime + "ns");
-                        
-                        return conformanceTestResult;
-                } finally {
-                        DOMProperties.setLenient(isLenient);
+            long localLoopTime = 0;
+            try {
+                // if user requested non-first-call calls to decide() to get performance info, run them now.
+                // We can ignore the result since we are only interested in how long they take to process the Request.
+                for (int i = 0 ; i < this.iterations ; i++) {
+                    startTime	= System.nanoTime();
+                    pdpEngine.decide(request);
+                    endTime = System.nanoTime();
+//System.out.println(endTime - startTime);
+                    // add to the global total for all tests
+                    this.decideTimeMultiple	+= (endTime - startTime);
+                    // remember just this one test's info
+                    localLoopTime += (endTime - startTime);
                 }
-        }
+            } catch (Exception ex) {
+                logger.error("Exception in iterated decide", ex);
+                return conformanceTestResult;
+            }
 
-        public long getFirstDecideTime() {
-                return this.firstDecideTime;
+            // add to total average for non-first-call times for all test cases
+            avgDecideTimeMultiple += (localLoopTime / iterations);
+//System.out.println("localLoop="+localLoopTime + "   it="+iterations + "   avg=" + (localLoopTime / iterations) );
+            // remember average time for just this test
+            conformanceTestResult.setAverageTotalLoopTime(localLoopTime/iterations);
+
+            long elapsedDecideTime	= this.firstDecideTime - curDecideTime;
+            logger.info("Decide Time: " + elapsedDecideTime + "ns");
+
+            return conformanceTestResult;
+        } finally {
+            DOMProperties.setLenient(isLenient);
         }
-        
-        public long getDecideTimeMultiple() {
-                return this.decideTimeMultiple;
-        }
-        
-        
-        public long getAvgFirstDecideTime() {
-                return this.firstDecideTime / numberOfFirstDecides;
-        }
-        public long getAvgDecideTimeMultiple() {
-                return this.avgDecideTimeMultiple / numberOfFirstDecides;
-        }
+    }
+
+    public long getFirstDecideTime() {
+        return this.firstDecideTime;
+    }
+
+    public long getDecideTimeMultiple() {
+        return this.decideTimeMultiple;
+    }
+
+
+    public long getAvgFirstDecideTime() {
+        return this.firstDecideTime / numberOfFirstDecides;
+    }
+    public long getAvgDecideTimeMultiple() {
+        return this.avgDecideTimeMultiple / numberOfFirstDecides;
+    }
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestResult.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestResult.java
index 7dc5dab..00fea1b 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestResult.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,99 +35,99 @@
 
 /**
  * ConformanceTestResult holds all of the objects for a single conformance test run.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ConformanceTestResult {
-        private ConformanceTest		conformanceTest;
-        private Request				request;
-        private Response			expectedResponse;
-        private Response			actualResponse;
-        private ResponseMatchResult	responseMatchResult;
-        private Exception			error;
-        
-        // performance timings
-        private long 			firstCallTime;
-        private long 			averageTotalLoopTime;
-        
-        // how many non-first-call times the decide() was called
-        private int iterations;
-        
-        public ConformanceTestResult(ConformanceTest conformanceTestIn, int iterations) {
-                this.conformanceTest	= conformanceTestIn;
-                this.iterations = iterations;
-        }
-        
-        public ConformanceTestResult(ConformanceTest conformanceTestIn, Exception errorIn) {
-                this.conformanceTest	= conformanceTestIn;
-                this.error				= errorIn;
-        }
-        
-        public int getIterations() {
-                return this.iterations;
-        }
+    private ConformanceTest		conformanceTest;
+    private Request				request;
+    private Response			expectedResponse;
+    private Response			actualResponse;
+    private ResponseMatchResult	responseMatchResult;
+    private Exception			error;
 
-        public ConformanceTest getConformanceTest() {
-                return this.conformanceTest;
+    // performance timings
+    private long 			firstCallTime;
+    private long 			averageTotalLoopTime;
+
+    // how many non-first-call times the decide() was called
+    private int iterations;
+
+    public ConformanceTestResult(ConformanceTest conformanceTestIn, int iterations) {
+        this.conformanceTest	= conformanceTestIn;
+        this.iterations = iterations;
+    }
+
+    public ConformanceTestResult(ConformanceTest conformanceTestIn, Exception errorIn) {
+        this.conformanceTest	= conformanceTestIn;
+        this.error				= errorIn;
+    }
+
+    public int getIterations() {
+        return this.iterations;
+    }
+
+    public ConformanceTest getConformanceTest() {
+        return this.conformanceTest;
+    }
+    public void setConformanceTest(ConformanceTest conformanceTestIn) {
+        this.conformanceTest	= conformanceTestIn;
+    }
+
+    public Request getRequest() {
+        return this.request;
+    }
+    public void setRequest(Request requestIn) {
+        this.request	= requestIn;
+    }
+
+    public Response getExpectedResponse() {
+        return this.expectedResponse;
+    }
+    public void setExpectedResponse(Response response) {
+        this.expectedResponse		= response;
+        this.responseMatchResult	= null;
+    }
+
+    public Response getActualResponse() {
+        return this.actualResponse;
+    }
+    public void setActualResponse(Response response) {
+        this.actualResponse		= response;
+        this.responseMatchResult	= null;
+    }
+
+    public ResponseMatchResult getResponseMatchResult() {
+        if (this.responseMatchResult == null && (this.actualResponse != null && this.expectedResponse != null)) {
+            this.computeResponseMatchResult();
         }
-        public void setConformanceTest(ConformanceTest conformanceTestIn) {
-                this.conformanceTest	= conformanceTestIn;
+        return this.responseMatchResult;
+    }
+    public void computeResponseMatchResult() {
+        if (this.expectedResponse != null && this.actualResponse != null) {
+            this.responseMatchResult	= ResponseMatchResult.newInstance(this.expectedResponse, this.actualResponse);
         }
-        
-        public Request getRequest() {
-                return this.request;
-        }
-        public void setRequest(Request requestIn) {
-                this.request	= requestIn;
-        }
-        
-        public Response getExpectedResponse() {
-                return this.expectedResponse;
-        }
-        public void setExpectedResponse(Response response) {
-                this.expectedResponse		= response;
-                this.responseMatchResult	= null;
-        }
-        
-        public Response getActualResponse() {
-                return this.actualResponse;
-        }
-        public void setActualResponse(Response response) {
-                this.actualResponse		= response;
-                this.responseMatchResult	= null;
-        }
-        
-        public ResponseMatchResult getResponseMatchResult() {
-                if (this.responseMatchResult == null && (this.actualResponse != null && this.expectedResponse != null)) {
-                        this.computeResponseMatchResult();
-                }
-                return this.responseMatchResult;
-        }
-        public void computeResponseMatchResult() {
-                if (this.expectedResponse != null && this.actualResponse != null) {
-                        this.responseMatchResult	= ResponseMatchResult.newInstance(this.expectedResponse, this.actualResponse);
-                }
-        }
-        public Exception getError() {
-                return this.error;
-        }
-        public void setError(Exception ex) {
-                this.error	= ex;
-        }
-        
-        public long getFirstCallTime() {
-                return firstCallTime;
-        }
-        public void setFirstCallTime(long t) {
-                firstCallTime = t;
-        }
-        public long getAverageTotalLoopTime(){
-                return averageTotalLoopTime;
-        }
-        public void setAverageTotalLoopTime(long t) {
-                averageTotalLoopTime = t;
-        }
-        
+    }
+    public Exception getError() {
+        return this.error;
+    }
+    public void setError(Exception ex) {
+        this.error	= ex;
+    }
+
+    public long getFirstCallTime() {
+        return firstCallTime;
+    }
+    public void setFirstCallTime(long t) {
+        firstCallTime = t;
+    }
+    public long getAverageTotalLoopTime() {
+        return averageTotalLoopTime;
+    }
+    public void setAverageTotalLoopTime(long t) {
+        averageTotalLoopTime = t;
+    }
+
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestSet.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestSet.java
index 1c8e445..d72d05f 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestSet.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ConformanceTestSet.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -50,142 +50,142 @@
 /**
  * ConformanceTestSet represents a collection of <code>ConformanceTest</code>s ordered by the test name.  It has methods for
  * scanning a directory to generate an ordered set.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ConformanceTestSet {
-        private static final Log logger						= LogFactory.getLog(ConformanceTestSet.class);
-        private List<ConformanceTest> listConformanceTests	= new ArrayList<ConformanceTest>();
-        
-        protected List<ConformanceTest> getListConformanceTests() {
-                return this.listConformanceTests;
+    private static final Log logger						= LogFactory.getLog(ConformanceTestSet.class);
+    private List<ConformanceTest> listConformanceTests	= new ArrayList<ConformanceTest>();
+
+    protected List<ConformanceTest> getListConformanceTests() {
+        return this.listConformanceTests;
+    }
+
+    protected ConformanceTestSet() {
+
+    }
+
+    private static String getTestName(String fileName, int itemPos) {
+        return (itemPos == 0 ? "NULL" : fileName.substring(0, itemPos));
+    }
+
+    private static String getTestName(File file) {
+        String fileName	= file.getName();
+        int itemPos		= fileName.indexOf("Policy");
+        if (itemPos >= 0) {
+            return getTestName(fileName, itemPos);
+        } else if ((itemPos = fileName.indexOf("Request")) >= 0) {
+            return getTestName(fileName, itemPos);
+        } else if ((itemPos = fileName.indexOf("Response")) >= 0) {
+            return getTestName(fileName, itemPos);
+        } else if ((itemPos = fileName.indexOf("Repository")) >= 0) {
+            return getTestName(fileName, itemPos);
+        } else {
+            return null;
         }
-        
-        protected ConformanceTestSet() {
-                
+    }
+
+    public static ConformanceTestSet loadDirectory(File fileDir) throws IOException {
+        final Map<String,ConformanceTest> mapConformanceTests	= new HashMap<String,ConformanceTest>();
+
+        Files.walkFileTree(fileDir.toPath(), new FileVisitor<Path>() {
+            @Override
+            public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
+                logger.info("Scanning directory " + dir.getFileName());
+                return FileVisitResult.CONTINUE;
+            }
+
+            @Override
+            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+                File fileVisited	= file.toFile();
+                String fileName		= fileVisited.getName();
+                if (fileName.endsWith(".xml") || fileName.endsWith(".properties")) {
+                    String testName	= getTestName(fileVisited);
+                    if (testName != null) {
+                        ConformanceTest conformanceTest	= mapConformanceTests.get(testName);
+                        if (conformanceTest == null) {
+                            logger.info("Added test " + testName);
+                            conformanceTest	= new ConformanceTest(testName);
+                            mapConformanceTests.put(testName, conformanceTest);
+                        }
+                        if (fileName.endsWith("Policy.xml")) {
+                            conformanceTest.getRepository().addRootPolicy(fileVisited);
+                        } else if (fileName.endsWith("Repository.properties")) {
+                            conformanceTest.getRepository().load(fileVisited);
+                        } else if (fileName.endsWith("Request.xml")) {
+                            conformanceTest.setRequest(fileVisited);
+                        } else if (fileName.endsWith("Response.xml")) {
+                            conformanceTest.setResponse(fileVisited);
+                        }
+                    }
+                }
+                return FileVisitResult.CONTINUE;
+            }
+
+            @Override
+            public FileVisitResult visitFileFailed(Path file, IOException exc) 	throws IOException {
+                logger.warn("Skipped " + file.getFileName());
+                return FileVisitResult.CONTINUE;
+            }
+
+            @Override
+            public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
+                return FileVisitResult.CONTINUE;
+            }
+        });
+
+        /*
+         * Sort the keyset and pull out the tests that have the required components
+         */
+        List<String> listTestNames	= new ArrayList<String>();
+        listTestNames.addAll(mapConformanceTests.keySet());
+        Collections.sort(listTestNames);
+
+        ConformanceTestSet conformanceTestSet	= new ConformanceTestSet();
+        Iterator<String> iterTestNames	= listTestNames.iterator();
+        while (iterTestNames.hasNext()) {
+            ConformanceTest	conformanceTest	= mapConformanceTests.get(iterTestNames.next());
+            if (conformanceTest.isComplete()) {
+                conformanceTestSet.addConformanceTest(conformanceTest);
+                logger.debug("Added conformance test " + conformanceTest.getTestName());
+            } else {
+                logger.warn("Incomplete conformance test " + conformanceTest.getTestName());
+            }
         }
-        
-        private static String getTestName(String fileName, int itemPos) {
-                return (itemPos == 0 ? "NULL" : fileName.substring(0, itemPos));
-        }
-        
-        private static String getTestName(File file) {
-                String fileName	= file.getName();
-                int itemPos		= fileName.indexOf("Policy");
-                if (itemPos >= 0) {
-                        return getTestName(fileName, itemPos);
-                } else if ((itemPos = fileName.indexOf("Request")) >= 0) {
-                        return getTestName(fileName, itemPos);
-                } else if ((itemPos = fileName.indexOf("Response")) >= 0) {
-                        return getTestName(fileName, itemPos);
-                } else if ((itemPos = fileName.indexOf("Repository")) >= 0) {
-                        return getTestName(fileName, itemPos);
+
+        return conformanceTestSet;
+
+    }
+
+    public Iterator<ConformanceTest> getConformanceTests() {
+        return this.listConformanceTests.iterator();
+    }
+
+    public void addConformanceTest(ConformanceTest conformanceTest) {
+        this.listConformanceTests.add(conformanceTest);
+    }
+
+    public void addConformanceTestSet(ConformanceTestSet conformanceTestSet) {
+        this.listConformanceTests.addAll(conformanceTestSet.getListConformanceTests());
+    }
+
+    public static void main(String[] args) {
+        for (String dir : args) {
+            try {
+                ConformanceTestSet conformanceTestSet			= ConformanceTestSet.loadDirectory(new File(dir));
+                Iterator<ConformanceTest> iterConformanceTests	= conformanceTestSet.getConformanceTests();
+                if (iterConformanceTests == null) {
+                    System.out.println("No tests found in " + dir);
                 } else {
-                        return null;
+                    System.out.println("Tests found in " + dir);
+                    while (iterConformanceTests.hasNext()) {
+                        System.out.println(iterConformanceTests.next().toString());
+                    }
                 }
+            } catch (Exception ex) {
+                ex.printStackTrace(System.err);
+            }
         }
-        
-        public static ConformanceTestSet loadDirectory(File fileDir) throws IOException {
-                final Map<String,ConformanceTest> mapConformanceTests	= new HashMap<String,ConformanceTest>();
-                
-                Files.walkFileTree(fileDir.toPath(), new FileVisitor<Path>() {
-                        @Override
-                        public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
-                                logger.info("Scanning directory " + dir.getFileName());
-                                return FileVisitResult.CONTINUE;
-                        }
-
-                        @Override
-                        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-                                File fileVisited	= file.toFile();
-                                String fileName		= fileVisited.getName();
-                                if (fileName.endsWith(".xml") || fileName.endsWith(".properties")) {
-                                        String testName	= getTestName(fileVisited);
-                                        if (testName != null) {
-                                                ConformanceTest conformanceTest	= mapConformanceTests.get(testName);
-                                                if (conformanceTest == null) {
-                                                        logger.info("Added test " + testName);
-                                                        conformanceTest	= new ConformanceTest(testName);
-                                                        mapConformanceTests.put(testName, conformanceTest);
-                                                }
-                                                if (fileName.endsWith("Policy.xml")) {
-                                                        conformanceTest.getRepository().addRootPolicy(fileVisited);
-                                                } else if (fileName.endsWith("Repository.properties")) {
-                                                        conformanceTest.getRepository().load(fileVisited);
-                                                } else if (fileName.endsWith("Request.xml")) {
-                                                        conformanceTest.setRequest(fileVisited);
-                                                } else if (fileName.endsWith("Response.xml")) {
-                                                        conformanceTest.setResponse(fileVisited);
-                                                }
-                                        }
-                                }
-                                return FileVisitResult.CONTINUE;
-                        }
-
-                        @Override
-                        public FileVisitResult visitFileFailed(Path file, IOException exc) 	throws IOException {
-                                logger.warn("Skipped " + file.getFileName());
-                                return FileVisitResult.CONTINUE;
-                        }
-
-                        @Override
-                        public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
-                                return FileVisitResult.CONTINUE;
-                        }
-                });
-                
-                /*
-                 * Sort the keyset and pull out the tests that have the required components
-                 */
-                List<String> listTestNames	= new ArrayList<String>();
-                listTestNames.addAll(mapConformanceTests.keySet());
-                Collections.sort(listTestNames);
-                
-                ConformanceTestSet conformanceTestSet	= new ConformanceTestSet();
-                Iterator<String> iterTestNames	= listTestNames.iterator();
-                while (iterTestNames.hasNext()) {
-                        ConformanceTest	conformanceTest	= mapConformanceTests.get(iterTestNames.next());
-                        if (conformanceTest.isComplete()) {
-                                conformanceTestSet.addConformanceTest(conformanceTest);
-                                logger.debug("Added conformance test " + conformanceTest.getTestName());
-                        } else {
-                                logger.warn("Incomplete conformance test " + conformanceTest.getTestName());
-                        }
-                }
-                
-                return conformanceTestSet;
-                
-        }
-
-        public Iterator<ConformanceTest> getConformanceTests() {
-                return this.listConformanceTests.iterator();
-        }
-        
-        public void addConformanceTest(ConformanceTest conformanceTest) {
-                this.listConformanceTests.add(conformanceTest);
-        }
-        
-        public void addConformanceTestSet(ConformanceTestSet conformanceTestSet) {
-                this.listConformanceTests.addAll(conformanceTestSet.getListConformanceTests());
-        }
-        
-        public static void main(String[] args) {
-                for (String dir : args) {
-                        try {
-                                ConformanceTestSet conformanceTestSet			= ConformanceTestSet.loadDirectory(new File(dir));
-                                Iterator<ConformanceTest> iterConformanceTests	= conformanceTestSet.getConformanceTests();
-                                if (iterConformanceTests == null) {
-                                        System.out.println("No tests found in " + dir);
-                                } else {
-                                        System.out.println("Tests found in " + dir);
-                                        while (iterConformanceTests.hasNext()) {
-                                                System.out.println(iterConformanceTests.next().toString());
-                                        }
-                                }
-                        } catch (Exception ex) {
-                                ex.printStackTrace(System.err);
-                        }
-                }
-        }
+    }
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ResponseMatchResult.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ResponseMatchResult.java
index fb8b748..4f9e331 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ResponseMatchResult.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ResponseMatchResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,108 +41,108 @@
 /**
  * ResponseMatchResult provides information about how a {@link com.att.research.xacml.api.Response} object matches
  * another <code>Response</code> object.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ResponseMatchResult {
-        private List<ResultMatchResult>	resultMatchResults	= new ArrayList<ResultMatchResult>();
-        
-        private boolean bAssociatedAdviceMatches			= true;
-        private boolean bAttributesMatch					= true;
-        private boolean bDecisionsMatch						= true;
-        private boolean bStatusCodesMatch					= true;
-        private boolean bObligationsMatch					= true;
-        private boolean bPolicyIdentifiersMatch				= true;
-        private boolean bPolicySetIdentifiersMatch			= true;
-        private boolean bNumResultsMatch					= true;
-        private boolean bUnknownFunction;
-        
-        protected void addResultMatchResult(ResultMatchResult resultMatchResult) {
-                this.resultMatchResults.add(resultMatchResult);
-                this.bAssociatedAdviceMatches	= resultMatchResult.associatedAdviceMatches() && this.bAssociatedAdviceMatches;
-                this.bAttributesMatch			= resultMatchResult.attributesMatch() && this.bAttributesMatch;
-                this.bDecisionsMatch			= resultMatchResult.decisionsMatch() && this.bDecisionsMatch;
-                this.bStatusCodesMatch			= resultMatchResult.statusCodesMatch() && this.bStatusCodesMatch;
-                this.bObligationsMatch			= resultMatchResult.obligationsMatch() && this.bObligationsMatch;
-                this.bPolicyIdentifiersMatch	= resultMatchResult.policyIdentifiersMatch() && this.bPolicyIdentifiersMatch;
-                this.bPolicySetIdentifiersMatch	= resultMatchResult.policySetIdentifiersMatch() && this.bPolicySetIdentifiersMatch;
-                this.bUnknownFunction			= resultMatchResult.unknownFunction() || this.bUnknownFunction;
-        }
-        
-        protected void setNumResultsMatch(boolean b) {
-                this.bNumResultsMatch	= b;
-        }
-        
-        public ResponseMatchResult() {
-        }
-        
-        public static ResponseMatchResult newInstance(Response response1, Response response2) {
-                ResponseMatchResult responseMatchResult	= new ResponseMatchResult();
+    private List<ResultMatchResult>	resultMatchResults	= new ArrayList<ResultMatchResult>();
 
-                Collection<Result> listResultsResponse1	= response1.getResults();
-                Collection<Result> listResultsResponse2	= response2.getResults();
-                if (listResultsResponse1.size() == 1 && listResultsResponse2.size() == 1) {
-                        /*
-                         * Just add a single ResultMatchResult comparing the results in the two responses
-                         */
-                        responseMatchResult.addResultMatchResult(ResultMatchResult.newInstance(listResultsResponse1.iterator().next(), listResultsResponse2.iterator().next()));
-                } else {
-                        /*
-                         * Iterate over all of the results in the two responses and match them
-                         */
-                        Iterator<Result> iterResponse1Results	= listResultsResponse1.iterator();
-                        Iterator<Result> iterResponse2Results	= listResultsResponse2.iterator();
-                        while ((iterResponse1Results != null && iterResponse1Results.hasNext()) || (iterResponse2Results != null && iterResponse2Results.hasNext())) {
-                                Result result1	= (iterResponse1Results != null && iterResponse1Results.hasNext() ? iterResponse1Results.next() : null);
-                                Result result2	= (iterResponse2Results != null && iterResponse2Results.hasNext() ? iterResponse2Results.next() : null);
-                                if ((result1 == null || result2 == null) && responseMatchResult.numResultsMatch()) {
-                                        responseMatchResult.setNumResultsMatch(false);
-                                }
-                                responseMatchResult.addResultMatchResult(ResultMatchResult.newInstance(result1, result2));
-                        }
+    private boolean bAssociatedAdviceMatches			= true;
+    private boolean bAttributesMatch					= true;
+    private boolean bDecisionsMatch						= true;
+    private boolean bStatusCodesMatch					= true;
+    private boolean bObligationsMatch					= true;
+    private boolean bPolicyIdentifiersMatch				= true;
+    private boolean bPolicySetIdentifiersMatch			= true;
+    private boolean bNumResultsMatch					= true;
+    private boolean bUnknownFunction;
+
+    protected void addResultMatchResult(ResultMatchResult resultMatchResult) {
+        this.resultMatchResults.add(resultMatchResult);
+        this.bAssociatedAdviceMatches	= resultMatchResult.associatedAdviceMatches() && this.bAssociatedAdviceMatches;
+        this.bAttributesMatch			= resultMatchResult.attributesMatch() && this.bAttributesMatch;
+        this.bDecisionsMatch			= resultMatchResult.decisionsMatch() && this.bDecisionsMatch;
+        this.bStatusCodesMatch			= resultMatchResult.statusCodesMatch() && this.bStatusCodesMatch;
+        this.bObligationsMatch			= resultMatchResult.obligationsMatch() && this.bObligationsMatch;
+        this.bPolicyIdentifiersMatch	= resultMatchResult.policyIdentifiersMatch() && this.bPolicyIdentifiersMatch;
+        this.bPolicySetIdentifiersMatch	= resultMatchResult.policySetIdentifiersMatch() && this.bPolicySetIdentifiersMatch;
+        this.bUnknownFunction			= resultMatchResult.unknownFunction() || this.bUnknownFunction;
+    }
+
+    protected void setNumResultsMatch(boolean b) {
+        this.bNumResultsMatch	= b;
+    }
+
+    public ResponseMatchResult() {
+    }
+
+    public static ResponseMatchResult newInstance(Response response1, Response response2) {
+        ResponseMatchResult responseMatchResult	= new ResponseMatchResult();
+
+        Collection<Result> listResultsResponse1	= response1.getResults();
+        Collection<Result> listResultsResponse2	= response2.getResults();
+        if (listResultsResponse1.size() == 1 && listResultsResponse2.size() == 1) {
+            /*
+             * Just add a single ResultMatchResult comparing the results in the two responses
+             */
+            responseMatchResult.addResultMatchResult(ResultMatchResult.newInstance(listResultsResponse1.iterator().next(), listResultsResponse2.iterator().next()));
+        } else {
+            /*
+             * Iterate over all of the results in the two responses and match them
+             */
+            Iterator<Result> iterResponse1Results	= listResultsResponse1.iterator();
+            Iterator<Result> iterResponse2Results	= listResultsResponse2.iterator();
+            while ((iterResponse1Results != null && iterResponse1Results.hasNext()) || (iterResponse2Results != null && iterResponse2Results.hasNext())) {
+                Result result1	= (iterResponse1Results != null && iterResponse1Results.hasNext() ? iterResponse1Results.next() : null);
+                Result result2	= (iterResponse2Results != null && iterResponse2Results.hasNext() ? iterResponse2Results.next() : null);
+                if ((result1 == null || result2 == null) && responseMatchResult.numResultsMatch()) {
+                    responseMatchResult.setNumResultsMatch(false);
                 }
-                return responseMatchResult;
+                responseMatchResult.addResultMatchResult(ResultMatchResult.newInstance(result1, result2));
+            }
         }
+        return responseMatchResult;
+    }
 
-        public Iterator<ResultMatchResult> getResultMatchResults() {
-                return this.resultMatchResults.iterator();
-        }
-        
-        public boolean numResultsMatch() {
-                return this.bNumResultsMatch;
-        }
-        
-        public boolean associatedAdviceMatches() {
-                return this.bAssociatedAdviceMatches;
-        }
-        
-        public boolean attributesMatch() {
-                return this.bAttributesMatch;
-        }
-        
-        public boolean decisionsMatch() {
-                return this.bDecisionsMatch;
-        }
-        
-        public boolean obligationsMatch() {
-                return this.bObligationsMatch;
-        }
-        
-        public boolean policyIdentifiersMatch() {
-                return this.bPolicyIdentifiersMatch;
-        }
-        
-        public boolean policySetIdentifiersMatch() {
-                return this.bPolicySetIdentifiersMatch;
-        }
-        
-        public boolean statusCodesMatch() {
-                return this.bStatusCodesMatch;
-        }
-        
-        public boolean unknownFunction() {
-                return this.bUnknownFunction;
-        }
+    public Iterator<ResultMatchResult> getResultMatchResults() {
+        return this.resultMatchResults.iterator();
+    }
+
+    public boolean numResultsMatch() {
+        return this.bNumResultsMatch;
+    }
+
+    public boolean associatedAdviceMatches() {
+        return this.bAssociatedAdviceMatches;
+    }
+
+    public boolean attributesMatch() {
+        return this.bAttributesMatch;
+    }
+
+    public boolean decisionsMatch() {
+        return this.bDecisionsMatch;
+    }
+
+    public boolean obligationsMatch() {
+        return this.bObligationsMatch;
+    }
+
+    public boolean policyIdentifiersMatch() {
+        return this.bPolicyIdentifiersMatch;
+    }
+
+    public boolean policySetIdentifiersMatch() {
+        return this.bPolicySetIdentifiersMatch;
+    }
+
+    public boolean statusCodesMatch() {
+        return this.bStatusCodesMatch;
+    }
+
+    public boolean unknownFunction() {
+        return this.bUnknownFunction;
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ResultMatchResult.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ResultMatchResult.java
index 064edf8..12eeff7 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ResultMatchResult.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/conformance/ResultMatchResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,111 +37,111 @@
 /**
  * ResultMatchResult provides information about how well a {@link com.att.research.xacml.api.Result} object matches
  * another <code>Result</code> object.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ResultMatchResult {
-        private boolean bAssociatedAdviceMatches	= true;
-        private boolean bAttributesMatch			= true;
-        private boolean bDecisionsMatch				= true;
-        private boolean bObligationsMatch			= true;
-        private boolean bPolicyIdentifiersMatch		= true;
-        private boolean bPolicySetIdentifiersMatch	= true;
-        private boolean bStatusCodesMatch			= true;
-        private boolean bUnknownFunction			= false;
-        
-        protected void setAssociatedAdviceMatches(boolean b) {
-                this.bAssociatedAdviceMatches	= b;
+    private boolean bAssociatedAdviceMatches	= true;
+    private boolean bAttributesMatch			= true;
+    private boolean bDecisionsMatch				= true;
+    private boolean bObligationsMatch			= true;
+    private boolean bPolicyIdentifiersMatch		= true;
+    private boolean bPolicySetIdentifiersMatch	= true;
+    private boolean bStatusCodesMatch			= true;
+    private boolean bUnknownFunction			= false;
+
+    protected void setAssociatedAdviceMatches(boolean b) {
+        this.bAssociatedAdviceMatches	= b;
+    }
+    protected void setAttributesMatch(boolean b) {
+        this.bAttributesMatch	= b;
+    }
+    protected void setDecisionsMatch(boolean b) {
+        this.bDecisionsMatch	= b;
+    }
+    protected void setObligationsMatch(boolean b) {
+        this.bObligationsMatch	= b;
+    }
+    protected void setPolicyIdentifiersMatch(boolean b) {
+        this.bPolicyIdentifiersMatch	= b;
+    }
+    protected void setPolicySetIdentifiersMatch(boolean b) {
+        this.bPolicySetIdentifiersMatch	= b;
+    }
+    protected void setStatusCodesMatch(boolean b) {
+        this.bStatusCodesMatch	= b;
+    }
+    protected void setUnknownFunction(boolean b) {
+        this.bUnknownFunction	= b;
+    }
+
+    public ResultMatchResult() {
+    }
+
+    public static ResultMatchResult newInstance(Result result1, Result result2) {
+        ResultMatchResult resultMatchResult	= new ResultMatchResult();
+        if (result2 != null && result2.getStatus() != null &&
+                result2.getStatus().getStatusCode().equals(StdStatusCode.STATUS_CODE_PROCESSING_ERROR) &&
+                result2.getStatus().getStatusMessage() != null &&
+                result2.getStatus().getStatusMessage().contains("Unknown Function")
+           ) {
+            resultMatchResult.setUnknownFunction(true);
         }
-        protected void setAttributesMatch(boolean b) {
-                this.bAttributesMatch	= b;
+        if (result1 == null || result2 == null) {
+            resultMatchResult.setAssociatedAdviceMatches(false);
+            resultMatchResult.setAttributesMatch(false);
+            resultMatchResult.setDecisionsMatch(false);
+            resultMatchResult.setObligationsMatch(false);
+            resultMatchResult.setPolicyIdentifiersMatch(false);
+            resultMatchResult.setPolicySetIdentifiersMatch(false);
+            resultMatchResult.setStatusCodesMatch(false);
+        } else {
+            resultMatchResult.setAssociatedAdviceMatches(ListUtil.equalsAllowNulls(result1.getAssociatedAdvice(), result2.getAssociatedAdvice()));
+            resultMatchResult.setAttributesMatch(ListUtil.equalsAllowNulls(result1.getAttributes(), result2.getAttributes()));
+            resultMatchResult.setDecisionsMatch(result1.getDecision() == result2.getDecision());
+            resultMatchResult.setObligationsMatch(ListUtil.equalsAllowNulls(result1.getObligations(), result2.getObligations()));
+            resultMatchResult.setPolicyIdentifiersMatch(ListUtil.equalsAllowNulls(result1.getPolicyIdentifiers(), result2.getPolicyIdentifiers()));
+            resultMatchResult.setPolicySetIdentifiersMatch(ListUtil.equalsAllowNulls(result1.getPolicySetIdentifiers(), result2.getPolicySetIdentifiers()));
+            if (result1.getStatus() == null || result1.getStatus().getStatusCode() == null || result2.getStatus() == null || result2.getStatus().getStatusCode() == null) {
+                resultMatchResult.setStatusCodesMatch(false);
+            } else {
+                resultMatchResult.setStatusCodesMatch(result1.getStatus().getStatusCode().equals(result2.getStatus().getStatusCode()));
+            }
         }
-        protected void setDecisionsMatch(boolean b) {
-                this.bDecisionsMatch	= b;
-        }
-        protected void setObligationsMatch(boolean b) {
-                this.bObligationsMatch	= b;
-        }
-        protected void setPolicyIdentifiersMatch(boolean b) {
-                this.bPolicyIdentifiersMatch	= b;
-        }
-        protected void setPolicySetIdentifiersMatch(boolean b) {
-                this.bPolicySetIdentifiersMatch	= b;
-        }
-        protected void setStatusCodesMatch(boolean b) {
-                this.bStatusCodesMatch	= b;
-        }
-        protected void setUnknownFunction(boolean b) {
-                this.bUnknownFunction	= b;
-        }
-        
-        public ResultMatchResult() {
-        }
-        
-        public static ResultMatchResult newInstance(Result result1, Result result2) {
-                ResultMatchResult resultMatchResult	= new ResultMatchResult();
-                if (result2 != null && result2.getStatus() != null && 
-                        result2.getStatus().getStatusCode().equals(StdStatusCode.STATUS_CODE_PROCESSING_ERROR) && 
-                        result2.getStatus().getStatusMessage() != null &&
-                        result2.getStatus().getStatusMessage().contains("Unknown Function")
-                        ) {
-                        resultMatchResult.setUnknownFunction(true);
-                }
-                if (result1 == null || result2 == null) {
-                        resultMatchResult.setAssociatedAdviceMatches(false);
-                        resultMatchResult.setAttributesMatch(false);
-                        resultMatchResult.setDecisionsMatch(false);
-                        resultMatchResult.setObligationsMatch(false);
-                        resultMatchResult.setPolicyIdentifiersMatch(false);
-                        resultMatchResult.setPolicySetIdentifiersMatch(false);
-                        resultMatchResult.setStatusCodesMatch(false);
-                } else {
-                        resultMatchResult.setAssociatedAdviceMatches(ListUtil.equalsAllowNulls(result1.getAssociatedAdvice(), result2.getAssociatedAdvice()));
-                        resultMatchResult.setAttributesMatch(ListUtil.equalsAllowNulls(result1.getAttributes(), result2.getAttributes()));
-                        resultMatchResult.setDecisionsMatch(result1.getDecision() == result2.getDecision());
-                        resultMatchResult.setObligationsMatch(ListUtil.equalsAllowNulls(result1.getObligations(), result2.getObligations()));
-                        resultMatchResult.setPolicyIdentifiersMatch(ListUtil.equalsAllowNulls(result1.getPolicyIdentifiers(), result2.getPolicyIdentifiers()));
-                        resultMatchResult.setPolicySetIdentifiersMatch(ListUtil.equalsAllowNulls(result1.getPolicySetIdentifiers(), result2.getPolicySetIdentifiers()));
-                        if (result1.getStatus() == null || result1.getStatus().getStatusCode() == null || result2.getStatus() == null || result2.getStatus().getStatusCode() == null) {
-                                resultMatchResult.setStatusCodesMatch(false);
-                        } else {
-                                resultMatchResult.setStatusCodesMatch(result1.getStatus().getStatusCode().equals(result2.getStatus().getStatusCode()));
-                        }
-                }
-                return resultMatchResult;
-        }
-        
-        public boolean associatedAdviceMatches() {
-                return this.bAssociatedAdviceMatches;
-        }
-        
-        public boolean attributesMatch() {
-                return this.bAttributesMatch;
-        }
-        
-        public boolean decisionsMatch() {
-                return this.bDecisionsMatch;
-        }
-        
-        public boolean obligationsMatch() {
-                return this.bObligationsMatch;
-        }
-        
-        public boolean policyIdentifiersMatch() {
-                return this.bPolicyIdentifiersMatch;
-        }
-        
-        public boolean policySetIdentifiersMatch() {
-                return this.bPolicySetIdentifiersMatch;
-        }
-        
-        public boolean statusCodesMatch() {
-                return this.bStatusCodesMatch;
-        }
-        
-        public boolean unknownFunction() {
-                return this.bUnknownFunction;
-        }
+        return resultMatchResult;
+    }
+
+    public boolean associatedAdviceMatches() {
+        return this.bAssociatedAdviceMatches;
+    }
+
+    public boolean attributesMatch() {
+        return this.bAttributesMatch;
+    }
+
+    public boolean decisionsMatch() {
+        return this.bDecisionsMatch;
+    }
+
+    public boolean obligationsMatch() {
+        return this.bObligationsMatch;
+    }
+
+    public boolean policyIdentifiersMatch() {
+        return this.bPolicyIdentifiersMatch;
+    }
+
+    public boolean policySetIdentifiersMatch() {
+        return this.bPolicySetIdentifiersMatch;
+    }
+
+    public boolean statusCodesMatch() {
+        return this.bStatusCodesMatch;
+    }
+
+    public boolean unknownFunction() {
+        return this.bUnknownFunction;
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/CustomDataTypeFactory.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/CustomDataTypeFactory.java
index 0131df1..40503f1 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/CustomDataTypeFactory.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/CustomDataTypeFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,60 +39,60 @@
 import com.att.research.xacml.std.datatypes.DataTypes;
 
 public class CustomDataTypeFactory extends DataTypeFactory {
-        private static final Map<Identifier,DataType<?>> mapIdentifiersToDataTypes	= new HashMap<Identifier,DataType<?>>();
-        private static boolean mapNeedsInit												= true;
-        
-        public static final DataTypePrivateKey				DT_PRIVATEKEY				= DataTypePrivateKey.newInstance();
-        public static final DataTypePublicKey				DT_PUBLICKEY				= DataTypePublicKey.newInstance();
-        
-        private static void registerDataType(DataType<?> dataType) {
-                if (dataType != null && dataType.getId() != null) {
-                        mapIdentifiersToDataTypes.put(dataType.getId(), dataType);
-                }
+    private static final Map<Identifier,DataType<?>> mapIdentifiersToDataTypes	= new HashMap<Identifier,DataType<?>>();
+    private static boolean mapNeedsInit												= true;
+
+    public static final DataTypePrivateKey				DT_PRIVATEKEY				= DataTypePrivateKey.newInstance();
+    public static final DataTypePublicKey				DT_PUBLICKEY				= DataTypePublicKey.newInstance();
+
+    private static void registerDataType(DataType<?> dataType) {
+        if (dataType != null && dataType.getId() != null) {
+            mapIdentifiersToDataTypes.put(dataType.getId(), dataType);
         }
-        
-        private static void initMap() {
+    }
+
+    private static void initMap() {
+        if (mapNeedsInit) {
+            synchronized(mapIdentifiersToDataTypes) {
                 if (mapNeedsInit) {
-                        synchronized(mapIdentifiersToDataTypes) {
-                                if (mapNeedsInit) {
-                                        registerDataType(DataTypes.DT_ANYURI);
-                                        registerDataType(DataTypes.DT_BASE64BINARY);
-                                        registerDataType(DataTypes.DT_BOOLEAN);
-                                        registerDataType(DataTypes.DT_DATE);
-                                        registerDataType(DataTypes.DT_DATETIME);
-                                        registerDataType(DataTypes.DT_DAYTIMEDURATION);
-                                        registerDataType(DataTypes.DT_DNSNAME);
-                                        registerDataType(DataTypes.DT_DOUBLE);
-                                        registerDataType(DataTypes.DT_HEXBINARY);
-                                        registerDataType(DataTypes.DT_INTEGER);
-                                        registerDataType(DataTypes.DT_IPADDRESS);
-                                        registerDataType(DataTypes.DT_RFC822NAME);
-                                        registerDataType(DataTypes.DT_STRING);
-                                        registerDataType(DataTypes.DT_TIME);
-                                        registerDataType(DataTypes.DT_X500NAME);
-                                        registerDataType(DataTypes.DT_XPATHEXPRESSION);
-                                        registerDataType(DataTypes.DT_YEARMONTHDURATION);
-                                        //
-                                        // These are the custom data types!
-                                        //
-                                        registerDataType(DT_PRIVATEKEY);
-                                        registerDataType(DT_PUBLICKEY);
-                                        //
-                                        // Done
-                                        //
-                                        mapNeedsInit	= false;
-                                }
-                        }
+                    registerDataType(DataTypes.DT_ANYURI);
+                    registerDataType(DataTypes.DT_BASE64BINARY);
+                    registerDataType(DataTypes.DT_BOOLEAN);
+                    registerDataType(DataTypes.DT_DATE);
+                    registerDataType(DataTypes.DT_DATETIME);
+                    registerDataType(DataTypes.DT_DAYTIMEDURATION);
+                    registerDataType(DataTypes.DT_DNSNAME);
+                    registerDataType(DataTypes.DT_DOUBLE);
+                    registerDataType(DataTypes.DT_HEXBINARY);
+                    registerDataType(DataTypes.DT_INTEGER);
+                    registerDataType(DataTypes.DT_IPADDRESS);
+                    registerDataType(DataTypes.DT_RFC822NAME);
+                    registerDataType(DataTypes.DT_STRING);
+                    registerDataType(DataTypes.DT_TIME);
+                    registerDataType(DataTypes.DT_X500NAME);
+                    registerDataType(DataTypes.DT_XPATHEXPRESSION);
+                    registerDataType(DataTypes.DT_YEARMONTHDURATION);
+                    //
+                    // These are the custom data types!
+                    //
+                    registerDataType(DT_PRIVATEKEY);
+                    registerDataType(DT_PUBLICKEY);
+                    //
+                    // Done
+                    //
+                    mapNeedsInit	= false;
                 }
+            }
         }
+    }
 
-        public CustomDataTypeFactory() {
-                initMap();
-        }
+    public CustomDataTypeFactory() {
+        initMap();
+    }
 
-        @Override
-        public DataType<?> getDataType(Identifier dataTypeId) {
-                return mapIdentifiersToDataTypes.get(dataTypeId);
-        }
+    @Override
+    public DataType<?> getDataType(Identifier dataTypeId) {
+        return mapIdentifiersToDataTypes.get(dataTypeId);
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/CustomFunctionDefinitionFactory.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/CustomFunctionDefinitionFactory.java
index 7430796..fb85cee 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/CustomFunctionDefinitionFactory.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/CustomFunctionDefinitionFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,56 +45,56 @@
 import com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionBagOneAndOnly;
 
 public class CustomFunctionDefinitionFactory extends FunctionDefinitionFactory {
-        private static Map<Identifier,FunctionDefinition> 	mapFunctionDefinitions	= new HashMap<Identifier,FunctionDefinition>();
-        private static boolean								needMapInit				= true;
-        
-        public static final Identifier ID_FUNCTION_PRIVATEKEY_ONE_AND_ONLY = new IdentifierImpl("urn:com:att:research:xacml:custom:function:3.0:rsa:privatekey-one-and-only");
-        public static final Identifier ID_FUNCTION_PUBLICKEY_ONE_AND_ONLY = new IdentifierImpl("urn:com:att:research:xacml:custom:function:3.0:rsa:publickey-one-and-only");
-        
-        public static final FunctionDefinition	FD_PRIVATEKEY_ONE_AND_ONLY	= new FunctionDefinitionBagOneAndOnly<PrivateKey>(ID_FUNCTION_PRIVATEKEY_ONE_AND_ONLY, DataTypePrivateKey.newInstance());
-        public static final FunctionDefinition	FD_PUBLICKEY_ONE_AND_ONLY	= new FunctionDefinitionBagOneAndOnly<PublicKey>(ID_FUNCTION_PUBLICKEY_ONE_AND_ONLY, DataTypePublicKey.newInstance());
+    private static Map<Identifier,FunctionDefinition> 	mapFunctionDefinitions	= new HashMap<Identifier,FunctionDefinition>();
+    private static boolean								needMapInit				= true;
 
-        private static void register(FunctionDefinition functionDefinition) {
-                mapFunctionDefinitions.put(functionDefinition.getId(), functionDefinition);
-        }
-                
-        private static void initMap() {
+    public static final Identifier ID_FUNCTION_PRIVATEKEY_ONE_AND_ONLY = new IdentifierImpl("urn:com:att:research:xacml:custom:function:3.0:rsa:privatekey-one-and-only");
+    public static final Identifier ID_FUNCTION_PUBLICKEY_ONE_AND_ONLY = new IdentifierImpl("urn:com:att:research:xacml:custom:function:3.0:rsa:publickey-one-and-only");
+
+    public static final FunctionDefinition	FD_PRIVATEKEY_ONE_AND_ONLY	= new FunctionDefinitionBagOneAndOnly<PrivateKey>(ID_FUNCTION_PRIVATEKEY_ONE_AND_ONLY, DataTypePrivateKey.newInstance());
+    public static final FunctionDefinition	FD_PUBLICKEY_ONE_AND_ONLY	= new FunctionDefinitionBagOneAndOnly<PublicKey>(ID_FUNCTION_PUBLICKEY_ONE_AND_ONLY, DataTypePublicKey.newInstance());
+
+    private static void register(FunctionDefinition functionDefinition) {
+        mapFunctionDefinitions.put(functionDefinition.getId(), functionDefinition);
+    }
+
+    private static void initMap() {
+        if (needMapInit) {
+            synchronized(mapFunctionDefinitions) {
                 if (needMapInit) {
-                        synchronized(mapFunctionDefinitions) {
-                                if (needMapInit) {
-                                        needMapInit	= false;
-                                        Field[] declaredFields	= StdFunctions.class.getDeclaredFields();
-                                        for (Field field : declaredFields) {
-                                                if (Modifier.isStatic(field.getModifiers()) && 
-                                                        field.getName().startsWith(StdFunctions.FD_PREFIX) &&
-                                                        FunctionDefinition.class.isAssignableFrom(field.getType()) &&
-                                                        Modifier.isPublic(field.getModifiers())
-                                                ) {
-                                                        try {
-                                                                register((FunctionDefinition)(field.get(null)));
-                                                        } catch (IllegalAccessException ex) {
-                                                                
-                                                        }
-                                                }
-                                        }
-                                        //
-                                        // Our custom function
-                                        //
-                                        register(FunctionDefinitionDecrypt.newInstance());
-                                        register(FD_PRIVATEKEY_ONE_AND_ONLY);
-                                        register(FD_PUBLICKEY_ONE_AND_ONLY);
-                                }
-                        }
-                }
-        }
-        
-        public CustomFunctionDefinitionFactory() {
-                initMap();
-        }
+                    needMapInit	= false;
+                    Field[] declaredFields	= StdFunctions.class.getDeclaredFields();
+                    for (Field field : declaredFields) {
+                        if (Modifier.isStatic(field.getModifiers()) &&
+                                field.getName().startsWith(StdFunctions.FD_PREFIX) &&
+                                FunctionDefinition.class.isAssignableFrom(field.getType()) &&
+                                Modifier.isPublic(field.getModifiers())
+                           ) {
+                            try {
+                                register((FunctionDefinition)(field.get(null)));
+                            } catch (IllegalAccessException ex) {
 
-        @Override
-        public FunctionDefinition getFunctionDefinition(Identifier functionId) {
-                return mapFunctionDefinitions.get(functionId);
+                            }
+                        }
+                    }
+                    //
+                    // Our custom function
+                    //
+                    register(FunctionDefinitionDecrypt.newInstance());
+                    register(FD_PRIVATEKEY_ONE_AND_ONLY);
+                    register(FD_PUBLICKEY_ONE_AND_ONLY);
+                }
+            }
         }
+    }
+
+    public CustomFunctionDefinitionFactory() {
+        initMap();
+    }
+
+    @Override
+    public FunctionDefinition getFunctionDefinition(Identifier functionId) {
+        return mapFunctionDefinitions.get(functionId);
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/DataTypePrivateKey.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/DataTypePrivateKey.java
index 22ab128..06867d3 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/DataTypePrivateKey.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/DataTypePrivateKey.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,27 +38,27 @@
 import com.att.research.xacml.std.datatypes.DataTypeBase;
 
 public class DataTypePrivateKey extends DataTypeBase<PrivateKey> {
-        public static final Identifier DT_PRIVATEKEY = new IdentifierImpl("urn:com:att:research:xacml:custom:3.0:rsa:private");
-        private static final DataTypePrivateKey singleInstance = new DataTypePrivateKey();
-        
-        private DataTypePrivateKey() {
-                super(DT_PRIVATEKEY, PrivateKey.class);
-        }
+    public static final Identifier DT_PRIVATEKEY = new IdentifierImpl("urn:com:att:research:xacml:custom:3.0:rsa:private");
+    private static final DataTypePrivateKey singleInstance = new DataTypePrivateKey();
 
-        public static DataTypePrivateKey newInstance() {
-                return singleInstance;
+    private DataTypePrivateKey() {
+        super(DT_PRIVATEKEY, PrivateKey.class);
+    }
+
+    public static DataTypePrivateKey newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public PrivateKey convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof PrivateKey) ) {
+            return (PrivateKey) source;
+        } else if (source instanceof byte[]) {
+            return (PrivateKey) source;
+        } else if (source instanceof String) {
+            return (PrivateKey) (Object) ((String) source).getBytes();
         }
-        
-        @Override
-        public PrivateKey convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof PrivateKey) ) {
-                        return (PrivateKey) source;
-                } else if (source instanceof byte[]) {
-                        return (PrivateKey) source;
-                } else if (source instanceof String) {
-                        return (PrivateKey) (Object) ((String) source).getBytes();
-                }
-                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName());				
-        }
+        throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName());
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/DataTypePublicKey.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/DataTypePublicKey.java
index ec40898..33f77cf 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/DataTypePublicKey.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/DataTypePublicKey.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,27 +38,27 @@
 import com.att.research.xacml.std.datatypes.DataTypeBase;
 
 public class DataTypePublicKey extends DataTypeBase<PublicKey> {
-        public static final Identifier DT_PUBLICKEY = new IdentifierImpl("urn:com:att:research:xacml:custom:3.0:rsa:public");
-        private static final DataTypePublicKey singleInstance = new DataTypePublicKey();
-        
-        public DataTypePublicKey() {
-                super(DT_PUBLICKEY, PublicKey.class);
-        }
-        
-        public static DataTypePublicKey newInstance() {
-                return singleInstance;
-        }
+    public static final Identifier DT_PUBLICKEY = new IdentifierImpl("urn:com:att:research:xacml:custom:3.0:rsa:public");
+    private static final DataTypePublicKey singleInstance = new DataTypePublicKey();
 
-        @Override
-        public PublicKey convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof PublicKey) ) {
-                        return (PublicKey) source;
-                } else if (source instanceof byte[]) {
-                        return (PublicKey) source;
-                } else if (source instanceof String) {
-                        return (PublicKey) (Object) ((String) source).getBytes();
-                }
-                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName());				
+    public DataTypePublicKey() {
+        super(DT_PUBLICKEY, PublicKey.class);
+    }
+
+    public static DataTypePublicKey newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public PublicKey convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof PublicKey) ) {
+            return (PublicKey) source;
+        } else if (source instanceof byte[]) {
+            return (PublicKey) source;
+        } else if (source instanceof String) {
+            return (PublicKey) (Object) ((String) source).getBytes();
         }
+        throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName());
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/FunctionDefinitionDecrypt.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/FunctionDefinitionDecrypt.java
index aa1ce7d..d27328f 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/FunctionDefinitionDecrypt.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/FunctionDefinitionDecrypt.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -58,115 +58,115 @@
 import com.att.research.xacmlatt.pdp.std.functions.ConvertedArgument;
 
 public class FunctionDefinitionDecrypt implements FunctionDefinition {
-        public static final Identifier FD_RSA_DECRYPT = new IdentifierImpl("urn:com:att:research:xacml:custom:function:3.0:rsa:decrypt");
-        private static final FunctionDefinitionDecrypt singleInstance = new FunctionDefinitionDecrypt();
-        
-        public static FunctionDefinitionDecrypt newInstance() {
-                return singleInstance;
-        }
+    public static final Identifier FD_RSA_DECRYPT = new IdentifierImpl("urn:com:att:research:xacml:custom:function:3.0:rsa:decrypt");
+    private static final FunctionDefinitionDecrypt singleInstance = new FunctionDefinitionDecrypt();
 
-        @Override
-        public Identifier getId() {
-                return FD_RSA_DECRYPT;
-        }
+    public static FunctionDefinitionDecrypt newInstance() {
+        return singleInstance;
+    }
 
-        @Override
-        public Identifier getDataTypeId() {
-                return XACML3.ID_DATATYPE_STRING;
-        }
+    @Override
+    public Identifier getId() {
+        return FD_RSA_DECRYPT;
+    }
 
-        @Override
-        public boolean returnsBag() {
-                return false;
-        }
+    @Override
+    public Identifier getDataTypeId() {
+        return XACML3.ID_DATATYPE_STRING;
+    }
 
-        @Override
-        public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {
-                if (arguments == null || arguments.size() < 2) {
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, expecting 2 arguments."));
-                }
-                //
-                // What is the first argument?
-                //
-                FunctionArgument arg0 = arguments.get(0);
-                if (arg0.isBag()) {
-                        //
-                        // We don't support bags right now
-                        //
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, not expecting a bag for argument 0."));
-                }
-                if (arg0.getValue().getDataTypeId().equals(XACML3.ID_DATATYPE_HEXBINARY) == false) {
-                        //
-                        // Should be a String
-                        //
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, expected a Hex Binary for argument 0."));
-                }
-                //
-                // Convert the argument
-                //
-                ConvertedArgument<HexBinary> data = new ConvertedArgument<HexBinary>(arg0, DataTypeHexBinary.newInstance(), false);
-                if (! data.isOk()) {
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, argument 0 failed to convert to Hex Binary."));
-                }
-                //
-                // Ok - check the 2nd argument
-                //
-                FunctionArgument arg1 = arguments.get(1);
-                if (arg1.isBag()) {
-                        //
-                        // We don't support bags right now
-                        //
-                        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, not expecting a bag for argument 1."));
-                }
-                if (arg1.getValue().getDataTypeId().equals(DataTypePrivateKey.DT_PRIVATEKEY) ||
-                                arg1.getValue().getDataTypeId().equals(DataTypePublicKey.DT_PUBLICKEY)) {
-                        //
-                        // Ok - let's try to decrypt
-                        //
-                        Cipher cipher;
-                        try {
-                                cipher = Cipher.getInstance("RSA");
-                                if (arg1.getValue().getDataTypeId().equals(DataTypePrivateKey.DT_PRIVATEKEY)) {
-                                        //
-                                        // Using the private key
-                                        //
-                                        DataType<PrivateKey> pkDatatype = DataTypePrivateKey.newInstance();
-                                        ConvertedArgument<PrivateKey> privateKey = new ConvertedArgument<PrivateKey>(arg1, pkDatatype, false);
-                                        if ( ! privateKey.isOk()) {
-                                                return ExpressionResult.newError(new StdStatus(privateKey.getStatus().getStatusCode(), "Decrypt: " + privateKey.getStatus().getStatusMessage()));
-                                        }
-                                        //
-                                        // Setup decryption
-                                        //
-                                        cipher.init(Cipher.DECRYPT_MODE, privateKey.getValue());
-                                } else if (arg1.getValue().getDataTypeId().equals(DataTypePublicKey.DT_PUBLICKEY)) {
-                                        //
-                                        // Using the private key
-                                        //
-                                        DataType<PublicKey> pkDatatype = DataTypePublicKey.newInstance();
-                                        ConvertedArgument<PublicKey> publicKey = new ConvertedArgument<PublicKey>(arg1, pkDatatype, false);
-                                        if ( ! publicKey.isOk()) {
-                                                return ExpressionResult.newError(new StdStatus(publicKey.getStatus().getStatusCode(), "Decrypt: " + publicKey.getStatus().getStatusMessage()));
-                                        }
-                                        //
-                                        // Setup decryption
-                                        //
-                                        cipher.init(Cipher.DECRYPT_MODE, publicKey.getValue());
-                                }
-                                //
-                                // Do the decryption
-                                //
-                                byte[] decryptedData = cipher.doFinal(data.getValue().getData());
-                                String decryptedString = new String(decryptedData);
-                                //
-                                // All good, return the decrypted string
-                                //
-                                return ExpressionResult.newSingle(DataTypeString.newInstance().createAttributeValue(decryptedString));
-                        } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException | DataTypeException e) {
-                                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed: " + e.getLocalizedMessage()));
-                        }
-                }		
-                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, expecting public/private key datatype for argument 1."));
+    @Override
+    public boolean returnsBag() {
+        return false;
+    }
+
+    @Override
+    public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments) {
+        if (arguments == null || arguments.size() < 2) {
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, expecting 2 arguments."));
         }
+        //
+        // What is the first argument?
+        //
+        FunctionArgument arg0 = arguments.get(0);
+        if (arg0.isBag()) {
+            //
+            // We don't support bags right now
+            //
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, not expecting a bag for argument 0."));
+        }
+        if (arg0.getValue().getDataTypeId().equals(XACML3.ID_DATATYPE_HEXBINARY) == false) {
+            //
+            // Should be a String
+            //
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, expected a Hex Binary for argument 0."));
+        }
+        //
+        // Convert the argument
+        //
+        ConvertedArgument<HexBinary> data = new ConvertedArgument<HexBinary>(arg0, DataTypeHexBinary.newInstance(), false);
+        if (! data.isOk()) {
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, argument 0 failed to convert to Hex Binary."));
+        }
+        //
+        // Ok - check the 2nd argument
+        //
+        FunctionArgument arg1 = arguments.get(1);
+        if (arg1.isBag()) {
+            //
+            // We don't support bags right now
+            //
+            return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, not expecting a bag for argument 1."));
+        }
+        if (arg1.getValue().getDataTypeId().equals(DataTypePrivateKey.DT_PRIVATEKEY) ||
+                arg1.getValue().getDataTypeId().equals(DataTypePublicKey.DT_PUBLICKEY)) {
+            //
+            // Ok - let's try to decrypt
+            //
+            Cipher cipher;
+            try {
+                cipher = Cipher.getInstance("RSA");
+                if (arg1.getValue().getDataTypeId().equals(DataTypePrivateKey.DT_PRIVATEKEY)) {
+                    //
+                    // Using the private key
+                    //
+                    DataType<PrivateKey> pkDatatype = DataTypePrivateKey.newInstance();
+                    ConvertedArgument<PrivateKey> privateKey = new ConvertedArgument<PrivateKey>(arg1, pkDatatype, false);
+                    if ( ! privateKey.isOk()) {
+                        return ExpressionResult.newError(new StdStatus(privateKey.getStatus().getStatusCode(), "Decrypt: " + privateKey.getStatus().getStatusMessage()));
+                    }
+                    //
+                    // Setup decryption
+                    //
+                    cipher.init(Cipher.DECRYPT_MODE, privateKey.getValue());
+                } else if (arg1.getValue().getDataTypeId().equals(DataTypePublicKey.DT_PUBLICKEY)) {
+                    //
+                    // Using the private key
+                    //
+                    DataType<PublicKey> pkDatatype = DataTypePublicKey.newInstance();
+                    ConvertedArgument<PublicKey> publicKey = new ConvertedArgument<PublicKey>(arg1, pkDatatype, false);
+                    if ( ! publicKey.isOk()) {
+                        return ExpressionResult.newError(new StdStatus(publicKey.getStatus().getStatusCode(), "Decrypt: " + publicKey.getStatus().getStatusMessage()));
+                    }
+                    //
+                    // Setup decryption
+                    //
+                    cipher.init(Cipher.DECRYPT_MODE, publicKey.getValue());
+                }
+                //
+                // Do the decryption
+                //
+                byte[] decryptedData = cipher.doFinal(data.getValue().getData());
+                String decryptedString = new String(decryptedData);
+                //
+                // All good, return the decrypted string
+                //
+                return ExpressionResult.newSingle(DataTypeString.newInstance().createAttributeValue(decryptedString));
+            } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException | DataTypeException e) {
+                return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed: " + e.getLocalizedMessage()));
+            }
+        }
+        return ExpressionResult.newError(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, "Decrypt failed, expecting public/private key datatype for argument 1."));
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/TestCustom.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/TestCustom.java
index e64aea7..c083ee2 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/TestCustom.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/custom/TestCustom.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -76,329 +76,329 @@
 
 /**
  * TestCustom is an application that tests the extensibility and configurability of the AT&T XACML API.
- * 
+ *
  * It creates a custom datatype definition factory that adds in custom data types for RSA
  * PublicKey and PrivateKey.
- * 
+ *
  * It creates a custom function definition factory that adds in custom decryption function for decrypting data. It
- * also derives and loads custom functions for the RSA public/private key datatypes for the bag function: one-and-only. 
- * 
+ * also derives and loads custom functions for the RSA public/private key datatypes for the bag function: one-and-only.
+ *
  * @author pameladragosh
  *
  */
 public class TestCustom extends TestBase {
-        private static final Log logger	= LogFactory.getLog(TestCustom.class);
-        
-        //
-        // Our public's
-        //
-        public static final String ALGORITHM = "RSA";
-        public static final String PRIVATEKEY_FILE = "PrivateKey.key";
-        public static final String PUBLICKEY_FILE = "PublicKey.key";
-        
-        public static final String DECRYPTION_INPUT_STRING = "This is the SECRET value!";
-        
-        public static final String DECRYPTION_INPUT_ID = "com:att:research:xacml:test:custom:encrypted-data";
-        //
-        // Our keys
-        //
-        protected PublicKey publicKey = null;
-        protected PrivateKey privateKey = null;
-        //
-        // Our command line parameters
-        //
-        public static final String OPTION_GENERATE = "generate";
+    private static final Log logger	= LogFactory.getLog(TestCustom.class);
 
-        static {
-                options.addOption(new Option(OPTION_GENERATE, false, "Generate a private/public key pair."));
-        }
-        
-        /**
-         * This function generates the public/private key pair. Should never have to call this again, this was
-         * called once to generate the keys. They were saved into the testsets/custom/datatype-function sub-directory.
-         */
-        public void generateKeyPair() {
-                //
-                // Generate a RSA private/public key pair
-                //
-                KeyPairGenerator keyGen;
-                try {
-                        keyGen = KeyPairGenerator.getInstance(ALGORITHM);
-                } catch (NoSuchAlgorithmException e) {
-                        logger.error("failed to generate keypair: " + e);
-                        return;
-                }
-                keyGen.initialize(1024);
-                final KeyPair key = keyGen.generateKeyPair();
-                //
-                // Save the keys to disk
-                //
-                Path file = Paths.get(this.directory, PRIVATEKEY_FILE);
-                try (ObjectOutputStream os = new ObjectOutputStream(Files.newOutputStream(file))) {
-                        os.writeObject(key.getPrivate());
-                } catch (IOException e) {
-                        e.printStackTrace();
-                }
-                file = Paths.get(this.directory, PUBLICKEY_FILE);
-                try (ObjectOutputStream os = new ObjectOutputStream(Files.newOutputStream(file))) {
-                        os.writeObject(key.getPublic());
-                } catch (IOException e) {
-                        e.printStackTrace();
-                }
-        }
+    //
+    // Our public's
+    //
+    public static final String ALGORITHM = "RSA";
+    public static final String PRIVATEKEY_FILE = "PrivateKey.key";
+    public static final String PUBLICKEY_FILE = "PublicKey.key";
 
-        public TestCustom(String[] args) throws ParseException, MalformedURLException, HelpException {
-                super(args);
-        }
-        
-        /* (non-Javadoc)
-         * 
-         * Simply look for command line option: -generate
-         * This generates the public/private key. Shouldn't need to call it again, the keys have
-         * already been generated and saved.
-         * 
-         * @see com.att.research.xacmlatt.pdp.test.TestBase#parseCommands(java.lang.String[])
-         */
-        @Override
-        protected void parseCommands(String[] args) throws ParseException, MalformedURLException, HelpException {
-                //
-                // Have our parent class parse its options out
-                //
-                super.parseCommands(args);
-                //
-                // Parse the command line options
-                //
-                CommandLine cl;
-                cl = new GnuParser().parse(options, args);
-                if (cl.hasOption(OPTION_GENERATE)) {
-                        //
-                        // Really only need to do this once to setup the test.
-                        //
-                        this.generateKeyPair();
-                }
-        }
+    public static final String DECRYPTION_INPUT_STRING = "This is the SECRET value!";
 
-        /* (non-Javadoc)
-         * 
-         * After our parent class configure's itself, all this needs to do is read in
-         * the public/private key's into objects.
-         * 
-         * @see com.att.research.xacmlatt.pdp.test.TestBase#configure()
-         */
-        @Override
-        protected void configure() throws FactoryException {
-                //
-                // Have our super do its thing
-                //
-                super.configure();
-                //
-                // Read in the public key
-                //
-                try {
-                        this.publicKey = (PublicKey) new ObjectInputStream(Files.newInputStream(Paths.get(this.directory, PUBLICKEY_FILE))).readObject();
-                } catch (ClassNotFoundException | IOException e) {
-                        logger.error(e);
-                }
-                //
-                // Read in the private key
-                //
-                try {
-                        this.privateKey = (PrivateKey) new ObjectInputStream(Files.newInputStream(Paths.get(this.directory, PRIVATEKEY_FILE))).readObject();
-                } catch (ClassNotFoundException | IOException e) {
-                        logger.error(e);
-                }
-        }
+    public static final String DECRYPTION_INPUT_ID = "com:att:research:xacml:test:custom:encrypted-data";
+    //
+    // Our keys
+    //
+    protected PublicKey publicKey = null;
+    protected PrivateKey privateKey = null;
+    //
+    // Our command line parameters
+    //
+    public static final String OPTION_GENERATE = "generate";
 
-        /* (non-Javadoc)
-         * 
-         * Here we add 2 attributes into the request: 1) the private key, and 2) a String that was encrypted using the public key.
-         * 
-         * The goal is to have the custom decrypt function use the private key to decrypt that string.
-         * 
-         * @see com.att.research.xacmlatt.pdp.test.TestBase#generateRequest(java.nio.file.Path, java.lang.String)
-         */
-        @Override
-        protected Request generateRequest(Path file, String group) throws JSONStructureException, DOMStructureException, PEPException {
-                //
-                // Have our super class do its work
-                //
-                Request oldRequest = super.generateRequest(file, group);
-                //
-                // Copy the request attributes
-                //
-                List<StdMutableRequestAttributes> attributes = new ArrayList<StdMutableRequestAttributes>();
-                for (RequestAttributes a : oldRequest.getRequestAttributes()) {
-                        attributes.add(new StdMutableRequestAttributes(a));
-                }
-                //
-                // We are supplying the private key as an attribute for the decryption function to use:
-                //
-                // (NOTE: Ideally this would be provided by a custom PIP provider, not the PEP)
-                //
-                // ID=com:att:research:xacml:test:custom:privatekey
-                // Issuer=com:att:research:xacml:test:custom
-                // Category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject
-                // Datatype=urn:com:att:research:xacml:custom:3.0:rsa:private
-                //
-                DataType<?> dtExtended = dataTypeFactory.getDataType(DataTypePrivateKey.DT_PRIVATEKEY);
-                if (dtExtended == null) {
-                        logger.error("Failed to get private key datatype.");
-                        return null;
-                }
-                //
-                // Create the attribute value
-                //
-                try {
-                        AttributeValue<?> attributeValue = dtExtended.createAttributeValue(this.privateKey);					
-                        //
-                        // Create the attribute
-                        //
-                        StdMutableAttribute newAttribute = new StdMutableAttribute(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT,
-                                                                                                                                                new IdentifierImpl("com:att:research:xacml:test:custom:privatekey"),
-                                                                                                                                                attributeValue,
-                                                                                                                                                "com:att:research:xacml:test:custom",
-                                                                                                                                                false);
-                        boolean added = false;
-                        for (StdMutableRequestAttributes a : attributes) {
-                                //
-                                // Does the category exist?
-                                //
-                                if (a.getCategory().equals(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT)) {
-                                        //
-                                        // Yes - add in the new attribute value
-                                        //
-                                        a.add(newAttribute);
-                                        added = true;
-                                        break;
-                                }
-                        }
-                        if (added == false) {
-                                //
-                                // New category - create it and add it in
-                                //
-                                StdMutableRequestAttributes a = new StdMutableRequestAttributes(); 
-                                a.setCategory(newAttribute.getCategory());
-                                a.add(newAttribute);
-                                attributes.add(a);
-                        }
-                } catch (DataTypeException e) {
-                        logger.error(e);
-                        return null;
-                }
-                //
-                // We are also supplying this attribute which is the secret text encrypted with
-                // the public key.
-                //
-                // ID=com:att:research:xacml:test:custom:encrypted-data
-                // Issuer=
-                // Category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject
-                // Datatype=http://www.w3.org/2001/XMLSchema#hexBinary
-                //
-                // Encrypt it
-                //
-                byte[] encryptedData = null;
-                try {
-                        Cipher cipher = Cipher.getInstance(ALGORITHM);
-                        cipher.init(Cipher.ENCRYPT_MODE, this.publicKey);
-                        //
-                        // This is just a hack to test a decryption of the wrong value.
-                        //
-                        if (group.equals("Permit")) {
-                                encryptedData = cipher.doFinal(DECRYPTION_INPUT_STRING.getBytes());
-                        } else {
-                                encryptedData = cipher.doFinal("This is NOT the secret".getBytes());
-                        }
-                } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
-                        logger.error(e);
-                        return null;
-                }
-                //
-                // Sanity check (for the Permit request)
-                //
-                try {
-                        if (group.equals("Permit")) {
-                                Cipher cipher = Cipher.getInstance(ALGORITHM);
-                                cipher.init(Cipher.DECRYPT_MODE, this.privateKey);
-                                byte[] decryptedData = cipher.doFinal(encryptedData);
-                                if (new String(decryptedData).equals(DECRYPTION_INPUT_STRING)) {
-                                        logger.info("Sanity check passed: decrypted the encrypted data.");
-                                } else {
-                                        logger.error("Sanity check failed to decrypt the encrypted data.");
-                                        return null;
-                                }
-                        }
-                } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
-                        logger.error(e);
-                }
-                //
-                // Get our datatype factory
-                //
-                dtExtended = dataTypeFactory.getDataType(XACML3.ID_DATATYPE_HEXBINARY);
-                if (dtExtended == null) {
-                        logger.error("Failed to get hex binary datatype.");
-                        return null;
-                }
-                //
-                // Create the attribute value
-                //
-                try {
-                        AttributeValue<?> attributeValue = dtExtended.createAttributeValue(encryptedData);					
-                        //
-                        // Create the attribute
-                        //
-                        StdMutableAttribute newAttribute = new StdMutableAttribute(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT,
-                                                                                                                                                new IdentifierImpl("com:att:research:xacml:test:custom:encrypted-data"),
-                                                                                                                                                attributeValue,
-                                                                                                                                                null,
-                                                                                                                                                false);
-                        boolean added = false;
-                        for (StdMutableRequestAttributes a : attributes) {
-                                //
-                                // Does the category exist?
-                                //
-                                if (a.getCategory().equals(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT)) {
-                                        //
-                                        // Yes - add in the new attribute value
-                                        //
-                                        a.add(newAttribute);
-                                        added = true;
-                                        break;
-                                }
-                        }
-                        if (added == false) {
-                                //
-                                // New category - create it and add it in
-                                //
-                                StdMutableRequestAttributes a = new StdMutableRequestAttributes(); 
-                                a.setCategory(newAttribute.getCategory());
-                                a.add(newAttribute);
-                                attributes.add(a);
-                        }
-                } catch (DataTypeException e) {
-                        logger.error(e);
-                        return null;
-                }
-                //
-                // Now form our final request
-                //
-                StdMutableRequest newRequest = new StdMutableRequest();
-                newRequest.setCombinedDecision(oldRequest.getCombinedDecision());
-                newRequest.setRequestDefaults(oldRequest.getRequestDefaults());
-                newRequest.setReturnPolicyIdList(oldRequest.getReturnPolicyIdList());
-                newRequest.setStatus(oldRequest.getStatus());
-                for (StdMutableRequestAttributes a : attributes) {
-                        newRequest.add(a);
-                }
-                return newRequest;
-        }
+    static {
+        options.addOption(new Option(OPTION_GENERATE, false, "Generate a private/public key pair."));
+    }
 
-        public static void main(String[] args) {
-                try {
-                        new TestCustom(args).run();
-                } catch (ParseException | IOException | FactoryException e) {
-                        logger.error(e);
-                } catch (HelpException e) {
-                }		
+    /**
+     * This function generates the public/private key pair. Should never have to call this again, this was
+     * called once to generate the keys. They were saved into the testsets/custom/datatype-function sub-directory.
+     */
+    public void generateKeyPair() {
+        //
+        // Generate a RSA private/public key pair
+        //
+        KeyPairGenerator keyGen;
+        try {
+            keyGen = KeyPairGenerator.getInstance(ALGORITHM);
+        } catch (NoSuchAlgorithmException e) {
+            logger.error("failed to generate keypair: " + e);
+            return;
         }
+        keyGen.initialize(1024);
+        final KeyPair key = keyGen.generateKeyPair();
+        //
+        // Save the keys to disk
+        //
+        Path file = Paths.get(this.directory, PRIVATEKEY_FILE);
+        try (ObjectOutputStream os = new ObjectOutputStream(Files.newOutputStream(file))) {
+            os.writeObject(key.getPrivate());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        file = Paths.get(this.directory, PUBLICKEY_FILE);
+        try (ObjectOutputStream os = new ObjectOutputStream(Files.newOutputStream(file))) {
+            os.writeObject(key.getPublic());
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public TestCustom(String[] args) throws ParseException, MalformedURLException, HelpException {
+        super(args);
+    }
+
+    /* (non-Javadoc)
+     *
+     * Simply look for command line option: -generate
+     * This generates the public/private key. Shouldn't need to call it again, the keys have
+     * already been generated and saved.
+     *
+     * @see com.att.research.xacmlatt.pdp.test.TestBase#parseCommands(java.lang.String[])
+     */
+    @Override
+    protected void parseCommands(String[] args) throws ParseException, MalformedURLException, HelpException {
+        //
+        // Have our parent class parse its options out
+        //
+        super.parseCommands(args);
+        //
+        // Parse the command line options
+        //
+        CommandLine cl;
+        cl = new GnuParser().parse(options, args);
+        if (cl.hasOption(OPTION_GENERATE)) {
+            //
+            // Really only need to do this once to setup the test.
+            //
+            this.generateKeyPair();
+        }
+    }
+
+    /* (non-Javadoc)
+     *
+     * After our parent class configure's itself, all this needs to do is read in
+     * the public/private key's into objects.
+     *
+     * @see com.att.research.xacmlatt.pdp.test.TestBase#configure()
+     */
+    @Override
+    protected void configure() throws FactoryException {
+        //
+        // Have our super do its thing
+        //
+        super.configure();
+        //
+        // Read in the public key
+        //
+        try {
+            this.publicKey = (PublicKey) new ObjectInputStream(Files.newInputStream(Paths.get(this.directory, PUBLICKEY_FILE))).readObject();
+        } catch (ClassNotFoundException | IOException e) {
+            logger.error(e);
+        }
+        //
+        // Read in the private key
+        //
+        try {
+            this.privateKey = (PrivateKey) new ObjectInputStream(Files.newInputStream(Paths.get(this.directory, PRIVATEKEY_FILE))).readObject();
+        } catch (ClassNotFoundException | IOException e) {
+            logger.error(e);
+        }
+    }
+
+    /* (non-Javadoc)
+     *
+     * Here we add 2 attributes into the request: 1) the private key, and 2) a String that was encrypted using the public key.
+     *
+     * The goal is to have the custom decrypt function use the private key to decrypt that string.
+     *
+     * @see com.att.research.xacmlatt.pdp.test.TestBase#generateRequest(java.nio.file.Path, java.lang.String)
+     */
+    @Override
+    protected Request generateRequest(Path file, String group) throws JSONStructureException, DOMStructureException, PEPException {
+        //
+        // Have our super class do its work
+        //
+        Request oldRequest = super.generateRequest(file, group);
+        //
+        // Copy the request attributes
+        //
+        List<StdMutableRequestAttributes> attributes = new ArrayList<StdMutableRequestAttributes>();
+        for (RequestAttributes a : oldRequest.getRequestAttributes()) {
+            attributes.add(new StdMutableRequestAttributes(a));
+        }
+        //
+        // We are supplying the private key as an attribute for the decryption function to use:
+        //
+        // (NOTE: Ideally this would be provided by a custom PIP provider, not the PEP)
+        //
+        // ID=com:att:research:xacml:test:custom:privatekey
+        // Issuer=com:att:research:xacml:test:custom
+        // Category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject
+        // Datatype=urn:com:att:research:xacml:custom:3.0:rsa:private
+        //
+        DataType<?> dtExtended = dataTypeFactory.getDataType(DataTypePrivateKey.DT_PRIVATEKEY);
+        if (dtExtended == null) {
+            logger.error("Failed to get private key datatype.");
+            return null;
+        }
+        //
+        // Create the attribute value
+        //
+        try {
+            AttributeValue<?> attributeValue = dtExtended.createAttributeValue(this.privateKey);
+            //
+            // Create the attribute
+            //
+            StdMutableAttribute newAttribute = new StdMutableAttribute(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT,
+                    new IdentifierImpl("com:att:research:xacml:test:custom:privatekey"),
+                    attributeValue,
+                    "com:att:research:xacml:test:custom",
+                    false);
+            boolean added = false;
+            for (StdMutableRequestAttributes a : attributes) {
+                //
+                // Does the category exist?
+                //
+                if (a.getCategory().equals(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT)) {
+                    //
+                    // Yes - add in the new attribute value
+                    //
+                    a.add(newAttribute);
+                    added = true;
+                    break;
+                }
+            }
+            if (added == false) {
+                //
+                // New category - create it and add it in
+                //
+                StdMutableRequestAttributes a = new StdMutableRequestAttributes();
+                a.setCategory(newAttribute.getCategory());
+                a.add(newAttribute);
+                attributes.add(a);
+            }
+        } catch (DataTypeException e) {
+            logger.error(e);
+            return null;
+        }
+        //
+        // We are also supplying this attribute which is the secret text encrypted with
+        // the public key.
+        //
+        // ID=com:att:research:xacml:test:custom:encrypted-data
+        // Issuer=
+        // Category=urn:oasis:names:tc:xacml:1.0:subject-category:access-subject
+        // Datatype=http://www.w3.org/2001/XMLSchema#hexBinary
+        //
+        // Encrypt it
+        //
+        byte[] encryptedData = null;
+        try {
+            Cipher cipher = Cipher.getInstance(ALGORITHM);
+            cipher.init(Cipher.ENCRYPT_MODE, this.publicKey);
+            //
+            // This is just a hack to test a decryption of the wrong value.
+            //
+            if (group.equals("Permit")) {
+                encryptedData = cipher.doFinal(DECRYPTION_INPUT_STRING.getBytes());
+            } else {
+                encryptedData = cipher.doFinal("This is NOT the secret".getBytes());
+            }
+        } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
+            logger.error(e);
+            return null;
+        }
+        //
+        // Sanity check (for the Permit request)
+        //
+        try {
+            if (group.equals("Permit")) {
+                Cipher cipher = Cipher.getInstance(ALGORITHM);
+                cipher.init(Cipher.DECRYPT_MODE, this.privateKey);
+                byte[] decryptedData = cipher.doFinal(encryptedData);
+                if (new String(decryptedData).equals(DECRYPTION_INPUT_STRING)) {
+                    logger.info("Sanity check passed: decrypted the encrypted data.");
+                } else {
+                    logger.error("Sanity check failed to decrypt the encrypted data.");
+                    return null;
+                }
+            }
+        } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
+            logger.error(e);
+        }
+        //
+        // Get our datatype factory
+        //
+        dtExtended = dataTypeFactory.getDataType(XACML3.ID_DATATYPE_HEXBINARY);
+        if (dtExtended == null) {
+            logger.error("Failed to get hex binary datatype.");
+            return null;
+        }
+        //
+        // Create the attribute value
+        //
+        try {
+            AttributeValue<?> attributeValue = dtExtended.createAttributeValue(encryptedData);
+            //
+            // Create the attribute
+            //
+            StdMutableAttribute newAttribute = new StdMutableAttribute(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT,
+                    new IdentifierImpl("com:att:research:xacml:test:custom:encrypted-data"),
+                    attributeValue,
+                    null,
+                    false);
+            boolean added = false;
+            for (StdMutableRequestAttributes a : attributes) {
+                //
+                // Does the category exist?
+                //
+                if (a.getCategory().equals(XACML3.ID_SUBJECT_CATEGORY_ACCESS_SUBJECT)) {
+                    //
+                    // Yes - add in the new attribute value
+                    //
+                    a.add(newAttribute);
+                    added = true;
+                    break;
+                }
+            }
+            if (added == false) {
+                //
+                // New category - create it and add it in
+                //
+                StdMutableRequestAttributes a = new StdMutableRequestAttributes();
+                a.setCategory(newAttribute.getCategory());
+                a.add(newAttribute);
+                attributes.add(a);
+            }
+        } catch (DataTypeException e) {
+            logger.error(e);
+            return null;
+        }
+        //
+        // Now form our final request
+        //
+        StdMutableRequest newRequest = new StdMutableRequest();
+        newRequest.setCombinedDecision(oldRequest.getCombinedDecision());
+        newRequest.setRequestDefaults(oldRequest.getRequestDefaults());
+        newRequest.setReturnPolicyIdList(oldRequest.getReturnPolicyIdList());
+        newRequest.setStatus(oldRequest.getStatus());
+        for (StdMutableRequestAttributes a : attributes) {
+            newRequest.add(a);
+        }
+        return newRequest;
+    }
+
+    public static void main(String[] args) {
+        try {
+            new TestCustom(args).run();
+        } catch (ParseException | IOException | FactoryException e) {
+            logger.error(e);
+        } catch (HelpException e) {
+        }
+    }
 
 }
diff --git a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/policy/TestPolicy.java b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/policy/TestPolicy.java
index c564e55..9054669 100644
--- a/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/policy/TestPolicy.java
+++ b/openaz-xacml-test/src/test/java/com/att/research/xacmlatt/pdp/test/policy/TestPolicy.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -84,722 +84,721 @@
 /**
  * This class reads the policy in and extracts all the attributes and their values that is contained
  * in the Policy. It then generates a request every single combination of attributes found.
- * 
+ *
  * The attributes mostly come from the Target Match elements, since they have both an attribute designator/selector
  * matched with an attribute value.
- * 
+ *
  * @author pameladragosh
  *
  */
 public class TestPolicy extends TestBase {
-        private static Log logger	= LogFactory.getLog(TestPolicy.class);
+    private static Log logger	= LogFactory.getLog(TestPolicy.class);
 
-        private boolean skip;
-        private Path policy;
-        private XACMLPolicyAggregator aggregator = new XACMLPolicyAggregator();
-        private long index;
-        
+    private boolean skip;
+    private Path policy;
+    private XACMLPolicyAggregator aggregator = new XACMLPolicyAggregator();
+    private long index;
+
+    //
+    // Our command line parameters
+    //
+    public static final String OPTION_POLICY = "policy";
+    public static final String OPTION_SKIP_GENERATE = "skip";
+
+    static {
+        options.addOption(new Option(OPTION_POLICY, true, "Path to the policy file."));
+        options.addOption(new Option(OPTION_SKIP_GENERATE, false, "Skip generating requests."));
+    }
+
+    public class FlattenerObject {
+        Identifier category;
+        Identifier datatype;
+        Identifier attribute;
+        Set<AttributeValue<?>> values;
+    }
+
+    /**
+     * This application exercises a policy by producing ALL the possible request combinations for a policy.
+     *
+     * -policy Path to a policy file
+     *
+     * @param args
+     * @throws HelpException
+     * @throws org.apache.commons.cli.ParseException
+     * @throws java.net.MalformedURLException
+     */
+
+    public TestPolicy(String[] args) throws MalformedURLException, ParseException, HelpException {
+        super(args);
+    }
+
+    /*
+     * Look for the -policy command line argument. This application needs a pointer to a specific policy
+     * in order to run.
+     *
+     *
+     * (non-Javadoc)
+     * @see com.att.research.xacmlatt.pdp.test.TestBase#parseCommands(java.lang.String[])
+     */
+    @Override
+    protected void parseCommands(String[] args) throws ParseException, MalformedURLException, HelpException {
         //
-        // Our command line parameters
+        // Have our super do its job
         //
-        public static final String OPTION_POLICY = "policy";
-        public static final String OPTION_SKIP_GENERATE = "skip";
-
-        static {
-                options.addOption(new Option(OPTION_POLICY, true, "Path to the policy file."));
-                options.addOption(new Option(OPTION_SKIP_GENERATE, false, "Skip generating requests."));
+        super.parseCommands(args);
+        //
+        // Look for the policy option
+        //
+        CommandLine cl;
+        cl = new GnuParser().parse(options, args);
+        if (cl.hasOption(OPTION_POLICY)) {
+            this.policy = Paths.get(cl.getOptionValue(OPTION_POLICY));
+            //
+            // Ensure it exists
+            //
+            if (Files.notExists(this.policy)) {
+                throw new ParseException("Policy file does not exist.");
+            }
+        } else {
+            throw new ParseException("You need to specify the policy file to be used.");
         }
-        
-        public class FlattenerObject {
-                Identifier category;
-                Identifier datatype;
-                Identifier attribute;
-                Set<AttributeValue<?>> values;
+        if (cl.hasOption(OPTION_SKIP_GENERATE)) {
+            this.skip = true;
+        } else {
+            this.skip = false;
         }
-        
-        /**
-         * This application exercises a policy by producing ALL the possible request combinations for a policy.
-         * 
-         * -policy Path to a policy file
-         * 
-         * @param args
-         * @throws HelpException 
-         * @throws org.apache.commons.cli.ParseException
-         * @throws java.net.MalformedURLException
-         */
+    }
 
-        public TestPolicy(String[] args) throws MalformedURLException, ParseException, HelpException {
-                super(args);
+    /*
+     * We override this method because here is where we want to scan the policy and aggregate all
+     * the attributes that are defined within the policy. This routine will then dump all the possible
+     * requests into the requests sub-directory. Thus, when this method returns the TestBase can proceed
+     * to iterate each generated request and run it against the PDP engine.
+     *
+     * (non-Javadoc)
+     * @see com.att.research.xacmlatt.pdp.test.TestBase#configure()
+     */
+    @Override
+    protected void configure() throws FactoryException {
+        //
+        // Have our base class do its thing
+        //
+        super.configure();
+        //
+        // Setup where the PDP can find the policy
+        //
+        System.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "policy");
+        System.setProperty("policy.file", this.policy.toString());
+        //
+        // Determine if they want us to skip generation. This helps when a huge number of
+        // requests will get generated for a policy and can take some time to do so. The user
+        // can generate the requests once and then start testing a policy against the requests. Thus,
+        // the attributes never changed but the policy logic did (saves time).
+        //
+        if (this.skip) {
+            return;
+        }
+        //
+        // Now we will scan the policy and get all the attributes.
+        //
+        XACMLPolicyScanner scanner = new XACMLPolicyScanner(this.policy, this.aggregator);
+        //
+        // The scanner returns us a policy object
+        //
+        Object policyObject = scanner.scan();
+        //
+        // Just dump some info
+        //
+        if (policyObject instanceof PolicySetType) {
+            logger.info("Creating requests for policyset: " + ((PolicySetType)policyObject).getDescription());
+        } else if (policyObject instanceof PolicyType) {
+            logger.info("Creating requests for policy: " + ((PolicyType)policyObject).getDescription());
+        }
+        //
+        // Call the function to create the requests
+        //
+        if (policyObject != null) {
+            this.createRequests();
         }
 
-        /* 
-         * Look for the -policy command line argument. This application needs a pointer to a specific policy
-         * in order to run.
-         * 
-         * 
-         * (non-Javadoc)
-         * @see com.att.research.xacmlatt.pdp.test.TestBase#parseCommands(java.lang.String[])
-         */
-        @Override
-        protected void parseCommands(String[] args) throws ParseException, MalformedURLException, HelpException {
-                //
-                // Have our super do its job
-                //
-                super.parseCommands(args);
-                //
-                // Look for the policy option
-                //
-                CommandLine cl;
-                cl = new GnuParser().parse(options, args);
-                if (cl.hasOption(OPTION_POLICY)) {
-                        this.policy = Paths.get(cl.getOptionValue(OPTION_POLICY));
-                        //
-                        // Ensure it exists
-                        //
-                        if (Files.notExists(this.policy)) {
-                                throw new ParseException("Policy file does not exist.");
-                        }
-                } else {
-                        throw new ParseException("You need to specify the policy file to be used.");
-                }
-                if (cl.hasOption(OPTION_SKIP_GENERATE)) {
-                        this.skip = true;
-                } else {
-                        this.skip = false;
-                }
-        }
+        logger.info("Completed Generating requests.");
+    }
 
-        /* 
-         * We override this method because here is where we want to scan the policy and aggregate all
-         * the attributes that are defined within the policy. This routine will then dump all the possible
-         * requests into the requests sub-directory. Thus, when this method returns the TestBase can proceed
-         * to iterate each generated request and run it against the PDP engine.
-         * 
-         * (non-Javadoc)
-         * @see com.att.research.xacmlatt.pdp.test.TestBase#configure()
-         */
-        @Override
-        protected void configure() throws FactoryException {
-                //
-                // Have our base class do its thing
-                //
-                super.configure();
-                //
-                // Setup where the PDP can find the policy
-                //
-                System.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "policy");
-                System.setProperty("policy.file", this.policy.toString());
-                //
-                // Determine if they want us to skip generation. This helps when a huge number of
-                // requests will get generated for a policy and can take some time to do so. The user
-                // can generate the requests once and then start testing a policy against the requests. Thus,
-                // the attributes never changed but the policy logic did (saves time).
-                //
-                if (this.skip) {
-                        return;
-                }
-                //
-                // Now we will scan the policy and get all the attributes.
-                //
-                XACMLPolicyScanner scanner = new XACMLPolicyScanner(this.policy, this.aggregator);
-                //
-                // The scanner returns us a policy object
-                //
-                Object policyObject = scanner.scan();
-                //
-                // Just dump some info
-                //
-                if (policyObject instanceof PolicySetType) {
-                        logger.info("Creating requests for policyset: " + ((PolicySetType)policyObject).getDescription());
-                } else if (policyObject instanceof PolicyType) {
-                        logger.info("Creating requests for policy: " + ((PolicyType)policyObject).getDescription());
-                }
-                //
-                // Call the function to create the requests
-                //
-                if (policyObject != null) {
-                        this.createRequests();
-                }
-
-                logger.info("Completed Generating requests.");
-        }
-
-        @SuppressWarnings("unchecked")
-        protected void createRequests() {
-                //
-                // Clear out our request directory
-                //
-                this.removeRequests();
-                //
-                // Get our map
-                //
-                Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> attributeMap = this.aggregator.getAttributeMap();
-                //
-                // We're going to create an initial flat list of requests for each unique attribute ID. Unique being the
-                // category, datatype and attribute id.
-                //
-                // By flattening the list, it makes it easier to then generate all the combinations of possible requests.
-                //
-                List<FlattenerObject> attributes = new ArrayList<FlattenerObject>();
-                //
-                // Iterate through all the maps, we are going to flatten it
-                // out into an array list.
-                //
-                for (Map.Entry<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> categoryEntry : attributeMap.entrySet()) {
-                        String category = categoryEntry.getKey().toString();
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Category: " + category);
-                        }
-                        Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>> datatypeMap = categoryEntry.getValue();
-                        for (Map.Entry<Identifier, Map<Identifier, Set<AttributeValue<?>>>> datatypeEntry : datatypeMap.entrySet()) {
-                                String datatype = datatypeEntry.getKey().toString();
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("\tData Type: " + datatype);
-                                }
-                                Map<Identifier, Set<AttributeValue<?>>> attributeIDMap = datatypeEntry.getValue();
-                                for (Map.Entry<Identifier, Set<AttributeValue<?>>> attributeIDEntry : attributeIDMap.entrySet()) {
-                                        String attributeID = attributeIDEntry.getKey().toString();
-                                        if (logger.isDebugEnabled()) {
-                                                logger.debug("\t\tAttribute ID: " + attributeID);
-                                        }
-                                        Set<AttributeValue<?>> attributeValueSet = attributeIDEntry.getValue();
-                                        //
-                                        // Sanity check to see if there are any values. Sometimes there isn't if an attribute
-                                        // is a designator that is part of a condition or variable.
-                                        //
-                                        if (attributeValueSet.isEmpty()) {
-                                                if (logger.isDebugEnabled()) {
-                                                        logger.debug("No values for attribute " + attributeIDEntry.getKey().stringValue());
-                                                }
-                                                //
-                                                // Check for the boolean datatype, in that case we can safely
-                                                // assume the true/false are ALL the possible values.
-                                                //
-                                                if (datatypeEntry.getKey().equals(XACML3.ID_DATATYPE_BOOLEAN) == false) {
-                                                        //
-                                                        // Not boolean, so skip it
-                                                        //
-                                                        continue;
-                                                }
-                                                if (logger.isDebugEnabled()) {
-                                                        logger.debug("No values but its a boolean datatype, we will include it anyway.");
-                                                }
-                                        }
-                                        //
-                                        // Create our flattener object
-                                        //
-                                        FlattenerObject flat = new FlattenerObject();
-                                        flat.category = categoryEntry.getKey();
-                                        flat.datatype = datatypeEntry.getKey();
-                                        flat.attribute = attributeIDEntry.getKey();
-                                        flat.values = new HashSet<AttributeValue<?>>();
-                                        if (datatypeEntry.getKey().equals(XACML3.ID_DATATYPE_BOOLEAN)) {
-                                                //
-                                                // There are only 2 possible values, true or false
-                                                //
-                                                flat.values.add(this.createAttributeValue(flat.datatype, true));
-                                                flat.values.add(this.createAttributeValue(flat.datatype, false));
-                                        } else {
-                                                flat.values.addAll(attributeValueSet);
-                                        }
-                                        attributes.add(flat);
-                                }
-                        }
-                }
-                if (attributes.size() <= 1) {
-                        //
-                        // Only one attribute, why bother
-                        //
-                        logger.info("Not enough attributes in policy: " + attributes.size());
-                        return;
-                }
-                /*
-                 * PLD work more on this later. This combinatorial formula is only accurate if each
-                 * attribute has one value.
-                 * 
-                 */
+    @SuppressWarnings("unchecked")
+    protected void createRequests() {
+        //
+        // Clear out our request directory
+        //
+        this.removeRequests();
+        //
+        // Get our map
+        //
+        Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> attributeMap = this.aggregator.getAttributeMap();
+        //
+        // We're going to create an initial flat list of requests for each unique attribute ID. Unique being the
+        // category, datatype and attribute id.
+        //
+        // By flattening the list, it makes it easier to then generate all the combinations of possible requests.
+        //
+        List<FlattenerObject> attributes = new ArrayList<FlattenerObject>();
+        //
+        // Iterate through all the maps, we are going to flatten it
+        // out into an array list.
+        //
+        for (Map.Entry<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> categoryEntry : attributeMap.entrySet()) {
+            String category = categoryEntry.getKey().toString();
+            if (logger.isDebugEnabled()) {
+                logger.debug("Category: " + category);
+            }
+            Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>> datatypeMap = categoryEntry.getValue();
+            for (Map.Entry<Identifier, Map<Identifier, Set<AttributeValue<?>>>> datatypeEntry : datatypeMap.entrySet()) {
+                String datatype = datatypeEntry.getKey().toString();
                 if (logger.isDebugEnabled()) {
+                    logger.debug("\tData Type: " + datatype);
+                }
+                Map<Identifier, Set<AttributeValue<?>>> attributeIDMap = datatypeEntry.getValue();
+                for (Map.Entry<Identifier, Set<AttributeValue<?>>> attributeIDEntry : attributeIDMap.entrySet()) {
+                    String attributeID = attributeIDEntry.getKey().toString();
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("\t\tAttribute ID: " + attributeID);
+                    }
+                    Set<AttributeValue<?>> attributeValueSet = attributeIDEntry.getValue();
+                    //
+                    // Sanity check to see if there are any values. Sometimes there isn't if an attribute
+                    // is a designator that is part of a condition or variable.
+                    //
+                    if (attributeValueSet.isEmpty()) {
+                        if (logger.isDebugEnabled()) {
+                            logger.debug("No values for attribute " + attributeIDEntry.getKey().stringValue());
+                        }
                         //
-                        // This isn't really accurate, if an attribute has more than one value
+                        // Check for the boolean datatype, in that case we can safely
+                        // assume the true/false are ALL the possible values.
                         //
-                        logger.debug(attributes.size() + " will generate " + computePossibleCombinations(attributes.size()));
-                }
-                this.index = 1;
-                for (int i = 0; i < attributes.size(); i++) {
-                        FlattenerObject flat = attributes.get(i);
-                        for (AttributeValue<?> value : flat.values) {
-                                //
-                                // Create a basic request object for just that attribute value.
-                                //
-                                RequestType request = new RequestType();
-                                //
-                                AttributesType attrs = new AttributesType();
-                                attrs.setCategory(flat.category.stringValue());
-                                request.getAttributes().add(attrs);
-                                //
-                                AttributeType attr = new AttributeType();
-                                attr.setAttributeId(flat.attribute.stringValue());
-                                attrs.getAttribute().add(attr);
-                                //
-                                AttributeValueType val = new AttributeValueType();
-                                val.setDataType(flat.datatype.stringValue());
-                                if (value.getValue() instanceof Collection) {
-                                        val.getContent().addAll((Collection<? extends Object>) value.getValue());
-                                } else {
-                                        val.getContent().add(value.getValue().toString());
-                                }
-                                //
-                                attr.getAttributeValue().add(val);
-                                //
-                                // Dump it out
-                                //
-                                this.writeRequest(request);
-                                //
-                                // Initiate recursive call to add other attributes to the request
-                                //
-                                this.recursivelyGenerateRequests(request, i + 1, attributes);
+                        if (datatypeEntry.getKey().equals(XACML3.ID_DATATYPE_BOOLEAN) == false) {
+                            //
+                            // Not boolean, so skip it
+                            //
+                            continue;
                         }
-                }
-        }
-        
-        protected void recursivelyGenerateRequests(RequestType request, int i, List<FlattenerObject> attributes) {
-                if (logger.isTraceEnabled()) {
-                        logger.trace("recursiveGenerate index: " + index + " i: " + i);
-                }
-                for ( ; i < attributes.size(); i++) {
-                        FlattenerObject flat = attributes.get(i);
-                        for (AttributeValue<?> value : flat.values) {
-                                //
-                                // Make a copy of the request
-                                //
-                                RequestType copyRequest = XACMLObjectCopy.deepCopy(request);
-                                //
-                                // Create the value object
-                                //
-                                AttributeValueType newValue = new AttributeValueType();
-                                newValue.setDataType(flat.datatype.stringValue());
-                                if (value.getValue() instanceof Collection) {
-                                        for (Object v : (Collection<?>) value.getValue()) {
-                                                newValue.getContent().add(v.toString());
-                                        }
-                                } else {
-                                        newValue.getContent().add(value.getValue().toString());
-                                }
-                                //
-                                // Add the value to the request
-                                //
-                                this.addAttribute(copyRequest, flat.category.stringValue(), flat.attribute.stringValue(), newValue);
-                                //
-                                // Now write it out
-                                //
-                                this.writeRequest(copyRequest);
-                                //
-                                // Recursively go through the rest of the attributes
-                                //
-                                this.recursivelyGenerateRequests(copyRequest, i + 1, attributes);
+                        if (logger.isDebugEnabled()) {
+                            logger.debug("No values but its a boolean datatype, we will include it anyway.");
                         }
-                }
-        }
-        
-        public static long	computePossibleCombinations(long numberOfAttributes) {
-                long num = 0;
-                for (long i = numberOfAttributes; i > 0; i--) {
-                        num += computeCombinations(numberOfAttributes, i);
-                }
-                return num;
-        }
-        
-        public static long	computeFactorial(long n) {
-                long fact = 1;
-                for (long i = 1; i <= n; i++) {
-                        fact *= i;
-                }
-                return fact;
-        }
-
-        public static long	computePermutationsWithoutRepetition(long n, long r) {
-                //
-                //      n!
-                //	---------
-                //   (n - r)!
-                //
-                long nPrime = 1;
-                long n_rPrime = 1;
-                for (long i = n; i > 1; i--) {
-                        nPrime *= i; 
-                }
-                
-                for (long i = (n - r); i > 1; i--) {
-                        n_rPrime *= i; 
-                }
-                return nPrime / n_rPrime;
-        }
-        
-        public static long	computeCombinations(long n, long r) {
-                //
-                //		 n!
-                //	-----------
-                //  r! * (n-r)!
-                //
-                long nPrime = 1;
-                long rPrime = 1;
-                long n_rPrime = 1;
-                
-                for (long i = n; i > 1; i--) {
-                        nPrime *= i; 
-                }
-                
-                for (long i = r; i > 1; i--) {
-                        rPrime *= i; 
-                }
-                
-                for (long i = (n - r); i > 1; i--) {
-                        n_rPrime *= i; 
-                }
-                
-                return nPrime / (rPrime * n_rPrime);
-        }
-
-        protected Set<AttributeValue<?>> getAttributeValues(RequestType request) {
-                //
-                // Get our map
-                //
-                Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> attributeMap = this.aggregator.getAttributeMap();
-                //
-                // Find the attribute
-                //
-                AttributesType attrs = request.getAttributes().get(0);
-                Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>> categoryMap = attributeMap.get(new IdentifierImpl(attrs.getCategory()));
-                if (categoryMap != null) {
-                        AttributeType a = attrs.getAttribute().get(0);
-                        Map<Identifier, Set<AttributeValue<?>>> datatypeMap = categoryMap.get(new IdentifierImpl(a.getAttributeValue().get(0).getDataType()));
-                        if (datatypeMap != null) {
-                                Set<AttributeValue<?>> values = datatypeMap.get(new IdentifierImpl(a.getAttributeId()));
-                                if (values != null) {
-                                        return values;
-                                }
-                        }
-                }
-                return Collections.emptySet();
-        }
-        
-        protected AttributeValue<?> createAttributeValue(Identifier datatype, Object value) {
-                DataTypeFactory dataTypeFactory		= null;
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                        if (dataTypeFactory == null) {
-                                logger.error("Could not create data type factory");
-                                return null;
-                        }
-                } catch (FactoryException e) {
-                        logger.error("Can't get Data type Factory: " + e.getLocalizedMessage());
-                        return null;
-                }		
-                DataType<?> dataTypeExtended	= dataTypeFactory.getDataType(datatype);
-                if (dataTypeExtended == null) {
-                        logger.error("Unknown datatype: " + datatype);
-                        return null;
-                }
-                try {
-                        return dataTypeExtended.createAttributeValue(value);
-                } catch (DataTypeException e) {
-                        logger.error(e);
-                }
-                return null;
-        }
-        
-        protected void removeRequests() {
-                //
-                // Delete any existing request files that we generate. i.e. Have the Unknown in the file name.
-                //
-                try {
-                        Files.walkFileTree(Paths.get(this.directory.toString(), "requests"), new SimpleFileVisitor<Path>() {
-
-                                @Override
-                                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-                                        //
-                                        // Sanity check the file name
-                                        //
-                                        Matcher matcher = pattern.matcher(file.getFileName().toString());
-                                        if (matcher.matches()) {
-                                                try {
-                                                        //
-                                                        // Pull what this request is supposed to be
-                                                        //
-                                                        String group = null;
-                                                        int count = matcher.groupCount();
-                                                        if (count >= 1) {
-                                                                group = matcher.group(count-1);
-                                                        }
-                                                        //
-                                                        // Send it
-                                                        //
-                                                        if (group.equals("Unknown")) {
-                                                                //
-                                                                // Remove the file
-                                                                //
-                                                                Files.delete(file);
-                                                        }
-                                                } catch (Exception e) {
-                                                        logger.error(e);
-                                                        e.printStackTrace();
-                                                }
-                                        }
-                                        return super.visitFile(file, attrs);
-                                }				
-                        });
-                } catch (IOException e) {
-                        logger.error("Failed to removeRequests from " + this.directory + " " + e);
-                }
-        }
-
-        protected void addRequests(RequestType request, List<RequestType> requests, int index) {
-                for (RequestType req : requests) {
+                    }
+                    //
+                    // Create our flattener object
+                    //
+                    FlattenerObject flat = new FlattenerObject();
+                    flat.category = categoryEntry.getKey();
+                    flat.datatype = datatypeEntry.getKey();
+                    flat.attribute = attributeIDEntry.getKey();
+                    flat.values = new HashSet<AttributeValue<?>>();
+                    if (datatypeEntry.getKey().equals(XACML3.ID_DATATYPE_BOOLEAN)) {
                         //
-                        // There really should only be one attribute
+                        // There are only 2 possible values, true or false
                         //
-                        for (AttributesType attrs : req.getAttributes()) {
-                                for (AttributeType attr : attrs.getAttribute()) {
-                                        for (AttributeValueType value : attr.getAttributeValue()) {
-                                                if (this.addAttribute(request, attrs.getCategory(), attr.getAttributeId(), value)) {
-                                                        this.writeRequest(request);
-                                                }
-                                        }
-                                }
-                        }
+                        flat.values.add(this.createAttributeValue(flat.datatype, true));
+                        flat.values.add(this.createAttributeValue(flat.datatype, false));
+                    } else {
+                        flat.values.addAll(attributeValueSet);
+                    }
+                    attributes.add(flat);
                 }
+            }
         }
-
-        /**
-         * Writes the request into the "requests" sub-directory, relative to the value of the "directory" setup
-         * during initialization.
-         * 
-         * Writing the requests out allows one to go back and easily refer to the request when analyzing the responses
-         * generated after the PDP decide() call. Also, one can then use the generated requests into any test tools
-         * they wish to build.
-         * 
-         * @param request - The request to be written.
+        if (attributes.size() <= 1) {
+            //
+            // Only one attribute, why bother
+            //
+            logger.info("Not enough attributes in policy: " + attributes.size());
+            return;
+        }
+        /*
+         * PLD work more on this later. This combinatorial formula is only accurate if each
+         * attribute has one value.
+         *
          */
-        protected void writeRequest(RequestType request) {
-                if (logger.isTraceEnabled()) {
-                        logger.trace("writeRequest: " + index);
-                }
-                try {
-                        ObjectFactory of = new ObjectFactory();
-                        JAXBElement<RequestType> requestElement = of.createRequest(request);
-                        JAXBContext context = JAXBContext.newInstance(RequestType.class);
-                        Marshaller m = context.createMarshaller();
-                        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-                        Path outFile = Paths.get(this.directory, "requests", String.format("Request.%06d.Unknown.xml", this.index));
-                        m.marshal(requestElement, outFile.toFile());
-                } catch (Exception e) {
-                        logger.error("Failed to write request: " + e.getMessage());
-                }
-                this.index++;
+        if (logger.isDebugEnabled()) {
+            //
+            // This isn't really accurate, if an attribute has more than one value
+            //
+            logger.debug(attributes.size() + " will generate " + computePossibleCombinations(attributes.size()));
         }
-
-        protected boolean	addAttribute(RequestType request, String category, String id, AttributeValueType value) {
+        this.index = 1;
+        for (int i = 0; i < attributes.size(); i++) {
+            FlattenerObject flat = attributes.get(i);
+            for (AttributeValue<?> value : flat.values) {
                 //
-                // See if the category exists
+                // Create a basic request object for just that attribute value.
                 //
-                for (AttributesType attrs : request.getAttributes()) {
-                        if (attrs.getCategory().equals(category)) {
-                                //
-                                // It does have the category. But does it have the attribute ID?
-                                //
-                                for (AttributeType attr : attrs.getAttribute()) {
-                                        if (attr.getAttributeId().equals(id)) {
-                                                //
-                                                // Yes, check for the same datatype
-                                                //
-                                                for (AttributeValueType val : attr.getAttributeValue()) {
-                                                        if (val.getDataType().equals(value.getDataType())) {
-                                                                //
-                                                                // We have something already there
-                                                                //
-                                                                return false;
-                                                        }
-                                                }
-                                                //
-                                                // The ID exists, but not the datatype
-                                                //
-                                                attr.getAttributeValue().add(value);
-                                                return true;
-                                        }
-                                }
-                                //
-                                // If we get here, the ID does not exist
-                                //
-                                AttributeType attr = new AttributeType();
-                                attr.setAttributeId(id);
-                                attr.getAttributeValue().add(value);
-                                attrs.getAttribute().add(attr);
-                                return true;
-                        }
-                }
-                //
-                // If we get here, the category does not exist. So add it in.
+                RequestType request = new RequestType();
                 //
                 AttributesType attrs = new AttributesType();
-                attrs.setCategory(category);
+                attrs.setCategory(flat.category.stringValue());
+                request.getAttributes().add(attrs);
+                //
+                AttributeType attr = new AttributeType();
+                attr.setAttributeId(flat.attribute.stringValue());
+                attrs.getAttribute().add(attr);
+                //
+                AttributeValueType val = new AttributeValueType();
+                val.setDataType(flat.datatype.stringValue());
+                if (value.getValue() instanceof Collection) {
+                    val.getContent().addAll((Collection<? extends Object>) value.getValue());
+                } else {
+                    val.getContent().add(value.getValue().toString());
+                }
+                //
+                attr.getAttributeValue().add(val);
+                //
+                // Dump it out
+                //
+                this.writeRequest(request);
+                //
+                // Initiate recursive call to add other attributes to the request
+                //
+                this.recursivelyGenerateRequests(request, i + 1, attributes);
+            }
+        }
+    }
+
+    protected void recursivelyGenerateRequests(RequestType request, int i, List<FlattenerObject> attributes) {
+        if (logger.isTraceEnabled()) {
+            logger.trace("recursiveGenerate index: " + index + " i: " + i);
+        }
+        for ( ; i < attributes.size(); i++) {
+            FlattenerObject flat = attributes.get(i);
+            for (AttributeValue<?> value : flat.values) {
+                //
+                // Make a copy of the request
+                //
+                RequestType copyRequest = XACMLObjectCopy.deepCopy(request);
+                //
+                // Create the value object
+                //
+                AttributeValueType newValue = new AttributeValueType();
+                newValue.setDataType(flat.datatype.stringValue());
+                if (value.getValue() instanceof Collection) {
+                    for (Object v : (Collection<?>) value.getValue()) {
+                        newValue.getContent().add(v.toString());
+                    }
+                } else {
+                    newValue.getContent().add(value.getValue().toString());
+                }
+                //
+                // Add the value to the request
+                //
+                this.addAttribute(copyRequest, flat.category.stringValue(), flat.attribute.stringValue(), newValue);
+                //
+                // Now write it out
+                //
+                this.writeRequest(copyRequest);
+                //
+                // Recursively go through the rest of the attributes
+                //
+                this.recursivelyGenerateRequests(copyRequest, i + 1, attributes);
+            }
+        }
+    }
+
+    public static long	computePossibleCombinations(long numberOfAttributes) {
+        long num = 0;
+        for (long i = numberOfAttributes; i > 0; i--) {
+            num += computeCombinations(numberOfAttributes, i);
+        }
+        return num;
+    }
+
+    public static long	computeFactorial(long n) {
+        long fact = 1;
+        for (long i = 1; i <= n; i++) {
+            fact *= i;
+        }
+        return fact;
+    }
+
+    public static long	computePermutationsWithoutRepetition(long n, long r) {
+        //
+        //      n!
+        //	---------
+        //   (n - r)!
+        //
+        long nPrime = 1;
+        long n_rPrime = 1;
+        for (long i = n; i > 1; i--) {
+            nPrime *= i;
+        }
+
+        for (long i = (n - r); i > 1; i--) {
+            n_rPrime *= i;
+        }
+        return nPrime / n_rPrime;
+    }
+
+    public static long	computeCombinations(long n, long r) {
+        //
+        //		 n!
+        //	-----------
+        //  r! * (n-r)!
+        //
+        long nPrime = 1;
+        long rPrime = 1;
+        long n_rPrime = 1;
+
+        for (long i = n; i > 1; i--) {
+            nPrime *= i;
+        }
+
+        for (long i = r; i > 1; i--) {
+            rPrime *= i;
+        }
+
+        for (long i = (n - r); i > 1; i--) {
+            n_rPrime *= i;
+        }
+
+        return nPrime / (rPrime * n_rPrime);
+    }
+
+    protected Set<AttributeValue<?>> getAttributeValues(RequestType request) {
+        //
+        // Get our map
+        //
+        Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> attributeMap = this.aggregator.getAttributeMap();
+        //
+        // Find the attribute
+        //
+        AttributesType attrs = request.getAttributes().get(0);
+        Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>> categoryMap = attributeMap.get(new IdentifierImpl(attrs.getCategory()));
+        if (categoryMap != null) {
+            AttributeType a = attrs.getAttribute().get(0);
+            Map<Identifier, Set<AttributeValue<?>>> datatypeMap = categoryMap.get(new IdentifierImpl(a.getAttributeValue().get(0).getDataType()));
+            if (datatypeMap != null) {
+                Set<AttributeValue<?>> values = datatypeMap.get(new IdentifierImpl(a.getAttributeId()));
+                if (values != null) {
+                    return values;
+                }
+            }
+        }
+        return Collections.emptySet();
+    }
+
+    protected AttributeValue<?> createAttributeValue(Identifier datatype, Object value) {
+        DataTypeFactory dataTypeFactory		= null;
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+            if (dataTypeFactory == null) {
+                logger.error("Could not create data type factory");
+                return null;
+            }
+        } catch (FactoryException e) {
+            logger.error("Can't get Data type Factory: " + e.getLocalizedMessage());
+            return null;
+        }
+        DataType<?> dataTypeExtended	= dataTypeFactory.getDataType(datatype);
+        if (dataTypeExtended == null) {
+            logger.error("Unknown datatype: " + datatype);
+            return null;
+        }
+        try {
+            return dataTypeExtended.createAttributeValue(value);
+        } catch (DataTypeException e) {
+            logger.error(e);
+        }
+        return null;
+    }
+
+    protected void removeRequests() {
+        //
+        // Delete any existing request files that we generate. i.e. Have the Unknown in the file name.
+        //
+        try {
+            Files.walkFileTree(Paths.get(this.directory.toString(), "requests"), new SimpleFileVisitor<Path>() {
+
+                @Override
+                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+                    //
+                    // Sanity check the file name
+                    //
+                    Matcher matcher = pattern.matcher(file.getFileName().toString());
+                    if (matcher.matches()) {
+                        try {
+                            //
+                            // Pull what this request is supposed to be
+                            //
+                            String group = null;
+                            int count = matcher.groupCount();
+                            if (count >= 1) {
+                                group = matcher.group(count-1);
+                            }
+                            //
+                            // Send it
+                            //
+                            if (group.equals("Unknown")) {
+                                //
+                                // Remove the file
+                                //
+                                Files.delete(file);
+                            }
+                        } catch (Exception e) {
+                            logger.error(e);
+                            e.printStackTrace();
+                        }
+                    }
+                    return super.visitFile(file, attrs);
+                }
+            });
+        } catch (IOException e) {
+            logger.error("Failed to removeRequests from " + this.directory + " " + e);
+        }
+    }
+
+    protected void addRequests(RequestType request, List<RequestType> requests, int index) {
+        for (RequestType req : requests) {
+            //
+            // There really should only be one attribute
+            //
+            for (AttributesType attrs : req.getAttributes()) {
+                for (AttributeType attr : attrs.getAttribute()) {
+                    for (AttributeValueType value : attr.getAttributeValue()) {
+                        if (this.addAttribute(request, attrs.getCategory(), attr.getAttributeId(), value)) {
+                            this.writeRequest(request);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Writes the request into the "requests" sub-directory, relative to the value of the "directory" setup
+     * during initialization.
+     *
+     * Writing the requests out allows one to go back and easily refer to the request when analyzing the responses
+     * generated after the PDP decide() call. Also, one can then use the generated requests into any test tools
+     * they wish to build.
+     *
+     * @param request - The request to be written.
+     */
+    protected void writeRequest(RequestType request) {
+        if (logger.isTraceEnabled()) {
+            logger.trace("writeRequest: " + index);
+        }
+        try {
+            ObjectFactory of = new ObjectFactory();
+            JAXBElement<RequestType> requestElement = of.createRequest(request);
+            JAXBContext context = JAXBContext.newInstance(RequestType.class);
+            Marshaller m = context.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+            Path outFile = Paths.get(this.directory, "requests", String.format("Request.%06d.Unknown.xml", this.index));
+            m.marshal(requestElement, outFile.toFile());
+        } catch (Exception e) {
+            logger.error("Failed to write request: " + e.getMessage());
+        }
+        this.index++;
+    }
+
+    protected boolean	addAttribute(RequestType request, String category, String id, AttributeValueType value) {
+        //
+        // See if the category exists
+        //
+        for (AttributesType attrs : request.getAttributes()) {
+            if (attrs.getCategory().equals(category)) {
+                //
+                // It does have the category. But does it have the attribute ID?
+                //
+                for (AttributeType attr : attrs.getAttribute()) {
+                    if (attr.getAttributeId().equals(id)) {
+                        //
+                        // Yes, check for the same datatype
+                        //
+                        for (AttributeValueType val : attr.getAttributeValue()) {
+                            if (val.getDataType().equals(value.getDataType())) {
+                                //
+                                // We have something already there
+                                //
+                                return false;
+                            }
+                        }
+                        //
+                        // The ID exists, but not the datatype
+                        //
+                        attr.getAttributeValue().add(value);
+                        return true;
+                    }
+                }
+                //
+                // If we get here, the ID does not exist
+                //
                 AttributeType attr = new AttributeType();
                 attr.setAttributeId(id);
                 attr.getAttributeValue().add(value);
                 attrs.getAttribute().add(attr);
-                request.getAttributes().add(attrs);
                 return true;
+            }
         }
+        //
+        // If we get here, the category does not exist. So add it in.
+        //
+        AttributesType attrs = new AttributesType();
+        attrs.setCategory(category);
+        AttributeType attr = new AttributeType();
+        attr.setAttributeId(id);
+        attr.getAttributeValue().add(value);
+        attrs.getAttribute().add(attr);
+        request.getAttributes().add(attrs);
+        return true;
+    }
 
-        public static void main(String[] args) {
-                try {
-                        new TestPolicy(args).run();
-                } catch (ParseException | IOException | FactoryException e) {
-                        logger.error(e);
-                } catch (HelpException e) {
-                }
+    public static void main(String[] args) {
+        try {
+            new TestPolicy(args).run();
+        } catch (ParseException | IOException | FactoryException e) {
+            logger.error(e);
+        } catch (HelpException e) {
         }
+    }
 
-        /*
-        // Map<CATEGORY, MAP<DATATYPE, MAP<ATTRIBUTEID, SET<VALUES>>>
-        @SuppressWarnings("unchecked")
-        private void generateRequests(Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> categoryMap) {
-                meta = new ArrayList<>();
-                
-                for (Map.Entry<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> categoryEntry : categoryMap.entrySet()) {
-                        String category = categoryEntry.getKey().toString();
-                        logger.debug("Category: " + category);
-                        Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>> datatypeMap = categoryEntry.getValue();
-                        for (Map.Entry<Identifier, Map<Identifier, Set<AttributeValue<?>>>> datatypeEntry : datatypeMap.entrySet()) {
-                                String datatype = datatypeEntry.getKey().toString();
-                                logger.debug("\tData Type: " + datatype);
-                                Map<Identifier, Set<AttributeValue<?>>> attributeIDMap = datatypeEntry.getValue();
-                                for (Map.Entry<Identifier, Set<AttributeValue<?>>> attributeIDEntry : attributeIDMap.entrySet()) {
-                                        String attributeID = attributeIDEntry.getKey().toString();
-                                        logger.debug("\t\tAttribute ID: " + attributeID);
-                                        Set<AttributeValue<?>> attributeValueSet = attributeIDEntry.getValue();
-                                        for (AttributeValue<?> value : attributeValueSet) {
-                                                logger.debug("\t\t\tAttribute Value: " + value);						
-                                        }
-                                        Iterator<AttributeValue<?>> iterator = attributeValueSet.iterator();
-                                        logger.debug("\t\t\t# of Attribute values: " + attributeValueSet.size());
-                                        meta.add(new Object[] {category, datatype, attributeID, iterator.next(), iterator, attributeValueSet});
-                                }
-                        }
-                }
-                
-                int count = 0;
-                for (File file : output.toFile().listFiles()) {
-                        file.delete();
-                }
-                        
-                do {
-                        RequestType request = new RequestType();
-                        request.setCombinedDecision(false);
-                        request.setReturnPolicyIdList(false);
-                        List<AttributesType> attributesList = request.getAttributes();
-                        
-                        Map<String, AttributesType> category2Attribute= new HashMap<>();
-                        for (int i = 0; i < meta.size(); i++) {
-                                Object[] record = meta.get(i);
-                                
-                                AttributesType attributes = null;
-                                if (category2Attribute.containsKey(record[0].toString()))
-                                        attributes = category2Attribute.get(record[0].toString());
-                                else {
-                                        attributes = new AttributesType();
-                                        attributes.setCategory(record[0].toString());
-                                        category2Attribute.put(record[0].toString(), attributes);
-                                        attributesList.add(attributes);				
-                                }
-//				attributes.setId(record[2].toString());
-                                List<AttributeType> attrList = attributes.getAttribute();
-                                
-                                AttributeType attribute = new AttributeType();
-                                attribute.setAttributeId(record[2].toString());
-                                List<AttributeValueType> valueList = attribute.getAttributeValue();
+    /*
+    // Map<CATEGORY, MAP<DATATYPE, MAP<ATTRIBUTEID, SET<VALUES>>>
+    @SuppressWarnings("unchecked")
+    private void generateRequests(Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> categoryMap) {
+            meta = new ArrayList<>();
 
-                                AttributeValue<?> attributeValue = (AttributeValue<?>) record[3];
+            for (Map.Entry<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> categoryEntry : categoryMap.entrySet()) {
+                    String category = categoryEntry.getKey().toString();
+                    logger.debug("Category: " + category);
+                    Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>> datatypeMap = categoryEntry.getValue();
+                    for (Map.Entry<Identifier, Map<Identifier, Set<AttributeValue<?>>>> datatypeEntry : datatypeMap.entrySet()) {
+                            String datatype = datatypeEntry.getKey().toString();
+                            logger.debug("\tData Type: " + datatype);
+                            Map<Identifier, Set<AttributeValue<?>>> attributeIDMap = datatypeEntry.getValue();
+                            for (Map.Entry<Identifier, Set<AttributeValue<?>>> attributeIDEntry : attributeIDMap.entrySet()) {
+                                    String attributeID = attributeIDEntry.getKey().toString();
+                                    logger.debug("\t\tAttribute ID: " + attributeID);
+                                    Set<AttributeValue<?>> attributeValueSet = attributeIDEntry.getValue();
+                                    for (AttributeValue<?> value : attributeValueSet) {
+                                            logger.debug("\t\t\tAttribute Value: " + value);
+                                    }
+                                    Iterator<AttributeValue<?>> iterator = attributeValueSet.iterator();
+                                    logger.debug("\t\t\t# of Attribute values: " + attributeValueSet.size());
+                                    meta.add(new Object[] {category, datatype, attributeID, iterator.next(), iterator, attributeValueSet});
+                            }
+                    }
+            }
 
-                                AttributeValueType value = new AttributeValueType();
-                                value.setDataType(attributeValue.getDataTypeId().toString());
-                                List<Object> content = value.getContent();
-                                content.addAll((Collection<? extends Object>) attributeValue.getValue());
-                                valueList.add(value);
+            int count = 0;
+            for (File file : output.toFile().listFiles()) {
+                    file.delete();
+            }
 
-                                attrList.add(attribute);
-                        }
-                        
-                        try {
-                                ObjectFactory of = new ObjectFactory();
-                                JAXBElement<RequestType> requestElement = of.createRequest(request);
-                                JAXBContext context = JAXBContext.newInstance(RequestType.class);
-                                Marshaller m = context.createMarshaller();
-                                m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-                                m.marshal(requestElement, output.resolve("request" + count + ".xml").toFile());
-                                
-//				if (count == 0) {//Just send the first request to the engine
-                                        StringWriter sw = new StringWriter();
-                                        m.marshal(requestElement, sw);
-                                        logger.info(sw.toString());
-                                        EngineCaller engine = new LocalEngineCaller();
-                                        if (engine.startEngine("")) {
-                                                String response = engine.decide(sw.toString(), "xml");
-                                                FileWriter writer = new FileWriter(output.resolve("response" + count + ".xml").toFile());
-                                                writer.write(response);
-                                                writer.close();
-                                                logger.info("Response received: \n" + response);					
-                                        }
-//				}
-                        } catch (Exception e) {
-                                e.printStackTrace();
-                        }
-                        
-                        count++;
-                } while (hasNextRequest());
-                        
-                logger.info("# of requests generated: " + count);
-        }
-        
-        private boolean hasNextRequest() {
-                int i = meta.size() - 1;
-                Object[] record = meta.get(i);
-                
-                @SuppressWarnings("unchecked")
-                Iterator<AttributeValue<?>> iterator = (Iterator<AttributeValue<?>>) record[4];
-                if (iterator.hasNext()) {
-                        record[3] = iterator.next();
-                } else {
-                        return recycleAttributeValue(i);
-                }
-                
-                return true;
-        }
-        
-        @SuppressWarnings("unchecked")
-        private boolean recycleAttributeValue(int position) {
-                boolean rc = true;
-                
-                if (position == 0)
-                        return false;
-                
-                Object[] record = meta.get(position);
-                Set<AttributeValue<?>> attributeValueSet = (Set<AttributeValue<?>>) record[5];
-                Iterator<AttributeValue<?>> newIt = attributeValueSet.iterator();
-                record[4] = newIt;
-                record[3] = newIt.next();
-                int i = position - 1;
-                Object[] previous = meta.get(i);
-                Iterator<AttributeValue<?>> preIt = (Iterator<AttributeValue<?>>) previous[4];
-                if (preIt.hasNext()) {
-                        previous[3] = preIt.next();
-                } else {
-                        rc = recycleAttributeValue(i);
-                }
-                
-                return rc;
-        }
-        
-        */
-        
+            do {
+                    RequestType request = new RequestType();
+                    request.setCombinedDecision(false);
+                    request.setReturnPolicyIdList(false);
+                    List<AttributesType> attributesList = request.getAttributes();
+
+                    Map<String, AttributesType> category2Attribute= new HashMap<>();
+                    for (int i = 0; i < meta.size(); i++) {
+                            Object[] record = meta.get(i);
+
+                            AttributesType attributes = null;
+                            if (category2Attribute.containsKey(record[0].toString()))
+                                    attributes = category2Attribute.get(record[0].toString());
+                            else {
+                                    attributes = new AttributesType();
+                                    attributes.setCategory(record[0].toString());
+                                    category2Attribute.put(record[0].toString(), attributes);
+                                    attributesList.add(attributes);
+                            }
+    //				attributes.setId(record[2].toString());
+                            List<AttributeType> attrList = attributes.getAttribute();
+
+                            AttributeType attribute = new AttributeType();
+                            attribute.setAttributeId(record[2].toString());
+                            List<AttributeValueType> valueList = attribute.getAttributeValue();
+
+                            AttributeValue<?> attributeValue = (AttributeValue<?>) record[3];
+
+                            AttributeValueType value = new AttributeValueType();
+                            value.setDataType(attributeValue.getDataTypeId().toString());
+                            List<Object> content = value.getContent();
+                            content.addAll((Collection<? extends Object>) attributeValue.getValue());
+                            valueList.add(value);
+
+                            attrList.add(attribute);
+                    }
+
+                    try {
+                            ObjectFactory of = new ObjectFactory();
+                            JAXBElement<RequestType> requestElement = of.createRequest(request);
+                            JAXBContext context = JAXBContext.newInstance(RequestType.class);
+                            Marshaller m = context.createMarshaller();
+                            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+                            m.marshal(requestElement, output.resolve("request" + count + ".xml").toFile());
+
+    //				if (count == 0) {//Just send the first request to the engine
+                                    StringWriter sw = new StringWriter();
+                                    m.marshal(requestElement, sw);
+                                    logger.info(sw.toString());
+                                    EngineCaller engine = new LocalEngineCaller();
+                                    if (engine.startEngine("")) {
+                                            String response = engine.decide(sw.toString(), "xml");
+                                            FileWriter writer = new FileWriter(output.resolve("response" + count + ".xml").toFile());
+                                            writer.write(response);
+                                            writer.close();
+                                            logger.info("Response received: \n" + response);
+                                    }
+    //				}
+                    } catch (Exception e) {
+                            e.printStackTrace();
+                    }
+
+                    count++;
+            } while (hasNextRequest());
+
+            logger.info("# of requests generated: " + count);
+    }
+
+    private boolean hasNextRequest() {
+            int i = meta.size() - 1;
+            Object[] record = meta.get(i);
+
+            @SuppressWarnings("unchecked")
+            Iterator<AttributeValue<?>> iterator = (Iterator<AttributeValue<?>>) record[4];
+            if (iterator.hasNext()) {
+                    record[3] = iterator.next();
+            } else {
+                    return recycleAttributeValue(i);
+            }
+
+            return true;
+    }
+
+    @SuppressWarnings("unchecked")
+    private boolean recycleAttributeValue(int position) {
+            boolean rc = true;
+
+            if (position == 0)
+                    return false;
+
+            Object[] record = meta.get(position);
+            Set<AttributeValue<?>> attributeValueSet = (Set<AttributeValue<?>>) record[5];
+            Iterator<AttributeValue<?>> newIt = attributeValueSet.iterator();
+            record[4] = newIt;
+            record[3] = newIt.next();
+            int i = position - 1;
+            Object[] previous = meta.get(i);
+            Iterator<AttributeValue<?>> preIt = (Iterator<AttributeValue<?>>) previous[4];
+            if (preIt.hasNext()) {
+                    previous[3] = preIt.next();
+            } else {
+                    rc = recycleAttributeValue(i);
+            }
+
+            return rc;
+    }
+
+    */
+
 }
-        
\ No newline at end of file
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Advice.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Advice.java
index 44c460d..26f9b6a 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Advice.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Advice.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,37 +34,37 @@
 
 /**
  * Defines the API for objects that implement XACML 3.0 AssociatedAdvice elements.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface Advice {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Identifier} for this <code>Advice</code> object.  The <code>Identifier</code>
-         * uniquely identifies a XACML 3.0 AssociatedAdvice element in a Rule or Policy.
-         * 
-         * @return the <code>Identifier</code> for this <code>Advice</code>.
-         */
-        public Identifier getId();
-        
-        /**
-         * Gets the {@link com.att.research.xacml.api.AttributeAssignment}s in this <code>Advice</code> object.  If there
-         * are no <code>AttributeAssignment</code>s in this <code>Advice</code>, an empty <code>Collection</code> must be returned.
-         * The returned <code>Collection</code> should not be modified.  Implementations are free to return an immutable view to enforce this.
-         * 
-         * @return the <code>Collection</code> of <code>AttributeAssignment</code>s in this <code>Advice</code> object.
-         */
-        public Collection<AttributeAssignment> getAttributeAssignments();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * The implementation of the <code>Advice</code> interface must override the <code>equals</code> method with the following
-         * semantics:
-         * 		Two <code>Advice</code> objects (<code>a1</code> and <code>a2</code>) are equal if:
-         * 			{@code a1.getId().equals(a2.getId())} AND
-         * 			{@code a1.getAttributeAssignments()} is pair-wise equal to {@code a2.getAttributeAssignments()}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link com.att.research.xacml.api.Identifier} for this <code>Advice</code> object.  The <code>Identifier</code>
+     * uniquely identifies a XACML 3.0 AssociatedAdvice element in a Rule or Policy.
+     *
+     * @return the <code>Identifier</code> for this <code>Advice</code>.
+     */
+    public Identifier getId();
+
+    /**
+     * Gets the {@link com.att.research.xacml.api.AttributeAssignment}s in this <code>Advice</code> object.  If there
+     * are no <code>AttributeAssignment</code>s in this <code>Advice</code>, an empty <code>Collection</code> must be returned.
+     * The returned <code>Collection</code> should not be modified.  Implementations are free to return an immutable view to enforce this.
+     *
+     * @return the <code>Collection</code> of <code>AttributeAssignment</code>s in this <code>Advice</code> object.
+     */
+    public Collection<AttributeAssignment> getAttributeAssignments();
+
+    /**
+     * {@inheritDoc}
+     *
+     * The implementation of the <code>Advice</code> interface must override the <code>equals</code> method with the following
+     * semantics:
+     * 		Two <code>Advice</code> objects (<code>a1</code> and <code>a2</code>) are equal if:
+     * 			{@code a1.getId().equals(a2.getId())} AND
+     * 			{@code a1.getAttributeAssignments()} is pair-wise equal to {@code a2.getAttributeAssignments()}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Attribute.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Attribute.java
index 130fa4b..6049c7c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Attribute.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Attribute.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,74 +35,74 @@
 
 /**
  * Defines the API for objects that represent XACML 3.0 Attribute elements.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface Attribute {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Identifier} for this <code>Attribute</code> object.
-         * The <code>Identifier</code> uniquely identifies a XACML 3.0 Attribute element in a Request, Policy, or Response document.
-         * 
-         * @return the <code>Identifier</code> for this <code>Attribute</code>
-         */
-        public Identifier getAttributeId();
-        
-        /**
-         * Gets the {@link com.att.research.xacml.api.Identifier} for the XACML 3.0 Category of this <code>Attribute</code>.
-         * 
-         * @return the <code>Identifier</code> for the XACML 3.0 Category of this <code>Attribute</code>.
-         */
-        public Identifier getCategory();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.AttributeValue} objects for this <code>Attribute</code>.
-         * If there are no <code>AttributeValue</code>s in this <code>Attribute</code>, an empty <code>Collection</code> must be returned.
-         * The returned <code>Collection</code> should not be modified.  Implementations are free to return an immutable view to enforce this.
-         * 
-         * @return a <code>Collection</code> of the <code>AttributeValue</code>s for this <code>Attribute</code>
-         */
-        public Collection<AttributeValue<?>> getValues();
-        
-        /**
-         * Finds all of the {@link com.att.research.xacml.api.AttributeValue} objects with the given {@link DataType} in
-         * the <code>AttributeValue</code>s for this <code>Attribute</code>.  If there are no matching <code>AttributeValue</code>s, an empty 
-         * <code>Iterator</code> must be returned.
-         * 
-         * @param dataType the <code>DataType</code> to filter on
-         * @return an <code>Iterator</code> over all of the <code>AttributeValue</code>s of the given <code>DataType</code>.
-         * @throws NullPointerException if the supplied <code>DataType</code> is null
-         */
-        public <T> Iterator<AttributeValue<T>> findValues(DataType<T> dataType);
-        
-        /**
-         * Gets the <code>String</code> issuer of this <code>Attribute</code>.  If the <code>Attribute</code> does
-         * not have an issuer, null is returned.
-         * 
-         * @return the <code>String</code> issuer of this <code>Attribute</code>.
-         */
-        public String getIssuer();
-        
-        /**
-         * Gets the <code>boolean</code> value indicating whether this <code>Attribute</code> should be included in the {@link com.att.research.xacml.Response}
-         * to a XACML 3.0 Request.
-         *  
-         * @return true if this <code>Attribute</code> should be included in the <code>Response</code> else false.
-         */
-        public boolean getIncludeInResults();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * The implementation of the <code>Attribute</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>Attribute</code>s (<code>a1</code> and <code>a2</code>) are equal if:
-         * 			{@code a1.getAttributeId().equals(a2.getAttributeId())} AND
-         * 			{@code a1.getCategory().equals(a2.getCategory())} AND
-         * 			{@code a1.getIssuer().equals(a2.getIssuer())} or both issuers are null AND
-         * 			{@code a1.getIncludeInResults() == a2.getIncludeInResults} AND
-         * 			{@code a1.getValues()} is pair-wise equal to {@code a2.getValues()}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link com.att.research.xacml.api.Identifier} for this <code>Attribute</code> object.
+     * The <code>Identifier</code> uniquely identifies a XACML 3.0 Attribute element in a Request, Policy, or Response document.
+     *
+     * @return the <code>Identifier</code> for this <code>Attribute</code>
+     */
+    public Identifier getAttributeId();
+
+    /**
+     * Gets the {@link com.att.research.xacml.api.Identifier} for the XACML 3.0 Category of this <code>Attribute</code>.
+     *
+     * @return the <code>Identifier</code> for the XACML 3.0 Category of this <code>Attribute</code>.
+     */
+    public Identifier getCategory();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.AttributeValue} objects for this <code>Attribute</code>.
+     * If there are no <code>AttributeValue</code>s in this <code>Attribute</code>, an empty <code>Collection</code> must be returned.
+     * The returned <code>Collection</code> should not be modified.  Implementations are free to return an immutable view to enforce this.
+     *
+     * @return a <code>Collection</code> of the <code>AttributeValue</code>s for this <code>Attribute</code>
+     */
+    public Collection<AttributeValue<?>> getValues();
+
+    /**
+     * Finds all of the {@link com.att.research.xacml.api.AttributeValue} objects with the given {@link DataType} in
+     * the <code>AttributeValue</code>s for this <code>Attribute</code>.  If there are no matching <code>AttributeValue</code>s, an empty
+     * <code>Iterator</code> must be returned.
+     *
+     * @param dataType the <code>DataType</code> to filter on
+     * @return an <code>Iterator</code> over all of the <code>AttributeValue</code>s of the given <code>DataType</code>.
+     * @throws NullPointerException if the supplied <code>DataType</code> is null
+     */
+    public <T> Iterator<AttributeValue<T>> findValues(DataType<T> dataType);
+
+    /**
+     * Gets the <code>String</code> issuer of this <code>Attribute</code>.  If the <code>Attribute</code> does
+     * not have an issuer, null is returned.
+     *
+     * @return the <code>String</code> issuer of this <code>Attribute</code>.
+     */
+    public String getIssuer();
+
+    /**
+     * Gets the <code>boolean</code> value indicating whether this <code>Attribute</code> should be included in the {@link com.att.research.xacml.Response}
+     * to a XACML 3.0 Request.
+     *
+     * @return true if this <code>Attribute</code> should be included in the <code>Response</code> else false.
+     */
+    public boolean getIncludeInResults();
+
+    /**
+     * {@inheritDoc}
+     *
+     * The implementation of the <code>Attribute</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>Attribute</code>s (<code>a1</code> and <code>a2</code>) are equal if:
+     * 			{@code a1.getAttributeId().equals(a2.getAttributeId())} AND
+     * 			{@code a1.getCategory().equals(a2.getCategory())} AND
+     * 			{@code a1.getIssuer().equals(a2.getIssuer())} or both issuers are null AND
+     * 			{@code a1.getIncludeInResults() == a2.getIncludeInResults} AND
+     * 			{@code a1.getValues()} is pair-wise equal to {@code a2.getValues()}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeAssignment.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeAssignment.java
index c638365..f2c2187 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeAssignment.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeAssignment.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,61 +33,61 @@
 /**
  * Defines the API for objects that represent XACML 3.0 AttributeAssignment elements.  AttributeAssignments are used
  * in XACML 3.0 ObligationExpressions and AdviceExpressions.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface AttributeAssignment {
-        /**
-         * Gets the {@link Identifier} for the XACML Attribute that is assigned by this <code>AttributeAssignment</code>.
-         * 
-         * @return the <code>Identifier</code> for the XACML Attribute that is assigned by this <code>AttributeAssignment</code>.
-         */
-        public Identifier getAttributeId();
-        
-        /**
-         * Gets the {@link Identifier} for the XACML Category of the Attribute that is assigned by this
-         * <code>AttributeAssignment</code>.
-         * 
-         * @return the <code>Identifier</code> for the XACML Category of the Attribute that is assigned by this <code>AttributeAssignment</code>.
-         */
-        public Identifier getCategory();
-        
-        /**
-         * Gets the <code>String</code> issuer of the XACML Attribute that is assigned by this <code>AttributeAssignment</code>.
-         * 
-         * @return the <code>String</code> issuer of the XACML Attribute that is assigned by this <code>AttributeAssignment</code>.
-         */
-        public String getIssuer();
-        
-        /**
-         * Gets the {@link Identifier} for the XACML data type of the AttributeValue that is assigned to the Attribute by this <code>AttributeAssignment</code>.
-         * 
-         * @return the <code>Identifier</code> for the XACML data type of the AttributeValue that is assigned to the Attribute by this <code>AttributeAssignment</code>.
-         */
-        public Identifier getDataTypeId();
-        
-        /**
-         * Gets the {@link AttributeValue} representing the XACML AttributeValue that is assigned to the Attribute by this
-         * <code>AttributeAssignment</code>.
-         * 
-         * @return the {@link AttributeValue} representing the XACML AttributeValue that is assigned to the Attribute by this
-         * <code>AttributeAssignment</code>.
-         */
-        public AttributeValue<?> getAttributeValue();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * The implementation of the <code>AttributeAssignment</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>AttributeAssignment</code>s (<code>a1</code> and <code>a2</code>) are equal if:
-         * 			{@code a1.getAttributeId().equals(a2.getAttributeId())} AND
-         * 			{@code a1.getCategory()>equals(a2.getCategory())} AND
-         * 			{@code a1.getIssuer() == null && @a2.getIssuer() == null} OR {@code a1.getIssuer().equals(a2.getIssuer())} AND
-         * 			{@code a1.getDataTypeId().equals(a2.getDataTypeId())} AND
-         * 			{@code a1.getAttributeValue().equals(a2.getAttributeValue())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link Identifier} for the XACML Attribute that is assigned by this <code>AttributeAssignment</code>.
+     *
+     * @return the <code>Identifier</code> for the XACML Attribute that is assigned by this <code>AttributeAssignment</code>.
+     */
+    public Identifier getAttributeId();
+
+    /**
+     * Gets the {@link Identifier} for the XACML Category of the Attribute that is assigned by this
+     * <code>AttributeAssignment</code>.
+     *
+     * @return the <code>Identifier</code> for the XACML Category of the Attribute that is assigned by this <code>AttributeAssignment</code>.
+     */
+    public Identifier getCategory();
+
+    /**
+     * Gets the <code>String</code> issuer of the XACML Attribute that is assigned by this <code>AttributeAssignment</code>.
+     *
+     * @return the <code>String</code> issuer of the XACML Attribute that is assigned by this <code>AttributeAssignment</code>.
+     */
+    public String getIssuer();
+
+    /**
+     * Gets the {@link Identifier} for the XACML data type of the AttributeValue that is assigned to the Attribute by this <code>AttributeAssignment</code>.
+     *
+     * @return the <code>Identifier</code> for the XACML data type of the AttributeValue that is assigned to the Attribute by this <code>AttributeAssignment</code>.
+     */
+    public Identifier getDataTypeId();
+
+    /**
+     * Gets the {@link AttributeValue} representing the XACML AttributeValue that is assigned to the Attribute by this
+     * <code>AttributeAssignment</code>.
+     *
+     * @return the {@link AttributeValue} representing the XACML AttributeValue that is assigned to the Attribute by this
+     * <code>AttributeAssignment</code>.
+     */
+    public AttributeValue<?> getAttributeValue();
+
+    /**
+     * {@inheritDoc}
+     *
+     * The implementation of the <code>AttributeAssignment</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>AttributeAssignment</code>s (<code>a1</code> and <code>a2</code>) are equal if:
+     * 			{@code a1.getAttributeId().equals(a2.getAttributeId())} AND
+     * 			{@code a1.getCategory()>equals(a2.getCategory())} AND
+     * 			{@code a1.getIssuer() == null && @a2.getIssuer() == null} OR {@code a1.getIssuer().equals(a2.getIssuer())} AND
+     * 			{@code a1.getDataTypeId().equals(a2.getDataTypeId())} AND
+     * 			{@code a1.getAttributeValue().equals(a2.getAttributeValue())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeCategory.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeCategory.java
index 780bd3a..d17326f 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeCategory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeCategory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,56 +36,56 @@
 /**
  * Defines the API for objects representing XACML Attributes elements.  Attributes elements represent collections of
  * XACML Attribute elements with the same Category.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface AttributeCategory {
-        /**
-         * Gets the {@link Identifier} for the XACML Category of this <code>AttributeCategory</code>.
-         * 
-         * @return the <code>Identifier</code> for the category of this <code>AttributeCategory</code>.
-         */
-        public Identifier getCategory();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link Attribute}s in this <code>AttributeCategory</code>.
-         * If there are no <code>Attribute</code>s in this <code>AttributeCategory</code> then an empty <code>Collection</code> must be
-         * returned.  
-         * The returned <code>Collection</code> should not be modified.  Implementations are free to return an immutable view to enforce this.
-         * 
-         * @return the <code>Collection</code> of {@link Attribute}s in this <code>AttributeCategory</code>.
-         */
-        public Collection<Attribute> getAttributes();
-        
-        /**
-         * Gets an <code>Iterator</code> over all of the {@link Attribute}s in this <code>AttributeCategory</code> with the
-         * given {@link Identifier} matching their XACML AttributeId.
-         * 
-         * @param attributeId the <code>Identifier</code> to match against the XACML AttributeId
-         * @return an <code>Iterator</code> over all of the <code>Attribute</code>s in this <code>AttributeCategory</code> with the given <code>Identifier</code>
-         * matching their XACML AttributeId.
-         */
-        public Iterator<Attribute> getAttributes(Identifier attributeId);
-        
-        /**
-         * Determines if there is at least one {@link Attribute} in this <code>AttributeCategory</code>
-         * whose XACML AttributeId matches the given {@link Identifier}.
-         * 
-         * @param attributeId the <code>Identifier</code> of the AttributeId to look for
-         * @return true if there is at least one <code>Attribute</code> whose XACML AttributeId matches the given <code>Identifier</code>, else false
-         */
-        public boolean hasAttributes(Identifier attributeId);
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>AttributeCategory</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>AttributeCategory</code>s (<code>a1</code> and <code>a2</code>) are equal if:
-         * 			{@code a1.getCategory().equals(a2.getCategory())} AND
-         * 			The {@link Attribute}s in <code>a1</code> and <code>a2</code> are pairwise equal.
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link Identifier} for the XACML Category of this <code>AttributeCategory</code>.
+     *
+     * @return the <code>Identifier</code> for the category of this <code>AttributeCategory</code>.
+     */
+    public Identifier getCategory();
+
+    /**
+     * Gets the <code>Collection</code> of {@link Attribute}s in this <code>AttributeCategory</code>.
+     * If there are no <code>Attribute</code>s in this <code>AttributeCategory</code> then an empty <code>Collection</code> must be
+     * returned.
+     * The returned <code>Collection</code> should not be modified.  Implementations are free to return an immutable view to enforce this.
+     *
+     * @return the <code>Collection</code> of {@link Attribute}s in this <code>AttributeCategory</code>.
+     */
+    public Collection<Attribute> getAttributes();
+
+    /**
+     * Gets an <code>Iterator</code> over all of the {@link Attribute}s in this <code>AttributeCategory</code> with the
+     * given {@link Identifier} matching their XACML AttributeId.
+     *
+     * @param attributeId the <code>Identifier</code> to match against the XACML AttributeId
+     * @return an <code>Iterator</code> over all of the <code>Attribute</code>s in this <code>AttributeCategory</code> with the given <code>Identifier</code>
+     * matching their XACML AttributeId.
+     */
+    public Iterator<Attribute> getAttributes(Identifier attributeId);
+
+    /**
+     * Determines if there is at least one {@link Attribute} in this <code>AttributeCategory</code>
+     * whose XACML AttributeId matches the given {@link Identifier}.
+     *
+     * @param attributeId the <code>Identifier</code> of the AttributeId to look for
+     * @return true if there is at least one <code>Attribute</code> whose XACML AttributeId matches the given <code>Identifier</code>, else false
+     */
+    public boolean hasAttributes(Identifier attributeId);
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>AttributeCategory</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>AttributeCategory</code>s (<code>a1</code> and <code>a2</code>) are equal if:
+     * 			{@code a1.getCategory().equals(a2.getCategory())} AND
+     * 			The {@link Attribute}s in <code>a1</code> and <code>a2</code> are pairwise equal.
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeValue.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeValue.java
index 323111b..7a9cca5 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeValue.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/AttributeValue.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,45 +32,45 @@
 
 /**
  * Defines the API for objects representing XACML AttributeValue elements.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  *
  * @param <T> the java type of the object representing the value of the XACML AttributeValue element.
  */
 public interface AttributeValue<T> {
-        /**
-         * Returns the {@link Identifier} representing the XACML data type of this <code>AttributeValue</code>.
-         * 
-         * @return the <code>Identifier</code> representing the XACML data type of this <code>AttributeValue</code>
-         */
-        public Identifier getDataTypeId();
-        
-        /**
-         * Returns the object representing the value of the XACML AttributeValue element represented by this<code>AttributeValue</code> of type <code>T</code>.
-         * 
-         * @return the object representing the value of the XACML AttributeValue element represented by this<code>AttributeValue</code>
-         */
-        public T getValue();
-        
-        /**
-         * Returns the {@link Identifier} representing the XACML Category id of this <code>AttributeValue</code> for
-         * <code>AttributeValue</code>s of the data type <code>XPathExpression</code>.
-         * 
-         * @return the <code>Identifier</code> representing the XACML Category id of this <code>AttributeValue</code>.
-         */
-        public Identifier getXPathCategory();
-        
-        /**
-         * {@inheritDoc}
-         *
-         * Implementations of the <code>AttributeValue</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>AttributeValue</code>s (<code>a1</code> and <code>a2</code>) are equal if:
-         * 			{@code a1.getDataTypeId().equals(a2.getDataTypeId())} AND
-         * 			{@code a1.getValue() == null && a2.getValue() == null} OR {@code a1.getValue().equals(a2.getValue())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Returns the {@link Identifier} representing the XACML data type of this <code>AttributeValue</code>.
+     *
+     * @return the <code>Identifier</code> representing the XACML data type of this <code>AttributeValue</code>
+     */
+    public Identifier getDataTypeId();
+
+    /**
+     * Returns the object representing the value of the XACML AttributeValue element represented by this<code>AttributeValue</code> of type <code>T</code>.
+     *
+     * @return the object representing the value of the XACML AttributeValue element represented by this<code>AttributeValue</code>
+     */
+    public T getValue();
+
+    /**
+     * Returns the {@link Identifier} representing the XACML Category id of this <code>AttributeValue</code> for
+     * <code>AttributeValue</code>s of the data type <code>XPathExpression</code>.
+     *
+     * @return the <code>Identifier</code> representing the XACML Category id of this <code>AttributeValue</code>.
+     */
+    public Identifier getXPathCategory();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>AttributeValue</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>AttributeValue</code>s (<code>a1</code> and <code>a2</code>) are equal if:
+     * 			{@code a1.getDataTypeId().equals(a2.getDataTypeId())} AND
+     * 			{@code a1.getValue() == null && a2.getValue() == null} OR {@code a1.getValue().equals(a2.getValue())}
+     */
+    @Override
+    public boolean equals(Object obj);
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/DataType.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/DataType.java
index 459b3b8..1342c41 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/DataType.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/DataType.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,66 +33,66 @@
 
 /**
  * Defines the API for objects that represent XACML 3.0 data types.
- *  
+ *
  * @author Christopher A. Rath
  *
  * @param <T> the class of the java objects that represent the XACML values
  */
 public interface DataType<T> {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Identifier} representing the XACML data type id for this <code>DataType</code>.
-         * 
-         * @return the <code>Identifier</code> representing the XACML data type id for this <code>DataType</code>.
-         */
-        public Identifier getId();
-        
-        /**
-         * Converts the given <code>Object</code> to a <code>T</code> object if possible.  If the <code>Object</code> is
-         * an instance of <code>T</code> then the object itself should be returned, cast to <code>T</code>.
-         * 
-         * @param source the source object to be converted
-         * @return a <code>T</code> object
-         * @throws UnsupportedOperationException if the given source object cannot be converted to a <code>T</code>
-         */
-        public T convert(Object source) throws DataTypeException;
-        
-        /**
-         * Converts the given <code>T</code> to a semantically meaningful <code>String</code>.
-         * 
-         * @param source the source object to be converted
-         * @return the semantically meaningful <code>String</code> representation of the <code>Object</code>
-         * @throws DataTypeException if there is an error doing the conversion
-         */
-        public String toStringValue(T source) throws DataTypeException;
-        
-        /**
-         * Converts the given <code>Object</code> to a {@link com.att.research.xacml.api.AttributeValue} whose value
-         * is an instance of class <code>T</code>.
-         * 
-         * @param source the source object to be converted
-         * @return a new {@link com.att.research.xacml.api.AttributeValue}
-         * @throws UnsupportedOperationException if the given source object cannot be converted to a <code>T</code>
-         */
-        public AttributeValue<T> createAttributeValue(Object source) throws DataTypeException;
-        
-        /**
-         * Converts the given <code>Object</code> to a {@link com.att.research.xacml.api.AttributeValue} whose value
-         * is an instance of class <code>T</code>.  If not null, the <code>xpathCategory</code> is used in the newly created <code>AttributeValue</code>
-         * 
-         * @param source the source object to be converted
-         * @param xpathCategory the <code>Identifier</code> for the XPathCategory of the new <code>AttributeValue</code>
-         * @return a new {@link com.att.research.xacml.api.AttributeValue}
-         * @throws UnsupportedOperationException if the given source object cannot be converted to a <code>T</code>
-         */
-        public AttributeValue<T> createAttributeValue(Object source, Identifier xpathCategory) throws DataTypeException;
-        
-        /**
-         * Converts the given {@link com.att.research.xacml.api.AttributeValue} of an unknown data type to an <code>AttributeValue</code> 
-         * whose value is represented by an instance of class <code>T</code>.
-         * 
-         * @param attributeValueFrom the <code>AttributeValue</code> to convert
-         * @return an <code>AttributeValue</code> whose value is represented by an instance of class <code>T</code> if possible.
-         * @throws UnsupportedOperationException
-         */
-        public AttributeValue<T> convertAttributeValue(AttributeValue<?> attributeValueFrom) throws DataTypeException;	
+    /**
+     * Gets the {@link com.att.research.xacml.api.Identifier} representing the XACML data type id for this <code>DataType</code>.
+     *
+     * @return the <code>Identifier</code> representing the XACML data type id for this <code>DataType</code>.
+     */
+    public Identifier getId();
+
+    /**
+     * Converts the given <code>Object</code> to a <code>T</code> object if possible.  If the <code>Object</code> is
+     * an instance of <code>T</code> then the object itself should be returned, cast to <code>T</code>.
+     *
+     * @param source the source object to be converted
+     * @return a <code>T</code> object
+     * @throws UnsupportedOperationException if the given source object cannot be converted to a <code>T</code>
+     */
+    public T convert(Object source) throws DataTypeException;
+
+    /**
+     * Converts the given <code>T</code> to a semantically meaningful <code>String</code>.
+     *
+     * @param source the source object to be converted
+     * @return the semantically meaningful <code>String</code> representation of the <code>Object</code>
+     * @throws DataTypeException if there is an error doing the conversion
+     */
+    public String toStringValue(T source) throws DataTypeException;
+
+    /**
+     * Converts the given <code>Object</code> to a {@link com.att.research.xacml.api.AttributeValue} whose value
+     * is an instance of class <code>T</code>.
+     *
+     * @param source the source object to be converted
+     * @return a new {@link com.att.research.xacml.api.AttributeValue}
+     * @throws UnsupportedOperationException if the given source object cannot be converted to a <code>T</code>
+     */
+    public AttributeValue<T> createAttributeValue(Object source) throws DataTypeException;
+
+    /**
+     * Converts the given <code>Object</code> to a {@link com.att.research.xacml.api.AttributeValue} whose value
+     * is an instance of class <code>T</code>.  If not null, the <code>xpathCategory</code> is used in the newly created <code>AttributeValue</code>
+     *
+     * @param source the source object to be converted
+     * @param xpathCategory the <code>Identifier</code> for the XPathCategory of the new <code>AttributeValue</code>
+     * @return a new {@link com.att.research.xacml.api.AttributeValue}
+     * @throws UnsupportedOperationException if the given source object cannot be converted to a <code>T</code>
+     */
+    public AttributeValue<T> createAttributeValue(Object source, Identifier xpathCategory) throws DataTypeException;
+
+    /**
+     * Converts the given {@link com.att.research.xacml.api.AttributeValue} of an unknown data type to an <code>AttributeValue</code>
+     * whose value is represented by an instance of class <code>T</code>.
+     *
+     * @param attributeValueFrom the <code>AttributeValue</code> to convert
+     * @return an <code>AttributeValue</code> whose value is represented by an instance of class <code>T</code> if possible.
+     * @throws UnsupportedOperationException
+     */
+    public AttributeValue<T> convertAttributeValue(AttributeValue<?> attributeValueFrom) throws DataTypeException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/DataTypeException.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/DataTypeException.java
index 002a157..3db50d6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/DataTypeException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/DataTypeException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,67 +32,67 @@
 
 /**
  * Extends <code>Exception</code> to represent errors thrown by methods in the {@link DataType} interface.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class DataTypeException extends Exception {
-        private static final long serialVersionUID = -6308818179904447096L;
-        
-        private DataType<?>	dataType;
+    private static final long serialVersionUID = -6308818179904447096L;
 
-        /**
-         * Creates a new <code>DataTypeException</code> for an error thrown by the given {@link DataType}.
-         * 
-         * @param dataTypeIn the <code>DataType</code> throwing the error.
-         */
-        public DataTypeException(DataType<?> dataTypeIn) {
-                this.dataType	= dataTypeIn;
-        }
+    private DataType<?>	dataType;
 
-        /**
-         * Creates a new <code>DataTypeException</code> for an error thrown by the given {@link DataType} with
-         * a <code>String</code> message.
-         * 
-         * @param dataTypeIn the <code>DataType</code> throwing the error
-         * @param message the <code>String</code> error message
-         */
-        public DataTypeException(DataType<?> dataTypeIn, String message) {
-                super(message);
-                this.dataType	= dataTypeIn;
-        }
+    /**
+     * Creates a new <code>DataTypeException</code> for an error thrown by the given {@link DataType}.
+     *
+     * @param dataTypeIn the <code>DataType</code> throwing the error.
+     */
+    public DataTypeException(DataType<?> dataTypeIn) {
+        this.dataType	= dataTypeIn;
+    }
 
-        /**
-         * Creates a new <code>DataTypeException</code> for an error thrown by the given {@link DataType} with
-         * a <code>Throwable</code> cause.
-         * 
-         * @param dataTypeIn the <code>DataType</code> throwing the error
-         * @param cause the <code>Throwable</code> cause of the error
-         */
-        public DataTypeException(DataType<?> dataTypeIn, Throwable cause) {
-                super(cause);
-                this.dataType	= dataTypeIn;
-        }
+    /**
+     * Creates a new <code>DataTypeException</code> for an error thrown by the given {@link DataType} with
+     * a <code>String</code> message.
+     *
+     * @param dataTypeIn the <code>DataType</code> throwing the error
+     * @param message the <code>String</code> error message
+     */
+    public DataTypeException(DataType<?> dataTypeIn, String message) {
+        super(message);
+        this.dataType	= dataTypeIn;
+    }
 
-        /**
-         * Creates a new <code>DataTypeException</code> for an error thrown by the given {@link DataType} with
-         * the given <code>String</code> message and <code>Throwable</code> cause.
-         * 
-         * @param dataTypeIn the <code>DataType</code> throwing the error
-         * @param message the <code>String</code> error message
-         * @param cause the <code>Throwable</code> cause of the error
-         */
-        public DataTypeException(DataType<?> dataTypeIn, String message, Throwable cause) {
-                super(message, cause);
-                this.dataType	= dataTypeIn;
-        }
-        
-        /**
-         * Returns the {@link DataType} that caused the <code>Exception</code>.
-         * 
-         * @return the <code>DataType</code> that caused the <code>Exception</code>
-         */
-        public DataType<?> getDataType() {
-                return this.dataType;
-        }
+    /**
+     * Creates a new <code>DataTypeException</code> for an error thrown by the given {@link DataType} with
+     * a <code>Throwable</code> cause.
+     *
+     * @param dataTypeIn the <code>DataType</code> throwing the error
+     * @param cause the <code>Throwable</code> cause of the error
+     */
+    public DataTypeException(DataType<?> dataTypeIn, Throwable cause) {
+        super(cause);
+        this.dataType	= dataTypeIn;
+    }
+
+    /**
+     * Creates a new <code>DataTypeException</code> for an error thrown by the given {@link DataType} with
+     * the given <code>String</code> message and <code>Throwable</code> cause.
+     *
+     * @param dataTypeIn the <code>DataType</code> throwing the error
+     * @param message the <code>String</code> error message
+     * @param cause the <code>Throwable</code> cause of the error
+     */
+    public DataTypeException(DataType<?> dataTypeIn, String message, Throwable cause) {
+        super(message, cause);
+        this.dataType	= dataTypeIn;
+    }
+
+    /**
+     * Returns the {@link DataType} that caused the <code>Exception</code>.
+     *
+     * @return the <code>DataType</code> that caused the <code>Exception</code>
+     */
+    public DataType<?> getDataType() {
+        return this.dataType;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/DataTypeFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/DataTypeFactory.java
index 4b18dc3..44507aa 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/DataTypeFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/DataTypeFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,7 +38,7 @@
 /**
  * Abstract class for mapping data type {@link Identifier}s to
  * {@link DataType} objects.
- * 
+ *
  * The static <code>newInstance</code> method looks for the class name of the class extending <code>DataTypeFactory</code> by looking for the
  * property: {@code xacml.dataTypeFactory} in the following places (in order):
  * 		1. System properties
@@ -46,75 +46,75 @@
  * 			a) {@code System.getProperty("xacml.properties")}
  * 			b) {@code java.home/xacml.properties}
  * 		3. If the class name is not found in one of these properties, the default is: {@code com.att.research.xacml.std.StdDataTypeFactory}
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public abstract class DataTypeFactory {
-        private static final String	FACTORYID					= "xacml.dataTypeFactory";
-        private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.StdDataTypeFactory";
-        
-        /**
-         * Protected constructor so this class cannot be instantiated.
-         */
-        protected DataTypeFactory() {
-                
-        }
-        
-        /**
-         * Protected constructor so this class cannot be instantiated.
-         */
-        protected DataTypeFactory(Properties properties) {
-        }
-        
-        /**
-         * Maps the given {@link Identifier} representing a XACML data type id to a {@link DataType}
-         * object implementing that data type.
-         * 
-         * @param dataTypeId the <code>Identifier</code> of the <code>DataType</code> to retrieve.
-         * @return the <code>DataType</code> with the given <code>Identifier</code> or null if there is no match.
-         */
-        public abstract DataType<?> getDataType(Identifier dataTypeId);
-        
-        /**
-         * Creates an instance of the <code>DataTypeFactory</code> using default configuration information.
-         * 
-         * @return the default <code>DataTypeFactory</code>
-         * @throws FactoryException
-         */
-        public static DataTypeFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, DataTypeFactory.class);
-        }
-        
-        /**
-         * Creates an instance of the <code>DataTypeFactory</code> using default configuration information.
-         * 
-         * @param properties
-         * @return the default <code>DataTypeFactory</code>
-         * @throws FactoryException
-         */
-        public static DataTypeFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, DataTypeFactory.class, properties);
-        }
-        
-        /**
-         * Creates an instance of the <code>DataTypeFactory</code> using the given class name.
-         * 
-         * @param className the <code>String</code> class name of the <code>DataTypeFactory</code> to create
-         * @return the <code>DataTypeFactory</code> for the given class name.
-         */
-        public static DataTypeFactory newInstance(String className) throws FactoryException {
-                return FactoryFinder.newInstance(className, DataTypeFactory.class, null, true);
-        }
-        
-        /**
-         * Creates an instance of the <code>DataTypeFactory</code> using the given class name using the given <code>ClassLoader</code>.
-         * 
-         * @param className the <code>String</code> class name of the <code>DataTypeFactory</code> to create
-         * @param classLoader the <code>ClassLoader</code> to use to load the class with the given class name
-         * @return the <code>DataTypeFactory</code> for the given class name
-         */
-        public static DataTypeFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(className, DataTypeFactory.class, classLoader, false);
-        }
+    private static final String	FACTORYID					= "xacml.dataTypeFactory";
+    private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.StdDataTypeFactory";
+
+    /**
+     * Protected constructor so this class cannot be instantiated.
+     */
+    protected DataTypeFactory() {
+
+    }
+
+    /**
+     * Protected constructor so this class cannot be instantiated.
+     */
+    protected DataTypeFactory(Properties properties) {
+    }
+
+    /**
+     * Maps the given {@link Identifier} representing a XACML data type id to a {@link DataType}
+     * object implementing that data type.
+     *
+     * @param dataTypeId the <code>Identifier</code> of the <code>DataType</code> to retrieve.
+     * @return the <code>DataType</code> with the given <code>Identifier</code> or null if there is no match.
+     */
+    public abstract DataType<?> getDataType(Identifier dataTypeId);
+
+    /**
+     * Creates an instance of the <code>DataTypeFactory</code> using default configuration information.
+     *
+     * @return the default <code>DataTypeFactory</code>
+     * @throws FactoryException
+     */
+    public static DataTypeFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, DataTypeFactory.class);
+    }
+
+    /**
+     * Creates an instance of the <code>DataTypeFactory</code> using default configuration information.
+     *
+     * @param properties
+     * @return the default <code>DataTypeFactory</code>
+     * @throws FactoryException
+     */
+    public static DataTypeFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, DataTypeFactory.class, properties);
+    }
+
+    /**
+     * Creates an instance of the <code>DataTypeFactory</code> using the given class name.
+     *
+     * @param className the <code>String</code> class name of the <code>DataTypeFactory</code> to create
+     * @return the <code>DataTypeFactory</code> for the given class name.
+     */
+    public static DataTypeFactory newInstance(String className) throws FactoryException {
+        return FactoryFinder.newInstance(className, DataTypeFactory.class, null, true);
+    }
+
+    /**
+     * Creates an instance of the <code>DataTypeFactory</code> using the given class name using the given <code>ClassLoader</code>.
+     *
+     * @param className the <code>String</code> class name of the <code>DataTypeFactory</code> to create
+     * @param classLoader the <code>ClassLoader</code> to use to load the class with the given class name
+     * @return the <code>DataTypeFactory</code> for the given class name
+     */
+    public static DataTypeFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(className, DataTypeFactory.class, classLoader, false);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Decision.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Decision.java
index d946487..2b51895 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Decision.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Decision.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,94 +33,94 @@
 /**
  * Enumeration of the XACML 3.0 decisions and extended decisions that can be returned as part of
  * a {@link Result}.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public enum Decision {
-        /**
-         * Indicates the request is permitted
-         */
-        PERMIT("Permit"),
-        /**
-         * Indicates the request is denied
-         */
-        DENY("Deny"),
-        /**
-         * Indicates no decision could be reached due to a processing error
-         */
-        INDETERMINATE("Indeterminate"),
-        /**
-         * Indicates no decision could be reached due to a processing error, but it would have been permitted had the error not occurred
-         */
-        INDETERMINATE_PERMIT("Indeterminate{P}", true, INDETERMINATE),
-        /**
-         * Indicates no decision could be reached due to a processing error, but it would have been denied had the error not occurred.
-         */
-        INDETERMINATE_DENY("Indeterminate{D}", true, INDETERMINATE),
-        /**
-         * Indicates no decision could be reached due to a processing error, but either a deny or permit would have been returned had the error not occurred.
-         */
-        INDETERMINATE_DENYPERMIT("Indeterminate{DP}", true, INDETERMINATE),
-        /**
-         * Indicates the policy in question is not applicable to the request
-         */
-        NOTAPPLICABLE("NotApplicable")
-        ;
-        
-        private String name;
-        private boolean extended;
-        private Decision basicDecision;
-        
-        private Decision(String nameIn, Boolean extendedIn, Decision basicDecisionIn) {
-                this.name			= nameIn;
-                this.extended		= extendedIn;
-                this.basicDecision	= basicDecisionIn;
+    /**
+     * Indicates the request is permitted
+     */
+    PERMIT("Permit"),
+    /**
+     * Indicates the request is denied
+     */
+    DENY("Deny"),
+    /**
+     * Indicates no decision could be reached due to a processing error
+     */
+    INDETERMINATE("Indeterminate"),
+    /**
+     * Indicates no decision could be reached due to a processing error, but it would have been permitted had the error not occurred
+     */
+    INDETERMINATE_PERMIT("Indeterminate{P}", true, INDETERMINATE),
+    /**
+     * Indicates no decision could be reached due to a processing error, but it would have been denied had the error not occurred.
+     */
+    INDETERMINATE_DENY("Indeterminate{D}", true, INDETERMINATE),
+    /**
+     * Indicates no decision could be reached due to a processing error, but either a deny or permit would have been returned had the error not occurred.
+     */
+    INDETERMINATE_DENYPERMIT("Indeterminate{DP}", true, INDETERMINATE),
+    /**
+     * Indicates the policy in question is not applicable to the request
+     */
+    NOTAPPLICABLE("NotApplicable")
+    ;
+
+    private String name;
+    private boolean extended;
+    private Decision basicDecision;
+
+    private Decision(String nameIn, Boolean extendedIn, Decision basicDecisionIn) {
+        this.name			= nameIn;
+        this.extended		= extendedIn;
+        this.basicDecision	= basicDecisionIn;
+    }
+    private Decision(String nameIn) {
+        this(nameIn, false, null);
+    }
+
+    /**
+     * Returns true if this <code>Decision</code> represents a XACML 3.0 extended Decision.
+     *
+     * @return true if this <code>Decision</code> is a XACML 3.0 extended Decision.
+     */
+    public boolean isExtended() {
+        return this.extended;
+    }
+
+    /**
+     * Returns the <code>Decision</code> representing the XACML 3.0 basic Decision for this <code>Decision</code>.
+     *
+     * @return the <code>Decision</code> representing the XACML 3.0 basic Decision for this <code>Decision</code>.
+     */
+    public Decision getBasicDecision() {
+        return (this.isExtended() ? this.basicDecision : this);
+    }
+
+    /**
+     * Gets the <code>Decision</code> whose <code>String</code> representation matches the given <code>String</code>.
+     *
+     * @param decisionName the <code>String</code> decision name
+     * @return the <code>Decision</code> with the name matching the given <code>String</code> or null if no match is found
+     */
+    public static Decision get(String decisionName) {
+        for (Decision decision : Decision.values()) {
+            if (decision.toString().equalsIgnoreCase(decisionName)) {
+                return decision;
+            }
         }
-        private Decision(String nameIn) {
-                this(nameIn, false, null);
-        }
-        
-        /**
-         * Returns true if this <code>Decision</code> represents a XACML 3.0 extended Decision.
-         * 
-         * @return true if this <code>Decision</code> is a XACML 3.0 extended Decision.
-         */
-        public boolean isExtended() {
-                return this.extended;
-        }
-        
-        /**
-         * Returns the <code>Decision</code> representing the XACML 3.0 basic Decision for this <code>Decision</code>.
-         * 
-         * @return the <code>Decision</code> representing the XACML 3.0 basic Decision for this <code>Decision</code>.
-         */
-        public Decision getBasicDecision() {
-                return (this.isExtended() ? this.basicDecision : this);
-        }
-        
-        /**
-         * Gets the <code>Decision</code> whose <code>String</code> representation matches the given <code>String</code>.
-         * 
-         * @param decisionName the <code>String</code> decision name
-         * @return the <code>Decision</code> with the name matching the given <code>String</code> or null if no match is found
-         */
-        public static Decision get(String decisionName) {
-                for (Decision decision : Decision.values()) {
-                        if (decision.toString().equalsIgnoreCase(decisionName)) {
-                                return decision;
-                        }
-                }
-                return null;
-        }
-        
-        /**
-         * Returns the canonical XACML 3.0 name for this <code>Decision</code>>
-         * 
-         * @return the canonical XACML 3.0 <code>String</code> name for this <code>Decision</code> 
-         */
-        public String toString() {
-                return this.name;
-        }
-        
+        return null;
+    }
+
+    /**
+     * Returns the canonical XACML 3.0 name for this <code>Decision</code>>
+     *
+     * @return the canonical XACML 3.0 <code>String</code> name for this <code>Decision</code>
+     */
+    public String toString() {
+        return this.name;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/IdReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/IdReference.java
index 0ac855c..604d800 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/IdReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/IdReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,36 +32,36 @@
 
 /**
  * Defines the API for objects that implement XACML reference elements PolicyIdReference and PolicySetIdReference.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface IdReference {
-        /**
-         * Returns the {@link Identifier} representing the XACML PolicyId or PolicySetId that
-         * is referenced by this <code>IdReference</code>.
-         * 
-         * @return the <code>Identifier</code> representing the XACML PolicyId or PolicySetId that
-         * is referenced by this <code>IdReference</code>.
-         */
-        public Identifier getId();
-        
-        /**
-         * Returns the {@link Version} of the XACML Policy or PolicySet referenced by this <code>IdReference</code>.
-         * 
-         * @return the <code>Version</code> of the XACML Policy or PolicySet referenced by this <code>IdReference</code>.
-         */
-        public Version getVersion();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>IdReference</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>IdReference</code>s (<code>i1</code> and <code>i2</code>) are equal if:
-         * 			{@code i1.getId().equals(i2.getId())} AND
-         * 			{@code i1.getVersion().equals(i2.getVersion())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Returns the {@link Identifier} representing the XACML PolicyId or PolicySetId that
+     * is referenced by this <code>IdReference</code>.
+     *
+     * @return the <code>Identifier</code> representing the XACML PolicyId or PolicySetId that
+     * is referenced by this <code>IdReference</code>.
+     */
+    public Identifier getId();
+
+    /**
+     * Returns the {@link Version} of the XACML Policy or PolicySet referenced by this <code>IdReference</code>.
+     *
+     * @return the <code>Version</code> of the XACML Policy or PolicySet referenced by this <code>IdReference</code>.
+     */
+    public Version getVersion();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>IdReference</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>IdReference</code>s (<code>i1</code> and <code>i2</code>) are equal if:
+     * 			{@code i1.getId().equals(i2.getId())} AND
+     * 			{@code i1.getVersion().equals(i2.getVersion())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/IdReferenceMatch.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/IdReferenceMatch.java
index ecd1bf8..a18fa04 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/IdReferenceMatch.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/IdReferenceMatch.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,52 +33,52 @@
 /**
  * Defines the API for objects that represent XACML PolicyIdReference or PolicySetIdReference elements with exact, earliest, and latest version
  * matching.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface IdReferenceMatch {
-        /**
-         * Returns the {@link Identifier} representing the XACML PolicyId or PolicySetId that
-         * is referenced by this <code>IdReference</code>.
-         * 
-         * @return the <code>Identifier</code> representing the XACML PolicyId or PolicySetId that
-         * is referenced by this <code>IdReference</code>.
-         */
-        public Identifier getId();
-        
-        /**
-         * Gets the {@link VersionMatch} representing a full or partial match against a XACML Version string.
-         * 
-         * @return the <code>VersionMatch</code> representing a full or partial match against a XACML Version string.
-         */
-        public VersionMatch getVersion();
-        
-        /**
-         * Gets the {@link VersionMatch} representing a full or partial match against the earliest XACML Version string.
-         * 
-         * @return the <code>VersionMatch</code> representing a full or partial match against the earliest XACML Version string.
-         */
-        public VersionMatch getEarliestVersion();
-        
-        /**
-         * Gets the {@link VersionMatch} representing a full or partial match against the latest XACML Version string.
-         * 
-         * @return the <code>VersionMatch</code> representing a full or partial match against the latest XACML Version string.
-         */
-        public VersionMatch getLatestVersion();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>IdReferenceMatch</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>IdReferenceMatch</code> objects (<code>i1</code> and <code>i2</code>) are equal if:
-         * 			{@code i1.getId().equals(i2.getId())} AND
-         * 			{@code i1.getVersion() == null && i2.getVersion() == null} OR {@code i1.getVersion().equals(i2.getVersion())}
-         * 			{@code i1.getEarliestVersion() == null && i2.getEarliestVersion() == null} OR {@code i1.getEarliestVersion().equals(i2.getEarliestVersion())} AND
-         * 			{@code i1.getLatestVersion() == null && i2.getLatestVersion() == null} OR {@code i1.getLatestVersion().equals(i2.getLatestVersion())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Returns the {@link Identifier} representing the XACML PolicyId or PolicySetId that
+     * is referenced by this <code>IdReference</code>.
+     *
+     * @return the <code>Identifier</code> representing the XACML PolicyId or PolicySetId that
+     * is referenced by this <code>IdReference</code>.
+     */
+    public Identifier getId();
+
+    /**
+     * Gets the {@link VersionMatch} representing a full or partial match against a XACML Version string.
+     *
+     * @return the <code>VersionMatch</code> representing a full or partial match against a XACML Version string.
+     */
+    public VersionMatch getVersion();
+
+    /**
+     * Gets the {@link VersionMatch} representing a full or partial match against the earliest XACML Version string.
+     *
+     * @return the <code>VersionMatch</code> representing a full or partial match against the earliest XACML Version string.
+     */
+    public VersionMatch getEarliestVersion();
+
+    /**
+     * Gets the {@link VersionMatch} representing a full or partial match against the latest XACML Version string.
+     *
+     * @return the <code>VersionMatch</code> representing a full or partial match against the latest XACML Version string.
+     */
+    public VersionMatch getLatestVersion();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>IdReferenceMatch</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>IdReferenceMatch</code> objects (<code>i1</code> and <code>i2</code>) are equal if:
+     * 			{@code i1.getId().equals(i2.getId())} AND
+     * 			{@code i1.getVersion() == null && i2.getVersion() == null} OR {@code i1.getVersion().equals(i2.getVersion())}
+     * 			{@code i1.getEarliestVersion() == null && i2.getEarliestVersion() == null} OR {@code i1.getEarliestVersion().equals(i2.getEarliestVersion())} AND
+     * 			{@code i1.getLatestVersion() == null && i2.getLatestVersion() == null} OR {@code i1.getLatestVersion().equals(i2.getLatestVersion())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Identifier.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Identifier.java
index 0a31e82..f228e2f 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Identifier.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Identifier.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,38 +37,38 @@
  * Identifier is the interface for objects that represent a XACML 3.0 identifier.  In most cases the {@link com.att.research.xacml.std.IdentifierImpl}
  * in this package will suffice as an implementation of this interface, but all use of identifiers will use the <code>Identifier</code>
  * interface to allow for extensions.
- * 
+ *
  * Classes that implement the <code>Identifier</code> interface should override the <code>equals</code> method to meet the following semantics:
  * 		Two <code>Identifier</code>s are <code>equal</code> if the values returned by the <code>getUri</code> method are <code>equal</code>.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public interface Identifier extends SemanticString {
-        /**
-         * Gets this <code>Identifier</code> as a <code>URI</code>.
-         * 
-         * @return the <code>URI</code> representation of this <code>Identifier</code>.
-         */
-        public URI getUri();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * The implementation of the <code>Identifier</code> interface must override the <code>hashCode</code> method .
-         * 
-         */
-        @Override
-        public int hashCode();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * The implementation of the <code>Identifier</code> interface must override the <code>equals</code> method with the following
-         * semantics:
-         * 		Two <code>Identifier</code> objects (<code>i1</code> and <code>i2</code>) are equal if:
-         * 			{@code a1.getUri().equals(a2.getUri())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets this <code>Identifier</code> as a <code>URI</code>.
+     *
+     * @return the <code>URI</code> representation of this <code>Identifier</code>.
+     */
+    public URI getUri();
+
+    /**
+     * {@inheritDoc}
+     *
+     * The implementation of the <code>Identifier</code> interface must override the <code>hashCode</code> method .
+     *
+     */
+    @Override
+    public int hashCode();
+
+    /**
+     * {@inheritDoc}
+     *
+     * The implementation of the <code>Identifier</code> interface must override the <code>equals</code> method with the following
+     * semantics:
+     * 		Two <code>Identifier</code> objects (<code>i1</code> and <code>i2</code>) are equal if:
+     * 			{@code a1.getUri().equals(a2.getUri())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/MissingAttributeDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/MissingAttributeDetail.java
index a0074a0..3303eec 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/MissingAttributeDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/MissingAttributeDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,62 +35,62 @@
 /**
  * Defines the API for objects that represent XACML MissingAtributeDetail elements as part of a Status element.  MissingAttributeDetails relay
  * information back about the reason a policy decision may have failed due to the absence of required AttributeValues.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface MissingAttributeDetail {
-        /**
-         * Gets the {@link Identifier} representing the XACML Category of the Attribute that was missing.
-         * 
-         * @return the <code>Identifier</code> representing the XACML Category of the Attribute that was missing.
-         */
-        public Identifier getCategory();
-        
-        /**
-         * Gets the {@link Identifier} representing the XACML AttributeId of the Attribute that was missing.
-         * 
-         * @return the <code>Identifier</code> representing the XACML AttributeId of the Attribute that was missing.
-         */
-        public Identifier getAttributeId();
-        
-        /**
-         * Gets the {@link Identifier} representing the XACML DataType of the AttributeValue that was missing.
-         * 
-         * @return the <code>Identifier</code> representing the XACML DataType of the Attribute that was missing.
-         */
-        public Identifier getDataTypeId();
-        
-        /**
-         * Gets the <code>String</code> representing the XACML Issuer for the Attribute that was missing if required.
-         * 
-         * @return the <code>String</code> representing the XACML Issuer for the Attribute that was missing if required.
-         */
-        public String getIssuer();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link AttributeValue}s that were expected for the Attribute that was missing.
-         * If there are no expected <code>AttributeValue</code>s this method should return an empty list.
-         * The <code>Collection</code> returned should not be modified.  Implementations are free to use unmodifiable <code>Collection</code>s to enforce this.
-         * 
-         * @return a <code>Collection</code> of <code>AttributeValue</code>s that were expected for the Attribute that was missing.
-         */
-        public Collection<AttributeValue<?>> getAttributeValues();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>MissingAttributeDetail</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>MissingAttributeDetail</code>s (<code>m1</code> and <code>m2</code>) are equal if:
-         * 			{@code m1.getCategory().equals(m2.getCategory())} AND
-         * 			{@code m1.getAttributeId().equals(m2.getAttributeId())} AND
-         * 			{@code m1.getDataTypeId().equals(m2.getDataTypeId())} AND
-         * 			{@code m1.getIssuer() == null && m2.getIssuer() == null} OR {@code m1.getIssuer().equals(m2.getIssuer())} AND
-         * 			{@code m1.getAttributeValues()} is pairwise equal to {@code m2.getAttributeValues()}
-         * @param obj
-         * @return
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link Identifier} representing the XACML Category of the Attribute that was missing.
+     *
+     * @return the <code>Identifier</code> representing the XACML Category of the Attribute that was missing.
+     */
+    public Identifier getCategory();
+
+    /**
+     * Gets the {@link Identifier} representing the XACML AttributeId of the Attribute that was missing.
+     *
+     * @return the <code>Identifier</code> representing the XACML AttributeId of the Attribute that was missing.
+     */
+    public Identifier getAttributeId();
+
+    /**
+     * Gets the {@link Identifier} representing the XACML DataType of the AttributeValue that was missing.
+     *
+     * @return the <code>Identifier</code> representing the XACML DataType of the Attribute that was missing.
+     */
+    public Identifier getDataTypeId();
+
+    /**
+     * Gets the <code>String</code> representing the XACML Issuer for the Attribute that was missing if required.
+     *
+     * @return the <code>String</code> representing the XACML Issuer for the Attribute that was missing if required.
+     */
+    public String getIssuer();
+
+    /**
+     * Gets the <code>Collection</code> of {@link AttributeValue}s that were expected for the Attribute that was missing.
+     * If there are no expected <code>AttributeValue</code>s this method should return an empty list.
+     * The <code>Collection</code> returned should not be modified.  Implementations are free to use unmodifiable <code>Collection</code>s to enforce this.
+     *
+     * @return a <code>Collection</code> of <code>AttributeValue</code>s that were expected for the Attribute that was missing.
+     */
+    public Collection<AttributeValue<?>> getAttributeValues();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>MissingAttributeDetail</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>MissingAttributeDetail</code>s (<code>m1</code> and <code>m2</code>) are equal if:
+     * 			{@code m1.getCategory().equals(m2.getCategory())} AND
+     * 			{@code m1.getAttributeId().equals(m2.getAttributeId())} AND
+     * 			{@code m1.getDataTypeId().equals(m2.getDataTypeId())} AND
+     * 			{@code m1.getIssuer() == null && m2.getIssuer() == null} OR {@code m1.getIssuer().equals(m2.getIssuer())} AND
+     * 			{@code m1.getAttributeValues()} is pairwise equal to {@code m2.getAttributeValues()}
+     * @param obj
+     * @return
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Obligation.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Obligation.java
index bbe738e..98e8bec 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Obligation.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Obligation.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,36 +35,36 @@
 /**
  * Defines the API for objects that represent XACML Obligation elements.  Obligations are returned in Result elements to indicate actions a PEP must
  * enforce as part of a decision.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface Obligation {
-        /**
-         * Gets the {@link Identifier} representing the XACML ObligationId for this <code>Obligation</code>.
-         * 
-         * @return the <code>Identifier</code> representing the XACML ObligationId for this <code>Obligation</code>.
-         */
-        public Identifier getId();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s representing the XACML AttributeAssignment elements
-         * for this <code>Obligation</code>.
-         * 
-         * @return a <code>Collection</code> of the <code>AttributeAssignment</code>s representing the XACML AttributeAssignment elements
-         * for this <code>Obligation</code>.
-         */
-        public Collection<AttributeAssignment> getAttributeAssignments();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>Obligation</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>Obligation</code>s (<code>o1</code> and <code>o2</code>) are equal if:
-         * 			{@code o1.getId().equals(o2.getId())} AND
-         * 			{@code o1.getAttributeAssignments()} is pairwise equal to {@code o2.getAttributeAssignments()}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link Identifier} representing the XACML ObligationId for this <code>Obligation</code>.
+     *
+     * @return the <code>Identifier</code> representing the XACML ObligationId for this <code>Obligation</code>.
+     */
+    public Identifier getId();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s representing the XACML AttributeAssignment elements
+     * for this <code>Obligation</code>.
+     *
+     * @return a <code>Collection</code> of the <code>AttributeAssignment</code>s representing the XACML AttributeAssignment elements
+     * for this <code>Obligation</code>.
+     */
+    public Collection<AttributeAssignment> getAttributeAssignments();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>Obligation</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>Obligation</code>s (<code>o1</code> and <code>o2</code>) are equal if:
+     * 			{@code o1.getId().equals(o2.getId())} AND
+     * 			{@code o1.getAttributeAssignments()} is pairwise equal to {@code o2.getAttributeAssignments()}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Request.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Request.java
index fc188a4..af6f8e4 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Request.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Request.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,95 +36,95 @@
 
 /**
  * Provides the API for objects that represent XACML Request elements.  Requests are used to specify the contents of a XACML decision request.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public interface Request {
 
-        /**
-         * Gets the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults for this <code>Request</code>.
-         * 
-         * @return the <code>RequestDefaults</code> representing the XACML RequestDefaults for this <code>Request</code>.
-         */
-        public RequestDefaults getRequestDefaults();
-        
-        /**
-         * Returns true if the list of XACML PolicyIds should be returned for this <code>Request</code>.
-         * 
-         * @return true if XACML PolicyIds should be returned, otherwise false
-         */
-        public boolean getReturnPolicyIdList();
-        
-        /**
-         * Returns true if the results from multiple individual decisions for this <code>Request</code> should
-         * be combined into a single XACML Result.
-         * 
-         * @return true if multiple results should be combined, otherwise false.
-         */
-        public boolean getCombinedDecision();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} representing XACML Attributes elements for
-         * this <code>Request</code>.  The <code>Collection</code> should not be modified.  Implementations are free to use unmodifiable lists
-         * to enforce this.
-         * 
-         * @return the <code>Collection</code> of <code>RequestAttributes</code> representing XACML Attributes elements for
-         * this <code>Request</code>.
-         */
-        public Collection<RequestAttributes> getRequestAttributes();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} representing XACML Attributes elements for
-         * this <code>Request</code> that contain {@link com.att.research.xacml.api.Attribute}s where <code>getIncludeInResults</code> is true.
-         * 
-         * @return a <code>Collection</code> of <code>RequestAttributes</code> containing one or more <code>Attribute</code>s to include in results.
-         */
-        public Collection<AttributeCategory> getRequestAttributesIncludedInResult();
-        
-        /**
-         * Gets an <code>Iterator</code> over all of the {@link com.att.research.xacml.api.RequestAttributes} objects
-         * found in this <code>Request</code> with the given {@link com.att.research.xacml.api.Identifier} representing a XACML Category.
-         * 
-         * @param category the <code>Identifier</code> representing the XACML Category of the <code>ReqestAttributes</code> to retrieve.
-         * @return an <code>Iterator</code> over all of the <code>RequestAttributes</code> whose Category matches the given <code>Identifier</code>
-         */
-        public Iterator<RequestAttributes> getRequestAttributes(Identifier category);
-        
-        /**
-         * Gets a single matching <code>RequestAttributes</code> representing the XACML Attributes element with whose xml:Id matches the given <code>String</code>>
-         * 
-         * @param xmlId the <code>String</code> representing the xml:Id of the <code>RequestAttributes</code> to retrieve
-         * @return the single matching <code>RequestAttributes</code> object or null if not found
-         */
-        public RequestAttributes getRequestAttributesByXmlId(String xmlId);
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s representing XACML MultiRequest elements in this <code>Request</code>.
-         * 
-         * @return the <code>Collection</code> of <code>RequestAttributes</code> representing XACML MultiRequest elements in this <code>Request</code>.
-         */
-        public Collection<RequestReference> getMultiRequests();
-        
-        /**
-         * Gets the {@link Status} representing the XACML Status element for the Request represented by this <code>Request</code>.
-         * 
-         * @return the <code>Status</code> representing the XACML Status element for the Request represented by this <code>Request</code>.
-         */
-        public Status getStatus();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>Request</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>Requests</code> (<code>r1</code> and <code>r2</code>) are equals if:
-         * 			{@code r1.getRequestDefaults() == null && r2.getRequestDefaults() == null} OR {@code r1.getRequestDefaults().equals(r2.getRequestDefaults())} AND
-         * 			{@code r1.getReturnPolicyIdList() == r2.getReturnPolicyIdList()} AND
-         * 			{@code r1.getCombinedDecision() == r2.getCombinedDecision()} AND
-         * 			{@code r1.getRequestAttributes()} is pairwise equal to {@code r2.getRequestAttributes()} AND
-         * 			{@code r1.getMultiRequests()} is pairwise equal to {@code r2.getMultiRequests()}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults for this <code>Request</code>.
+     *
+     * @return the <code>RequestDefaults</code> representing the XACML RequestDefaults for this <code>Request</code>.
+     */
+    public RequestDefaults getRequestDefaults();
+
+    /**
+     * Returns true if the list of XACML PolicyIds should be returned for this <code>Request</code>.
+     *
+     * @return true if XACML PolicyIds should be returned, otherwise false
+     */
+    public boolean getReturnPolicyIdList();
+
+    /**
+     * Returns true if the results from multiple individual decisions for this <code>Request</code> should
+     * be combined into a single XACML Result.
+     *
+     * @return true if multiple results should be combined, otherwise false.
+     */
+    public boolean getCombinedDecision();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} representing XACML Attributes elements for
+     * this <code>Request</code>.  The <code>Collection</code> should not be modified.  Implementations are free to use unmodifiable lists
+     * to enforce this.
+     *
+     * @return the <code>Collection</code> of <code>RequestAttributes</code> representing XACML Attributes elements for
+     * this <code>Request</code>.
+     */
+    public Collection<RequestAttributes> getRequestAttributes();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} representing XACML Attributes elements for
+     * this <code>Request</code> that contain {@link com.att.research.xacml.api.Attribute}s where <code>getIncludeInResults</code> is true.
+     *
+     * @return a <code>Collection</code> of <code>RequestAttributes</code> containing one or more <code>Attribute</code>s to include in results.
+     */
+    public Collection<AttributeCategory> getRequestAttributesIncludedInResult();
+
+    /**
+     * Gets an <code>Iterator</code> over all of the {@link com.att.research.xacml.api.RequestAttributes} objects
+     * found in this <code>Request</code> with the given {@link com.att.research.xacml.api.Identifier} representing a XACML Category.
+     *
+     * @param category the <code>Identifier</code> representing the XACML Category of the <code>ReqestAttributes</code> to retrieve.
+     * @return an <code>Iterator</code> over all of the <code>RequestAttributes</code> whose Category matches the given <code>Identifier</code>
+     */
+    public Iterator<RequestAttributes> getRequestAttributes(Identifier category);
+
+    /**
+     * Gets a single matching <code>RequestAttributes</code> representing the XACML Attributes element with whose xml:Id matches the given <code>String</code>>
+     *
+     * @param xmlId the <code>String</code> representing the xml:Id of the <code>RequestAttributes</code> to retrieve
+     * @return the single matching <code>RequestAttributes</code> object or null if not found
+     */
+    public RequestAttributes getRequestAttributesByXmlId(String xmlId);
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s representing XACML MultiRequest elements in this <code>Request</code>.
+     *
+     * @return the <code>Collection</code> of <code>RequestAttributes</code> representing XACML MultiRequest elements in this <code>Request</code>.
+     */
+    public Collection<RequestReference> getMultiRequests();
+
+    /**
+     * Gets the {@link Status} representing the XACML Status element for the Request represented by this <code>Request</code>.
+     *
+     * @return the <code>Status</code> representing the XACML Status element for the Request represented by this <code>Request</code>.
+     */
+    public Status getStatus();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>Request</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>Requests</code> (<code>r1</code> and <code>r2</code>) are equals if:
+     * 			{@code r1.getRequestDefaults() == null && r2.getRequestDefaults() == null} OR {@code r1.getRequestDefaults().equals(r2.getRequestDefaults())} AND
+     * 			{@code r1.getReturnPolicyIdList() == r2.getReturnPolicyIdList()} AND
+     * 			{@code r1.getCombinedDecision() == r2.getCombinedDecision()} AND
+     * 			{@code r1.getRequestAttributes()} is pairwise equal to {@code r2.getRequestAttributes()} AND
+     * 			{@code r1.getMultiRequests()} is pairwise equal to {@code r2.getMultiRequests()}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestAttributes.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestAttributes.java
index 8d89277..055cd76 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestAttributes.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestAttributes.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,53 +39,53 @@
  * Defines the API for objects that represent XACML 3.0 Attributes elements within a Request by extending the
  * {@link AttributeCategory} interface with methods for accessing DOM {@link org.w3c.dom.Node}s
  * representing XACML 3.0 Content elements.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface RequestAttributes extends AttributeCategory {
-        /**
-         * Gets the root {@link org.w3c.dom.Node} from the XACML 3.0 Content element of an Attributes element in a Request.
-         * 
-         * @return the root <code>Node</code> from the XACML 3.0 Content element of an Attributes element in a Request.
-         */
-        public Node getContentRoot();
-        
-        /**
-         * Finds the {@link org.w3c.dom.Node} referenced by the given {@link javax.xml.xpath.XPathExpression} within the
-         * XACML Content element in this <code>RequestAttributes</code> object.
-         * 
-         * @param xpathExpression the <code>XPathExpression</code> to apply to the Content element.
-         * @return the <code>Node</code> returned by the given <code>XPathExpression</code> or null if not found.
-         */
-        public Node getContentNodeByXpathExpression(XPathExpression xpathExpression);
-        
-        /**
-         * Finds the {@link org.w3c.dom.NodeList} referenced by the given {@link javax.xml.xpath.XPathExpression} within the
-         * XACML Content element in this <code>RequestAttributes</code> object.
-         * 
-         * @param xpathExpression the <code>XPathExpression</code> to apply to the Content element.
-         * @return the <code>NodeList</code> containing all <code>Node</code>s that match the <code>XPathExpression</code>
-         */
-        public NodeList getContentNodeListByXpathExpression(XPathExpression xpathExpression);
-        
-        /**
-         * Returns the <code>String</code> representing the xml:Id attribute for the XACML Attributes element represented by
-         * this <code>RequestAttributes</code> object.
-         * 
-         * @return the <code>String</code> representing the xml:Id attribute for the XACML Attributes element represented by
-         * this <code>RequestAttributes</code> object.  May be null.
-         */
-        public String getXmlId();
-        
-        /**
-         * Implementations of the <code>RequestAttributes</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>RequestAttributes</code> objects (<code>r1</code> and <code>r2</code>) are equal if:
-         * 			{@code r1.super.equals(r2)} AND
-         * 			{@code r1.getContentRoot() == null && r2.getContentRoot() == null} OR {@code r1.getContentRoot().equals(r2.getContentRoot())} AND
-         * 			{@code r1.getXmlId() == null && r2.getXmlId() == null} OR {@code r1.getXmlId().equals(r2.getXmlId())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the root {@link org.w3c.dom.Node} from the XACML 3.0 Content element of an Attributes element in a Request.
+     *
+     * @return the root <code>Node</code> from the XACML 3.0 Content element of an Attributes element in a Request.
+     */
+    public Node getContentRoot();
+
+    /**
+     * Finds the {@link org.w3c.dom.Node} referenced by the given {@link javax.xml.xpath.XPathExpression} within the
+     * XACML Content element in this <code>RequestAttributes</code> object.
+     *
+     * @param xpathExpression the <code>XPathExpression</code> to apply to the Content element.
+     * @return the <code>Node</code> returned by the given <code>XPathExpression</code> or null if not found.
+     */
+    public Node getContentNodeByXpathExpression(XPathExpression xpathExpression);
+
+    /**
+     * Finds the {@link org.w3c.dom.NodeList} referenced by the given {@link javax.xml.xpath.XPathExpression} within the
+     * XACML Content element in this <code>RequestAttributes</code> object.
+     *
+     * @param xpathExpression the <code>XPathExpression</code> to apply to the Content element.
+     * @return the <code>NodeList</code> containing all <code>Node</code>s that match the <code>XPathExpression</code>
+     */
+    public NodeList getContentNodeListByXpathExpression(XPathExpression xpathExpression);
+
+    /**
+     * Returns the <code>String</code> representing the xml:Id attribute for the XACML Attributes element represented by
+     * this <code>RequestAttributes</code> object.
+     *
+     * @return the <code>String</code> representing the xml:Id attribute for the XACML Attributes element represented by
+     * this <code>RequestAttributes</code> object.  May be null.
+     */
+    public String getXmlId();
+
+    /**
+     * Implementations of the <code>RequestAttributes</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>RequestAttributes</code> objects (<code>r1</code> and <code>r2</code>) are equal if:
+     * 			{@code r1.super.equals(r2)} AND
+     * 			{@code r1.getContentRoot() == null && r2.getContentRoot() == null} OR {@code r1.getContentRoot().equals(r2.getContentRoot())} AND
+     * 			{@code r1.getXmlId() == null && r2.getXmlId() == null} OR {@code r1.getXmlId().equals(r2.getXmlId())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestAttributesReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestAttributesReference.java
index 5ca7465..a6c6cfc 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestAttributesReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestAttributesReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,26 +32,26 @@
 
 /**
  * Defines the API for objects that implement XACML AttributesReference elements.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface RequestAttributesReference {
-        /**
-         * Gets the <String> representing the xml:Id of the XACML AttributesReference element represented by this <code>RequestAttributesReference</code>
-         * 
-         * @return the <code>String</code> representing the xml:Id of the XACML AttributesReference element represented by this <code>RequestAttributesReference</code>
-         */
-        public String getReferenceId();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of this interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>RequestAttributesReference</code>s (<code>r1</code> and <code>r2</code>) are equal if:
-         * 			{@code r1.getReferenceId() == null && r2.getReferenceId() == null} OR {@code r1.getReferenceId().equals(r2.getReferenceId())}	
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the <String> representing the xml:Id of the XACML AttributesReference element represented by this <code>RequestAttributesReference</code>
+     *
+     * @return the <code>String</code> representing the xml:Id of the XACML AttributesReference element represented by this <code>RequestAttributesReference</code>
+     */
+    public String getReferenceId();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of this interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>RequestAttributesReference</code>s (<code>r1</code> and <code>r2</code>) are equal if:
+     * 			{@code r1.getReferenceId() == null && r2.getReferenceId() == null} OR {@code r1.getReferenceId().equals(r2.getReferenceId())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestDefaults.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestDefaults.java
index 7d401df..d13b2cc 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestDefaults.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestDefaults.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,26 +34,26 @@
 
 /**
  * Defines the API for objects that represent XACML RequestDefaults elements.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface RequestDefaults {
-        /**
-         * Returns the <code>URI</code> of the XPath version to use when applying XPath expressions to XML content.
-         * 
-         * @return the <code>URI</code> of the XPath version.
-         */
-        public URI getXPathVersion();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of this interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>RequestDefaults</code> (<code>r1</code> and <code>r2</code> are equal if:
-         * 			{@code r1.getXPathVersion() == null && r2.getXPathVersion() == null} OR {@code r1.getXPathVersion().equals(r2.getXPathVersion())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Returns the <code>URI</code> of the XPath version to use when applying XPath expressions to XML content.
+     *
+     * @return the <code>URI</code> of the XPath version.
+     */
+    public URI getXPathVersion();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of this interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>RequestDefaults</code> (<code>r1</code> and <code>r2</code> are equal if:
+     * 			{@code r1.getXPathVersion() == null && r2.getXPathVersion() == null} OR {@code r1.getXPathVersion().equals(r2.getXPathVersion())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestReference.java
index a3c6142..d32f35b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/RequestReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,28 +35,28 @@
 /**
  * Defines the API for objects that represent XACML RequestReference elements.  RequestReference elements contain zero or more AttributesReference
  * elements and are used in multi-requests.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface RequestReference {
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributesReference}s contained
-         * in this <code>RequestReference</code>.  If there are no <code>RequestAttributesReference}s this method must return an empty <code>Collection</code>.
-         * 
-         * @return the <code>Collection</code> of <code>RequestAttributesReference</code>s contained in this <code>RequestReference</code>.
-         */
-        public Collection<RequestAttributesReference> getAttributesReferences();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of this interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>RequestReference</code>s (<code>r1</code> and <code>r2</code>) are equal if:
-         * 
-         * 			{@code r1.getAttributesReferences()} is pair-wise equal to {@code r2.getAttributesReferences()}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributesReference}s contained
+     * in this <code>RequestReference</code>.  If there are no <code>RequestAttributesReference}s this method must return an empty <code>Collection</code>.
+     *
+     * @return the <code>Collection</code> of <code>RequestAttributesReference</code>s contained in this <code>RequestReference</code>.
+     */
+    public Collection<RequestAttributesReference> getAttributesReferences();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of this interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>RequestReference</code>s (<code>r1</code> and <code>r2</code>) are equal if:
+     *
+     * 			{@code r1.getAttributesReferences()} is pair-wise equal to {@code r2.getAttributesReferences()}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Response.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Response.java
index 8b33bef..9a46767 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Response.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Response.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,29 +34,29 @@
 import java.util.Collection;
 
 /**
- * Defines the API for objects that represent XACML Response documents.  Response documents wrap the Result elements for individual XACML 
+ * Defines the API for objects that represent XACML Response documents.  Response documents wrap the Result elements for individual XACML
  * decision requests.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public interface Response {
-        /**
-         * Gets the <code>Collection</code> of {@link Result}s objects in this <code>Response</code>.  If
-         * there are no <code>Result</code>s, this method must return an empty <code>Collection</code>.
-         * 
-         * @return the <code>Collection</code> of {@link Result}s objects in this <code>Response</code>.
-         */
-        public Collection<Result> getResults();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of this interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>Response</code>s (<code>r1</code> and <code>r2</code>) are equal if:
-         * 			{@code r1.getResults()} is pairwise equal to {@code r2.getResults()}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the <code>Collection</code> of {@link Result}s objects in this <code>Response</code>.  If
+     * there are no <code>Result</code>s, this method must return an empty <code>Collection</code>.
+     *
+     * @return the <code>Collection</code> of {@link Result}s objects in this <code>Response</code>.
+     */
+    public Collection<Result> getResults();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of this interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>Response</code>s (<code>r1</code> and <code>r2</code>) are equal if:
+     * 			{@code r1.getResults()} is pairwise equal to {@code r2.getResults()}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Result.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Result.java
index b0d335e..d0530ba 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Result.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Result.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,79 +35,79 @@
 /**
  * Defines the API for objects that represent XACML Result elements.  Results communicate the Decision, Status, Attributes,
  * Obligations, and Advice for an individual decision request.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface Result {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Decision} associated with this <code>Result</code>.
-         * 
-         * @return the <code>Decision</code> associated with this <code>Result</code>.
-         */
-        public Decision getDecision();
-        
-        /**
-         * Gets the {@link com.att.research.xacml.api.Status} associated with this <code>Result</code>.
-         * 
-         * @return the <code>Status</code> associated with this <code>Result</code>
-         */
-        public Status getStatus();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s int this <code>Result</code>.  If there
-         * are no <code>Obligation</code>s this method must return an empty <code>Collection</code>.
-         * 
-         * @return the <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s <code>Result</code>.
-         */
-        public Collection<Obligation> getObligations();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link Advice} objects in this <code>Result</code>.  If there
-         * are no <code>Advice</code> codes this method must return an empty <code>Collection</code>.
-         * 
-         * @return the <code>Collection</code> of <code>Advice</code> objects in this <code>Result</code>.
-         */
-        public Collection<Advice> getAssociatedAdvice();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.AttributeCategory} objects in this <code>Result</code>.  If there
-         * are no <code>AttributeCategory</code> objects this method must return an empty <code>Collection</code>.
-         * 
-         * @return the <code>Collection</code> of <code>AttributeCategory</code> objects in this <code>Result</code>.
-         */
-        public Collection<AttributeCategory> getAttributes();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects referring to XACML 3.0 Policies
-         * that are in this <code>Result</code>.
-         * 
-         * @return the <code>Collection</code> of Policy <code>IdReference</code>s in this <code>Result</code>.
-         */
-        public Collection<IdReference> getPolicyIdentifiers();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects referring to XACML 3.0 PolicySets
-         * that are in this <code>Result</code>.
-         * 
-         * @return the <code>Collection</code> of PolicySet <code>IdReference</code>s in this <code>Result</code>.
-         */
-        public Collection<IdReference> getPolicySetIdentifiers();
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of this interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * 		Two <code>Result</code>s (<code>r1</code> and <code>r2</code>) are equal if:
-         * 			{@code r1.getDecision() == r2.getDecision()} AND
-         * 			{@code r1.getStatus().equals(r2.getStatus()} AND
-         * 			{@code r1.getObligations()} is pair-wise equal to {@code r2.getObligations()}
-         * 			{@code r1.getAssociatedAdvice()} is pair-wise equal to {@code r2.getAssociatedAdvice()}
-         * 			{@code r1.getAttributes()} is pair-wise equal to {@code r2.getAttributes()}
-         * 			{@code r1.getPolicyIdentifiers()} is pair-wise equal to {@code r2.getPolicyIdentifiers()}
-         * 			{@code r1.getPolicySetIdentifiers()} is pair-wise equal to {@code r2.getPolicySetIdentifiers()}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link com.att.research.xacml.api.Decision} associated with this <code>Result</code>.
+     *
+     * @return the <code>Decision</code> associated with this <code>Result</code>.
+     */
+    public Decision getDecision();
+
+    /**
+     * Gets the {@link com.att.research.xacml.api.Status} associated with this <code>Result</code>.
+     *
+     * @return the <code>Status</code> associated with this <code>Result</code>
+     */
+    public Status getStatus();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s int this <code>Result</code>.  If there
+     * are no <code>Obligation</code>s this method must return an empty <code>Collection</code>.
+     *
+     * @return the <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s <code>Result</code>.
+     */
+    public Collection<Obligation> getObligations();
+
+    /**
+     * Gets the <code>Collection</code> of {@link Advice} objects in this <code>Result</code>.  If there
+     * are no <code>Advice</code> codes this method must return an empty <code>Collection</code>.
+     *
+     * @return the <code>Collection</code> of <code>Advice</code> objects in this <code>Result</code>.
+     */
+    public Collection<Advice> getAssociatedAdvice();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.AttributeCategory} objects in this <code>Result</code>.  If there
+     * are no <code>AttributeCategory</code> objects this method must return an empty <code>Collection</code>.
+     *
+     * @return the <code>Collection</code> of <code>AttributeCategory</code> objects in this <code>Result</code>.
+     */
+    public Collection<AttributeCategory> getAttributes();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects referring to XACML 3.0 Policies
+     * that are in this <code>Result</code>.
+     *
+     * @return the <code>Collection</code> of Policy <code>IdReference</code>s in this <code>Result</code>.
+     */
+    public Collection<IdReference> getPolicyIdentifiers();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects referring to XACML 3.0 PolicySets
+     * that are in this <code>Result</code>.
+     *
+     * @return the <code>Collection</code> of PolicySet <code>IdReference</code>s in this <code>Result</code>.
+     */
+    public Collection<IdReference> getPolicySetIdentifiers();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of this interface must override the <code>equals</code> method with the following semantics:
+     *
+     * 		Two <code>Result</code>s (<code>r1</code> and <code>r2</code>) are equal if:
+     * 			{@code r1.getDecision() == r2.getDecision()} AND
+     * 			{@code r1.getStatus().equals(r2.getStatus()} AND
+     * 			{@code r1.getObligations()} is pair-wise equal to {@code r2.getObligations()}
+     * 			{@code r1.getAssociatedAdvice()} is pair-wise equal to {@code r2.getAssociatedAdvice()}
+     * 			{@code r1.getAttributes()} is pair-wise equal to {@code r2.getAttributes()}
+     * 			{@code r1.getPolicyIdentifiers()} is pair-wise equal to {@code r2.getPolicyIdentifiers()}
+     * 			{@code r1.getPolicySetIdentifiers()} is pair-wise equal to {@code r2.getPolicySetIdentifiers()}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/SemanticString.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/SemanticString.java
index 3499d7e..0b17cdb 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/SemanticString.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/SemanticString.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,15 +33,15 @@
 /**
  * SemanticString is an interface for objects that have semantically significant <code>String</code> representations.  It differentiates
  * objects whose <code>toString</code> method represents debugging information rather than something that is meaningful at runtime.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public interface SemanticString {
-        /**
-         * Gets the semantically significant <code>String</code> representation of the object implementing this interface.
-         * 
-         * @return the semantically significant <code>String</code> representation of the object implementing this interface.
-         */
-        public String stringValue();
+    /**
+     * Gets the semantically significant <code>String</code> representation of the object implementing this interface.
+     *
+     * @return the semantically significant <code>String</code> representation of the object implementing this interface.
+     */
+    public String stringValue();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Status.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Status.java
index 359926c..9ce3651 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Status.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Status.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,59 +32,59 @@
 
 /**
  * Defines the API for objects that represent XACML Status elements.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface Status {
-        /**
-         * Gets the {@link com.att.research.xacml.api.StatusCode} for this <code>Status</code>.
-         * 
-         * @return the <code>StatusCode</code> for this <code>Status</code>.
-         */
-        public StatusCode getStatusCode();
-        
-        /**
-         * Gets the <code>String</code> status message for this <code>Status</code>.
-         * 
-         * @return the <code>String</code> status message for this <code>Status</code>
-         */
-        public String getStatusMessage();
-        
-        /**
-         * Gets the {@link com.att.research.xacml.api.StatusDetail} associated with this <code>Status</code> if there is any.
-         * 
-         * @return the <code>StatusDetail</code> for this <code>Status</code> if there is any.
-         */
-        public StatusDetail getStatusDetail();
-        
-        /**
-         * Returns <code>true</code> if the <code>StatusCode</code> for this <code>Status</code> is the XACML OK value.
-         * 
-         * @return true if the <code>StatusCode</code> for this <code>Status</code> is the XACML OK value, else false
-         */
-        public boolean isOk();
-        
-        /**
-         * Returns a <code>Status</code> with the same <code>StatusCode</code> and status message as this <code>Status</code>
-         * but whose <code>StatusDetail</code> is the merging of the <code>StatusDetail</code> in this <code>Status</code>
-         * and the <code>StatusDetail</code> in the given <code>Status</code>.
-         * 
-         * @param status the <code>Status</code> whose <code>StatusDetail</code> is to be merged in
-         * @return a <code>Status</code> with merged <code>StatusDetail</code>
-         */
-        public Status merge(Status status);
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>Status</code> interface must override the <code>equals</code> method with the following semantics:
-         * 
-         * Two <code>Status</code> objects (<code>s1</code> and <code>s2</code>) are equal if:
-         * 		{@code s1.getStatusCode().equals(s2.getStatusCode())} AND
-         * 		{@code s1.getStatusMessage() == null && s2.getStatusMessage() == null} OR {@code s1.getStatusMessage().equals(s2.getStatusMessage())}
-         * 		{@code s1.getStatusDetail() == null && s2.getStatusDetail() == null} OR {@code s1.getStatusDetail().equals(s2.getStatusDetail())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the {@link com.att.research.xacml.api.StatusCode} for this <code>Status</code>.
+     *
+     * @return the <code>StatusCode</code> for this <code>Status</code>.
+     */
+    public StatusCode getStatusCode();
+
+    /**
+     * Gets the <code>String</code> status message for this <code>Status</code>.
+     *
+     * @return the <code>String</code> status message for this <code>Status</code>
+     */
+    public String getStatusMessage();
+
+    /**
+     * Gets the {@link com.att.research.xacml.api.StatusDetail} associated with this <code>Status</code> if there is any.
+     *
+     * @return the <code>StatusDetail</code> for this <code>Status</code> if there is any.
+     */
+    public StatusDetail getStatusDetail();
+
+    /**
+     * Returns <code>true</code> if the <code>StatusCode</code> for this <code>Status</code> is the XACML OK value.
+     *
+     * @return true if the <code>StatusCode</code> for this <code>Status</code> is the XACML OK value, else false
+     */
+    public boolean isOk();
+
+    /**
+     * Returns a <code>Status</code> with the same <code>StatusCode</code> and status message as this <code>Status</code>
+     * but whose <code>StatusDetail</code> is the merging of the <code>StatusDetail</code> in this <code>Status</code>
+     * and the <code>StatusDetail</code> in the given <code>Status</code>.
+     *
+     * @param status the <code>Status</code> whose <code>StatusDetail</code> is to be merged in
+     * @return a <code>Status</code> with merged <code>StatusDetail</code>
+     */
+    public Status merge(Status status);
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>Status</code> interface must override the <code>equals</code> method with the following semantics:
+     *
+     * Two <code>Status</code> objects (<code>s1</code> and <code>s2</code>) are equal if:
+     * 		{@code s1.getStatusCode().equals(s2.getStatusCode())} AND
+     * 		{@code s1.getStatusMessage() == null && s2.getStatusMessage() == null} OR {@code s1.getStatusMessage().equals(s2.getStatusMessage())}
+     * 		{@code s1.getStatusDetail() == null && s2.getStatusDetail() == null} OR {@code s1.getStatusDetail().equals(s2.getStatusDetail())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/StatusCode.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/StatusCode.java
index dda7121..8b00d43 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/StatusCode.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/StatusCode.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,34 +32,34 @@
 
 /**
  * Defines the API for objects that represent XACML StatusCode values.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface StatusCode {
-        /**
-         * Retrieves the major status {@link com.att.research.xacmo.common.Identifier} for this <code>StatusCode</code>.
-         * 
-         * @return the major status <code>Identifier</code> for this <code>StatusCode</code>
-         */
-        public Identifier	getStatusCodeValue();
-        
-        /**
-         * Gets a child <code>StatusCode</code> of this <code>StatusCode</code> if there is one.
-         * 
-         * @return the child <code>StatusCode</code> of this <code>StatusCode</code> or null if there is none
-         */
-        public StatusCode getChild();
+    /**
+     * Retrieves the major status {@link com.att.research.xacmo.common.Identifier} for this <code>StatusCode</code>.
+     *
+     * @return the major status <code>Identifier</code> for this <code>StatusCode</code>
+     */
+    public Identifier	getStatusCodeValue();
 
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>StatusCode</code> interface must override the <code>equals</code> method as follows:
-         * 
-         * Two <code>StatusCode</code>s (<code>s1</code> and <code>s2</code>) are equal if:
-         * 		{@code s1.getIdentifer().equals(s2.getIdentifier()} AND
-         * 		{@code s1.getChild() == null && s2.getChild() == null} OR {@code s1.getChild().equals(s2.getChild())}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets a child <code>StatusCode</code> of this <code>StatusCode</code> if there is one.
+     *
+     * @return the child <code>StatusCode</code> of this <code>StatusCode</code> or null if there is none
+     */
+    public StatusCode getChild();
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>StatusCode</code> interface must override the <code>equals</code> method as follows:
+     *
+     * Two <code>StatusCode</code>s (<code>s1</code> and <code>s2</code>) are equal if:
+     * 		{@code s1.getIdentifer().equals(s2.getIdentifier()} AND
+     * 		{@code s1.getChild() == null && s2.getChild() == null} OR {@code s1.getChild().equals(s2.getChild())}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/StatusDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/StatusDetail.java
index 2748d14..d883038 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/StatusDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/StatusDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,36 +34,36 @@
 
 /**
  * Defines the API for objects that represent XACML StatusDetail elements.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public interface StatusDetail {
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.MissingAttributeDetail} objects for this <code>StatusDetail</code>.
-         * If there are no <code>MissingAttributeDetail</code>s an empty <code>Collection</code> must be returned.
-         * 
-         * @return the <code>MissingAttributeDetail</code> objects for this <code>StatusDetail</code> or null if none.
-         */
-        public Collection<MissingAttributeDetail>	getMissingAttributeDetails();
-        
-        /**
-         * Gets a <code>StatusDetail</code> object that is the result of merging this <code>StatusDetail<code> with the
-         * given <code>StatusDetail</code>.
-         * 
-         * @param statusDetail the <code>StatusDetail</code> to merge in
-         * @return a <code>StatusDetail</code> merging this <code>StatusDetail</code> with the given <code>StatusDetail</code>.
-         */
-        public StatusDetail merge(StatusDetail statusDetail);
-        
-        /**
-         * {@inheritDoc}
-         * 
-         * Implementations of the <code>StatusDetail</code> interface must override the <code>equals</code> method as follows:
-         * 
-         * 		Two <code>StatusDetail</code>s (<code>s1</code> and <code>s2</code>) are equal if:
-         * 			{@code s1.getMissingAttributeDetails()} is pair-wise equal to {@code s2.getMissingAttributeDetails()}
-         */
-        @Override
-        public boolean equals(Object obj);
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.MissingAttributeDetail} objects for this <code>StatusDetail</code>.
+     * If there are no <code>MissingAttributeDetail</code>s an empty <code>Collection</code> must be returned.
+     *
+     * @return the <code>MissingAttributeDetail</code> objects for this <code>StatusDetail</code> or null if none.
+     */
+    public Collection<MissingAttributeDetail>	getMissingAttributeDetails();
+
+    /**
+     * Gets a <code>StatusDetail</code> object that is the result of merging this <code>StatusDetail<code> with the
+     * given <code>StatusDetail</code>.
+     *
+     * @param statusDetail the <code>StatusDetail</code> to merge in
+     * @return a <code>StatusDetail</code> merging this <code>StatusDetail</code> with the given <code>StatusDetail</code>.
+     */
+    public StatusDetail merge(StatusDetail statusDetail);
+
+    /**
+     * {@inheritDoc}
+     *
+     * Implementations of the <code>StatusDetail</code> interface must override the <code>equals</code> method as follows:
+     *
+     * 		Two <code>StatusDetail</code>s (<code>s1</code> and <code>s2</code>) are equal if:
+     * 			{@code s1.getMissingAttributeDetails()} is pair-wise equal to {@code s2.getMissingAttributeDetails()}
+     */
+    @Override
+    public boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/Version.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/Version.java
index 388b736..a543bf3 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/Version.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/Version.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,23 +32,23 @@
 
 /**
  * Version is the interface that objects that represent XACML VersionType attributes and elements implement.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface Version extends Comparable<Version>, SemanticString {
-        /**
-         * Gets the <code>String</code> representation of this <code>Version</code>.
-         * 
-         * @return the <code>String</code> representation of this <code>Version</code>
-         */
-        public String getVersion();
-        
-        /**
-         * Gets the integer array representation of this <code>Version</code>.
-         * 
-         * @return the integer array representation of this <code>Version</code>
-         */
-        public int[] getVersionDigits();
-        
+    /**
+     * Gets the <code>String</code> representation of this <code>Version</code>.
+     *
+     * @return the <code>String</code> representation of this <code>Version</code>
+     */
+    public String getVersion();
+
+    /**
+     * Gets the integer array representation of this <code>Version</code>.
+     *
+     * @return the integer array representation of this <code>Version</code>
+     */
+    public int[] getVersionDigits();
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/VersionMatch.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/VersionMatch.java
index 1b13dc0..6371da8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/VersionMatch.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/VersionMatch.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,30 +33,30 @@
 /**
  * VersionMatch is the interface that objects implementing references to {@link Version} objects
  * must implement.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface VersionMatch {
-        /**
-         * Gets the <code>String</code> representation of the <code>Version</code> matching pattern.
-         * 
-         * @return the <code>String</code> representation of the <code>Version</code> matching pattern.
-         */
-        public String getVersionMatch();
-        
-        /**
-         * Determines if the pattern in this <code>VersionMatch</code> matches the given <code>Version</code> based on the
-         * given comparison code.  Comparison code values are:
-         * 	0 - match only if version numbers match the pattern
-         * -1 - match if the version numbers <= the pattern
-         *  1 - match if the version numbers >= the pattern
-         *  
-         * Wildcard values are considered to match any comparison code
-         * 
-         * @param version the <code>Version</code> to match against
-         * @param cmp integer comparision code
-         * @return true if this pattern matches the given <code>Version</code> else false
-         */
-        public boolean match(Version version, int cmp);
+    /**
+     * Gets the <code>String</code> representation of the <code>Version</code> matching pattern.
+     *
+     * @return the <code>String</code> representation of the <code>Version</code> matching pattern.
+     */
+    public String getVersionMatch();
+
+    /**
+     * Determines if the pattern in this <code>VersionMatch</code> matches the given <code>Version</code> based on the
+     * given comparison code.  Comparison code values are:
+     * 	0 - match only if version numbers match the pattern
+     * -1 - match if the version numbers <= the pattern
+     *  1 - match if the version numbers >= the pattern
+     *
+     * Wildcard values are considered to match any comparison code
+     *
+     * @param version the <code>Version</code> to match against
+     * @param cmp integer comparision code
+     * @return true if this pattern matches the given <code>Version</code> else false
+     */
+    public boolean match(Version version, int cmp);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML.java
index a292379..94e639e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,85 +35,85 @@
 
 /**
  * XACML defines a number of constants useful in processing XACML documents.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class XACML {
 
-        protected XACML() {
-        }
-        
-        public static final String	XMLSCHEMA			= "http://www.w3.org/2001/XMLSchema#";
-        public static final String	XPATHVERSION_1_0	= "http://www.w3.org/TR/1999/REC-xpath-19991116";
-        public static final String	XPATHVERSION_2_0	= "http://www.w3.org/TR/2007/REC-xpath20-20070123";
-        public static final String	XQUERYOPERATORS		= "http://www.w3.org/TR/2002/WD-xquery-operators-20020816";
+    protected XACML() {
+    }
 
-        /*
-         * URN builder components
-         */
-        public static final String	URN_XACML					= "urn:oasis:names:tc:xacml";
-        public static final String	DATA_TYPE					= "data-type";
-        public static final String	RULE_COMBINING_ALGORITHM	= "rule-combining-algorithm";
-        public static final String	POLICY_COMBINING_ALGORITHM	= "policy-combining-algorithm";
-        public static final String	FUNCTION					= "function";
-        public static final String	ATTRIBUTE_CATEGORY			= "attribute-category";
-        public static final String	SUBJECT_CATEGORY			= "subject-category";
-        public static final String	SCOPE						= "scope";
-        public static final String	CONTENT_SELECTOR			= "content-selector";
-        public static final String	MULTIPLE_CONTENT_SELECTOR	= "multiple" + CONTENT_SELECTOR;
-        public static final String	CONFORMANCE_TEST			= "conformance-test";
-        public static final String	CONTEXT						= "context";
-        public static final String	EXAMPLE						= "example";
-        public static final String	ENVIRONMENT					= "environment";
-        public static final String 	POLICY						= "policy";
-        public static final String	SUBJECT						= "subject";
-        public static final String	RESOURCE					= "resource";
-        public static final String	ACTION						= "action";
-        public static final String  ACTIONS						= "actions";
-        public static final String	PROFILE						= "profile";
-        public static final String	PROFILES					= "profiles";
-        
-        /*
-         * Full Identifiers from the URN components
-         */
-        public static final Identifier ID_XACML				= new IdentifierImpl(URN_XACML);
-        
-        /*
-         * Data Type strings
-         */
-        public static final String	DATATYPE_STRING					= XMLSCHEMA + "string";
-        public static final String	DATATYPE_BOOLEAN				= XMLSCHEMA + "boolean";
-        public static final String	DATATYPE_INTEGER				= XMLSCHEMA + "integer";
-        public static final String	DATATYPE_DOUBLE					= XMLSCHEMA + "double";
-        public static final String	DATATYPE_TIME					= XMLSCHEMA + "time";
-        public static final String	DATATYPE_DATE					= XMLSCHEMA + "date";
-        public static final String	DATATYPE_DATETIME				= XMLSCHEMA + "dateTime";
-        public static final String	DATATYPE_DAYTIMEDURATION		= XMLSCHEMA + "dayTimeDuration";
-        public static final String	DATATYPE_YEARMONTHDURATION		= XMLSCHEMA + "yearMonthDuration";
-        public static final String	DATATYPE_ANYURI					= XMLSCHEMA + "anyURI";
-        public static final String	DATATYPE_HEXBINARY				= XMLSCHEMA + "hexBinary";
-        public static final String	DATATYPE_BASE64BINARY			= XMLSCHEMA + "base64Binary";
-        
-        public static final String	DATATYPE_WD_DAYTIMEDURATION		= XQUERYOPERATORS + "#dayTimeDuration";
-        public static final String	DATATYPE_WD_YEARMONTHDURATION	= XQUERYOPERATORS + "#yearMonthDuration";
-        
-        /*
-         * Data Type identifiers
-         */
-        public static final Identifier	ID_DATATYPE_STRING					= new IdentifierImpl(DATATYPE_STRING);
-        public static final Identifier	ID_DATATYPE_BOOLEAN					= new IdentifierImpl(DATATYPE_BOOLEAN);
-        public static final Identifier	ID_DATATYPE_INTEGER					= new IdentifierImpl(DATATYPE_INTEGER);
-        public static final Identifier	ID_DATATYPE_DOUBLE					= new IdentifierImpl(DATATYPE_DOUBLE);
-        public static final Identifier	ID_DATATYPE_TIME					= new IdentifierImpl(DATATYPE_TIME);
-        public static final Identifier	ID_DATATYPE_DATE					= new IdentifierImpl(DATATYPE_DATE);
-        public static final Identifier	ID_DATATYPE_DATETIME				= new IdentifierImpl(DATATYPE_DATETIME);
-        public static final Identifier	ID_DATATYPE_DAYTIMEDURATION			= new IdentifierImpl(DATATYPE_DAYTIMEDURATION);
-        public static final Identifier	ID_DATATYPE_YEARMONTHDURATION		= new IdentifierImpl(DATATYPE_YEARMONTHDURATION);
-        public static final Identifier	ID_DATATYPE_ANYURI					= new IdentifierImpl(DATATYPE_ANYURI);
-        public static final Identifier	ID_DATATYPE_HEXBINARY				= new IdentifierImpl(DATATYPE_HEXBINARY);
-        public static final Identifier	ID_DATATYPE_BASE64BINARY			= new IdentifierImpl(DATATYPE_BASE64BINARY);
-        
-        public static final Identifier	ID_DATATYPE_WD_DAYTIMEDURATION		= new IdentifierImpl(DATATYPE_WD_DAYTIMEDURATION);
-        public static final Identifier	ID_DATATYPE_WD_YEARMONTHDURATION	= new IdentifierImpl(DATATYPE_WD_YEARMONTHDURATION);
+    public static final String	XMLSCHEMA			= "http://www.w3.org/2001/XMLSchema#";
+    public static final String	XPATHVERSION_1_0	= "http://www.w3.org/TR/1999/REC-xpath-19991116";
+    public static final String	XPATHVERSION_2_0	= "http://www.w3.org/TR/2007/REC-xpath20-20070123";
+    public static final String	XQUERYOPERATORS		= "http://www.w3.org/TR/2002/WD-xquery-operators-20020816";
+
+    /*
+     * URN builder components
+     */
+    public static final String	URN_XACML					= "urn:oasis:names:tc:xacml";
+    public static final String	DATA_TYPE					= "data-type";
+    public static final String	RULE_COMBINING_ALGORITHM	= "rule-combining-algorithm";
+    public static final String	POLICY_COMBINING_ALGORITHM	= "policy-combining-algorithm";
+    public static final String	FUNCTION					= "function";
+    public static final String	ATTRIBUTE_CATEGORY			= "attribute-category";
+    public static final String	SUBJECT_CATEGORY			= "subject-category";
+    public static final String	SCOPE						= "scope";
+    public static final String	CONTENT_SELECTOR			= "content-selector";
+    public static final String	MULTIPLE_CONTENT_SELECTOR	= "multiple" + CONTENT_SELECTOR;
+    public static final String	CONFORMANCE_TEST			= "conformance-test";
+    public static final String	CONTEXT						= "context";
+    public static final String	EXAMPLE						= "example";
+    public static final String	ENVIRONMENT					= "environment";
+    public static final String 	POLICY						= "policy";
+    public static final String	SUBJECT						= "subject";
+    public static final String	RESOURCE					= "resource";
+    public static final String	ACTION						= "action";
+    public static final String  ACTIONS						= "actions";
+    public static final String	PROFILE						= "profile";
+    public static final String	PROFILES					= "profiles";
+
+    /*
+     * Full Identifiers from the URN components
+     */
+    public static final Identifier ID_XACML				= new IdentifierImpl(URN_XACML);
+
+    /*
+     * Data Type strings
+     */
+    public static final String	DATATYPE_STRING					= XMLSCHEMA + "string";
+    public static final String	DATATYPE_BOOLEAN				= XMLSCHEMA + "boolean";
+    public static final String	DATATYPE_INTEGER				= XMLSCHEMA + "integer";
+    public static final String	DATATYPE_DOUBLE					= XMLSCHEMA + "double";
+    public static final String	DATATYPE_TIME					= XMLSCHEMA + "time";
+    public static final String	DATATYPE_DATE					= XMLSCHEMA + "date";
+    public static final String	DATATYPE_DATETIME				= XMLSCHEMA + "dateTime";
+    public static final String	DATATYPE_DAYTIMEDURATION		= XMLSCHEMA + "dayTimeDuration";
+    public static final String	DATATYPE_YEARMONTHDURATION		= XMLSCHEMA + "yearMonthDuration";
+    public static final String	DATATYPE_ANYURI					= XMLSCHEMA + "anyURI";
+    public static final String	DATATYPE_HEXBINARY				= XMLSCHEMA + "hexBinary";
+    public static final String	DATATYPE_BASE64BINARY			= XMLSCHEMA + "base64Binary";
+
+    public static final String	DATATYPE_WD_DAYTIMEDURATION		= XQUERYOPERATORS + "#dayTimeDuration";
+    public static final String	DATATYPE_WD_YEARMONTHDURATION	= XQUERYOPERATORS + "#yearMonthDuration";
+
+    /*
+     * Data Type identifiers
+     */
+    public static final Identifier	ID_DATATYPE_STRING					= new IdentifierImpl(DATATYPE_STRING);
+    public static final Identifier	ID_DATATYPE_BOOLEAN					= new IdentifierImpl(DATATYPE_BOOLEAN);
+    public static final Identifier	ID_DATATYPE_INTEGER					= new IdentifierImpl(DATATYPE_INTEGER);
+    public static final Identifier	ID_DATATYPE_DOUBLE					= new IdentifierImpl(DATATYPE_DOUBLE);
+    public static final Identifier	ID_DATATYPE_TIME					= new IdentifierImpl(DATATYPE_TIME);
+    public static final Identifier	ID_DATATYPE_DATE					= new IdentifierImpl(DATATYPE_DATE);
+    public static final Identifier	ID_DATATYPE_DATETIME				= new IdentifierImpl(DATATYPE_DATETIME);
+    public static final Identifier	ID_DATATYPE_DAYTIMEDURATION			= new IdentifierImpl(DATATYPE_DAYTIMEDURATION);
+    public static final Identifier	ID_DATATYPE_YEARMONTHDURATION		= new IdentifierImpl(DATATYPE_YEARMONTHDURATION);
+    public static final Identifier	ID_DATATYPE_ANYURI					= new IdentifierImpl(DATATYPE_ANYURI);
+    public static final Identifier	ID_DATATYPE_HEXBINARY				= new IdentifierImpl(DATATYPE_HEXBINARY);
+    public static final Identifier	ID_DATATYPE_BASE64BINARY			= new IdentifierImpl(DATATYPE_BASE64BINARY);
+
+    public static final Identifier	ID_DATATYPE_WD_DAYTIMEDURATION		= new IdentifierImpl(DATATYPE_WD_DAYTIMEDURATION);
+    public static final Identifier	ID_DATATYPE_WD_YEARMONTHDURATION	= new IdentifierImpl(DATATYPE_WD_YEARMONTHDURATION);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML1.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML1.java
index ebaf0ab..ac8f8a5 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML1.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML1.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,378 +35,378 @@
 /**
  * XACML1 contains the constants (<code>String</code>s, <code>URI</code>s {@link com.att.research.xacml.api.Identifier}s that are
  * defined in the XACML 1.0 Specification: "OASIS Standard 1.0, 18 February 2003 OASIS Standard as of 6 Feb. 2003".
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class XACML1 {
 
-        protected XACML1() {
-        }
+    protected XACML1() {
+    }
 
-        /*
-         * DOM Namespaces and schema
-         */
-        public static final String	SCHEMA_LOCATION_POLICY	= "urn:oasis:names:tc:xacml:1.0:policy http://www.oasis-open.org/tc/xacml/1.0/cs-xacml-schema-policy-01.xsd";
-        public static final String	SCHEMA_LOCATION_CONTEXT	= "urn:oasos:names:tc:xacml:1.0:context http://www.oasis-open.org/tc/xacml/1.0/cs-xacml-schema-context-01.xsd";
-        public static final String	XMLNS_POLICY			= "urn:oasis:names:tc:xacml:1.0:policy";
-        public static final String	XMLNS_CONTEXT			= "urn:oasis:names:tc:xacml:1.0:context";
-        public static final String	XMLNS_XSI				= "http://www.w3.org/2001/XMLSchema-instance";
-        
-        /*
-         * URN builder components
-         */
-        public static final String	VERSION_1_0	= "1.0";
-        public static final String	VERSION_1_1	= "1.1";
-        
-        /*
-         * Section 10.2.2 Identifier Prefixes
-         */
-        public static final Identifier ID_XACML_1_0			= new IdentifierImpl(XACML.ID_XACML, VERSION_1_0);
-        public static final Identifier ID_XACML_1_1			= new IdentifierImpl(XACML.ID_XACML, VERSION_1_1);
-        public static final Identifier ID_CONFORMANCE_TEST	= new IdentifierImpl(ID_XACML_1_0, XACML.CONFORMANCE_TEST);
-        public static final Identifier ID_CONTEXT			= new IdentifierImpl(ID_XACML_1_0, XACML.CONTEXT);
-        public static final Identifier ID_EXAMPLE			= new IdentifierImpl(ID_XACML_1_0, XACML.EXAMPLE);
-        public static final Identifier ID_FUNCTION			= new IdentifierImpl(ID_XACML_1_0, XACML.FUNCTION);
-        public static final Identifier ID_POLICY			= new IdentifierImpl(ID_XACML_1_0, XACML.POLICY);
-        public static final Identifier ID_SUBJECT			= new IdentifierImpl(ID_XACML_1_0, XACML.SUBJECT);
-        public static final Identifier ID_SUBJECT_CATEGORY	= new IdentifierImpl(ID_XACML_1_0, XACML.SUBJECT_CATEGORY);
-        public static final Identifier ID_RESOURCE			= new IdentifierImpl(ID_XACML_1_0, XACML.RESOURCE);
-        public static final Identifier ID_ACTION			= new IdentifierImpl(ID_XACML_1_0, XACML.ACTION);
-        public static final Identifier ID_ENVIRONMENT		= new IdentifierImpl(ID_XACML_1_0, XACML.ENVIRONMENT);
-        
-        /*
-         * Section 10.2.3 Algorithms
-         */
-        public static final Identifier ID_RULE_COMBINING_ALGORITHM		= new IdentifierImpl(ID_XACML_1_0, "rule-combining-algorithm");
-        public static final Identifier ID_POLICY_COMBINING_ALGORITHM	= new IdentifierImpl(ID_XACML_1_0, "policy-combining-algorithm");
-        
-        public static final String		DENY_OVERRIDES					= "deny-overrides";
-        public static final Identifier	ID_RULE_DENY_OVERRIDES			= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, DENY_OVERRIDES);
-        public static final Identifier	ID_POLICY_DENY_OVERRIDES		= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, DENY_OVERRIDES);
-        public static final String		PERMIT_OVERRIDES				= "permit-overrides";
-        public static final Identifier	ID_RULE_PERMIT_OVERRIDES		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, PERMIT_OVERRIDES);
-        public static final Identifier	ID_POLICY_PERMIT_OVERRIDES		= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, PERMIT_OVERRIDES);
-        public static final String		FIRST_APPLICABLE				= "first-applicable";
-        public static final Identifier	ID_RULE_FIRST_APPLICABLE		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, FIRST_APPLICABLE);
-        public static final Identifier	ID_POLICY_FIRST_APPLICABLE		= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, FIRST_APPLICABLE);
-        public static final String		ONLY_ONE_APPLICABLE				= "only-one-applicable";
-        public static final Identifier	ID_RULE_ONLY_ONE_APPLICABLE		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, ONLY_ONE_APPLICABLE);
-        public static final Identifier	ID_POLICY_ONLY_ONE_APPLICABLE	= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, ONLY_ONE_APPLICABLE);
-        
-        public static final Identifier ID_RULE_COMBINING_ALGORITHM11	= new IdentifierImpl(ID_XACML_1_1, "rule-combining-algorithm");
-        public static final Identifier ID_POLICY_COMBINING_ALGORITHM11	= new IdentifierImpl(ID_XACML_1_1, "policy-combining-algorithm");
-        
-        public static final String		ORDERED_DENY_OVERRIDES				= "ordered-deny-overrides";
-        public static final Identifier	ID_RULE_ORDERED_DENY_OVERRIDES		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM11, ORDERED_DENY_OVERRIDES);
-        public static final Identifier	ID_POLICY_ORDERED_DENY_OVERRIDES	= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM11, ORDERED_DENY_OVERRIDES);
-        public static final String		ORDERED_PERMIT_OVERRIDES			= "ordered-permit-overrides";
-        public static final Identifier	ID_RULE_ORDERED_PERMIT_OVERRIDES	= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM11, ORDERED_PERMIT_OVERRIDES);
-        public static final Identifier	ID_POLICY_ORDERED_PERMIT_OVERRIDES	= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM11, ORDERED_PERMIT_OVERRIDES);
-        
-        /*
-         * Section 10.2.4 Status Codes
-         */
-        public static final Identifier ID_STATUS					= new IdentifierImpl(ID_XACML_1_0, "status");
-        public static final Identifier ID_STATUS_MISSING_ATTRIBUTE	= new IdentifierImpl(ID_STATUS, "missing-attribute");
-        public static final Identifier ID_STATUS_OK					= new IdentifierImpl(ID_STATUS, "ok");
-        public static final Identifier ID_STATUS_PROCESSING_ERROR	= new IdentifierImpl(ID_STATUS, "processing-error");
-        public static final Identifier ID_STATUS_SYNTAX_ERROR		= new IdentifierImpl(ID_STATUS, "syntax-error");
-        
-        /*
-         * Section 10.2.5 Attributes
-         */
-        public static final Identifier ID_ENVIRONMENT_CURRENT_TIME		= new IdentifierImpl(ID_ENVIRONMENT, "current-time");
-        public static final Identifier ID_ENVIRONMENT_CURRENT_DATE		= new IdentifierImpl(ID_ENVIRONMENT, "current-date");
-        public static final Identifier ID_ENVIRONMENT_CURRENT_DATETIME	= new IdentifierImpl(ID_ENVIRONMENT, "current-dateTime");
-        
-        /*
-         * Section 10.2.6 Identifiers
-         */
-        public static final Identifier ID_SUBJECT_AUTHN_LOCALITY				= new IdentifierImpl(ID_SUBJECT, "authn-locality");
-        public static final Identifier ID_SUBJECT_AUTHN_LOCALITY_DNS_NAME		= new IdentifierImpl(ID_SUBJECT_AUTHN_LOCALITY, "dns-name");
-        public static final Identifier ID_SUBJECT_AUTHN_LOCALITY_IP_ADDRESS		= new IdentifierImpl(ID_SUBJECT_AUTHN_LOCALITY, "ip-address");
-        public static final Identifier ID_SUBJECT_AUTHENTICATION_METHOD			= new IdentifierImpl(ID_SUBJECT, "authentication-method");
-        public static final Identifier ID_SUBJECT_AUTHENTICATION_TIME			= new IdentifierImpl(ID_SUBJECT, "authentication-time");
-        public static final Identifier ID_SUBJECT_KEY_INFO						= new IdentifierImpl(ID_SUBJECT, "key-info");
-        public static final Identifier ID_SUBJECT_REQUEST_TIME					= new IdentifierImpl(ID_SUBJECT, "request-time");
-        public static final Identifier ID_SUBJECT_SESSION_START_TIME			= new IdentifierImpl(ID_SUBJECT, "session-start-time");
-        public static final Identifier ID_SUBJECT_SUBJECT_ID					= new IdentifierImpl(ID_SUBJECT, "subject-id");
-        public static final Identifier ID_SUBJECT_SUBJECT_ID_QUALIFIER			= new IdentifierImpl(ID_SUBJECT, "subject-id-qualifier");
-        public static final Identifier ID_SUBJECT_CATEGORY_ACCESS_SUBJECT		= new IdentifierImpl(ID_SUBJECT_CATEGORY, "access-subject");
-        public static final Identifier ID_SUBJECT_CATEGORY_CODEBASE				= new IdentifierImpl(ID_SUBJECT_CATEGORY, "codebase");
-        public static final Identifier ID_SUBJECT_CATEGORY_INTERMEDIARY_SUBJECT	= new IdentifierImpl(ID_SUBJECT_CATEGORY, "intermediary-subject");
-        public static final Identifier ID_SUBJECT_CATEGORY_RECIPIENT_SUBJECT	= new IdentifierImpl(ID_SUBJECT_CATEGORY, "recipient-subject");
-        public static final Identifier ID_SUBJECT_CATEGORY_REQUESTING_MACHINE	= new IdentifierImpl(ID_SUBJECT_CATEGORY, "requesting-machine");
-        public static final Identifier ID_RESOURCE_RESOURCE_LOCATION			= new IdentifierImpl(ID_RESOURCE, "resource-location");
-        public static final Identifier ID_RESOURCE_RESOURCE_ID					= new IdentifierImpl(ID_RESOURCE, "resource-id");
-        public static final Identifier ID_RESOURCE_SCOPE						= new IdentifierImpl(ID_RESOURCE, "scope");
-        public static final Identifier ID_RESOURCE_SIMPLE_FILE_NAME				= new IdentifierImpl(ID_RESOURCE, "simple-file-name");
-        public static final Identifier ID_ACTION_ACTION_ID						= new IdentifierImpl(ID_ACTION, "action-id");
-        public static final Identifier ID_ACTION_IMPLIED_ACTION					= new IdentifierImpl(ID_ACTION, "implied-action");
-        
-        /*
-         * Section 10.2.7 Data-types
-         */
-        public static final Identifier ID_DATATYPE_STRING				= XACML.ID_DATATYPE_STRING;
-        public static final Identifier ID_DATATYPE_BOOLEAN				= XACML.ID_DATATYPE_BOOLEAN;
-        public static final Identifier ID_DATATYPE_INTEGER				= XACML.ID_DATATYPE_BOOLEAN;
-        public static final Identifier ID_DATATYPE_DOUBLE				= XACML.ID_DATATYPE_DOUBLE;
-        public static final Identifier ID_DATATYPE_TIME					= XACML.ID_DATATYPE_TIME;
-        public static final Identifier ID_DATATYPE_DATE					= XACML.ID_DATATYPE_DATE;
-        public static final Identifier ID_DATATYPE_DATETIME				= XACML.ID_DATATYPE_DATETIME;
-        public static final Identifier ID_DATATYPE_DAYTIMEDURATION		= XACML.ID_DATATYPE_WD_DAYTIMEDURATION;
-        public static final Identifier ID_DATATYPE_YEARMONTHDURATION	= XACML.ID_DATATYPE_WD_YEARMONTHDURATION;
-        public static final Identifier ID_DATATYPE_ANYURI				= XACML.ID_DATATYPE_ANYURI;
-        public static final Identifier ID_DATATYPE_HEXBINARY			= XACML.ID_DATATYPE_HEXBINARY;
-        public static final Identifier ID_DATATYPE_BASE64BINARY			= XACML.ID_DATATYPE_BASE64BINARY;
-        public static final Identifier ID_DATATYPE						= new IdentifierImpl(ID_XACML_1_0, XACML.DATA_TYPE);
-        public static final Identifier ID_DATATYPE_RFC822NAME			= new IdentifierImpl(ID_DATATYPE, "rfc822Name");
-        public static final Identifier ID_DATATYPE_X500NAME				= new IdentifierImpl(ID_DATATYPE, "x500Name");
-        
-        /*
-         * Section 10.2.8 Functions
-         */
-        public static final Identifier ID_FUNCTION_STRING_EQUAL									= new IdentifierImpl(ID_FUNCTION, "string-equal");
-        public static final Identifier ID_FUNCTION_BOOLEAN_EQUAL								= new IdentifierImpl(ID_FUNCTION, "boolean-equal");
-        public static final Identifier ID_FUNCTION_INTEGER_EQUAL								= new IdentifierImpl(ID_FUNCTION, "integer-equal");
-        public static final Identifier ID_FUNCTION_DOUBLE_EQUAL									= new IdentifierImpl(ID_FUNCTION, "double-equal");
-        public static final Identifier ID_FUNCTION_DATE_EQUAL									= new IdentifierImpl(ID_FUNCTION, "date-equal");
-        public static final Identifier ID_FUNCTION_TIME_EQUAL									= new IdentifierImpl(ID_FUNCTION, "time-equal");
-        public static final Identifier ID_FUNCTION_DATETIME_EQUAL								= new IdentifierImpl(ID_FUNCTION, "dateTime-equal");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_EQUAL						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-equal");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_EQUAL						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-equal");
-        public static final Identifier ID_FUNCTION_ANYURI_EQUAL									= new IdentifierImpl(ID_FUNCTION, "anyURI-equal");
-        public static final Identifier ID_FUNCTION_X500NAME_EQUAL								= new IdentifierImpl(ID_FUNCTION, "x500Name-equal");
-        public static final Identifier ID_FUNCTION_RFC822NAME_EQUAL								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-equal");
-        public static final Identifier ID_FUNCTION_HEXBINARY_EQUAL								= new IdentifierImpl(ID_FUNCTION, "hexBinary-equal");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_EQUAL							= new IdentifierImpl(ID_FUNCTION, "base64Binary-equal");
-        public static final Identifier ID_FUNCTION_INTEGER_ADD									= new IdentifierImpl(ID_FUNCTION, "integer-add");
-        public static final Identifier ID_FUNCTION_DOUBLE_ADD									= new IdentifierImpl(ID_FUNCTION, "double-add");
-        public static final Identifier ID_FUNCTION_INTEGER_SUBTRACT								= new IdentifierImpl(ID_FUNCTION, "integer-subtract");
-        public static final Identifier ID_FUNCTION_DOUBLE_SUBTRACT								= new IdentifierImpl(ID_FUNCTION, "double-subtract");
-        public static final Identifier ID_FUNCTION_INTEGER_MULTIPLY								= new IdentifierImpl(ID_FUNCTION, "integer-multiply");
-        public static final Identifier ID_FUNCTION_DOUBLE_MULTIPLY								= new IdentifierImpl(ID_FUNCTION, "double-multiply");
-        public static final Identifier ID_FUNCTION_INTEGER_DIVIDE								= new IdentifierImpl(ID_FUNCTION, "integer-divide");
-        public static final Identifier ID_FUNCTION_DOUBLE_DIVIDE								= new IdentifierImpl(ID_FUNCTION, "double-divide");
-        public static final Identifier ID_FUNCTION_INTEGER_MOD									= new IdentifierImpl(ID_FUNCTION, "integer-mod");
-        public static final Identifier ID_FUNCTION_INTEGER_ABS									= new IdentifierImpl(ID_FUNCTION, "integer-abs");
-        public static final Identifier ID_FUNCTION_DOUBLE_ABS									= new IdentifierImpl(ID_FUNCTION, "double-abs");
-        public static final Identifier ID_FUNCTION_ROUND										= new IdentifierImpl(ID_FUNCTION, "round");
-        public static final Identifier ID_FUNCTION_FLOOR										= new IdentifierImpl(ID_FUNCTION, "floor");
-        public static final Identifier ID_FUNCTION_STRING_NORMALIZE_SPACE						= new IdentifierImpl(ID_FUNCTION, "string-normalize-space");
-        public static final Identifier ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE				= new IdentifierImpl(ID_FUNCTION, "string-normalize-to-lower-case");
-        public static final Identifier ID_FUNCTION_DOUBLE_TO_INTEGER							= new IdentifierImpl(ID_FUNCTION, "double-to-integer");
-        public static final Identifier ID_FUNCTION_INTEGER_TO_DOUBLE							= new IdentifierImpl(ID_FUNCTION, "integer-to-double");
-        public static final Identifier ID_FUNCTION_OR											= new IdentifierImpl(ID_FUNCTION, "or");
-        public static final Identifier ID_FUNCTION_AND											= new IdentifierImpl(ID_FUNCTION, "and");
-        public static final Identifier ID_FUNCTION_N_OF											= new IdentifierImpl(ID_FUNCTION, "n-of");
-        public static final Identifier ID_FUNCTION_NOT											= new IdentifierImpl(ID_FUNCTION, "not");
-        public static final Identifier ID_FUNCTION_PRESENT										= new IdentifierImpl(ID_FUNCTION, "present");
-        public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "integer-greater-than");
-        public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL				= new IdentifierImpl(ID_FUNCTION, "integer-greater-than-or-equal");
-        public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN							= new IdentifierImpl(ID_FUNCTION, "integer-less-than");
-        public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "integer-less-than-or-equal");
-        public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "double-greater-than");
-        public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "double-greater-than-or-equal");
-        public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN								= new IdentifierImpl(ID_FUNCTION, "double-less-than");
-        public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "double-less-than-or-equal");
-        public static final Identifier ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION					= new IdentifierImpl(ID_FUNCTION, "dateTime-add-dayTimeDuration");
-        public static final Identifier ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION				= new IdentifierImpl(ID_FUNCTION, "dateTime-add-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION			= new IdentifierImpl(ID_FUNCTION, "dateTime-subtract-dayTimeDuration");
-        public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION			= new IdentifierImpl(ID_FUNCTION, "dateTime-subtract-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_DATE_ADD_YEARMONTHDURATION					= new IdentifierImpl(ID_FUNCTION, "date-add-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION				= new IdentifierImpl(ID_FUNCTION, "date-subtract-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_STRING_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "string-greater-than");
-        public static final Identifier ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "string-greater-than-or-equal");
-        public static final Identifier ID_FUNCTION_STRING_LESS_THAN								= new IdentifierImpl(ID_FUNCTION, "string-less-than");
-        public static final Identifier ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "string-less-than-or-equal");
-        public static final Identifier ID_FUNCTION_TIME_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "time-greater-than");
-        public static final Identifier ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "time-greater-than-or-equal");
-        public static final Identifier ID_FUNCTION_TIME_LESS_THAN								= new IdentifierImpl(ID_FUNCTION, "time-less-than");
-        public static final Identifier ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL						= new IdentifierImpl(ID_FUNCTION, "time-less-than-or-equal");
-        public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN						= new IdentifierImpl(ID_FUNCTION, "dateTime-greater-than");
-        public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL				= new IdentifierImpl(ID_FUNCTION, "dateTime-greater-than-or-equal");
-        public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN							= new IdentifierImpl(ID_FUNCTION, "dateTime-less-than");
-        public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "dateTime-less-than-or-equal");
-        public static final Identifier ID_FUNCTION_DATE_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "date-greater-than");
-        public static final Identifier ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "date-greater-than-or-equal");
-        public static final Identifier ID_FUNCTION_DATE_LESS_THAN								= new IdentifierImpl(ID_FUNCTION, "date-less-than");
-        public static final Identifier ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL						= new IdentifierImpl(ID_FUNCTION, "date-less-than-or-equal");
-        public static final Identifier ID_FUNCTION_STRING_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "string-one-and-only");
-        public static final Identifier ID_FUNCTION_STRING_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "string-bag-size");
-        public static final Identifier ID_FUNCTION_STRING_IS_IN									= new IdentifierImpl(ID_FUNCTION, "string-is-in");
-        public static final Identifier ID_FUNCTION_STRING_BAG									= new IdentifierImpl(ID_FUNCTION, "string-bag");
-        public static final Identifier ID_FUNCTION_BOOLEAN_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "boolean-one-and-only");
-        public static final Identifier ID_FUNCTION_BOOLEAN_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "boolean-bag-size");
-        public static final Identifier ID_FUNCTION_BOOLEAN_IS_IN								= new IdentifierImpl(ID_FUNCTION, "boolean-is-in");
-        public static final Identifier ID_FUNCTION_BOOLEAN_BAG									= new IdentifierImpl(ID_FUNCTION, "boolean-bag");
-        public static final Identifier ID_FUNCTION_INTEGER_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "integer-one-and-only");
-        public static final Identifier ID_FUNCTION_INTEGER_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "integer-bag-size");
-        public static final Identifier ID_FUNCTION_INTEGER_IS_IN								= new IdentifierImpl(ID_FUNCTION, "integer-is-in");
-        public static final Identifier ID_FUNCTION_INTEGER_BAG									= new IdentifierImpl(ID_FUNCTION, "integer-bag");
-        public static final Identifier ID_FUNCTION_DOUBLE_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "double-one-and-only");
-        public static final Identifier ID_FUNCTION_DOUBLE_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "double-bag-size");
-        public static final Identifier ID_FUNCTION_DOUBLE_IS_IN									= new IdentifierImpl(ID_FUNCTION, "double-is-in");
-        public static final Identifier ID_FUNCTION_DOUBLE_BAG									= new IdentifierImpl(ID_FUNCTION, "double-bag");
-        public static final Identifier ID_FUNCTION_TIME_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "time-one-and-only");
-        public static final Identifier ID_FUNCTION_TIME_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "time-bag-size");
-        public static final Identifier ID_FUNCTION_TIME_IS_IN									= new IdentifierImpl(ID_FUNCTION, "time-is-in");
-        public static final Identifier ID_FUNCTION_TIME_BAG										= new IdentifierImpl(ID_FUNCTION, "time-bag");
-        public static final Identifier ID_FUNCTION_DATE_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "date-one-and-only");
-        public static final Identifier ID_FUNCTION_DATE_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "date-bag-size");
-        public static final Identifier ID_FUNCTION_DATE_IS_IN									= new IdentifierImpl(ID_FUNCTION, "date-is-in");
-        public static final Identifier ID_FUNCTION_DATE_BAG										= new IdentifierImpl(ID_FUNCTION, "date-bag");
-        public static final Identifier ID_FUNCTION_DATETIME_ONE_AND_ONLY						= new IdentifierImpl(ID_FUNCTION, "dateTime-one-and-only");
-        public static final Identifier ID_FUNCTION_DATETIME_BAG_SIZE							= new IdentifierImpl(ID_FUNCTION, "dateTime-bag-size");
-        public static final Identifier ID_FUNCTION_DATETIME_IS_IN								= new IdentifierImpl(ID_FUNCTION, "dateTime-is-in");
-        public static final Identifier ID_FUNCTION_DATETIME_BAG									= new IdentifierImpl(ID_FUNCTION, "dateTime-bag");
-        public static final Identifier ID_FUNCTION_ANYURI_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "anyURI-one-and-only");
-        public static final Identifier ID_FUNCTION_ANYURI_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "anyURI-bag-size");
-        public static final Identifier ID_FUNCTION_ANYURI_IS_IN									= new IdentifierImpl(ID_FUNCTION, "anyURI-is-in");
-        public static final Identifier ID_FUNCTION_ANYURI_BAG									= new IdentifierImpl(ID_FUNCTION, "anyURI-bag");
-        public static final Identifier ID_FUNCTION_HEXBINARY_ONE_AND_ONLY						= new IdentifierImpl(ID_FUNCTION, "hexBinary-one-and-only");
-        public static final Identifier ID_FUNCTION_HEXBINARY_BAG_SIZE							= new IdentifierImpl(ID_FUNCTION, "hexBinary-bag-size");
-        public static final Identifier ID_FUNCTION_HEXBINARY_IS_IN								= new IdentifierImpl(ID_FUNCTION, "hexBinary-is-in");
-        public static final Identifier ID_FUNCTION_HEXBINARY_BAG								= new IdentifierImpl(ID_FUNCTION, "hexBinary-bag");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY					= new IdentifierImpl(ID_FUNCTION, "base64Binary-one-and-only");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_BAG_SIZE						= new IdentifierImpl(ID_FUNCTION, "base64Binary-bag-size");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_IS_IN							= new IdentifierImpl(ID_FUNCTION, "base64Binary-is-in");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_BAG								= new IdentifierImpl(ID_FUNCTION, "base64Binary-bag");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY					= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-one-and-only");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-bag-size");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_IS_IN						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-is-in");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG							= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-bag");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY				= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-one-and-only");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE					= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-bag-size");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_IS_IN						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-is-in");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-bag");
-        public static final Identifier ID_FUNCTION_X500NAME_ONE_AND_ONLY						= new IdentifierImpl(ID_FUNCTION, "x500Name-one-and-only");
-        public static final Identifier ID_FUNCTION_X500NAME_BAG_SIZE							= new IdentifierImpl(ID_FUNCTION, "x500Name-bag-size");
-        public static final Identifier ID_FUNCTION_X500NAME_IS_IN								= new IdentifierImpl(ID_FUNCTION, "x500Name-is-in");
-        public static final Identifier ID_FUNCTION_X500NAME_BAG									= new IdentifierImpl(ID_FUNCTION, "x500Name-bag");
-        public static final Identifier ID_FUNCTION_RFC822NAME_ONE_AND_ONLY						= new IdentifierImpl(ID_FUNCTION, "rfc822Name-one-and-only");
-        public static final Identifier ID_FUNCTION_RFC822NAME_BAG_SIZE							= new IdentifierImpl(ID_FUNCTION, "rfc822Name-bag-size");
-        public static final Identifier ID_FUNCTION_RFC822NAME_IS_IN								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-is-in");
-        public static final Identifier ID_FUNCTION_RFC822NAME_BAG								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-bag");
-        public static final Identifier ID_FUNCTION_ANY_OF										= new IdentifierImpl(ID_FUNCTION, "any-of");
-        public static final Identifier ID_FUNCTION_ALL_OF										= new IdentifierImpl(ID_FUNCTION, "all-of");
-        public static final Identifier ID_FUNCTION_ANY_OF_ANY									= new IdentifierImpl(ID_FUNCTION, "any-of-any");
-        public static final Identifier ID_FUNCTION_ALL_OF_ANY									= new IdentifierImpl(ID_FUNCTION, "all-of-any");
-        public static final Identifier ID_FUNCTION_ANY_OF_ALL									= new IdentifierImpl(ID_FUNCTION, "any-of-all");
-        public static final Identifier ID_FUNCTION_ALL_OF_ALL									= new IdentifierImpl(ID_FUNCTION, "all-of-all");
-        public static final Identifier ID_FUNCTION_MAP											= new IdentifierImpl(ID_FUNCTION, "map");
-        public static final Identifier ID_FUNCTION_X500NAME_MATCH								= new IdentifierImpl(ID_FUNCTION, "x500Name-match");
-        public static final Identifier ID_FUNCTION_RFC822NAME_MATCH								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-match");
-        public static final Identifier ID_FUNCTION_STRING_REGEXP_MATCH							= new IdentifierImpl(ID_FUNCTION, "string-regexp-match");
+    /*
+     * DOM Namespaces and schema
+     */
+    public static final String	SCHEMA_LOCATION_POLICY	= "urn:oasis:names:tc:xacml:1.0:policy http://www.oasis-open.org/tc/xacml/1.0/cs-xacml-schema-policy-01.xsd";
+    public static final String	SCHEMA_LOCATION_CONTEXT	= "urn:oasos:names:tc:xacml:1.0:context http://www.oasis-open.org/tc/xacml/1.0/cs-xacml-schema-context-01.xsd";
+    public static final String	XMLNS_POLICY			= "urn:oasis:names:tc:xacml:1.0:policy";
+    public static final String	XMLNS_CONTEXT			= "urn:oasis:names:tc:xacml:1.0:context";
+    public static final String	XMLNS_XSI				= "http://www.w3.org/2001/XMLSchema-instance";
+
+    /*
+     * URN builder components
+     */
+    public static final String	VERSION_1_0	= "1.0";
+    public static final String	VERSION_1_1	= "1.1";
+
+    /*
+     * Section 10.2.2 Identifier Prefixes
+     */
+    public static final Identifier ID_XACML_1_0			= new IdentifierImpl(XACML.ID_XACML, VERSION_1_0);
+    public static final Identifier ID_XACML_1_1			= new IdentifierImpl(XACML.ID_XACML, VERSION_1_1);
+    public static final Identifier ID_CONFORMANCE_TEST	= new IdentifierImpl(ID_XACML_1_0, XACML.CONFORMANCE_TEST);
+    public static final Identifier ID_CONTEXT			= new IdentifierImpl(ID_XACML_1_0, XACML.CONTEXT);
+    public static final Identifier ID_EXAMPLE			= new IdentifierImpl(ID_XACML_1_0, XACML.EXAMPLE);
+    public static final Identifier ID_FUNCTION			= new IdentifierImpl(ID_XACML_1_0, XACML.FUNCTION);
+    public static final Identifier ID_POLICY			= new IdentifierImpl(ID_XACML_1_0, XACML.POLICY);
+    public static final Identifier ID_SUBJECT			= new IdentifierImpl(ID_XACML_1_0, XACML.SUBJECT);
+    public static final Identifier ID_SUBJECT_CATEGORY	= new IdentifierImpl(ID_XACML_1_0, XACML.SUBJECT_CATEGORY);
+    public static final Identifier ID_RESOURCE			= new IdentifierImpl(ID_XACML_1_0, XACML.RESOURCE);
+    public static final Identifier ID_ACTION			= new IdentifierImpl(ID_XACML_1_0, XACML.ACTION);
+    public static final Identifier ID_ENVIRONMENT		= new IdentifierImpl(ID_XACML_1_0, XACML.ENVIRONMENT);
+
+    /*
+     * Section 10.2.3 Algorithms
+     */
+    public static final Identifier ID_RULE_COMBINING_ALGORITHM		= new IdentifierImpl(ID_XACML_1_0, "rule-combining-algorithm");
+    public static final Identifier ID_POLICY_COMBINING_ALGORITHM	= new IdentifierImpl(ID_XACML_1_0, "policy-combining-algorithm");
+
+    public static final String		DENY_OVERRIDES					= "deny-overrides";
+    public static final Identifier	ID_RULE_DENY_OVERRIDES			= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, DENY_OVERRIDES);
+    public static final Identifier	ID_POLICY_DENY_OVERRIDES		= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, DENY_OVERRIDES);
+    public static final String		PERMIT_OVERRIDES				= "permit-overrides";
+    public static final Identifier	ID_RULE_PERMIT_OVERRIDES		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, PERMIT_OVERRIDES);
+    public static final Identifier	ID_POLICY_PERMIT_OVERRIDES		= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, PERMIT_OVERRIDES);
+    public static final String		FIRST_APPLICABLE				= "first-applicable";
+    public static final Identifier	ID_RULE_FIRST_APPLICABLE		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, FIRST_APPLICABLE);
+    public static final Identifier	ID_POLICY_FIRST_APPLICABLE		= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, FIRST_APPLICABLE);
+    public static final String		ONLY_ONE_APPLICABLE				= "only-one-applicable";
+    public static final Identifier	ID_RULE_ONLY_ONE_APPLICABLE		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, ONLY_ONE_APPLICABLE);
+    public static final Identifier	ID_POLICY_ONLY_ONE_APPLICABLE	= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, ONLY_ONE_APPLICABLE);
+
+    public static final Identifier ID_RULE_COMBINING_ALGORITHM11	= new IdentifierImpl(ID_XACML_1_1, "rule-combining-algorithm");
+    public static final Identifier ID_POLICY_COMBINING_ALGORITHM11	= new IdentifierImpl(ID_XACML_1_1, "policy-combining-algorithm");
+
+    public static final String		ORDERED_DENY_OVERRIDES				= "ordered-deny-overrides";
+    public static final Identifier	ID_RULE_ORDERED_DENY_OVERRIDES		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM11, ORDERED_DENY_OVERRIDES);
+    public static final Identifier	ID_POLICY_ORDERED_DENY_OVERRIDES	= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM11, ORDERED_DENY_OVERRIDES);
+    public static final String		ORDERED_PERMIT_OVERRIDES			= "ordered-permit-overrides";
+    public static final Identifier	ID_RULE_ORDERED_PERMIT_OVERRIDES	= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM11, ORDERED_PERMIT_OVERRIDES);
+    public static final Identifier	ID_POLICY_ORDERED_PERMIT_OVERRIDES	= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM11, ORDERED_PERMIT_OVERRIDES);
+
+    /*
+     * Section 10.2.4 Status Codes
+     */
+    public static final Identifier ID_STATUS					= new IdentifierImpl(ID_XACML_1_0, "status");
+    public static final Identifier ID_STATUS_MISSING_ATTRIBUTE	= new IdentifierImpl(ID_STATUS, "missing-attribute");
+    public static final Identifier ID_STATUS_OK					= new IdentifierImpl(ID_STATUS, "ok");
+    public static final Identifier ID_STATUS_PROCESSING_ERROR	= new IdentifierImpl(ID_STATUS, "processing-error");
+    public static final Identifier ID_STATUS_SYNTAX_ERROR		= new IdentifierImpl(ID_STATUS, "syntax-error");
+
+    /*
+     * Section 10.2.5 Attributes
+     */
+    public static final Identifier ID_ENVIRONMENT_CURRENT_TIME		= new IdentifierImpl(ID_ENVIRONMENT, "current-time");
+    public static final Identifier ID_ENVIRONMENT_CURRENT_DATE		= new IdentifierImpl(ID_ENVIRONMENT, "current-date");
+    public static final Identifier ID_ENVIRONMENT_CURRENT_DATETIME	= new IdentifierImpl(ID_ENVIRONMENT, "current-dateTime");
+
+    /*
+     * Section 10.2.6 Identifiers
+     */
+    public static final Identifier ID_SUBJECT_AUTHN_LOCALITY				= new IdentifierImpl(ID_SUBJECT, "authn-locality");
+    public static final Identifier ID_SUBJECT_AUTHN_LOCALITY_DNS_NAME		= new IdentifierImpl(ID_SUBJECT_AUTHN_LOCALITY, "dns-name");
+    public static final Identifier ID_SUBJECT_AUTHN_LOCALITY_IP_ADDRESS		= new IdentifierImpl(ID_SUBJECT_AUTHN_LOCALITY, "ip-address");
+    public static final Identifier ID_SUBJECT_AUTHENTICATION_METHOD			= new IdentifierImpl(ID_SUBJECT, "authentication-method");
+    public static final Identifier ID_SUBJECT_AUTHENTICATION_TIME			= new IdentifierImpl(ID_SUBJECT, "authentication-time");
+    public static final Identifier ID_SUBJECT_KEY_INFO						= new IdentifierImpl(ID_SUBJECT, "key-info");
+    public static final Identifier ID_SUBJECT_REQUEST_TIME					= new IdentifierImpl(ID_SUBJECT, "request-time");
+    public static final Identifier ID_SUBJECT_SESSION_START_TIME			= new IdentifierImpl(ID_SUBJECT, "session-start-time");
+    public static final Identifier ID_SUBJECT_SUBJECT_ID					= new IdentifierImpl(ID_SUBJECT, "subject-id");
+    public static final Identifier ID_SUBJECT_SUBJECT_ID_QUALIFIER			= new IdentifierImpl(ID_SUBJECT, "subject-id-qualifier");
+    public static final Identifier ID_SUBJECT_CATEGORY_ACCESS_SUBJECT		= new IdentifierImpl(ID_SUBJECT_CATEGORY, "access-subject");
+    public static final Identifier ID_SUBJECT_CATEGORY_CODEBASE				= new IdentifierImpl(ID_SUBJECT_CATEGORY, "codebase");
+    public static final Identifier ID_SUBJECT_CATEGORY_INTERMEDIARY_SUBJECT	= new IdentifierImpl(ID_SUBJECT_CATEGORY, "intermediary-subject");
+    public static final Identifier ID_SUBJECT_CATEGORY_RECIPIENT_SUBJECT	= new IdentifierImpl(ID_SUBJECT_CATEGORY, "recipient-subject");
+    public static final Identifier ID_SUBJECT_CATEGORY_REQUESTING_MACHINE	= new IdentifierImpl(ID_SUBJECT_CATEGORY, "requesting-machine");
+    public static final Identifier ID_RESOURCE_RESOURCE_LOCATION			= new IdentifierImpl(ID_RESOURCE, "resource-location");
+    public static final Identifier ID_RESOURCE_RESOURCE_ID					= new IdentifierImpl(ID_RESOURCE, "resource-id");
+    public static final Identifier ID_RESOURCE_SCOPE						= new IdentifierImpl(ID_RESOURCE, "scope");
+    public static final Identifier ID_RESOURCE_SIMPLE_FILE_NAME				= new IdentifierImpl(ID_RESOURCE, "simple-file-name");
+    public static final Identifier ID_ACTION_ACTION_ID						= new IdentifierImpl(ID_ACTION, "action-id");
+    public static final Identifier ID_ACTION_IMPLIED_ACTION					= new IdentifierImpl(ID_ACTION, "implied-action");
+
+    /*
+     * Section 10.2.7 Data-types
+     */
+    public static final Identifier ID_DATATYPE_STRING				= XACML.ID_DATATYPE_STRING;
+    public static final Identifier ID_DATATYPE_BOOLEAN				= XACML.ID_DATATYPE_BOOLEAN;
+    public static final Identifier ID_DATATYPE_INTEGER				= XACML.ID_DATATYPE_BOOLEAN;
+    public static final Identifier ID_DATATYPE_DOUBLE				= XACML.ID_DATATYPE_DOUBLE;
+    public static final Identifier ID_DATATYPE_TIME					= XACML.ID_DATATYPE_TIME;
+    public static final Identifier ID_DATATYPE_DATE					= XACML.ID_DATATYPE_DATE;
+    public static final Identifier ID_DATATYPE_DATETIME				= XACML.ID_DATATYPE_DATETIME;
+    public static final Identifier ID_DATATYPE_DAYTIMEDURATION		= XACML.ID_DATATYPE_WD_DAYTIMEDURATION;
+    public static final Identifier ID_DATATYPE_YEARMONTHDURATION	= XACML.ID_DATATYPE_WD_YEARMONTHDURATION;
+    public static final Identifier ID_DATATYPE_ANYURI				= XACML.ID_DATATYPE_ANYURI;
+    public static final Identifier ID_DATATYPE_HEXBINARY			= XACML.ID_DATATYPE_HEXBINARY;
+    public static final Identifier ID_DATATYPE_BASE64BINARY			= XACML.ID_DATATYPE_BASE64BINARY;
+    public static final Identifier ID_DATATYPE						= new IdentifierImpl(ID_XACML_1_0, XACML.DATA_TYPE);
+    public static final Identifier ID_DATATYPE_RFC822NAME			= new IdentifierImpl(ID_DATATYPE, "rfc822Name");
+    public static final Identifier ID_DATATYPE_X500NAME				= new IdentifierImpl(ID_DATATYPE, "x500Name");
+
+    /*
+     * Section 10.2.8 Functions
+     */
+    public static final Identifier ID_FUNCTION_STRING_EQUAL									= new IdentifierImpl(ID_FUNCTION, "string-equal");
+    public static final Identifier ID_FUNCTION_BOOLEAN_EQUAL								= new IdentifierImpl(ID_FUNCTION, "boolean-equal");
+    public static final Identifier ID_FUNCTION_INTEGER_EQUAL								= new IdentifierImpl(ID_FUNCTION, "integer-equal");
+    public static final Identifier ID_FUNCTION_DOUBLE_EQUAL									= new IdentifierImpl(ID_FUNCTION, "double-equal");
+    public static final Identifier ID_FUNCTION_DATE_EQUAL									= new IdentifierImpl(ID_FUNCTION, "date-equal");
+    public static final Identifier ID_FUNCTION_TIME_EQUAL									= new IdentifierImpl(ID_FUNCTION, "time-equal");
+    public static final Identifier ID_FUNCTION_DATETIME_EQUAL								= new IdentifierImpl(ID_FUNCTION, "dateTime-equal");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_EQUAL						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-equal");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_EQUAL						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-equal");
+    public static final Identifier ID_FUNCTION_ANYURI_EQUAL									= new IdentifierImpl(ID_FUNCTION, "anyURI-equal");
+    public static final Identifier ID_FUNCTION_X500NAME_EQUAL								= new IdentifierImpl(ID_FUNCTION, "x500Name-equal");
+    public static final Identifier ID_FUNCTION_RFC822NAME_EQUAL								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-equal");
+    public static final Identifier ID_FUNCTION_HEXBINARY_EQUAL								= new IdentifierImpl(ID_FUNCTION, "hexBinary-equal");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_EQUAL							= new IdentifierImpl(ID_FUNCTION, "base64Binary-equal");
+    public static final Identifier ID_FUNCTION_INTEGER_ADD									= new IdentifierImpl(ID_FUNCTION, "integer-add");
+    public static final Identifier ID_FUNCTION_DOUBLE_ADD									= new IdentifierImpl(ID_FUNCTION, "double-add");
+    public static final Identifier ID_FUNCTION_INTEGER_SUBTRACT								= new IdentifierImpl(ID_FUNCTION, "integer-subtract");
+    public static final Identifier ID_FUNCTION_DOUBLE_SUBTRACT								= new IdentifierImpl(ID_FUNCTION, "double-subtract");
+    public static final Identifier ID_FUNCTION_INTEGER_MULTIPLY								= new IdentifierImpl(ID_FUNCTION, "integer-multiply");
+    public static final Identifier ID_FUNCTION_DOUBLE_MULTIPLY								= new IdentifierImpl(ID_FUNCTION, "double-multiply");
+    public static final Identifier ID_FUNCTION_INTEGER_DIVIDE								= new IdentifierImpl(ID_FUNCTION, "integer-divide");
+    public static final Identifier ID_FUNCTION_DOUBLE_DIVIDE								= new IdentifierImpl(ID_FUNCTION, "double-divide");
+    public static final Identifier ID_FUNCTION_INTEGER_MOD									= new IdentifierImpl(ID_FUNCTION, "integer-mod");
+    public static final Identifier ID_FUNCTION_INTEGER_ABS									= new IdentifierImpl(ID_FUNCTION, "integer-abs");
+    public static final Identifier ID_FUNCTION_DOUBLE_ABS									= new IdentifierImpl(ID_FUNCTION, "double-abs");
+    public static final Identifier ID_FUNCTION_ROUND										= new IdentifierImpl(ID_FUNCTION, "round");
+    public static final Identifier ID_FUNCTION_FLOOR										= new IdentifierImpl(ID_FUNCTION, "floor");
+    public static final Identifier ID_FUNCTION_STRING_NORMALIZE_SPACE						= new IdentifierImpl(ID_FUNCTION, "string-normalize-space");
+    public static final Identifier ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE				= new IdentifierImpl(ID_FUNCTION, "string-normalize-to-lower-case");
+    public static final Identifier ID_FUNCTION_DOUBLE_TO_INTEGER							= new IdentifierImpl(ID_FUNCTION, "double-to-integer");
+    public static final Identifier ID_FUNCTION_INTEGER_TO_DOUBLE							= new IdentifierImpl(ID_FUNCTION, "integer-to-double");
+    public static final Identifier ID_FUNCTION_OR											= new IdentifierImpl(ID_FUNCTION, "or");
+    public static final Identifier ID_FUNCTION_AND											= new IdentifierImpl(ID_FUNCTION, "and");
+    public static final Identifier ID_FUNCTION_N_OF											= new IdentifierImpl(ID_FUNCTION, "n-of");
+    public static final Identifier ID_FUNCTION_NOT											= new IdentifierImpl(ID_FUNCTION, "not");
+    public static final Identifier ID_FUNCTION_PRESENT										= new IdentifierImpl(ID_FUNCTION, "present");
+    public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "integer-greater-than");
+    public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL				= new IdentifierImpl(ID_FUNCTION, "integer-greater-than-or-equal");
+    public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN							= new IdentifierImpl(ID_FUNCTION, "integer-less-than");
+    public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "integer-less-than-or-equal");
+    public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "double-greater-than");
+    public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "double-greater-than-or-equal");
+    public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN								= new IdentifierImpl(ID_FUNCTION, "double-less-than");
+    public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "double-less-than-or-equal");
+    public static final Identifier ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION					= new IdentifierImpl(ID_FUNCTION, "dateTime-add-dayTimeDuration");
+    public static final Identifier ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION				= new IdentifierImpl(ID_FUNCTION, "dateTime-add-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION			= new IdentifierImpl(ID_FUNCTION, "dateTime-subtract-dayTimeDuration");
+    public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION			= new IdentifierImpl(ID_FUNCTION, "dateTime-subtract-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_DATE_ADD_YEARMONTHDURATION					= new IdentifierImpl(ID_FUNCTION, "date-add-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION				= new IdentifierImpl(ID_FUNCTION, "date-subtract-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_STRING_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "string-greater-than");
+    public static final Identifier ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "string-greater-than-or-equal");
+    public static final Identifier ID_FUNCTION_STRING_LESS_THAN								= new IdentifierImpl(ID_FUNCTION, "string-less-than");
+    public static final Identifier ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "string-less-than-or-equal");
+    public static final Identifier ID_FUNCTION_TIME_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "time-greater-than");
+    public static final Identifier ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "time-greater-than-or-equal");
+    public static final Identifier ID_FUNCTION_TIME_LESS_THAN								= new IdentifierImpl(ID_FUNCTION, "time-less-than");
+    public static final Identifier ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL						= new IdentifierImpl(ID_FUNCTION, "time-less-than-or-equal");
+    public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN						= new IdentifierImpl(ID_FUNCTION, "dateTime-greater-than");
+    public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL				= new IdentifierImpl(ID_FUNCTION, "dateTime-greater-than-or-equal");
+    public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN							= new IdentifierImpl(ID_FUNCTION, "dateTime-less-than");
+    public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "dateTime-less-than-or-equal");
+    public static final Identifier ID_FUNCTION_DATE_GREATER_THAN							= new IdentifierImpl(ID_FUNCTION, "date-greater-than");
+    public static final Identifier ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL					= new IdentifierImpl(ID_FUNCTION, "date-greater-than-or-equal");
+    public static final Identifier ID_FUNCTION_DATE_LESS_THAN								= new IdentifierImpl(ID_FUNCTION, "date-less-than");
+    public static final Identifier ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL						= new IdentifierImpl(ID_FUNCTION, "date-less-than-or-equal");
+    public static final Identifier ID_FUNCTION_STRING_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "string-one-and-only");
+    public static final Identifier ID_FUNCTION_STRING_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "string-bag-size");
+    public static final Identifier ID_FUNCTION_STRING_IS_IN									= new IdentifierImpl(ID_FUNCTION, "string-is-in");
+    public static final Identifier ID_FUNCTION_STRING_BAG									= new IdentifierImpl(ID_FUNCTION, "string-bag");
+    public static final Identifier ID_FUNCTION_BOOLEAN_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "boolean-one-and-only");
+    public static final Identifier ID_FUNCTION_BOOLEAN_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "boolean-bag-size");
+    public static final Identifier ID_FUNCTION_BOOLEAN_IS_IN								= new IdentifierImpl(ID_FUNCTION, "boolean-is-in");
+    public static final Identifier ID_FUNCTION_BOOLEAN_BAG									= new IdentifierImpl(ID_FUNCTION, "boolean-bag");
+    public static final Identifier ID_FUNCTION_INTEGER_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "integer-one-and-only");
+    public static final Identifier ID_FUNCTION_INTEGER_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "integer-bag-size");
+    public static final Identifier ID_FUNCTION_INTEGER_IS_IN								= new IdentifierImpl(ID_FUNCTION, "integer-is-in");
+    public static final Identifier ID_FUNCTION_INTEGER_BAG									= new IdentifierImpl(ID_FUNCTION, "integer-bag");
+    public static final Identifier ID_FUNCTION_DOUBLE_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "double-one-and-only");
+    public static final Identifier ID_FUNCTION_DOUBLE_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "double-bag-size");
+    public static final Identifier ID_FUNCTION_DOUBLE_IS_IN									= new IdentifierImpl(ID_FUNCTION, "double-is-in");
+    public static final Identifier ID_FUNCTION_DOUBLE_BAG									= new IdentifierImpl(ID_FUNCTION, "double-bag");
+    public static final Identifier ID_FUNCTION_TIME_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "time-one-and-only");
+    public static final Identifier ID_FUNCTION_TIME_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "time-bag-size");
+    public static final Identifier ID_FUNCTION_TIME_IS_IN									= new IdentifierImpl(ID_FUNCTION, "time-is-in");
+    public static final Identifier ID_FUNCTION_TIME_BAG										= new IdentifierImpl(ID_FUNCTION, "time-bag");
+    public static final Identifier ID_FUNCTION_DATE_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "date-one-and-only");
+    public static final Identifier ID_FUNCTION_DATE_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "date-bag-size");
+    public static final Identifier ID_FUNCTION_DATE_IS_IN									= new IdentifierImpl(ID_FUNCTION, "date-is-in");
+    public static final Identifier ID_FUNCTION_DATE_BAG										= new IdentifierImpl(ID_FUNCTION, "date-bag");
+    public static final Identifier ID_FUNCTION_DATETIME_ONE_AND_ONLY						= new IdentifierImpl(ID_FUNCTION, "dateTime-one-and-only");
+    public static final Identifier ID_FUNCTION_DATETIME_BAG_SIZE							= new IdentifierImpl(ID_FUNCTION, "dateTime-bag-size");
+    public static final Identifier ID_FUNCTION_DATETIME_IS_IN								= new IdentifierImpl(ID_FUNCTION, "dateTime-is-in");
+    public static final Identifier ID_FUNCTION_DATETIME_BAG									= new IdentifierImpl(ID_FUNCTION, "dateTime-bag");
+    public static final Identifier ID_FUNCTION_ANYURI_ONE_AND_ONLY							= new IdentifierImpl(ID_FUNCTION, "anyURI-one-and-only");
+    public static final Identifier ID_FUNCTION_ANYURI_BAG_SIZE								= new IdentifierImpl(ID_FUNCTION, "anyURI-bag-size");
+    public static final Identifier ID_FUNCTION_ANYURI_IS_IN									= new IdentifierImpl(ID_FUNCTION, "anyURI-is-in");
+    public static final Identifier ID_FUNCTION_ANYURI_BAG									= new IdentifierImpl(ID_FUNCTION, "anyURI-bag");
+    public static final Identifier ID_FUNCTION_HEXBINARY_ONE_AND_ONLY						= new IdentifierImpl(ID_FUNCTION, "hexBinary-one-and-only");
+    public static final Identifier ID_FUNCTION_HEXBINARY_BAG_SIZE							= new IdentifierImpl(ID_FUNCTION, "hexBinary-bag-size");
+    public static final Identifier ID_FUNCTION_HEXBINARY_IS_IN								= new IdentifierImpl(ID_FUNCTION, "hexBinary-is-in");
+    public static final Identifier ID_FUNCTION_HEXBINARY_BAG								= new IdentifierImpl(ID_FUNCTION, "hexBinary-bag");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY					= new IdentifierImpl(ID_FUNCTION, "base64Binary-one-and-only");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_BAG_SIZE						= new IdentifierImpl(ID_FUNCTION, "base64Binary-bag-size");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_IS_IN							= new IdentifierImpl(ID_FUNCTION, "base64Binary-is-in");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_BAG								= new IdentifierImpl(ID_FUNCTION, "base64Binary-bag");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY					= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-one-and-only");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-bag-size");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_IS_IN						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-is-in");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG							= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-bag");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY				= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-one-and-only");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE					= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-bag-size");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_IS_IN						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-is-in");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-bag");
+    public static final Identifier ID_FUNCTION_X500NAME_ONE_AND_ONLY						= new IdentifierImpl(ID_FUNCTION, "x500Name-one-and-only");
+    public static final Identifier ID_FUNCTION_X500NAME_BAG_SIZE							= new IdentifierImpl(ID_FUNCTION, "x500Name-bag-size");
+    public static final Identifier ID_FUNCTION_X500NAME_IS_IN								= new IdentifierImpl(ID_FUNCTION, "x500Name-is-in");
+    public static final Identifier ID_FUNCTION_X500NAME_BAG									= new IdentifierImpl(ID_FUNCTION, "x500Name-bag");
+    public static final Identifier ID_FUNCTION_RFC822NAME_ONE_AND_ONLY						= new IdentifierImpl(ID_FUNCTION, "rfc822Name-one-and-only");
+    public static final Identifier ID_FUNCTION_RFC822NAME_BAG_SIZE							= new IdentifierImpl(ID_FUNCTION, "rfc822Name-bag-size");
+    public static final Identifier ID_FUNCTION_RFC822NAME_IS_IN								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-is-in");
+    public static final Identifier ID_FUNCTION_RFC822NAME_BAG								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-bag");
+    public static final Identifier ID_FUNCTION_ANY_OF										= new IdentifierImpl(ID_FUNCTION, "any-of");
+    public static final Identifier ID_FUNCTION_ALL_OF										= new IdentifierImpl(ID_FUNCTION, "all-of");
+    public static final Identifier ID_FUNCTION_ANY_OF_ANY									= new IdentifierImpl(ID_FUNCTION, "any-of-any");
+    public static final Identifier ID_FUNCTION_ALL_OF_ANY									= new IdentifierImpl(ID_FUNCTION, "all-of-any");
+    public static final Identifier ID_FUNCTION_ANY_OF_ALL									= new IdentifierImpl(ID_FUNCTION, "any-of-all");
+    public static final Identifier ID_FUNCTION_ALL_OF_ALL									= new IdentifierImpl(ID_FUNCTION, "all-of-all");
+    public static final Identifier ID_FUNCTION_MAP											= new IdentifierImpl(ID_FUNCTION, "map");
+    public static final Identifier ID_FUNCTION_X500NAME_MATCH								= new IdentifierImpl(ID_FUNCTION, "x500Name-match");
+    public static final Identifier ID_FUNCTION_RFC822NAME_MATCH								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-match");
+    public static final Identifier ID_FUNCTION_STRING_REGEXP_MATCH							= new IdentifierImpl(ID_FUNCTION, "string-regexp-match");
 // the following xpath-node functions are optional in 3.0 and are NOT included in this implementation.  See the Implementation Notes.
 //	public static final Identifier ID_FUNCTION_XPATH_NODE_COUNT								= new IdentifierImpl(ID_FUNCTION, "xpath-node-count");
 //	public static final Identifier ID_FUNCTION_XPATH_NODE_EQUAL								= new IdentifierImpl(ID_FUNCTION, "xpath-node-equal");
 //	public static final Identifier ID_FUNCTION_XPATH_NODE_MATCH								= new IdentifierImpl(ID_FUNCTION, "xpath-node-match");
-        public static final Identifier ID_FUNCTION_STRING_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "string-intersection");
-        public static final Identifier ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "string-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_STRING_UNION									= new IdentifierImpl(ID_FUNCTION, "string-union");
-        public static final Identifier ID_FUNCTION_STRING_SUBSET								= new IdentifierImpl(ID_FUNCTION, "string-subset");
-        public static final Identifier ID_FUNCTION_STRING_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "string-set-equals");
-        public static final Identifier ID_FUNCTION_BOOLEAN_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "boolean-intersection");
-        public static final Identifier ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "boolean-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_BOOLEAN_UNION								= new IdentifierImpl(ID_FUNCTION, "boolean-union");
-        public static final Identifier ID_FUNCTION_BOOLEAN_SUBSET								= new IdentifierImpl(ID_FUNCTION, "boolean-subset");
-        public static final Identifier ID_FUNCTION_BOOLEAN_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "boolean-set-equals");
-        public static final Identifier ID_FUNCTION_INTEGER_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "integer-intersection");
-        public static final Identifier ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "integer-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_INTEGER_UNION								= new IdentifierImpl(ID_FUNCTION, "integer-union");
-        public static final Identifier ID_FUNCTION_INTEGER_SUBSET								= new IdentifierImpl(ID_FUNCTION, "integer-subset");
-        public static final Identifier ID_FUNCTION_INTEGER_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "integer-set-equals");
-        public static final Identifier ID_FUNCTION_DOUBLE_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "double-intersection");
-        public static final Identifier ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "double-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_DOUBLE_UNION									= new IdentifierImpl(ID_FUNCTION, "double-union");
-        public static final Identifier ID_FUNCTION_DOUBLE_SUBSET								= new IdentifierImpl(ID_FUNCTION, "double-subset");
-        public static final Identifier ID_FUNCTION_DOUBLE_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "double-set-equals");
-        public static final Identifier ID_FUNCTION_TIME_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "time-intersection");
-        public static final Identifier ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF					= new IdentifierImpl(ID_FUNCTION, "time-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_TIME_UNION									= new IdentifierImpl(ID_FUNCTION, "time-union");
-        public static final Identifier ID_FUNCTION_TIME_SUBSET									= new IdentifierImpl(ID_FUNCTION, "time-subset");
-        public static final Identifier ID_FUNCTION_TIME_SET_EQUALS								= new IdentifierImpl(ID_FUNCTION, "time-set-equals");
-        public static final Identifier ID_FUNCTION_DATE_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "date-intersection");
-        public static final Identifier ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF					= new IdentifierImpl(ID_FUNCTION, "date-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_DATE_UNION									= new IdentifierImpl(ID_FUNCTION, "date-union");
-        public static final Identifier ID_FUNCTION_DATE_SUBSET									= new IdentifierImpl(ID_FUNCTION, "date-subset");
-        public static final Identifier ID_FUNCTION_DATE_SET_EQUALS								= new IdentifierImpl(ID_FUNCTION, "date-set-equals");
-        public static final Identifier ID_FUNCTION_DATETIME_INTERSECTION						= new IdentifierImpl(ID_FUNCTION, "dateTime-intersection");
-        public static final Identifier ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "dateTime-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_DATETIME_UNION								= new IdentifierImpl(ID_FUNCTION, "dateTime-union");
-        public static final Identifier ID_FUNCTION_DATETIME_SUBSET								= new IdentifierImpl(ID_FUNCTION, "dateTime-subset");
-        public static final Identifier ID_FUNCTION_DATETIME_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "dateTime-set-equals");
-        public static final Identifier ID_FUNCTION_ANYURI_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "anyURI-intersection");
-        public static final Identifier ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "anyURI-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_ANYURI_UNION									= new IdentifierImpl(ID_FUNCTION, "anyURI-union");
-        public static final Identifier ID_FUNCTION_ANYURI_SUBSET								= new IdentifierImpl(ID_FUNCTION, "anyURI-subset");
-        public static final Identifier ID_FUNCTION_ANYURI_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "anyURI-set-equals");
-        public static final Identifier ID_FUNCTION_HEXBINARY_INTERSECTION						= new IdentifierImpl(ID_FUNCTION, "hexBinary-intersection");
-        public static final Identifier ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "hexBinary-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_HEXBINARY_UNION								= new IdentifierImpl(ID_FUNCTION, "hexBinary-union");
-        public static final Identifier ID_FUNCTION_HEXBINARY_SUBSET								= new IdentifierImpl(ID_FUNCTION, "hexBinary-subset");
-        public static final Identifier ID_FUNCTION_HEXBINARY_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "hexBinary-set-equals");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_INTERSECTION					= new IdentifierImpl(ID_FUNCTION, "base64Binary-intersection");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF			= new IdentifierImpl(ID_FUNCTION, "base64Binary-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_UNION							= new IdentifierImpl(ID_FUNCTION, "base64Binary-union");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_SUBSET							= new IdentifierImpl(ID_FUNCTION, "base64Binary-subset");
-        public static final Identifier ID_FUNCTION_BASE64BINARY_SET_EQUALS						= new IdentifierImpl(ID_FUNCTION, "base64Binary-set-equals");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_INTERSECTION					= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-intersection");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_UNION						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-union");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SUBSET						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-subset");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS					= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-set-equals");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_INTERSECTION				= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-intersection");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_UNION						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-union");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SUBSET						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-subset");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS					= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-set-equals");
-        public static final Identifier ID_FUNCTION_X500NAME_INTERSECTION						= new IdentifierImpl(ID_FUNCTION, "x500Name-intersection");
-        public static final Identifier ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "x500Name-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_X500NAME_UNION								= new IdentifierImpl(ID_FUNCTION, "x500Name-union");
-        public static final Identifier ID_FUNCTION_X500NAME_SUBSET								= new IdentifierImpl(ID_FUNCTION, "x500Name-subset");
-        public static final Identifier ID_FUNCTION_X500NAME_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "x500Name-set-equals");
-        public static final Identifier ID_FUNCTION_RFC822NAME_INTERSECTION						= new IdentifierImpl(ID_FUNCTION, "rfc822Name-intersection");
-        public static final Identifier ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF			= new IdentifierImpl(ID_FUNCTION, "rfc822Name-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_RFC822NAME_UNION								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-union");
-        public static final Identifier ID_FUNCTION_RFC822NAME_SUBSET							= new IdentifierImpl(ID_FUNCTION, "rfc822Name-subset");
-        public static final Identifier ID_FUNCTION_RFC822NAME_SET_EQUALS						= new IdentifierImpl(ID_FUNCTION, "rfc822Name-set-equals");
-        
-        /*
-         * TODO: Declare all of the XML elements and attributes in use
-         */
-        
-        /*
-         * Profiles
-         */
-        public static final Identifier ID_PROFILES	= new IdentifierImpl(ID_XACML_1_0, XACML.PROFILES);
-        public static final Identifier ID_PROFILE	= new IdentifierImpl(ID_XACML_1_0, XACML.PROFILE);
-        
-        /*
-         * SAML 2.0 Profile of XACML, Version 2.0
-         */
-        public static final Identifier ID_PROFILE_SAML2_0_V2									= new IdentifierImpl(ID_PROFILE, "saml2.0:v2");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_POLICIES							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "policies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_ADVICESAML							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "adviceSAML");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZTOKEN							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzToken");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_ATTRS_ALL							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "attrs:all");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "SOAP");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_AUTHZQUERY					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "authzQuery");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_ATTRASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "attrAssertion");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION						= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecision");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_NOPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "noPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_WITHPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "withPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST				= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecisionWSTrust");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_WITHPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "withPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_NOPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "noPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "schema");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_ASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "assertion");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_PROTOCOL					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "protocol");
+    public static final Identifier ID_FUNCTION_STRING_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "string-intersection");
+    public static final Identifier ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "string-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_STRING_UNION									= new IdentifierImpl(ID_FUNCTION, "string-union");
+    public static final Identifier ID_FUNCTION_STRING_SUBSET								= new IdentifierImpl(ID_FUNCTION, "string-subset");
+    public static final Identifier ID_FUNCTION_STRING_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "string-set-equals");
+    public static final Identifier ID_FUNCTION_BOOLEAN_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "boolean-intersection");
+    public static final Identifier ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "boolean-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_BOOLEAN_UNION								= new IdentifierImpl(ID_FUNCTION, "boolean-union");
+    public static final Identifier ID_FUNCTION_BOOLEAN_SUBSET								= new IdentifierImpl(ID_FUNCTION, "boolean-subset");
+    public static final Identifier ID_FUNCTION_BOOLEAN_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "boolean-set-equals");
+    public static final Identifier ID_FUNCTION_INTEGER_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "integer-intersection");
+    public static final Identifier ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "integer-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_INTEGER_UNION								= new IdentifierImpl(ID_FUNCTION, "integer-union");
+    public static final Identifier ID_FUNCTION_INTEGER_SUBSET								= new IdentifierImpl(ID_FUNCTION, "integer-subset");
+    public static final Identifier ID_FUNCTION_INTEGER_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "integer-set-equals");
+    public static final Identifier ID_FUNCTION_DOUBLE_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "double-intersection");
+    public static final Identifier ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "double-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_DOUBLE_UNION									= new IdentifierImpl(ID_FUNCTION, "double-union");
+    public static final Identifier ID_FUNCTION_DOUBLE_SUBSET								= new IdentifierImpl(ID_FUNCTION, "double-subset");
+    public static final Identifier ID_FUNCTION_DOUBLE_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "double-set-equals");
+    public static final Identifier ID_FUNCTION_TIME_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "time-intersection");
+    public static final Identifier ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF					= new IdentifierImpl(ID_FUNCTION, "time-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_TIME_UNION									= new IdentifierImpl(ID_FUNCTION, "time-union");
+    public static final Identifier ID_FUNCTION_TIME_SUBSET									= new IdentifierImpl(ID_FUNCTION, "time-subset");
+    public static final Identifier ID_FUNCTION_TIME_SET_EQUALS								= new IdentifierImpl(ID_FUNCTION, "time-set-equals");
+    public static final Identifier ID_FUNCTION_DATE_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "date-intersection");
+    public static final Identifier ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF					= new IdentifierImpl(ID_FUNCTION, "date-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_DATE_UNION									= new IdentifierImpl(ID_FUNCTION, "date-union");
+    public static final Identifier ID_FUNCTION_DATE_SUBSET									= new IdentifierImpl(ID_FUNCTION, "date-subset");
+    public static final Identifier ID_FUNCTION_DATE_SET_EQUALS								= new IdentifierImpl(ID_FUNCTION, "date-set-equals");
+    public static final Identifier ID_FUNCTION_DATETIME_INTERSECTION						= new IdentifierImpl(ID_FUNCTION, "dateTime-intersection");
+    public static final Identifier ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "dateTime-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_DATETIME_UNION								= new IdentifierImpl(ID_FUNCTION, "dateTime-union");
+    public static final Identifier ID_FUNCTION_DATETIME_SUBSET								= new IdentifierImpl(ID_FUNCTION, "dateTime-subset");
+    public static final Identifier ID_FUNCTION_DATETIME_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "dateTime-set-equals");
+    public static final Identifier ID_FUNCTION_ANYURI_INTERSECTION							= new IdentifierImpl(ID_FUNCTION, "anyURI-intersection");
+    public static final Identifier ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "anyURI-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_ANYURI_UNION									= new IdentifierImpl(ID_FUNCTION, "anyURI-union");
+    public static final Identifier ID_FUNCTION_ANYURI_SUBSET								= new IdentifierImpl(ID_FUNCTION, "anyURI-subset");
+    public static final Identifier ID_FUNCTION_ANYURI_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "anyURI-set-equals");
+    public static final Identifier ID_FUNCTION_HEXBINARY_INTERSECTION						= new IdentifierImpl(ID_FUNCTION, "hexBinary-intersection");
+    public static final Identifier ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "hexBinary-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_HEXBINARY_UNION								= new IdentifierImpl(ID_FUNCTION, "hexBinary-union");
+    public static final Identifier ID_FUNCTION_HEXBINARY_SUBSET								= new IdentifierImpl(ID_FUNCTION, "hexBinary-subset");
+    public static final Identifier ID_FUNCTION_HEXBINARY_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "hexBinary-set-equals");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_INTERSECTION					= new IdentifierImpl(ID_FUNCTION, "base64Binary-intersection");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF			= new IdentifierImpl(ID_FUNCTION, "base64Binary-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_UNION							= new IdentifierImpl(ID_FUNCTION, "base64Binary-union");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_SUBSET							= new IdentifierImpl(ID_FUNCTION, "base64Binary-subset");
+    public static final Identifier ID_FUNCTION_BASE64BINARY_SET_EQUALS						= new IdentifierImpl(ID_FUNCTION, "base64Binary-set-equals");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_INTERSECTION					= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-intersection");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_UNION						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-union");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SUBSET						= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-subset");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS					= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-set-equals");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_INTERSECTION				= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-intersection");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_UNION						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-union");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SUBSET						= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-subset");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS					= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-set-equals");
+    public static final Identifier ID_FUNCTION_X500NAME_INTERSECTION						= new IdentifierImpl(ID_FUNCTION, "x500Name-intersection");
+    public static final Identifier ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF				= new IdentifierImpl(ID_FUNCTION, "x500Name-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_X500NAME_UNION								= new IdentifierImpl(ID_FUNCTION, "x500Name-union");
+    public static final Identifier ID_FUNCTION_X500NAME_SUBSET								= new IdentifierImpl(ID_FUNCTION, "x500Name-subset");
+    public static final Identifier ID_FUNCTION_X500NAME_SET_EQUALS							= new IdentifierImpl(ID_FUNCTION, "x500Name-set-equals");
+    public static final Identifier ID_FUNCTION_RFC822NAME_INTERSECTION						= new IdentifierImpl(ID_FUNCTION, "rfc822Name-intersection");
+    public static final Identifier ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF			= new IdentifierImpl(ID_FUNCTION, "rfc822Name-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_RFC822NAME_UNION								= new IdentifierImpl(ID_FUNCTION, "rfc822Name-union");
+    public static final Identifier ID_FUNCTION_RFC822NAME_SUBSET							= new IdentifierImpl(ID_FUNCTION, "rfc822Name-subset");
+    public static final Identifier ID_FUNCTION_RFC822NAME_SET_EQUALS						= new IdentifierImpl(ID_FUNCTION, "rfc822Name-set-equals");
 
-        /*
-         * XACML Profile for Role Based Access Control (RBAC) Version 1.0
-         */
-        public static final Identifier ID_PROFILES_RBAC_CORE_HIERARCHICAL	= new IdentifierImpl(ID_PROFILES, "rbac:core-hierarchical");
+    /*
+     * TODO: Declare all of the XML elements and attributes in use
+     */
+
+    /*
+     * Profiles
+     */
+    public static final Identifier ID_PROFILES	= new IdentifierImpl(ID_XACML_1_0, XACML.PROFILES);
+    public static final Identifier ID_PROFILE	= new IdentifierImpl(ID_XACML_1_0, XACML.PROFILE);
+
+    /*
+     * SAML 2.0 Profile of XACML, Version 2.0
+     */
+    public static final Identifier ID_PROFILE_SAML2_0_V2									= new IdentifierImpl(ID_PROFILE, "saml2.0:v2");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_POLICIES							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "policies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_ADVICESAML							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "adviceSAML");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZTOKEN							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzToken");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_ATTRS_ALL							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "attrs:all");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "SOAP");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_AUTHZQUERY					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "authzQuery");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_ATTRASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "attrAssertion");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION						= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecision");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_NOPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "noPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_WITHPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "withPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST				= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecisionWSTrust");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_WITHPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "withPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_NOPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "noPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "schema");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_ASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "assertion");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_PROTOCOL					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "protocol");
+
+    /*
+     * XACML Profile for Role Based Access Control (RBAC) Version 1.0
+     */
+    public static final Identifier ID_PROFILES_RBAC_CORE_HIERARCHICAL	= new IdentifierImpl(ID_PROFILES, "rbac:core-hierarchical");
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML2.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML2.java
index b69f369..8b21113 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML2.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML2.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,68 +35,68 @@
 /**
  * XACML2 contains the constants (<code>String</code>s, <code>URI</code>s {@link com.att.research.xacml.api.Identifier}s that are
  * defined in the XACML 2.0 Specification: "XACML 2.0 Core: eXtensible Access Control Markup Language (XACML) Version 2.0".
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class XACML2 {
-        protected XACML2() {
-        }
+    protected XACML2() {
+    }
 
-        /*
-         * DOM Namespaces and schema
-         */
-        public static final String	SCHEMA_LOCATION					= "urn:oasis:names:tc:xacml:2.0:context:schema:os access_control-xacml-2.0-context-schema-os.xsd";
-        public static final String	XMLNS							= "urn:oasis:names:tc:xacml:2.0:context:schema:os";
-        public static final String	XMLNS_XSI						= "http://www.w3.org/2001/XMLSchema-instance";
-        
-        /*
-         * URN builder components
-         */
-        public static final String	VERSION_2_0						= "2.0";
-        
-        /*
-         * 10.2.2 Identifier Prefixes
-         */
-        public static final Identifier ID_XACML						= new IdentifierImpl(XACML.ID_XACML, VERSION_2_0);
-        public static final Identifier ID_CONFORMANCE_TEST			= new IdentifierImpl(ID_XACML, XACML.CONFORMANCE_TEST);
-        public static final Identifier ID_CONTEXT					= new IdentifierImpl(ID_XACML, XACML.CONTEXT);
-        public static final Identifier ID_EXAMPLE					= new IdentifierImpl(ID_XACML, XACML.EXAMPLE);
-        public static final Identifier ID_FUNCTION10				= XACML1.ID_FUNCTION;
-        public static final Identifier ID_FUNCTION					= new IdentifierImpl(ID_XACML, XACML.FUNCTION);
-        public static final Identifier ID_POLICY					= new IdentifierImpl(ID_XACML, XACML.POLICY);
-        public static final Identifier ID_SUBJECT					= new IdentifierImpl(ID_XACML, XACML.SUBJECT);
-        public static final Identifier ID_SUBJECT_CATEGORY			= new IdentifierImpl(ID_XACML, XACML.SUBJECT_CATEGORY);
-        public static final Identifier ID_RESOURCE					= new IdentifierImpl(ID_XACML, XACML.RESOURCE);
-        public static final Identifier ID_ACTION					= new IdentifierImpl(ID_XACML, XACML.ACTION);
-        public static final Identifier ID_ACTIONS					= new IdentifierImpl(ID_XACML, XACML.ACTIONS);;
-        public static final Identifier ID_ENVIRONMENT				= new IdentifierImpl(ID_XACML, XACML.ENVIRONMENT);
-        public static final Identifier ID_STATUS					= XACML1.ID_STATUS;
-        
-        /*
-         * 10.2.3 Algorithms
-         */
-        public static final Identifier ID_RULE_DENY_OVERRIDES				= XACML1.ID_RULE_DENY_OVERRIDES;
-        public static final Identifier ID_POLICY_DENY_OVERRIDES				= XACML1.ID_POLICY_DENY_OVERRIDES;
-        public static final Identifier ID_RULE_PERMIT_OVERRIDES				= XACML1.ID_RULE_PERMIT_OVERRIDES;
-        public static final Identifier ID_POLICY_PERMIT_OVERRIDES			= XACML1.ID_POLICY_PERMIT_OVERRIDES;
-        public static final Identifier ID_RULE_FIRST_APPLICABLE				= XACML1.ID_RULE_FIRST_APPLICABLE;
-        public static final Identifier ID_POLICY_FIRST_APPLICABLE			= XACML1.ID_POLICY_FIRST_APPLICABLE;
-        public static final Identifier ID_RULE_ONLY_ONE_APPLICABLE			= XACML1.ID_RULE_ONLY_ONE_APPLICABLE;
-        public static final Identifier ID_POLICY_ONLY_ONE_APPLICABLE		= XACML1.ID_POLICY_ONLY_ONE_APPLICABLE;
-        public static final Identifier ID_RULE_ORDERED_DENY_OVERRIDES		= XACML1.ID_RULE_ORDERED_DENY_OVERRIDES;
-        public static final Identifier ID_POLICY_ORDERED_DENY_OVERRIDES		= XACML1.ID_POLICY_ORDERED_DENY_OVERRIDES;
-        public static final Identifier ID_RULE_ORDERED_PERMIT_OVERRIDES		= XACML1.ID_RULE_ORDERED_PERMIT_OVERRIDES;
-        public static final Identifier ID_POLICY_ORDERED_PERMIT_OVERRIDES	= XACML1.ID_POLICY_ORDERED_PERMIT_OVERRIDES;
-        
-        /*
-         * 10.2.4 Status Codes
-         */
-        public static final Identifier ID_STATUS_MISSING_ATTRIBUTE	= XACML1.ID_STATUS_MISSING_ATTRIBUTE;
-        public static final Identifier ID_STATUS_OK					= XACML1.ID_STATUS_OK;
-        public static final Identifier ID_STATUS_PROCESSING_ERROR	= XACML1.ID_STATUS_PROCESSING_ERROR;
-        public static final Identifier ID_STATUS_SYNTAX_ERROR		= XACML1.ID_STATUS_SYNTAX_ERROR;
-        
+    /*
+     * DOM Namespaces and schema
+     */
+    public static final String	SCHEMA_LOCATION					= "urn:oasis:names:tc:xacml:2.0:context:schema:os access_control-xacml-2.0-context-schema-os.xsd";
+    public static final String	XMLNS							= "urn:oasis:names:tc:xacml:2.0:context:schema:os";
+    public static final String	XMLNS_XSI						= "http://www.w3.org/2001/XMLSchema-instance";
+
+    /*
+     * URN builder components
+     */
+    public static final String	VERSION_2_0						= "2.0";
+
+    /*
+     * 10.2.2 Identifier Prefixes
+     */
+    public static final Identifier ID_XACML						= new IdentifierImpl(XACML.ID_XACML, VERSION_2_0);
+    public static final Identifier ID_CONFORMANCE_TEST			= new IdentifierImpl(ID_XACML, XACML.CONFORMANCE_TEST);
+    public static final Identifier ID_CONTEXT					= new IdentifierImpl(ID_XACML, XACML.CONTEXT);
+    public static final Identifier ID_EXAMPLE					= new IdentifierImpl(ID_XACML, XACML.EXAMPLE);
+    public static final Identifier ID_FUNCTION10				= XACML1.ID_FUNCTION;
+    public static final Identifier ID_FUNCTION					= new IdentifierImpl(ID_XACML, XACML.FUNCTION);
+    public static final Identifier ID_POLICY					= new IdentifierImpl(ID_XACML, XACML.POLICY);
+    public static final Identifier ID_SUBJECT					= new IdentifierImpl(ID_XACML, XACML.SUBJECT);
+    public static final Identifier ID_SUBJECT_CATEGORY			= new IdentifierImpl(ID_XACML, XACML.SUBJECT_CATEGORY);
+    public static final Identifier ID_RESOURCE					= new IdentifierImpl(ID_XACML, XACML.RESOURCE);
+    public static final Identifier ID_ACTION					= new IdentifierImpl(ID_XACML, XACML.ACTION);
+    public static final Identifier ID_ACTIONS					= new IdentifierImpl(ID_XACML, XACML.ACTIONS);;
+    public static final Identifier ID_ENVIRONMENT				= new IdentifierImpl(ID_XACML, XACML.ENVIRONMENT);
+    public static final Identifier ID_STATUS					= XACML1.ID_STATUS;
+
+    /*
+     * 10.2.3 Algorithms
+     */
+    public static final Identifier ID_RULE_DENY_OVERRIDES				= XACML1.ID_RULE_DENY_OVERRIDES;
+    public static final Identifier ID_POLICY_DENY_OVERRIDES				= XACML1.ID_POLICY_DENY_OVERRIDES;
+    public static final Identifier ID_RULE_PERMIT_OVERRIDES				= XACML1.ID_RULE_PERMIT_OVERRIDES;
+    public static final Identifier ID_POLICY_PERMIT_OVERRIDES			= XACML1.ID_POLICY_PERMIT_OVERRIDES;
+    public static final Identifier ID_RULE_FIRST_APPLICABLE				= XACML1.ID_RULE_FIRST_APPLICABLE;
+    public static final Identifier ID_POLICY_FIRST_APPLICABLE			= XACML1.ID_POLICY_FIRST_APPLICABLE;
+    public static final Identifier ID_RULE_ONLY_ONE_APPLICABLE			= XACML1.ID_RULE_ONLY_ONE_APPLICABLE;
+    public static final Identifier ID_POLICY_ONLY_ONE_APPLICABLE		= XACML1.ID_POLICY_ONLY_ONE_APPLICABLE;
+    public static final Identifier ID_RULE_ORDERED_DENY_OVERRIDES		= XACML1.ID_RULE_ORDERED_DENY_OVERRIDES;
+    public static final Identifier ID_POLICY_ORDERED_DENY_OVERRIDES		= XACML1.ID_POLICY_ORDERED_DENY_OVERRIDES;
+    public static final Identifier ID_RULE_ORDERED_PERMIT_OVERRIDES		= XACML1.ID_RULE_ORDERED_PERMIT_OVERRIDES;
+    public static final Identifier ID_POLICY_ORDERED_PERMIT_OVERRIDES	= XACML1.ID_POLICY_ORDERED_PERMIT_OVERRIDES;
+
+    /*
+     * 10.2.4 Status Codes
+     */
+    public static final Identifier ID_STATUS_MISSING_ATTRIBUTE	= XACML1.ID_STATUS_MISSING_ATTRIBUTE;
+    public static final Identifier ID_STATUS_OK					= XACML1.ID_STATUS_OK;
+    public static final Identifier ID_STATUS_PROCESSING_ERROR	= XACML1.ID_STATUS_PROCESSING_ERROR;
+    public static final Identifier ID_STATUS_SYNTAX_ERROR		= XACML1.ID_STATUS_SYNTAX_ERROR;
+
     /*
      * Section 10.2.5 Attributes
      */
@@ -130,346 +130,346 @@
     public static final Identifier ID_ACTION_ACTION_ID      				= XACML1.ID_ACTION_ACTION_ID;
     public static final Identifier ID_ACTION_IMPLIED_ACTION 				= XACML1.ID_ACTION_IMPLIED_ACTION;
 
-        /*
-         * Section 10.2.7 Data-types
-         */
-        public static final Identifier ID_DATATYPE_STRING				= XACML.ID_DATATYPE_STRING;
-        public static final Identifier ID_DATATYPE_BOOLEAN				= XACML.ID_DATATYPE_BOOLEAN;
-        public static final Identifier ID_DATATYPE_INTEGER				= XACML.ID_DATATYPE_BOOLEAN;
-        public static final Identifier ID_DATATYPE_DOUBLE				= XACML.ID_DATATYPE_DOUBLE;
-        public static final Identifier ID_DATATYPE_TIME					= XACML.ID_DATATYPE_TIME;
-        public static final Identifier ID_DATATYPE_DATE					= XACML.ID_DATATYPE_DATE;
-        public static final Identifier ID_DATATYPE_DATETIME				= XACML.ID_DATATYPE_DATETIME;
-        public static final Identifier ID_DATATYPE_DAYTIMEDURATION		= XACML.ID_DATATYPE_WD_DAYTIMEDURATION;
-        public static final Identifier ID_DATATYPE_YEARMONTHDURATION	= XACML.ID_DATATYPE_WD_YEARMONTHDURATION;
-        public static final Identifier ID_DATATYPE_ANYURI				= XACML.ID_DATATYPE_ANYURI;
-        public static final Identifier ID_DATATYPE_HEXBINARY			= XACML.ID_DATATYPE_HEXBINARY;
-        public static final Identifier ID_DATATYPE_BASE64BINARY			= XACML.ID_DATATYPE_BASE64BINARY;
-        public static final Identifier ID_DATATYPE_RFC822NAME			= XACML1.ID_DATATYPE_RFC822NAME;
-        public static final Identifier ID_DATATYPE_X500NAME				= XACML1.ID_DATATYPE_X500NAME;
-        
-        public static final Identifier ID_DATATYPE						= new IdentifierImpl(ID_XACML, XACML.DATA_TYPE);
-        public static final Identifier ID_DATATYPE_IPADDRESS			= new IdentifierImpl(ID_DATATYPE, "ipAddress");
-        public static final Identifier ID_DATATYPE_DNSNAME				= new IdentifierImpl(ID_DATATYPE, "dnsName");
-        
-        /*
-         * Section 10.2.8 Functions
-         */
-        
-        public static final Identifier ID_FUNCTION_STRING_EQUAL 						= XACML1.ID_FUNCTION_STRING_EQUAL;
-        public static final Identifier ID_FUNCTION_BOOLEAN_EQUAL        				= XACML1.ID_FUNCTION_BOOLEAN_EQUAL;
-        public static final Identifier ID_FUNCTION_INTEGER_EQUAL        				= XACML1.ID_FUNCTION_INTEGER_EQUAL;
-        public static final Identifier ID_FUNCTION_DOUBLE_EQUAL 						= XACML1.ID_FUNCTION_DOUBLE_EQUAL;
-        public static final Identifier ID_FUNCTION_DATE_EQUAL   						= XACML1.ID_FUNCTION_DATE_EQUAL;
-        public static final Identifier ID_FUNCTION_TIME_EQUAL   						= XACML1.ID_FUNCTION_TIME_EQUAL;
-        public static final Identifier ID_FUNCTION_DATETIME_EQUAL       				= XACML1.ID_FUNCTION_DATETIME_EQUAL;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_EQUAL        		= XACML1.ID_FUNCTION_DAYTIMEDURATION_EQUAL;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_EQUAL      		= XACML1.ID_FUNCTION_YEARMONTHDURATION_EQUAL;
-        public static final Identifier ID_FUNCTION_ANYURI_EQUAL 						= XACML1.ID_FUNCTION_ANYURI_EQUAL;
-        public static final Identifier ID_FUNCTION_X500NAME_EQUAL       				= XACML1.ID_FUNCTION_X500NAME_EQUAL;
-        public static final Identifier ID_FUNCTION_RFC822NAME_EQUAL     				= XACML1.ID_FUNCTION_RFC822NAME_EQUAL;
-        public static final Identifier ID_FUNCTION_HEXBINARY_EQUAL      				= XACML1.ID_FUNCTION_HEXBINARY_EQUAL;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_EQUAL   				= XACML1.ID_FUNCTION_BASE64BINARY_EQUAL;
-        public static final Identifier ID_FUNCTION_INTEGER_ADD  						= XACML1.ID_FUNCTION_INTEGER_ADD;
-        public static final Identifier ID_FUNCTION_DOUBLE_ADD   						= XACML1.ID_FUNCTION_DOUBLE_ADD;
-        public static final Identifier ID_FUNCTION_INTEGER_SUBTRACT     				= XACML1.ID_FUNCTION_INTEGER_SUBTRACT;
-        public static final Identifier ID_FUNCTION_DOUBLE_SUBTRACT      				= XACML1.ID_FUNCTION_DOUBLE_SUBTRACT;
-        public static final Identifier ID_FUNCTION_INTEGER_MULTIPLY     				= XACML1.ID_FUNCTION_INTEGER_MULTIPLY;
-        public static final Identifier ID_FUNCTION_DOUBLE_MULTIPLY      				= XACML1.ID_FUNCTION_DOUBLE_MULTIPLY;
-        public static final Identifier ID_FUNCTION_INTEGER_DIVIDE       				= XACML1.ID_FUNCTION_INTEGER_DIVIDE;
-        public static final Identifier ID_FUNCTION_DOUBLE_DIVIDE        				= XACML1.ID_FUNCTION_DOUBLE_DIVIDE;
-        public static final Identifier ID_FUNCTION_INTEGER_MOD  						= XACML1.ID_FUNCTION_INTEGER_MOD;
-        public static final Identifier ID_FUNCTION_INTEGER_ABS  						= XACML1.ID_FUNCTION_INTEGER_ABS;
-        public static final Identifier ID_FUNCTION_DOUBLE_ABS   						= XACML1.ID_FUNCTION_DOUBLE_ABS;
-        public static final Identifier ID_FUNCTION_ROUND        						= XACML1.ID_FUNCTION_ROUND;
-        public static final Identifier ID_FUNCTION_FLOOR        						= XACML1.ID_FUNCTION_FLOOR;
-        public static final Identifier ID_FUNCTION_STRING_NORMALIZE_SPACE       		= XACML1.ID_FUNCTION_STRING_NORMALIZE_SPACE;
-        public static final Identifier ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE       = XACML1.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE;
-        public static final Identifier ID_FUNCTION_DOUBLE_TO_INTEGER    				= XACML1.ID_FUNCTION_DOUBLE_TO_INTEGER;
-        public static final Identifier ID_FUNCTION_INTEGER_TO_DOUBLE    				= XACML1.ID_FUNCTION_INTEGER_TO_DOUBLE;
-        public static final Identifier ID_FUNCTION_OR   								= XACML1.ID_FUNCTION_OR;
-        public static final Identifier ID_FUNCTION_AND  								= XACML1.ID_FUNCTION_AND;
-        public static final Identifier ID_FUNCTION_N_OF 								= XACML1.ID_FUNCTION_N_OF;
-        public static final Identifier ID_FUNCTION_NOT  								= XACML1.ID_FUNCTION_NOT;
-        public static final Identifier ID_FUNCTION_PRESENT      						= XACML1.ID_FUNCTION_PRESENT;
-        public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN 				= XACML1.ID_FUNCTION_INTEGER_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL        = XACML1.ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN    				= XACML1.ID_FUNCTION_INTEGER_LESS_THAN;
-        public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN  				= XACML1.ID_FUNCTION_DOUBLE_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL 		= XACML1.ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN     				= XACML1.ID_FUNCTION_DOUBLE_LESS_THAN;
-        public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL    		= XACML1.ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION 		= XACML1.ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION;
-        public static final Identifier ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION       = XACML1.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION;
-        public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION    = XACML1.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION;
-        public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION  = XACML1.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION;
-        public static final Identifier ID_FUNCTION_DATE_ADD_YEARMONTHDURATION   		= XACML1.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION;
-        public static final Identifier ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION      = XACML1.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION;
-        public static final Identifier ID_FUNCTION_STRING_GREATER_THAN  				= XACML1.ID_FUNCTION_STRING_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL 		= XACML1.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_STRING_LESS_THAN     				= XACML1.ID_FUNCTION_STRING_LESS_THAN;
-        public static final Identifier ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL    		= XACML1.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_TIME_GREATER_THAN    				= XACML1.ID_FUNCTION_TIME_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_TIME_LESS_THAN       				= XACML1.ID_FUNCTION_TIME_LESS_THAN;
-        public static final Identifier ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL      		= XACML1.ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_TIME_IN_RANGE						= new IdentifierImpl(ID_FUNCTION, "time-in-range");
-        public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN        		= XACML1.ID_FUNCTION_DATETIME_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL       = XACML1.ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN   				= XACML1.ID_FUNCTION_DATETIME_LESS_THAN;
-        public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL  		= XACML1.ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DATE_GREATER_THAN    				= XACML1.ID_FUNCTION_DATE_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DATE_LESS_THAN       				= XACML1.ID_FUNCTION_DATE_LESS_THAN;
-        public static final Identifier ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL      		= XACML1.ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_STRING_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_STRING_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_STRING_BAG_SIZE      				= XACML1.ID_FUNCTION_STRING_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_STRING_IS_IN 						= XACML1.ID_FUNCTION_STRING_IS_IN;
-        public static final Identifier ID_FUNCTION_STRING_BAG   						= XACML1.ID_FUNCTION_STRING_BAG;
-        public static final Identifier ID_FUNCTION_BOOLEAN_ONE_AND_ONLY 				= XACML1.ID_FUNCTION_BOOLEAN_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_BOOLEAN_BAG_SIZE     				= XACML1.ID_FUNCTION_BOOLEAN_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_BOOLEAN_IS_IN        				= XACML1.ID_FUNCTION_BOOLEAN_IS_IN;
-        public static final Identifier ID_FUNCTION_BOOLEAN_BAG  						= XACML1.ID_FUNCTION_BOOLEAN_BAG;
-        public static final Identifier ID_FUNCTION_INTEGER_ONE_AND_ONLY 				= XACML1.ID_FUNCTION_INTEGER_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_INTEGER_BAG_SIZE     				= XACML1.ID_FUNCTION_INTEGER_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_INTEGER_IS_IN        				= XACML1.ID_FUNCTION_INTEGER_IS_IN;
-        public static final Identifier ID_FUNCTION_INTEGER_BAG  						= XACML1.ID_FUNCTION_INTEGER_BAG;
-        public static final Identifier ID_FUNCTION_DOUBLE_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_DOUBLE_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_DOUBLE_BAG_SIZE      				= XACML1.ID_FUNCTION_DOUBLE_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_DOUBLE_IS_IN 						= XACML1.ID_FUNCTION_DOUBLE_IS_IN;
-        public static final Identifier ID_FUNCTION_DOUBLE_BAG   						= XACML1.ID_FUNCTION_DOUBLE_BAG;
-        public static final Identifier ID_FUNCTION_TIME_ONE_AND_ONLY    				= XACML1.ID_FUNCTION_TIME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_TIME_BAG_SIZE        				= XACML1.ID_FUNCTION_TIME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_TIME_IS_IN   						= XACML1.ID_FUNCTION_TIME_IS_IN;
-        public static final Identifier ID_FUNCTION_TIME_BAG     						= XACML1.ID_FUNCTION_TIME_BAG;
-        public static final Identifier ID_FUNCTION_DATE_ONE_AND_ONLY    				= XACML1.ID_FUNCTION_DATE_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_DATE_BAG_SIZE        				= XACML1.ID_FUNCTION_DATE_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_DATE_IS_IN   						= XACML1.ID_FUNCTION_DATE_IS_IN;
-        public static final Identifier ID_FUNCTION_DATE_BAG     						= XACML1.ID_FUNCTION_DATE_BAG;
-        public static final Identifier ID_FUNCTION_DATETIME_ONE_AND_ONLY        		= XACML1.ID_FUNCTION_DATETIME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_DATETIME_BAG_SIZE    				= XACML1.ID_FUNCTION_DATETIME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_DATETIME_IS_IN       				= XACML1.ID_FUNCTION_DATETIME_IS_IN;
-        public static final Identifier ID_FUNCTION_DATETIME_BAG 						= XACML1.ID_FUNCTION_DATETIME_BAG;
-        public static final Identifier ID_FUNCTION_ANYURI_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_ANYURI_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_ANYURI_BAG_SIZE      				= XACML1.ID_FUNCTION_ANYURI_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_ANYURI_IS_IN 						= XACML1.ID_FUNCTION_ANYURI_IS_IN;
-        public static final Identifier ID_FUNCTION_ANYURI_BAG   						= XACML1.ID_FUNCTION_ANYURI_BAG;
-        public static final Identifier ID_FUNCTION_HEXBINARY_ONE_AND_ONLY       		= XACML1.ID_FUNCTION_HEXBINARY_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_HEXBINARY_BAG_SIZE   				= XACML1.ID_FUNCTION_HEXBINARY_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_HEXBINARY_IS_IN      				= XACML1.ID_FUNCTION_HEXBINARY_IS_IN;
-        public static final Identifier ID_FUNCTION_HEXBINARY_BAG        				= XACML1.ID_FUNCTION_HEXBINARY_BAG;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY    		= XACML1.ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_BAG_SIZE        		= XACML1.ID_FUNCTION_BASE64BINARY_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_IS_IN   				= XACML1.ID_FUNCTION_BASE64BINARY_IS_IN;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_BAG     				= XACML1.ID_FUNCTION_BASE64BINARY_BAG;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY 		= XACML1.ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE     		= XACML1.ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_IS_IN        		= XACML1.ID_FUNCTION_DAYTIMEDURATION_IS_IN;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG  				= XACML1.ID_FUNCTION_DAYTIMEDURATION_BAG;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY       = XACML1.ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE   		= XACML1.ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_IS_IN      		= XACML1.ID_FUNCTION_YEARMONTHDURATION_IS_IN;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG        		= XACML1.ID_FUNCTION_YEARMONTHDURATION_BAG;
-        public static final Identifier ID_FUNCTION_X500NAME_ONE_AND_ONLY        		= XACML1.ID_FUNCTION_X500NAME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_X500NAME_BAG_SIZE    				= XACML1.ID_FUNCTION_X500NAME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_X500NAME_IS_IN       				= XACML1.ID_FUNCTION_X500NAME_IS_IN;
-        public static final Identifier ID_FUNCTION_X500NAME_BAG 						= XACML1.ID_FUNCTION_X500NAME_BAG;
-        public static final Identifier ID_FUNCTION_RFC822NAME_ONE_AND_ONLY      		= XACML1.ID_FUNCTION_RFC822NAME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_RFC822NAME_BAG_SIZE  				= XACML1.ID_FUNCTION_RFC822NAME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_RFC822NAME_IS_IN     				= XACML1.ID_FUNCTION_RFC822NAME_IS_IN;
-        public static final Identifier ID_FUNCTION_RFC822NAME_BAG       				= XACML1.ID_FUNCTION_RFC822NAME_BAG;
-        public static final Identifier ID_FUNCTION_IPADDRESS_ONE_AND_ONLY      			= new IdentifierImpl(ID_FUNCTION, "ipAddress-one-and-only");
-        public static final Identifier ID_FUNCTION_IPADDRESS_BAG_SIZE  					= new IdentifierImpl(ID_FUNCTION, "ipAddress-bag-size");
-        public static final Identifier ID_FUNCTION_IPADDRESS_IS_IN     					= new IdentifierImpl(ID_FUNCTION, "ipAddress-is-in");
-        public static final Identifier ID_FUNCTION_IPADDRESS_BAG       					= new IdentifierImpl(ID_FUNCTION, "ipAddress-bag");
-        public static final Identifier ID_FUNCTION_DNSNAME_ONE_AND_ONLY      			= new IdentifierImpl(ID_FUNCTION, "dnsName-one-and-only");
-        public static final Identifier ID_FUNCTION_DNSNAME_BAG_SIZE  					= new IdentifierImpl(ID_FUNCTION, "dnsName-bag-size");
-        public static final Identifier ID_FUNCTION_DNSNAME_IS_IN     					= new IdentifierImpl(ID_FUNCTION, "dnsName-is-in");
-        public static final Identifier ID_FUNCTION_DNSNAME_BAG       					= new IdentifierImpl(ID_FUNCTION, "dnsName-bag");
-        public static final Identifier ID_FUNCTION_STRING_CONCATENATE					= new IdentifierImpl(ID_FUNCTION, "string-concatenate");
-        public static final Identifier ID_FUNCTION_STRING_URI_CONCATENATE				= new IdentifierImpl(ID_FUNCTION, "string-uri-concatenate");
-        public static final Identifier ID_FUNCTION_ANY_OF       						= XACML1.ID_FUNCTION_ANY_OF;
-        public static final Identifier ID_FUNCTION_ALL_OF       						= XACML1.ID_FUNCTION_ALL_OF;
-        public static final Identifier ID_FUNCTION_ANY_OF_ANY   						= XACML1.ID_FUNCTION_ANY_OF_ANY;
-        public static final Identifier ID_FUNCTION_ALL_OF_ANY   						= XACML1.ID_FUNCTION_ALL_OF_ANY;
-        public static final Identifier ID_FUNCTION_ANY_OF_ALL   						= XACML1.ID_FUNCTION_ANY_OF_ALL;
-        public static final Identifier ID_FUNCTION_ALL_OF_ALL   						= XACML1.ID_FUNCTION_ALL_OF_ALL;
-        public static final Identifier ID_FUNCTION_MAP  								= XACML1.ID_FUNCTION_MAP;
-        public static final Identifier ID_FUNCTION_X500NAME_MATCH        				= XACML1.ID_FUNCTION_X500NAME_MATCH;
-        public static final Identifier ID_FUNCTION_RFC822NAME_MATCH      				= XACML1.ID_FUNCTION_RFC822NAME_MATCH;
-        public static final Identifier ID_FUNCTION_STRING_REGEXP_MATCH   						= XACML1.ID_FUNCTION_STRING_REGEXP_MATCH;
-        public static final Identifier ID_FUNCTION_ANYURI_REGEXP_MATCH							= new IdentifierImpl(ID_FUNCTION, "anyURI-regexp-match");
-        public static final Identifier ID_FUNCTION_IPADDRESS_REGEXP_MATCH						= new IdentifierImpl(ID_FUNCTION, "ipAddress-regexp-match");
-        public static final Identifier ID_FUNCTION_DNSNAME_REGEXP_MATCH							= new IdentifierImpl(ID_FUNCTION, "dnsName-regexp-match");
-        public static final Identifier ID_FUNCTION_RFC822NAME_REGEXP_MATCH						= new IdentifierImpl(ID_FUNCTION, "rfc822Name-regexp-match");
-        public static final Identifier ID_FUNCTION_X500NAME_REGEXP_MATCH							= new IdentifierImpl(ID_FUNCTION, "x500Name-regexp-match");
+    /*
+     * Section 10.2.7 Data-types
+     */
+    public static final Identifier ID_DATATYPE_STRING				= XACML.ID_DATATYPE_STRING;
+    public static final Identifier ID_DATATYPE_BOOLEAN				= XACML.ID_DATATYPE_BOOLEAN;
+    public static final Identifier ID_DATATYPE_INTEGER				= XACML.ID_DATATYPE_BOOLEAN;
+    public static final Identifier ID_DATATYPE_DOUBLE				= XACML.ID_DATATYPE_DOUBLE;
+    public static final Identifier ID_DATATYPE_TIME					= XACML.ID_DATATYPE_TIME;
+    public static final Identifier ID_DATATYPE_DATE					= XACML.ID_DATATYPE_DATE;
+    public static final Identifier ID_DATATYPE_DATETIME				= XACML.ID_DATATYPE_DATETIME;
+    public static final Identifier ID_DATATYPE_DAYTIMEDURATION		= XACML.ID_DATATYPE_WD_DAYTIMEDURATION;
+    public static final Identifier ID_DATATYPE_YEARMONTHDURATION	= XACML.ID_DATATYPE_WD_YEARMONTHDURATION;
+    public static final Identifier ID_DATATYPE_ANYURI				= XACML.ID_DATATYPE_ANYURI;
+    public static final Identifier ID_DATATYPE_HEXBINARY			= XACML.ID_DATATYPE_HEXBINARY;
+    public static final Identifier ID_DATATYPE_BASE64BINARY			= XACML.ID_DATATYPE_BASE64BINARY;
+    public static final Identifier ID_DATATYPE_RFC822NAME			= XACML1.ID_DATATYPE_RFC822NAME;
+    public static final Identifier ID_DATATYPE_X500NAME				= XACML1.ID_DATATYPE_X500NAME;
+
+    public static final Identifier ID_DATATYPE						= new IdentifierImpl(ID_XACML, XACML.DATA_TYPE);
+    public static final Identifier ID_DATATYPE_IPADDRESS			= new IdentifierImpl(ID_DATATYPE, "ipAddress");
+    public static final Identifier ID_DATATYPE_DNSNAME				= new IdentifierImpl(ID_DATATYPE, "dnsName");
+
+    /*
+     * Section 10.2.8 Functions
+     */
+
+    public static final Identifier ID_FUNCTION_STRING_EQUAL 						= XACML1.ID_FUNCTION_STRING_EQUAL;
+    public static final Identifier ID_FUNCTION_BOOLEAN_EQUAL        				= XACML1.ID_FUNCTION_BOOLEAN_EQUAL;
+    public static final Identifier ID_FUNCTION_INTEGER_EQUAL        				= XACML1.ID_FUNCTION_INTEGER_EQUAL;
+    public static final Identifier ID_FUNCTION_DOUBLE_EQUAL 						= XACML1.ID_FUNCTION_DOUBLE_EQUAL;
+    public static final Identifier ID_FUNCTION_DATE_EQUAL   						= XACML1.ID_FUNCTION_DATE_EQUAL;
+    public static final Identifier ID_FUNCTION_TIME_EQUAL   						= XACML1.ID_FUNCTION_TIME_EQUAL;
+    public static final Identifier ID_FUNCTION_DATETIME_EQUAL       				= XACML1.ID_FUNCTION_DATETIME_EQUAL;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_EQUAL        		= XACML1.ID_FUNCTION_DAYTIMEDURATION_EQUAL;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_EQUAL      		= XACML1.ID_FUNCTION_YEARMONTHDURATION_EQUAL;
+    public static final Identifier ID_FUNCTION_ANYURI_EQUAL 						= XACML1.ID_FUNCTION_ANYURI_EQUAL;
+    public static final Identifier ID_FUNCTION_X500NAME_EQUAL       				= XACML1.ID_FUNCTION_X500NAME_EQUAL;
+    public static final Identifier ID_FUNCTION_RFC822NAME_EQUAL     				= XACML1.ID_FUNCTION_RFC822NAME_EQUAL;
+    public static final Identifier ID_FUNCTION_HEXBINARY_EQUAL      				= XACML1.ID_FUNCTION_HEXBINARY_EQUAL;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_EQUAL   				= XACML1.ID_FUNCTION_BASE64BINARY_EQUAL;
+    public static final Identifier ID_FUNCTION_INTEGER_ADD  						= XACML1.ID_FUNCTION_INTEGER_ADD;
+    public static final Identifier ID_FUNCTION_DOUBLE_ADD   						= XACML1.ID_FUNCTION_DOUBLE_ADD;
+    public static final Identifier ID_FUNCTION_INTEGER_SUBTRACT     				= XACML1.ID_FUNCTION_INTEGER_SUBTRACT;
+    public static final Identifier ID_FUNCTION_DOUBLE_SUBTRACT      				= XACML1.ID_FUNCTION_DOUBLE_SUBTRACT;
+    public static final Identifier ID_FUNCTION_INTEGER_MULTIPLY     				= XACML1.ID_FUNCTION_INTEGER_MULTIPLY;
+    public static final Identifier ID_FUNCTION_DOUBLE_MULTIPLY      				= XACML1.ID_FUNCTION_DOUBLE_MULTIPLY;
+    public static final Identifier ID_FUNCTION_INTEGER_DIVIDE       				= XACML1.ID_FUNCTION_INTEGER_DIVIDE;
+    public static final Identifier ID_FUNCTION_DOUBLE_DIVIDE        				= XACML1.ID_FUNCTION_DOUBLE_DIVIDE;
+    public static final Identifier ID_FUNCTION_INTEGER_MOD  						= XACML1.ID_FUNCTION_INTEGER_MOD;
+    public static final Identifier ID_FUNCTION_INTEGER_ABS  						= XACML1.ID_FUNCTION_INTEGER_ABS;
+    public static final Identifier ID_FUNCTION_DOUBLE_ABS   						= XACML1.ID_FUNCTION_DOUBLE_ABS;
+    public static final Identifier ID_FUNCTION_ROUND        						= XACML1.ID_FUNCTION_ROUND;
+    public static final Identifier ID_FUNCTION_FLOOR        						= XACML1.ID_FUNCTION_FLOOR;
+    public static final Identifier ID_FUNCTION_STRING_NORMALIZE_SPACE       		= XACML1.ID_FUNCTION_STRING_NORMALIZE_SPACE;
+    public static final Identifier ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE       = XACML1.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE;
+    public static final Identifier ID_FUNCTION_DOUBLE_TO_INTEGER    				= XACML1.ID_FUNCTION_DOUBLE_TO_INTEGER;
+    public static final Identifier ID_FUNCTION_INTEGER_TO_DOUBLE    				= XACML1.ID_FUNCTION_INTEGER_TO_DOUBLE;
+    public static final Identifier ID_FUNCTION_OR   								= XACML1.ID_FUNCTION_OR;
+    public static final Identifier ID_FUNCTION_AND  								= XACML1.ID_FUNCTION_AND;
+    public static final Identifier ID_FUNCTION_N_OF 								= XACML1.ID_FUNCTION_N_OF;
+    public static final Identifier ID_FUNCTION_NOT  								= XACML1.ID_FUNCTION_NOT;
+    public static final Identifier ID_FUNCTION_PRESENT      						= XACML1.ID_FUNCTION_PRESENT;
+    public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN 				= XACML1.ID_FUNCTION_INTEGER_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL        = XACML1.ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN    				= XACML1.ID_FUNCTION_INTEGER_LESS_THAN;
+    public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN  				= XACML1.ID_FUNCTION_DOUBLE_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL 		= XACML1.ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN     				= XACML1.ID_FUNCTION_DOUBLE_LESS_THAN;
+    public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL    		= XACML1.ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION 		= XACML1.ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION;
+    public static final Identifier ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION       = XACML1.ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION;
+    public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION    = XACML1.ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION;
+    public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION  = XACML1.ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION;
+    public static final Identifier ID_FUNCTION_DATE_ADD_YEARMONTHDURATION   		= XACML1.ID_FUNCTION_DATE_ADD_YEARMONTHDURATION;
+    public static final Identifier ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION      = XACML1.ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION;
+    public static final Identifier ID_FUNCTION_STRING_GREATER_THAN  				= XACML1.ID_FUNCTION_STRING_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL 		= XACML1.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_STRING_LESS_THAN     				= XACML1.ID_FUNCTION_STRING_LESS_THAN;
+    public static final Identifier ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL    		= XACML1.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_TIME_GREATER_THAN    				= XACML1.ID_FUNCTION_TIME_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_TIME_LESS_THAN       				= XACML1.ID_FUNCTION_TIME_LESS_THAN;
+    public static final Identifier ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL      		= XACML1.ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_TIME_IN_RANGE						= new IdentifierImpl(ID_FUNCTION, "time-in-range");
+    public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN        		= XACML1.ID_FUNCTION_DATETIME_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL       = XACML1.ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN   				= XACML1.ID_FUNCTION_DATETIME_LESS_THAN;
+    public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL  		= XACML1.ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DATE_GREATER_THAN    				= XACML1.ID_FUNCTION_DATE_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DATE_LESS_THAN       				= XACML1.ID_FUNCTION_DATE_LESS_THAN;
+    public static final Identifier ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL      		= XACML1.ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_STRING_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_STRING_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_STRING_BAG_SIZE      				= XACML1.ID_FUNCTION_STRING_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_STRING_IS_IN 						= XACML1.ID_FUNCTION_STRING_IS_IN;
+    public static final Identifier ID_FUNCTION_STRING_BAG   						= XACML1.ID_FUNCTION_STRING_BAG;
+    public static final Identifier ID_FUNCTION_BOOLEAN_ONE_AND_ONLY 				= XACML1.ID_FUNCTION_BOOLEAN_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_BOOLEAN_BAG_SIZE     				= XACML1.ID_FUNCTION_BOOLEAN_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_BOOLEAN_IS_IN        				= XACML1.ID_FUNCTION_BOOLEAN_IS_IN;
+    public static final Identifier ID_FUNCTION_BOOLEAN_BAG  						= XACML1.ID_FUNCTION_BOOLEAN_BAG;
+    public static final Identifier ID_FUNCTION_INTEGER_ONE_AND_ONLY 				= XACML1.ID_FUNCTION_INTEGER_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_INTEGER_BAG_SIZE     				= XACML1.ID_FUNCTION_INTEGER_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_INTEGER_IS_IN        				= XACML1.ID_FUNCTION_INTEGER_IS_IN;
+    public static final Identifier ID_FUNCTION_INTEGER_BAG  						= XACML1.ID_FUNCTION_INTEGER_BAG;
+    public static final Identifier ID_FUNCTION_DOUBLE_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_DOUBLE_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_DOUBLE_BAG_SIZE      				= XACML1.ID_FUNCTION_DOUBLE_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_DOUBLE_IS_IN 						= XACML1.ID_FUNCTION_DOUBLE_IS_IN;
+    public static final Identifier ID_FUNCTION_DOUBLE_BAG   						= XACML1.ID_FUNCTION_DOUBLE_BAG;
+    public static final Identifier ID_FUNCTION_TIME_ONE_AND_ONLY    				= XACML1.ID_FUNCTION_TIME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_TIME_BAG_SIZE        				= XACML1.ID_FUNCTION_TIME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_TIME_IS_IN   						= XACML1.ID_FUNCTION_TIME_IS_IN;
+    public static final Identifier ID_FUNCTION_TIME_BAG     						= XACML1.ID_FUNCTION_TIME_BAG;
+    public static final Identifier ID_FUNCTION_DATE_ONE_AND_ONLY    				= XACML1.ID_FUNCTION_DATE_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_DATE_BAG_SIZE        				= XACML1.ID_FUNCTION_DATE_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_DATE_IS_IN   						= XACML1.ID_FUNCTION_DATE_IS_IN;
+    public static final Identifier ID_FUNCTION_DATE_BAG     						= XACML1.ID_FUNCTION_DATE_BAG;
+    public static final Identifier ID_FUNCTION_DATETIME_ONE_AND_ONLY        		= XACML1.ID_FUNCTION_DATETIME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_DATETIME_BAG_SIZE    				= XACML1.ID_FUNCTION_DATETIME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_DATETIME_IS_IN       				= XACML1.ID_FUNCTION_DATETIME_IS_IN;
+    public static final Identifier ID_FUNCTION_DATETIME_BAG 						= XACML1.ID_FUNCTION_DATETIME_BAG;
+    public static final Identifier ID_FUNCTION_ANYURI_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_ANYURI_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_ANYURI_BAG_SIZE      				= XACML1.ID_FUNCTION_ANYURI_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_ANYURI_IS_IN 						= XACML1.ID_FUNCTION_ANYURI_IS_IN;
+    public static final Identifier ID_FUNCTION_ANYURI_BAG   						= XACML1.ID_FUNCTION_ANYURI_BAG;
+    public static final Identifier ID_FUNCTION_HEXBINARY_ONE_AND_ONLY       		= XACML1.ID_FUNCTION_HEXBINARY_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_HEXBINARY_BAG_SIZE   				= XACML1.ID_FUNCTION_HEXBINARY_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_HEXBINARY_IS_IN      				= XACML1.ID_FUNCTION_HEXBINARY_IS_IN;
+    public static final Identifier ID_FUNCTION_HEXBINARY_BAG        				= XACML1.ID_FUNCTION_HEXBINARY_BAG;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY    		= XACML1.ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_BAG_SIZE        		= XACML1.ID_FUNCTION_BASE64BINARY_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_IS_IN   				= XACML1.ID_FUNCTION_BASE64BINARY_IS_IN;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_BAG     				= XACML1.ID_FUNCTION_BASE64BINARY_BAG;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY 		= XACML1.ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE     		= XACML1.ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_IS_IN        		= XACML1.ID_FUNCTION_DAYTIMEDURATION_IS_IN;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG  				= XACML1.ID_FUNCTION_DAYTIMEDURATION_BAG;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY       = XACML1.ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE   		= XACML1.ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_IS_IN      		= XACML1.ID_FUNCTION_YEARMONTHDURATION_IS_IN;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG        		= XACML1.ID_FUNCTION_YEARMONTHDURATION_BAG;
+    public static final Identifier ID_FUNCTION_X500NAME_ONE_AND_ONLY        		= XACML1.ID_FUNCTION_X500NAME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_X500NAME_BAG_SIZE    				= XACML1.ID_FUNCTION_X500NAME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_X500NAME_IS_IN       				= XACML1.ID_FUNCTION_X500NAME_IS_IN;
+    public static final Identifier ID_FUNCTION_X500NAME_BAG 						= XACML1.ID_FUNCTION_X500NAME_BAG;
+    public static final Identifier ID_FUNCTION_RFC822NAME_ONE_AND_ONLY      		= XACML1.ID_FUNCTION_RFC822NAME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_RFC822NAME_BAG_SIZE  				= XACML1.ID_FUNCTION_RFC822NAME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_RFC822NAME_IS_IN     				= XACML1.ID_FUNCTION_RFC822NAME_IS_IN;
+    public static final Identifier ID_FUNCTION_RFC822NAME_BAG       				= XACML1.ID_FUNCTION_RFC822NAME_BAG;
+    public static final Identifier ID_FUNCTION_IPADDRESS_ONE_AND_ONLY      			= new IdentifierImpl(ID_FUNCTION, "ipAddress-one-and-only");
+    public static final Identifier ID_FUNCTION_IPADDRESS_BAG_SIZE  					= new IdentifierImpl(ID_FUNCTION, "ipAddress-bag-size");
+    public static final Identifier ID_FUNCTION_IPADDRESS_IS_IN     					= new IdentifierImpl(ID_FUNCTION, "ipAddress-is-in");
+    public static final Identifier ID_FUNCTION_IPADDRESS_BAG       					= new IdentifierImpl(ID_FUNCTION, "ipAddress-bag");
+    public static final Identifier ID_FUNCTION_DNSNAME_ONE_AND_ONLY      			= new IdentifierImpl(ID_FUNCTION, "dnsName-one-and-only");
+    public static final Identifier ID_FUNCTION_DNSNAME_BAG_SIZE  					= new IdentifierImpl(ID_FUNCTION, "dnsName-bag-size");
+    public static final Identifier ID_FUNCTION_DNSNAME_IS_IN     					= new IdentifierImpl(ID_FUNCTION, "dnsName-is-in");
+    public static final Identifier ID_FUNCTION_DNSNAME_BAG       					= new IdentifierImpl(ID_FUNCTION, "dnsName-bag");
+    public static final Identifier ID_FUNCTION_STRING_CONCATENATE					= new IdentifierImpl(ID_FUNCTION, "string-concatenate");
+    public static final Identifier ID_FUNCTION_STRING_URI_CONCATENATE				= new IdentifierImpl(ID_FUNCTION, "string-uri-concatenate");
+    public static final Identifier ID_FUNCTION_ANY_OF       						= XACML1.ID_FUNCTION_ANY_OF;
+    public static final Identifier ID_FUNCTION_ALL_OF       						= XACML1.ID_FUNCTION_ALL_OF;
+    public static final Identifier ID_FUNCTION_ANY_OF_ANY   						= XACML1.ID_FUNCTION_ANY_OF_ANY;
+    public static final Identifier ID_FUNCTION_ALL_OF_ANY   						= XACML1.ID_FUNCTION_ALL_OF_ANY;
+    public static final Identifier ID_FUNCTION_ANY_OF_ALL   						= XACML1.ID_FUNCTION_ANY_OF_ALL;
+    public static final Identifier ID_FUNCTION_ALL_OF_ALL   						= XACML1.ID_FUNCTION_ALL_OF_ALL;
+    public static final Identifier ID_FUNCTION_MAP  								= XACML1.ID_FUNCTION_MAP;
+    public static final Identifier ID_FUNCTION_X500NAME_MATCH        				= XACML1.ID_FUNCTION_X500NAME_MATCH;
+    public static final Identifier ID_FUNCTION_RFC822NAME_MATCH      				= XACML1.ID_FUNCTION_RFC822NAME_MATCH;
+    public static final Identifier ID_FUNCTION_STRING_REGEXP_MATCH   						= XACML1.ID_FUNCTION_STRING_REGEXP_MATCH;
+    public static final Identifier ID_FUNCTION_ANYURI_REGEXP_MATCH							= new IdentifierImpl(ID_FUNCTION, "anyURI-regexp-match");
+    public static final Identifier ID_FUNCTION_IPADDRESS_REGEXP_MATCH						= new IdentifierImpl(ID_FUNCTION, "ipAddress-regexp-match");
+    public static final Identifier ID_FUNCTION_DNSNAME_REGEXP_MATCH							= new IdentifierImpl(ID_FUNCTION, "dnsName-regexp-match");
+    public static final Identifier ID_FUNCTION_RFC822NAME_REGEXP_MATCH						= new IdentifierImpl(ID_FUNCTION, "rfc822Name-regexp-match");
+    public static final Identifier ID_FUNCTION_X500NAME_REGEXP_MATCH							= new IdentifierImpl(ID_FUNCTION, "x500Name-regexp-match");
 // the following xpath-node functions are optional in 3.0 and are NOT included in this implementation.  See the Implementation Notes.
 //	public static final Identifier ID_FUNCTION_XPATH_NODE_COUNT      						= XACML1.ID_FUNCTION_XPATH_NODE_COUNT;
 //	public static final Identifier ID_FUNCTION_XPATH_NODE_EQUAL      						= XACML1.ID_FUNCTION_XPATH_NODE_EQUAL;
 //	public static final Identifier ID_FUNCTION_XPATH_NODE_MATCH      						= XACML1.ID_FUNCTION_XPATH_NODE_MATCH;
-        public static final Identifier ID_FUNCTION_STRING_INTERSECTION   						= XACML1.ID_FUNCTION_STRING_INTERSECTION;
-        public static final Identifier ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF 				= XACML1.ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_STRING_UNION  								= XACML1.ID_FUNCTION_STRING_UNION;
-        public static final Identifier ID_FUNCTION_STRING_SUBSET 								= XACML1.ID_FUNCTION_STRING_SUBSET;
-        public static final Identifier ID_FUNCTION_STRING_SET_EQUALS     						= XACML1.ID_FUNCTION_STRING_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_BOOLEAN_INTERSECTION  						= XACML1.ID_FUNCTION_BOOLEAN_INTERSECTION;
-        public static final Identifier ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF        		= XACML1.ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_BOOLEAN_UNION 								= XACML1.ID_FUNCTION_BOOLEAN_UNION;
-        public static final Identifier ID_FUNCTION_BOOLEAN_SUBSET        						= XACML1.ID_FUNCTION_BOOLEAN_SUBSET;
-        public static final Identifier ID_FUNCTION_BOOLEAN_SET_EQUALS    						= XACML1.ID_FUNCTION_BOOLEAN_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_INTEGER_INTERSECTION  						= XACML1.ID_FUNCTION_INTEGER_INTERSECTION;
-        public static final Identifier ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF        		= XACML1.ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_INTEGER_UNION 								= XACML1.ID_FUNCTION_INTEGER_UNION;
-        public static final Identifier ID_FUNCTION_INTEGER_SUBSET        						= XACML1.ID_FUNCTION_INTEGER_SUBSET;
-        public static final Identifier ID_FUNCTION_INTEGER_SET_EQUALS    						= XACML1.ID_FUNCTION_INTEGER_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DOUBLE_INTERSECTION   						= XACML1.ID_FUNCTION_DOUBLE_INTERSECTION;
-        public static final Identifier ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF 				= XACML1.ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_DOUBLE_UNION  								= XACML1.ID_FUNCTION_DOUBLE_UNION;
-        public static final Identifier ID_FUNCTION_DOUBLE_SUBSET 								= XACML1.ID_FUNCTION_DOUBLE_SUBSET;
-        public static final Identifier ID_FUNCTION_DOUBLE_SET_EQUALS     						= XACML1.ID_FUNCTION_DOUBLE_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_TIME_INTERSECTION     						= XACML1.ID_FUNCTION_TIME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF   				= XACML1.ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_TIME_UNION    								= XACML1.ID_FUNCTION_TIME_UNION;
-        public static final Identifier ID_FUNCTION_TIME_SUBSET   								= XACML1.ID_FUNCTION_TIME_SUBSET;
-        public static final Identifier ID_FUNCTION_TIME_SET_EQUALS       						= XACML1.ID_FUNCTION_TIME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DATE_INTERSECTION     						= XACML1.ID_FUNCTION_DATE_INTERSECTION;
-        public static final Identifier ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF   				= XACML1.ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_DATE_UNION    								= XACML1.ID_FUNCTION_DATE_UNION;
-        public static final Identifier ID_FUNCTION_DATE_SUBSET   								= XACML1.ID_FUNCTION_DATE_SUBSET;
-        public static final Identifier ID_FUNCTION_DATE_SET_EQUALS       						= XACML1.ID_FUNCTION_DATE_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DATETIME_INTERSECTION 						= XACML1.ID_FUNCTION_DATETIME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF       		= XACML1.ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_DATETIME_UNION        						= XACML1.ID_FUNCTION_DATETIME_UNION;
-        public static final Identifier ID_FUNCTION_DATETIME_SUBSET       						= XACML1.ID_FUNCTION_DATETIME_SUBSET;
-        public static final Identifier ID_FUNCTION_DATETIME_SET_EQUALS   						= XACML1.ID_FUNCTION_DATETIME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_ANYURI_INTERSECTION   						= XACML1.ID_FUNCTION_ANYURI_INTERSECTION;
-        public static final Identifier ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF 				= XACML1.ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_ANYURI_UNION  								= XACML1.ID_FUNCTION_ANYURI_UNION;
-        public static final Identifier ID_FUNCTION_ANYURI_SUBSET 								= XACML1.ID_FUNCTION_ANYURI_SUBSET;
-        public static final Identifier ID_FUNCTION_ANYURI_SET_EQUALS     						= XACML1.ID_FUNCTION_ANYURI_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_HEXBINARY_INTERSECTION        				= XACML1.ID_FUNCTION_HEXBINARY_INTERSECTION;
-        public static final Identifier ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF      		= XACML1.ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_HEXBINARY_UNION       						= XACML1.ID_FUNCTION_HEXBINARY_UNION;
-        public static final Identifier ID_FUNCTION_HEXBINARY_SUBSET      						= XACML1.ID_FUNCTION_HEXBINARY_SUBSET;
-        public static final Identifier ID_FUNCTION_HEXBINARY_SET_EQUALS  						= XACML1.ID_FUNCTION_HEXBINARY_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_INTERSECTION     				= XACML1.ID_FUNCTION_BASE64BINARY_INTERSECTION;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF   		= XACML1.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_UNION    						= XACML1.ID_FUNCTION_BASE64BINARY_UNION;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_SUBSET   						= XACML1.ID_FUNCTION_BASE64BINARY_SUBSET;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_SET_EQUALS       				= XACML1.ID_FUNCTION_BASE64BINARY_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_INTERSECTION  				= XACML1.ID_FUNCTION_DAYTIMEDURATION_INTERSECTION;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF       = XACML1.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_UNION 						= XACML1.ID_FUNCTION_DAYTIMEDURATION_UNION;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SUBSET        				= XACML1.ID_FUNCTION_DAYTIMEDURATION_SUBSET;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS    				= XACML1.ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_INTERSECTION        		= XACML1.ID_FUNCTION_YEARMONTHDURATION_INTERSECTION;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF		= XACML1.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_UNION       				= XACML1.ID_FUNCTION_YEARMONTHDURATION_UNION;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SUBSET      				= XACML1.ID_FUNCTION_YEARMONTHDURATION_SUBSET;
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS  				= XACML1.ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_X500NAME_INTERSECTION 						= XACML1.ID_FUNCTION_X500NAME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF       		= XACML1.ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_X500NAME_UNION        						= XACML1.ID_FUNCTION_X500NAME_UNION;
-        public static final Identifier ID_FUNCTION_X500NAME_SUBSET       						= XACML1.ID_FUNCTION_X500NAME_SUBSET;
-        public static final Identifier ID_FUNCTION_X500NAME_SET_EQUALS   						= XACML1.ID_FUNCTION_X500NAME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_RFC822NAME_INTERSECTION       				= XACML1.ID_FUNCTION_RFC822NAME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF     		= XACML1.ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_RFC822NAME_UNION      						= XACML1.ID_FUNCTION_RFC822NAME_UNION;
-        public static final Identifier ID_FUNCTION_RFC822NAME_SUBSET     						= XACML1.ID_FUNCTION_RFC822NAME_SUBSET;
-        public static final Identifier ID_FUNCTION_RFC822NAME_SET_EQUALS 						= XACML1.ID_FUNCTION_RFC822NAME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_IPADDRESS_INTERSECTION       				= new IdentifierImpl(ID_FUNCTION, "ipAddress-intersection");
-        public static final Identifier ID_FUNCTION_IPADDRESS_AT_LEAST_ONE_MEMBER_OF     		= new IdentifierImpl(ID_FUNCTION, "ipAddress-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_IPADDRESS_UNION      						= new IdentifierImpl(ID_FUNCTION, "ipAddress-union");
-        public static final Identifier ID_FUNCTION_IPADDRESS_SUBSET     						= new IdentifierImpl(ID_FUNCTION, "ipAddress-subset");
-        public static final Identifier ID_FUNCTION_IPADDRESS_SET_EQUALS 						= new IdentifierImpl(ID_FUNCTION, "ipAddress-set-equals");
-        public static final Identifier ID_FUNCTION_DNSNAME_INTERSECTION       					= new IdentifierImpl(ID_FUNCTION, "dnsName-intersection");
-        public static final Identifier ID_FUNCTION_DNSNAME_AT_LEAST_ONE_MEMBER_OF     			= new IdentifierImpl(ID_FUNCTION, "dnsName-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_DNSNAME_UNION      							= new IdentifierImpl(ID_FUNCTION, "dnsName-union");
-        public static final Identifier ID_FUNCTION_DNSNAME_SUBSET     							= new IdentifierImpl(ID_FUNCTION, "dnsName-subset");
-        public static final Identifier ID_FUNCTION_DNSNAME_SET_EQUALS 							= new IdentifierImpl(ID_FUNCTION, "dnsName-set-equals");
+    public static final Identifier ID_FUNCTION_STRING_INTERSECTION   						= XACML1.ID_FUNCTION_STRING_INTERSECTION;
+    public static final Identifier ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF 				= XACML1.ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_STRING_UNION  								= XACML1.ID_FUNCTION_STRING_UNION;
+    public static final Identifier ID_FUNCTION_STRING_SUBSET 								= XACML1.ID_FUNCTION_STRING_SUBSET;
+    public static final Identifier ID_FUNCTION_STRING_SET_EQUALS     						= XACML1.ID_FUNCTION_STRING_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_BOOLEAN_INTERSECTION  						= XACML1.ID_FUNCTION_BOOLEAN_INTERSECTION;
+    public static final Identifier ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF        		= XACML1.ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_BOOLEAN_UNION 								= XACML1.ID_FUNCTION_BOOLEAN_UNION;
+    public static final Identifier ID_FUNCTION_BOOLEAN_SUBSET        						= XACML1.ID_FUNCTION_BOOLEAN_SUBSET;
+    public static final Identifier ID_FUNCTION_BOOLEAN_SET_EQUALS    						= XACML1.ID_FUNCTION_BOOLEAN_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_INTEGER_INTERSECTION  						= XACML1.ID_FUNCTION_INTEGER_INTERSECTION;
+    public static final Identifier ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF        		= XACML1.ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_INTEGER_UNION 								= XACML1.ID_FUNCTION_INTEGER_UNION;
+    public static final Identifier ID_FUNCTION_INTEGER_SUBSET        						= XACML1.ID_FUNCTION_INTEGER_SUBSET;
+    public static final Identifier ID_FUNCTION_INTEGER_SET_EQUALS    						= XACML1.ID_FUNCTION_INTEGER_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DOUBLE_INTERSECTION   						= XACML1.ID_FUNCTION_DOUBLE_INTERSECTION;
+    public static final Identifier ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF 				= XACML1.ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_DOUBLE_UNION  								= XACML1.ID_FUNCTION_DOUBLE_UNION;
+    public static final Identifier ID_FUNCTION_DOUBLE_SUBSET 								= XACML1.ID_FUNCTION_DOUBLE_SUBSET;
+    public static final Identifier ID_FUNCTION_DOUBLE_SET_EQUALS     						= XACML1.ID_FUNCTION_DOUBLE_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_TIME_INTERSECTION     						= XACML1.ID_FUNCTION_TIME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF   				= XACML1.ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_TIME_UNION    								= XACML1.ID_FUNCTION_TIME_UNION;
+    public static final Identifier ID_FUNCTION_TIME_SUBSET   								= XACML1.ID_FUNCTION_TIME_SUBSET;
+    public static final Identifier ID_FUNCTION_TIME_SET_EQUALS       						= XACML1.ID_FUNCTION_TIME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DATE_INTERSECTION     						= XACML1.ID_FUNCTION_DATE_INTERSECTION;
+    public static final Identifier ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF   				= XACML1.ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_DATE_UNION    								= XACML1.ID_FUNCTION_DATE_UNION;
+    public static final Identifier ID_FUNCTION_DATE_SUBSET   								= XACML1.ID_FUNCTION_DATE_SUBSET;
+    public static final Identifier ID_FUNCTION_DATE_SET_EQUALS       						= XACML1.ID_FUNCTION_DATE_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DATETIME_INTERSECTION 						= XACML1.ID_FUNCTION_DATETIME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF       		= XACML1.ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_DATETIME_UNION        						= XACML1.ID_FUNCTION_DATETIME_UNION;
+    public static final Identifier ID_FUNCTION_DATETIME_SUBSET       						= XACML1.ID_FUNCTION_DATETIME_SUBSET;
+    public static final Identifier ID_FUNCTION_DATETIME_SET_EQUALS   						= XACML1.ID_FUNCTION_DATETIME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_ANYURI_INTERSECTION   						= XACML1.ID_FUNCTION_ANYURI_INTERSECTION;
+    public static final Identifier ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF 				= XACML1.ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_ANYURI_UNION  								= XACML1.ID_FUNCTION_ANYURI_UNION;
+    public static final Identifier ID_FUNCTION_ANYURI_SUBSET 								= XACML1.ID_FUNCTION_ANYURI_SUBSET;
+    public static final Identifier ID_FUNCTION_ANYURI_SET_EQUALS     						= XACML1.ID_FUNCTION_ANYURI_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_HEXBINARY_INTERSECTION        				= XACML1.ID_FUNCTION_HEXBINARY_INTERSECTION;
+    public static final Identifier ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF      		= XACML1.ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_HEXBINARY_UNION       						= XACML1.ID_FUNCTION_HEXBINARY_UNION;
+    public static final Identifier ID_FUNCTION_HEXBINARY_SUBSET      						= XACML1.ID_FUNCTION_HEXBINARY_SUBSET;
+    public static final Identifier ID_FUNCTION_HEXBINARY_SET_EQUALS  						= XACML1.ID_FUNCTION_HEXBINARY_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_INTERSECTION     				= XACML1.ID_FUNCTION_BASE64BINARY_INTERSECTION;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF   		= XACML1.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_UNION    						= XACML1.ID_FUNCTION_BASE64BINARY_UNION;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_SUBSET   						= XACML1.ID_FUNCTION_BASE64BINARY_SUBSET;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_SET_EQUALS       				= XACML1.ID_FUNCTION_BASE64BINARY_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_INTERSECTION  				= XACML1.ID_FUNCTION_DAYTIMEDURATION_INTERSECTION;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF       = XACML1.ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_UNION 						= XACML1.ID_FUNCTION_DAYTIMEDURATION_UNION;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SUBSET        				= XACML1.ID_FUNCTION_DAYTIMEDURATION_SUBSET;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS    				= XACML1.ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_INTERSECTION        		= XACML1.ID_FUNCTION_YEARMONTHDURATION_INTERSECTION;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF		= XACML1.ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_UNION       				= XACML1.ID_FUNCTION_YEARMONTHDURATION_UNION;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SUBSET      				= XACML1.ID_FUNCTION_YEARMONTHDURATION_SUBSET;
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS  				= XACML1.ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_X500NAME_INTERSECTION 						= XACML1.ID_FUNCTION_X500NAME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF       		= XACML1.ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_X500NAME_UNION        						= XACML1.ID_FUNCTION_X500NAME_UNION;
+    public static final Identifier ID_FUNCTION_X500NAME_SUBSET       						= XACML1.ID_FUNCTION_X500NAME_SUBSET;
+    public static final Identifier ID_FUNCTION_X500NAME_SET_EQUALS   						= XACML1.ID_FUNCTION_X500NAME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_RFC822NAME_INTERSECTION       				= XACML1.ID_FUNCTION_RFC822NAME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF     		= XACML1.ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_RFC822NAME_UNION      						= XACML1.ID_FUNCTION_RFC822NAME_UNION;
+    public static final Identifier ID_FUNCTION_RFC822NAME_SUBSET     						= XACML1.ID_FUNCTION_RFC822NAME_SUBSET;
+    public static final Identifier ID_FUNCTION_RFC822NAME_SET_EQUALS 						= XACML1.ID_FUNCTION_RFC822NAME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_IPADDRESS_INTERSECTION       				= new IdentifierImpl(ID_FUNCTION, "ipAddress-intersection");
+    public static final Identifier ID_FUNCTION_IPADDRESS_AT_LEAST_ONE_MEMBER_OF     		= new IdentifierImpl(ID_FUNCTION, "ipAddress-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_IPADDRESS_UNION      						= new IdentifierImpl(ID_FUNCTION, "ipAddress-union");
+    public static final Identifier ID_FUNCTION_IPADDRESS_SUBSET     						= new IdentifierImpl(ID_FUNCTION, "ipAddress-subset");
+    public static final Identifier ID_FUNCTION_IPADDRESS_SET_EQUALS 						= new IdentifierImpl(ID_FUNCTION, "ipAddress-set-equals");
+    public static final Identifier ID_FUNCTION_DNSNAME_INTERSECTION       					= new IdentifierImpl(ID_FUNCTION, "dnsName-intersection");
+    public static final Identifier ID_FUNCTION_DNSNAME_AT_LEAST_ONE_MEMBER_OF     			= new IdentifierImpl(ID_FUNCTION, "dnsName-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_DNSNAME_UNION      							= new IdentifierImpl(ID_FUNCTION, "dnsName-union");
+    public static final Identifier ID_FUNCTION_DNSNAME_SUBSET     							= new IdentifierImpl(ID_FUNCTION, "dnsName-subset");
+    public static final Identifier ID_FUNCTION_DNSNAME_SET_EQUALS 							= new IdentifierImpl(ID_FUNCTION, "dnsName-set-equals");
 
-        // deprecated in 3.0
-        public static final Identifier ID_FUNCTION_URI_STRING_CONCATENATE						= new IdentifierImpl(ID_FUNCTION, "uri-string-concatenate");
+    // deprecated in 3.0
+    public static final Identifier ID_FUNCTION_URI_STRING_CONCATENATE						= new IdentifierImpl(ID_FUNCTION, "uri-string-concatenate");
 
-        /*
-         * Profiles
-         */
-        public static final Identifier ID_PROFILES	= new IdentifierImpl(ID_XACML, XACML.PROFILES);
-        public static final Identifier ID_PROFILE	= new IdentifierImpl(ID_XACML, XACML.PROFILE);
-        
-        /*
-         * Core and hierarchical role based access control (RBAC) profile of XACML v2.0
-         */
-        public static final Identifier ID_PROFILES_RBAC_CORE_HIERARCHICAL				= new IdentifierImpl(ID_PROFILES, "rbac:core-hierarchical");
-        public static final Identifier ID_SUBJECT_ROLE									= new IdentifierImpl(ID_SUBJECT, "role");
+    /*
+     * Profiles
+     */
+    public static final Identifier ID_PROFILES	= new IdentifierImpl(ID_XACML, XACML.PROFILES);
+    public static final Identifier ID_PROFILE	= new IdentifierImpl(ID_XACML, XACML.PROFILE);
+
+    /*
+     * Core and hierarchical role based access control (RBAC) profile of XACML v2.0
+     */
+    public static final Identifier ID_PROFILES_RBAC_CORE_HIERARCHICAL				= new IdentifierImpl(ID_PROFILES, "rbac:core-hierarchical");
+    public static final Identifier ID_SUBJECT_ROLE									= new IdentifierImpl(ID_SUBJECT, "role");
     public static final Identifier ID_SUBJECT_CATEGORY_ROLE_ENABLEMENT_AUTHORITY	= new IdentifierImpl(ID_SUBJECT_CATEGORY, "role-enablement-authority");
     public static final Identifier ID_ACTIONS_HASPRIVILEGESFROLE					= new IdentifierImpl(ID_ACTIONS, "hasPrivilegesOfRole");
     public static final Identifier ID_ACTIONS_ENABLEROLE							= new IdentifierImpl(ID_ACTIONS, "enableRole");
 
-        /*
-         * Hierarchical resource profile of XACML v2.0
-         */
-        public static final Identifier ID_PROFILE_HIERARCHICAL												= new IdentifierImpl(ID_PROFILE, "hierarchical");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_ID									= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "xml-node-id");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_ID								= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "non-xml-node-id");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ									= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "xml-node-req");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ_RESOURCE_PARENT					= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_XML_NODE_REQ, "resource-parent");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ_RESOURCE_ANCESTOR				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_XML_NODE_REQ, "resource-ancestor");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ_RESOURCE_ANCESTOR_OR_SELF		= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_XML_NODE_REQ, "resource-ancestor-or-self");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ								= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "non-xml-node-req");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_PARENT				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-parent");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_ANCESTOR			= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-ancestor");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_ANCESTOR_OR_SELF	= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-ancestor-or-self");
+    /*
+     * Hierarchical resource profile of XACML v2.0
+     */
+    public static final Identifier ID_PROFILE_HIERARCHICAL												= new IdentifierImpl(ID_PROFILE, "hierarchical");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_ID									= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "xml-node-id");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_ID								= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "non-xml-node-id");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ									= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "xml-node-req");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ_RESOURCE_PARENT					= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_XML_NODE_REQ, "resource-parent");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ_RESOURCE_ANCESTOR				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_XML_NODE_REQ, "resource-ancestor");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ_RESOURCE_ANCESTOR_OR_SELF		= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_XML_NODE_REQ, "resource-ancestor-or-self");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ								= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "non-xml-node-req");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_PARENT				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-parent");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_ANCESTOR			= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-ancestor");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_ANCESTOR_OR_SELF	= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-ancestor-or-self");
 
-        public static final Identifier ID_RESOURCE_DOCUMENT_ID					= new IdentifierImpl(ID_RESOURCE, "document-id");
-        public static final Identifier ID_RESOURCE_RESOURCE_PARENT				= new IdentifierImpl(ID_RESOURCE, "resource-parent");
-        public static final Identifier ID_RESOURCE_RESOURCE_ANCESTOR			= new IdentifierImpl(ID_RESOURCE, "resource-ancestor");
-        public static final Identifier ID_RESOURCE_RESOURCE_ANCESTOR_OR_SELF	= new IdentifierImpl(ID_RESOURCE, "resource-ancestor-or-self");
-        
-        /*
-         * Privacy ppolicy profile of XACML v2.0
-         * TODO: No URI found
-         */
-        
-        /*
-         * SAML 2.0 profile of XACML v2.0
-         */
-        /*
-         * SAML 2.0 Profile of XACML, Version 2.0
-         */
-        public static final Identifier ID_PROFILE_SAML2_0_V2									= new IdentifierImpl(ID_PROFILE, "saml2.0:v2");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_POLICIES							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "policies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_ADVICESAML							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "adviceSAML");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZTOKEN							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzToken");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_ATTRS_ALL							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "attrs:all");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "SOAP");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_AUTHZQUERY					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "authzQuery");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_ATTRASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "attrAssertion");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION						= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecision");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_NOPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "noPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_WITHPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "withPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST				= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecisionWSTrust");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_WITHPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "withPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_NOPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "noPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "schema");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_ASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "assertion");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_PROTOCOL					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "protocol");
-        
-        /*
-         * XML Digital Signature profile of XACML v2.0
-         * TODO: No URI found
-         */
-        
-        /*
-         * Cross-Enterprise Security and Privacy Authorization (SXPA) Profile of XACML v2.0 for Healthcare Version 1.0
-         * TODO: No URI found
-         */
-        
+    public static final Identifier ID_RESOURCE_DOCUMENT_ID					= new IdentifierImpl(ID_RESOURCE, "document-id");
+    public static final Identifier ID_RESOURCE_RESOURCE_PARENT				= new IdentifierImpl(ID_RESOURCE, "resource-parent");
+    public static final Identifier ID_RESOURCE_RESOURCE_ANCESTOR			= new IdentifierImpl(ID_RESOURCE, "resource-ancestor");
+    public static final Identifier ID_RESOURCE_RESOURCE_ANCESTOR_OR_SELF	= new IdentifierImpl(ID_RESOURCE, "resource-ancestor-or-self");
+
+    /*
+     * Privacy ppolicy profile of XACML v2.0
+     * TODO: No URI found
+     */
+
+    /*
+     * SAML 2.0 profile of XACML v2.0
+     */
+    /*
+     * SAML 2.0 Profile of XACML, Version 2.0
+     */
+    public static final Identifier ID_PROFILE_SAML2_0_V2									= new IdentifierImpl(ID_PROFILE, "saml2.0:v2");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_POLICIES							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "policies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_ADVICESAML							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "adviceSAML");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZTOKEN							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzToken");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_ATTRS_ALL							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "attrs:all");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "SOAP");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_AUTHZQUERY					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "authzQuery");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_ATTRASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "attrAssertion");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION						= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecision");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_NOPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "noPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_WITHPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "withPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST				= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecisionWSTrust");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_WITHPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "withPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_NOPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "noPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "schema");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_ASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "assertion");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_PROTOCOL					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "protocol");
+
+    /*
+     * XML Digital Signature profile of XACML v2.0
+     * TODO: No URI found
+     */
+
+    /*
+     * Cross-Enterprise Security and Privacy Authorization (SXPA) Profile of XACML v2.0 for Healthcare Version 1.0
+     * TODO: No URI found
+     */
+
     /*
      * XACML v3.0 Privacy Policy Profile Version 1.0
      */
-        public static final Identifier ID_RESOURCE_PURPOSE	= new IdentifierImpl(ID_RESOURCE, "purpose");
-        public static final Identifier ID_ACTION_PURPOSE	= new IdentifierImpl(ID_ACTION, "purpose");
-        
+    public static final Identifier ID_RESOURCE_PURPOSE	= new IdentifierImpl(ID_RESOURCE, "purpose");
+    public static final Identifier ID_ACTION_PURPOSE	= new IdentifierImpl(ID_ACTION, "purpose");
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML3.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML3.java
index 2909285..3750bab 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML3.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/XACML3.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,179 +35,179 @@
 /**
  * XACML3 contains the constants (<code>String</code>s, <code>URI</code>s {@link com.att.research.xacml.api.Identifier}s that are
  * defined in the XACML 2.0 Specification: "eXtensible Access Control Markup Language (XACML) Version 3.0".
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class XACML3 {
-        
-        protected XACML3() {
-        }
 
-        /*
-         * Namespace and Schema constants
-         */
-        public static final String	SCHEMA_LOCATION					= "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd";
-        public static final String	XMLNS							= "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17";
-        public static final String	XMLNS_XSI						= "http://www.w3.org/2001/XMLSchema-instance";
-        
-        /*
-         * 10.2.1 Schema elements
-         * DOM Elements and Attributes
-         * TODO: Copy any of these to the XACML1 and XACML2 constants object if they are available there, and then reference them here
-         */
-        public static final String	ELEMENT_ADVICE					= "Advice";
-        public static final String	ELEMENT_ADVICEEXPRESSION		= "AdviceExpression";
-        public static final String	ELEMENT_ADVICEEXPRESSIONS		= "AdviceExpressions";
-        public static final String	ELEMENT_ALLOF					= "AllOf";
-        public static final String	ELEMENT_ANYOF					= "AnyOf";
-        public static final String	ELEMENT_APPLY					= "Apply";
-        public static final String	ELEMENT_ASSOCIATEDADVICE		= "AssociatedAdvice";
-        public static final String	ELEMENT_ATTRIBUTE				= "Attribute";
-        public static final String	ELEMENT_ATTRIBUTEASSIGNMENT		= "AttributeAssignment";
-        public static final String	ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION	= "AttributeAssignmentExpression";
-        public static final String	ELEMENT_ATTRIBUTEDESIGNATOR		= "AttributeDesignator";
-        public static final String	ELEMENT_ATTRIBUTESELECTOR		= "AttributeSelector";
-        public static final String	ELEMENT_ATTRIBUTESREFERENCE		= "AttributesReference";
-        public static final String	ELEMENT_ATTRIBUTES				= "Attributes";
-        public static final String	ELEMENT_ATTRIBUTEVALUE			= "AttributeValue";
-        public static final String	ELEMENT_CONDITION				= "Condition";
-        public static final String	ELEMENT_COMBINERPARAMETER		= "CombinerParameter";
-        public static final String	ELEMENT_COMBINERPARAMETERS		= "CombinerParameters";
-        public static final String	ELEMENT_CONTENT					= "Content";
-        public static final String	ELEMENT_DECISION				= "Decision";
-        public static final String	ELEMENT_DESCRIPTION				= "Description";
-        public static final String	ELEMENT_EXPRESSION				= "Expression";
-        public static final String	ELEMENT_FUNCTION				= "Function";
-        public static final String	ELEMENT_MATCH					= "Match";
-        public static final String	ELEMENT_MISSINGATTRIBUTEDETAIL	= "MissingAttributeDetail";
-        public static final String	ELEMENT_MULTIREQUESTS			= "MultiRequests";
-        public static final String	ELEMENT_OBLIGATION				= "Obligation";
-        public static final String	ELEMENT_OBLIGATIONEXPRESSION	= "ObligationExpression";
-        public static final String	ELEMENT_OBLIGATIONEXPRESSIONS	= "ObligationExpressions";
-        public static final String	ELEMENT_OBLIGATIONS				= "Obligations";
-        public static final String	ELEMENT_POLICY					= "Policy";
-        public static final String	ELEMENT_POLICYCOMBINERPARAMETERS	= "PolicyCombinerParameters";
-        public static final String	ELEMENT_POLICYDEFAULTS			= "PolicyDefaults";
-        public static final String	ELEMENT_POLICYIDENTIFIERLIST	= "PolicyIdentifierList";
-        public static final String	ELEMENT_POLICYIDREFERENCE		= "PolicyIdReference";
-        public static final String	ELEMENT_POLICYISSUER			= "PolicyIssuer";
-        public static final String	ELEMENT_POLICYSET				= "PolicySet";
-        public static final String	ELEMENT_POLICYSETCOMBINERPARAMETERS	= "PolicySetCombinerParameters";
-        public static final String	ELEMENT_POLICYSETDEFAULTS		= "PolicySetDefaults";
-        public static final String	ELEMENT_POLICYSETIDREFERENCE	= "PolicySetIdReference";
-        public static final String	ELEMENT_REQUEST					= "Request";
-        public static final String	ELEMENT_REQUESTDEFAULTS			= "RequestDefaults";
-        public static final String	ELEMENT_REQUESTREFERENCE		= "RequestReference";
-        public static final String	ELEMENT_RESPONSE				= "Response";
-        public static final String	ELEMENT_RESULT					= "Result";
-        public static final String	ELEMENT_RULE					= "Rule";
-        public static final String	ELEMENT_RULECOMBINERPARAMETERS	= "RuleCombinerParameters";
-        public static final String	ELEMENT_STATUS					= "Status";
-        public static final String	ELEMENT_STATUSCODE				= "StatusCode";
-        public static final String	ELEMENT_STATUSDETAIL			= "StatusDetail";
-        public static final String	ELEMENT_STATUSMESSAGE			= "StatusMessage";
-        public static final String	ELEMENT_TARGET					= "Target";
-        public static final String	ELEMENT_VARIABLEDEFINITION		= "VariableDefinition";
-        public static final String	ELEMENT_VARIABLEREFERENCE		= "VariableReference";
-        public static final String	ELEMENT_XPATHVERSION			= "XPathVersion";
-        
-        public static final String	ATTRIBUTE_ADVICEID				= "AdviceId";
-        public static final String	ATTRIBUTE_APPLIESTO				= "AppliesTo";
-        public static final String	ATTRIBUTE_ATTRIBUTEID			= "AttributeId";
-        public static final String	ATTRIBUTE_CATEGORY				= "Category";
-        public static final String	ATTRIBUTE_COMBINEDDECISION		= "CombinedDecision";
-        public static final String	ATTRIBUTE_CONTEXTSELECTORID		= "ContextSelectorId";
-        public static final String	ATTRIBUTE_DATATYPE				= "DataType";
-        public static final String	ATTRIBUTE_EARLIESTVERSION		= "EarliestVersion";
-        public static final String	ATTRIBUTE_EFFECT				= "Effect";
-        public static final String	ATTRIBUTE_FULFILLON				= "FulfillOn";
-        public static final String	ATTRIBUTE_FUNCTIONID			= "FunctionId";
-        public static final String	ATTRIBUTE_LATESTVERSION			= "LatestVersion";
-        public static final String	ATTRIBUTE_ID					= "id";					// xml:id
-        public static final String	ATTRIBUTE_INCLUDEINRESULT		= "IncludeInResult";
-        public static final String	ATTRIBUTE_ISSUER				= "Issuer";
-        public static final String	ATTRIBUTE_MATCHID				= "MatchId";
-        public static final String	ATTRIBUTE_MAXDELEGATIONDEPTH	= "MaxDelegationDepth";
-        public static final String	ATTRIBUTE_MUSTBEPRESENT			= "MustBePresent";
-        public static final String	ATTRIBUTE_OBLIGATIONID			= "ObligationId";
-        public static final String	ATTRIBUTE_PARAMETERNAME			= "ParameterName";
-        public static final String	ATTRIBUTE_PATH					= "Path";
-        public static final String	ATTRIBUTE_POLICYCOMBININGALGID	= "PolicyCombiningAlgId";
-        public static final String	ATTRIBUTE_POLICYID				= "PolicyId";
-        public static final String	ATTRIBUTE_POLICYIDREF			= "PolicyIdRef";
-        public static final String	ATTRIBUTE_POLICYSETID			= "PolicySetId";
-        public static final String	ATTRIBUTE_POLICYSETIDREF		= "PolicySetIdRef";
-        public static final String	ATTRIBUTE_REFERENCEID			= "ReferenceId";
-        public static final String	ATTRIBUTE_RETURNPOLICYIDLIST	= "ReturnPolicyIdList";
-        public static final String	ATTRIBUTE_RULECOMBININGALGID	= "RuleCombiningAlgId";
-        public static final String	ATTRIBUTE_RULEID				= "RuleId";
-        public static final String	ATTRIBUTE_RULEIDREF				= "RuleIdRef";
-        public static final String	ATTRIBUTE_VALUE					= "Value";
-        public static final String	ATTRIBUTE_VARIABLEID			= "VariableId";
-        public static final String	ATTRIBUTE_VERSION				= "Version";
-        public static final String	ATTRIBUTE_XPATHCATEGORY			= "XPathCategory";
-        
-        /*
-         * 10.2.2 Identifier Prefixes
-         */
-        public static final String VERSION							= "3.0";
-        public static final Identifier ID_XACML						= new IdentifierImpl(XACML.ID_XACML, VERSION);
-        public static final Identifier ID_CONFORMANCE_TEST			= XACML2.ID_CONFORMANCE_TEST;
-        public static final Identifier ID_CONTEXT					= XACML2.ID_CONTEXT;
-        public static final Identifier ID_EXAMPLE					= XACML2.ID_EXAMPLE;
-        public static final Identifier ID_FUNCTION10				= XACML1.ID_FUNCTION;
-        public static final Identifier ID_FUNCTION20				= XACML2.ID_FUNCTION;
-        public static final Identifier ID_FUNCTION					= new IdentifierImpl(ID_XACML, XACML.FUNCTION);
-        public static final Identifier ID_POLICY					= XACML2.ID_POLICY;
-        public static final Identifier ID_SUBJECT					= XACML1.ID_SUBJECT;
-        public static final Identifier ID_RESOURCE					= XACML1.ID_RESOURCE;
-        public static final Identifier ID_ACTION					= XACML1.ID_ACTION;
-        public static final Identifier ID_ENVIRONMENT				= XACML1.ID_ENVIRONMENT;
-        public static final Identifier ID_STATUS					= XACML1.ID_STATUS;
-        public static final Identifier ID_ATTRIBUTE_CATEGORY		= new IdentifierImpl(ID_XACML, "attribute-category");
-        
-        /*
-         * 10.2.3 Algorithms
-         */
-        public static final Identifier ID_RULE_COMBINING_ALGORITHM			= new IdentifierImpl(ID_XACML,"rule-combining-algorithm");
-        public static final Identifier ID_POLICY_COMBINING_ALGORITHM		= new IdentifierImpl(ID_XACML, "policy-combining-algorithm");
-        
-        public static final Identifier ID_RULE_DENY_OVERRIDES				= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, XACML1.DENY_OVERRIDES);
-        public static final Identifier ID_POLICY_DENY_OVERRIDES				= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, XACML1.DENY_OVERRIDES);
-        public static final Identifier ID_RULE_PERMIT_OVERRIDES				= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, XACML1.PERMIT_OVERRIDES);
-        public static final Identifier ID_POLICY_PERMIT_OVERRIDES			= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, XACML1.PERMIT_OVERRIDES);
-        public static final Identifier ID_RULE_FIRST_APPLICABLE				= XACML1.ID_RULE_FIRST_APPLICABLE;
-        public static final Identifier ID_POLICY_FIRST_APPLICABLE			= XACML1.ID_POLICY_FIRST_APPLICABLE;
-        public static final Identifier ID_RULE_ONLY_ONE_APPLICABLE			= XACML1.ID_RULE_ONLY_ONE_APPLICABLE;
-        public static final Identifier ID_POLICY_ONLY_ONE_APPLICABLE		= XACML1.ID_POLICY_ONLY_ONE_APPLICABLE;
-        public static final Identifier ID_RULE_ORDERED_DENY_OVERRIDES		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, XACML1.ORDERED_DENY_OVERRIDES);
-        public static final Identifier ID_POLICY_ORDERED_DENY_OVERRIDES		= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, XACML1.ORDERED_DENY_OVERRIDES);
-        public static final Identifier ID_RULE_ORDERED_PERMIT_OVERRIDES		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, XACML1.ORDERED_PERMIT_OVERRIDES);
-        public static final Identifier ID_POLICY_ORDERED_PERMIT_OVERRIDES	= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, XACML1.ORDERED_PERMIT_OVERRIDES);
-        public static final String DENY_UNLESS_PERMIT						= "deny-unless-permit";
-        public static final Identifier ID_RULE_DENY_UNLESS_PERMIT			= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, DENY_UNLESS_PERMIT);
-        public static final Identifier ID_POLICY_DENY_UNLESS_PERMIT			= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, DENY_UNLESS_PERMIT);
-        public static final String PERMIT_UNLESS_DENY						= "permit-unless-deny";
-        public static final Identifier ID_RULE_PERMIT_UNLESS_DENY			= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, PERMIT_UNLESS_DENY);
-        public static final Identifier ID_POLICY_PERMIT_UNLESS_DENY			= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, PERMIT_UNLESS_DENY);
-        
-        public static final Identifier ID_RULE_LEGACY_DENY_OVERRIDES				= XACML1.ID_RULE_DENY_OVERRIDES;
-        public static final Identifier ID_POLICY_LEGACY_DENY_OVERRIDES				= XACML1.ID_POLICY_DENY_OVERRIDES;
-        public static final Identifier ID_RULE_LEGACY_PERMIT_OVERRIDES				= XACML1.ID_RULE_PERMIT_OVERRIDES;
-        public static final Identifier ID_POLICY_LEGACY_PERMIT_OVERRIDES			= XACML1.ID_POLICY_PERMIT_OVERRIDES;
-        public static final Identifier ID_RULE_LEGACY_ORDERED_DENY_OVERRIDES		= XACML1.ID_RULE_ORDERED_DENY_OVERRIDES;
-        public static final Identifier ID_POLICY_LEGACY_ORDERED_DENY_OVERRIDES		= XACML1.ID_POLICY_ORDERED_DENY_OVERRIDES;
-        public static final Identifier ID_RULE_LEGACY_ORDERED_PERMIT_OVERRIDES		= XACML1.ID_RULE_ORDERED_PERMIT_OVERRIDES;
-        public static final Identifier ID_POLICY_LEGACY_ORDERED_PERMIT_OVERRIDES	= XACML1.ID_POLICY_ORDERED_PERMIT_OVERRIDES;
-        
-        /*
-         * 10.2.4 Status Codes
-         */
-        public static final Identifier ID_STATUS_MISSING_ATTRIBUTE	= XACML1.ID_STATUS_MISSING_ATTRIBUTE;
-        public static final Identifier ID_STATUS_OK					= XACML1.ID_STATUS_OK;
-        public static final Identifier ID_STATUS_PROCESSING_ERROR	= XACML1.ID_STATUS_PROCESSING_ERROR;
-        public static final Identifier ID_STATUS_SYNTAX_ERROR		= XACML1.ID_STATUS_SYNTAX_ERROR;
+    protected XACML3() {
+    }
+
+    /*
+     * Namespace and Schema constants
+     */
+    public static final String	SCHEMA_LOCATION					= "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17 http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd";
+    public static final String	XMLNS							= "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17";
+    public static final String	XMLNS_XSI						= "http://www.w3.org/2001/XMLSchema-instance";
+
+    /*
+     * 10.2.1 Schema elements
+     * DOM Elements and Attributes
+     * TODO: Copy any of these to the XACML1 and XACML2 constants object if they are available there, and then reference them here
+     */
+    public static final String	ELEMENT_ADVICE					= "Advice";
+    public static final String	ELEMENT_ADVICEEXPRESSION		= "AdviceExpression";
+    public static final String	ELEMENT_ADVICEEXPRESSIONS		= "AdviceExpressions";
+    public static final String	ELEMENT_ALLOF					= "AllOf";
+    public static final String	ELEMENT_ANYOF					= "AnyOf";
+    public static final String	ELEMENT_APPLY					= "Apply";
+    public static final String	ELEMENT_ASSOCIATEDADVICE		= "AssociatedAdvice";
+    public static final String	ELEMENT_ATTRIBUTE				= "Attribute";
+    public static final String	ELEMENT_ATTRIBUTEASSIGNMENT		= "AttributeAssignment";
+    public static final String	ELEMENT_ATTRIBUTEASSIGNMENTEXPRESSION	= "AttributeAssignmentExpression";
+    public static final String	ELEMENT_ATTRIBUTEDESIGNATOR		= "AttributeDesignator";
+    public static final String	ELEMENT_ATTRIBUTESELECTOR		= "AttributeSelector";
+    public static final String	ELEMENT_ATTRIBUTESREFERENCE		= "AttributesReference";
+    public static final String	ELEMENT_ATTRIBUTES				= "Attributes";
+    public static final String	ELEMENT_ATTRIBUTEVALUE			= "AttributeValue";
+    public static final String	ELEMENT_CONDITION				= "Condition";
+    public static final String	ELEMENT_COMBINERPARAMETER		= "CombinerParameter";
+    public static final String	ELEMENT_COMBINERPARAMETERS		= "CombinerParameters";
+    public static final String	ELEMENT_CONTENT					= "Content";
+    public static final String	ELEMENT_DECISION				= "Decision";
+    public static final String	ELEMENT_DESCRIPTION				= "Description";
+    public static final String	ELEMENT_EXPRESSION				= "Expression";
+    public static final String	ELEMENT_FUNCTION				= "Function";
+    public static final String	ELEMENT_MATCH					= "Match";
+    public static final String	ELEMENT_MISSINGATTRIBUTEDETAIL	= "MissingAttributeDetail";
+    public static final String	ELEMENT_MULTIREQUESTS			= "MultiRequests";
+    public static final String	ELEMENT_OBLIGATION				= "Obligation";
+    public static final String	ELEMENT_OBLIGATIONEXPRESSION	= "ObligationExpression";
+    public static final String	ELEMENT_OBLIGATIONEXPRESSIONS	= "ObligationExpressions";
+    public static final String	ELEMENT_OBLIGATIONS				= "Obligations";
+    public static final String	ELEMENT_POLICY					= "Policy";
+    public static final String	ELEMENT_POLICYCOMBINERPARAMETERS	= "PolicyCombinerParameters";
+    public static final String	ELEMENT_POLICYDEFAULTS			= "PolicyDefaults";
+    public static final String	ELEMENT_POLICYIDENTIFIERLIST	= "PolicyIdentifierList";
+    public static final String	ELEMENT_POLICYIDREFERENCE		= "PolicyIdReference";
+    public static final String	ELEMENT_POLICYISSUER			= "PolicyIssuer";
+    public static final String	ELEMENT_POLICYSET				= "PolicySet";
+    public static final String	ELEMENT_POLICYSETCOMBINERPARAMETERS	= "PolicySetCombinerParameters";
+    public static final String	ELEMENT_POLICYSETDEFAULTS		= "PolicySetDefaults";
+    public static final String	ELEMENT_POLICYSETIDREFERENCE	= "PolicySetIdReference";
+    public static final String	ELEMENT_REQUEST					= "Request";
+    public static final String	ELEMENT_REQUESTDEFAULTS			= "RequestDefaults";
+    public static final String	ELEMENT_REQUESTREFERENCE		= "RequestReference";
+    public static final String	ELEMENT_RESPONSE				= "Response";
+    public static final String	ELEMENT_RESULT					= "Result";
+    public static final String	ELEMENT_RULE					= "Rule";
+    public static final String	ELEMENT_RULECOMBINERPARAMETERS	= "RuleCombinerParameters";
+    public static final String	ELEMENT_STATUS					= "Status";
+    public static final String	ELEMENT_STATUSCODE				= "StatusCode";
+    public static final String	ELEMENT_STATUSDETAIL			= "StatusDetail";
+    public static final String	ELEMENT_STATUSMESSAGE			= "StatusMessage";
+    public static final String	ELEMENT_TARGET					= "Target";
+    public static final String	ELEMENT_VARIABLEDEFINITION		= "VariableDefinition";
+    public static final String	ELEMENT_VARIABLEREFERENCE		= "VariableReference";
+    public static final String	ELEMENT_XPATHVERSION			= "XPathVersion";
+
+    public static final String	ATTRIBUTE_ADVICEID				= "AdviceId";
+    public static final String	ATTRIBUTE_APPLIESTO				= "AppliesTo";
+    public static final String	ATTRIBUTE_ATTRIBUTEID			= "AttributeId";
+    public static final String	ATTRIBUTE_CATEGORY				= "Category";
+    public static final String	ATTRIBUTE_COMBINEDDECISION		= "CombinedDecision";
+    public static final String	ATTRIBUTE_CONTEXTSELECTORID		= "ContextSelectorId";
+    public static final String	ATTRIBUTE_DATATYPE				= "DataType";
+    public static final String	ATTRIBUTE_EARLIESTVERSION		= "EarliestVersion";
+    public static final String	ATTRIBUTE_EFFECT				= "Effect";
+    public static final String	ATTRIBUTE_FULFILLON				= "FulfillOn";
+    public static final String	ATTRIBUTE_FUNCTIONID			= "FunctionId";
+    public static final String	ATTRIBUTE_LATESTVERSION			= "LatestVersion";
+    public static final String	ATTRIBUTE_ID					= "id";					// xml:id
+    public static final String	ATTRIBUTE_INCLUDEINRESULT		= "IncludeInResult";
+    public static final String	ATTRIBUTE_ISSUER				= "Issuer";
+    public static final String	ATTRIBUTE_MATCHID				= "MatchId";
+    public static final String	ATTRIBUTE_MAXDELEGATIONDEPTH	= "MaxDelegationDepth";
+    public static final String	ATTRIBUTE_MUSTBEPRESENT			= "MustBePresent";
+    public static final String	ATTRIBUTE_OBLIGATIONID			= "ObligationId";
+    public static final String	ATTRIBUTE_PARAMETERNAME			= "ParameterName";
+    public static final String	ATTRIBUTE_PATH					= "Path";
+    public static final String	ATTRIBUTE_POLICYCOMBININGALGID	= "PolicyCombiningAlgId";
+    public static final String	ATTRIBUTE_POLICYID				= "PolicyId";
+    public static final String	ATTRIBUTE_POLICYIDREF			= "PolicyIdRef";
+    public static final String	ATTRIBUTE_POLICYSETID			= "PolicySetId";
+    public static final String	ATTRIBUTE_POLICYSETIDREF		= "PolicySetIdRef";
+    public static final String	ATTRIBUTE_REFERENCEID			= "ReferenceId";
+    public static final String	ATTRIBUTE_RETURNPOLICYIDLIST	= "ReturnPolicyIdList";
+    public static final String	ATTRIBUTE_RULECOMBININGALGID	= "RuleCombiningAlgId";
+    public static final String	ATTRIBUTE_RULEID				= "RuleId";
+    public static final String	ATTRIBUTE_RULEIDREF				= "RuleIdRef";
+    public static final String	ATTRIBUTE_VALUE					= "Value";
+    public static final String	ATTRIBUTE_VARIABLEID			= "VariableId";
+    public static final String	ATTRIBUTE_VERSION				= "Version";
+    public static final String	ATTRIBUTE_XPATHCATEGORY			= "XPathCategory";
+
+    /*
+     * 10.2.2 Identifier Prefixes
+     */
+    public static final String VERSION							= "3.0";
+    public static final Identifier ID_XACML						= new IdentifierImpl(XACML.ID_XACML, VERSION);
+    public static final Identifier ID_CONFORMANCE_TEST			= XACML2.ID_CONFORMANCE_TEST;
+    public static final Identifier ID_CONTEXT					= XACML2.ID_CONTEXT;
+    public static final Identifier ID_EXAMPLE					= XACML2.ID_EXAMPLE;
+    public static final Identifier ID_FUNCTION10				= XACML1.ID_FUNCTION;
+    public static final Identifier ID_FUNCTION20				= XACML2.ID_FUNCTION;
+    public static final Identifier ID_FUNCTION					= new IdentifierImpl(ID_XACML, XACML.FUNCTION);
+    public static final Identifier ID_POLICY					= XACML2.ID_POLICY;
+    public static final Identifier ID_SUBJECT					= XACML1.ID_SUBJECT;
+    public static final Identifier ID_RESOURCE					= XACML1.ID_RESOURCE;
+    public static final Identifier ID_ACTION					= XACML1.ID_ACTION;
+    public static final Identifier ID_ENVIRONMENT				= XACML1.ID_ENVIRONMENT;
+    public static final Identifier ID_STATUS					= XACML1.ID_STATUS;
+    public static final Identifier ID_ATTRIBUTE_CATEGORY		= new IdentifierImpl(ID_XACML, "attribute-category");
+
+    /*
+     * 10.2.3 Algorithms
+     */
+    public static final Identifier ID_RULE_COMBINING_ALGORITHM			= new IdentifierImpl(ID_XACML,"rule-combining-algorithm");
+    public static final Identifier ID_POLICY_COMBINING_ALGORITHM		= new IdentifierImpl(ID_XACML, "policy-combining-algorithm");
+
+    public static final Identifier ID_RULE_DENY_OVERRIDES				= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, XACML1.DENY_OVERRIDES);
+    public static final Identifier ID_POLICY_DENY_OVERRIDES				= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, XACML1.DENY_OVERRIDES);
+    public static final Identifier ID_RULE_PERMIT_OVERRIDES				= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, XACML1.PERMIT_OVERRIDES);
+    public static final Identifier ID_POLICY_PERMIT_OVERRIDES			= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, XACML1.PERMIT_OVERRIDES);
+    public static final Identifier ID_RULE_FIRST_APPLICABLE				= XACML1.ID_RULE_FIRST_APPLICABLE;
+    public static final Identifier ID_POLICY_FIRST_APPLICABLE			= XACML1.ID_POLICY_FIRST_APPLICABLE;
+    public static final Identifier ID_RULE_ONLY_ONE_APPLICABLE			= XACML1.ID_RULE_ONLY_ONE_APPLICABLE;
+    public static final Identifier ID_POLICY_ONLY_ONE_APPLICABLE		= XACML1.ID_POLICY_ONLY_ONE_APPLICABLE;
+    public static final Identifier ID_RULE_ORDERED_DENY_OVERRIDES		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, XACML1.ORDERED_DENY_OVERRIDES);
+    public static final Identifier ID_POLICY_ORDERED_DENY_OVERRIDES		= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, XACML1.ORDERED_DENY_OVERRIDES);
+    public static final Identifier ID_RULE_ORDERED_PERMIT_OVERRIDES		= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, XACML1.ORDERED_PERMIT_OVERRIDES);
+    public static final Identifier ID_POLICY_ORDERED_PERMIT_OVERRIDES	= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, XACML1.ORDERED_PERMIT_OVERRIDES);
+    public static final String DENY_UNLESS_PERMIT						= "deny-unless-permit";
+    public static final Identifier ID_RULE_DENY_UNLESS_PERMIT			= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, DENY_UNLESS_PERMIT);
+    public static final Identifier ID_POLICY_DENY_UNLESS_PERMIT			= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, DENY_UNLESS_PERMIT);
+    public static final String PERMIT_UNLESS_DENY						= "permit-unless-deny";
+    public static final Identifier ID_RULE_PERMIT_UNLESS_DENY			= new IdentifierImpl(ID_RULE_COMBINING_ALGORITHM, PERMIT_UNLESS_DENY);
+    public static final Identifier ID_POLICY_PERMIT_UNLESS_DENY			= new IdentifierImpl(ID_POLICY_COMBINING_ALGORITHM, PERMIT_UNLESS_DENY);
+
+    public static final Identifier ID_RULE_LEGACY_DENY_OVERRIDES				= XACML1.ID_RULE_DENY_OVERRIDES;
+    public static final Identifier ID_POLICY_LEGACY_DENY_OVERRIDES				= XACML1.ID_POLICY_DENY_OVERRIDES;
+    public static final Identifier ID_RULE_LEGACY_PERMIT_OVERRIDES				= XACML1.ID_RULE_PERMIT_OVERRIDES;
+    public static final Identifier ID_POLICY_LEGACY_PERMIT_OVERRIDES			= XACML1.ID_POLICY_PERMIT_OVERRIDES;
+    public static final Identifier ID_RULE_LEGACY_ORDERED_DENY_OVERRIDES		= XACML1.ID_RULE_ORDERED_DENY_OVERRIDES;
+    public static final Identifier ID_POLICY_LEGACY_ORDERED_DENY_OVERRIDES		= XACML1.ID_POLICY_ORDERED_DENY_OVERRIDES;
+    public static final Identifier ID_RULE_LEGACY_ORDERED_PERMIT_OVERRIDES		= XACML1.ID_RULE_ORDERED_PERMIT_OVERRIDES;
+    public static final Identifier ID_POLICY_LEGACY_ORDERED_PERMIT_OVERRIDES	= XACML1.ID_POLICY_ORDERED_PERMIT_OVERRIDES;
+
+    /*
+     * 10.2.4 Status Codes
+     */
+    public static final Identifier ID_STATUS_MISSING_ATTRIBUTE	= XACML1.ID_STATUS_MISSING_ATTRIBUTE;
+    public static final Identifier ID_STATUS_OK					= XACML1.ID_STATUS_OK;
+    public static final Identifier ID_STATUS_PROCESSING_ERROR	= XACML1.ID_STATUS_PROCESSING_ERROR;
+    public static final Identifier ID_STATUS_SYNTAX_ERROR		= XACML1.ID_STATUS_SYNTAX_ERROR;
 
     /*
      * Section 10.2.5 Attributes
@@ -239,399 +239,399 @@
     public static final Identifier ID_RESOURCE_SIMPLE_FILE_NAME     		= XACML1.ID_RESOURCE_SIMPLE_FILE_NAME;
     public static final Identifier ID_ACTION_ACTION_ID      				= XACML1.ID_ACTION_ACTION_ID;
     public static final Identifier ID_ACTION_IMPLIED_ACTION 				= XACML1.ID_ACTION_IMPLIED_ACTION;
-        /*
-         * There does not seem to be a place in the spec where the standard categories are defined, so I will put them here for now
-         */
-        public static final Identifier ID_ATTRIBUTE_CATEGORY_RESOURCE		= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, XACML.RESOURCE);
-        public static final Identifier ID_ATTRIBUTE_CATEGORY_ACTION			= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, XACML.ACTION);
-        public static final Identifier ID_ATTRIBUTE_CATEGORY_ENVIRONMENT	= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, XACML.ENVIRONMENT);
+    /*
+     * There does not seem to be a place in the spec where the standard categories are defined, so I will put them here for now
+     */
+    public static final Identifier ID_ATTRIBUTE_CATEGORY_RESOURCE		= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, XACML.RESOURCE);
+    public static final Identifier ID_ATTRIBUTE_CATEGORY_ACTION			= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, XACML.ACTION);
+    public static final Identifier ID_ATTRIBUTE_CATEGORY_ENVIRONMENT	= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, XACML.ENVIRONMENT);
 
 
-        /*
-         * Section 10.2.7 Data-types
-         */
-        public static final Identifier ID_DATATYPE_STRING				= XACML.ID_DATATYPE_STRING;
-        public static final Identifier ID_DATATYPE_BOOLEAN				= XACML.ID_DATATYPE_BOOLEAN;
-        public static final Identifier ID_DATATYPE_INTEGER				= XACML.ID_DATATYPE_INTEGER;
-        public static final Identifier ID_DATATYPE_DOUBLE				= XACML.ID_DATATYPE_DOUBLE;
-        public static final Identifier ID_DATATYPE_TIME					= XACML.ID_DATATYPE_TIME;
-        public static final Identifier ID_DATATYPE_DATE					= XACML.ID_DATATYPE_DATE;
-        public static final Identifier ID_DATATYPE_DATETIME				= XACML.ID_DATATYPE_DATETIME;
-        public static final Identifier ID_DATATYPE_DAYTIMEDURATION		= XACML.ID_DATATYPE_DAYTIMEDURATION;
-        public static final Identifier ID_DATATYPE_YEARMONTHDURATION	= XACML.ID_DATATYPE_YEARMONTHDURATION;
-        public static final Identifier ID_DATATYPE_ANYURI				= XACML.ID_DATATYPE_ANYURI;
-        public static final Identifier ID_DATATYPE_HEXBINARY			= XACML.ID_DATATYPE_HEXBINARY;
-        public static final Identifier ID_DATATYPE_BASE64BINARY			= XACML.ID_DATATYPE_BASE64BINARY;
-        public static final Identifier ID_DATATYPE_RFC822NAME			= XACML1.ID_DATATYPE_RFC822NAME;
-        public static final Identifier ID_DATATYPE_X500NAME				= XACML1.ID_DATATYPE_X500NAME;
-        public static final Identifier ID_DATATYPE_IPADDRESS			= XACML2.ID_DATATYPE_IPADDRESS;
-        public static final Identifier ID_DATATYPE_DNSNAME				= XACML2.ID_DATATYPE_DNSNAME;
-        
-        public static final Identifier ID_DATATYPE						= new IdentifierImpl(ID_XACML, XACML.DATA_TYPE);
-        public static final Identifier ID_DATATYPE_XPATHEXPRESSION		= new IdentifierImpl(ID_DATATYPE, "xpathExpression");
-        
-        /*
-         * Section 10.2.8 Functions
-         */
-        
-        public static final Identifier ID_FUNCTION_STRING_EQUAL 						= XACML1.ID_FUNCTION_STRING_EQUAL;
-        public static final Identifier ID_FUNCTION_BOOLEAN_EQUAL        				= XACML1.ID_FUNCTION_BOOLEAN_EQUAL;
-        public static final Identifier ID_FUNCTION_INTEGER_EQUAL        				= XACML1.ID_FUNCTION_INTEGER_EQUAL;
-        public static final Identifier ID_FUNCTION_DOUBLE_EQUAL 						= XACML1.ID_FUNCTION_DOUBLE_EQUAL;
-        public static final Identifier ID_FUNCTION_DATE_EQUAL   						= XACML1.ID_FUNCTION_DATE_EQUAL;
-        public static final Identifier ID_FUNCTION_TIME_EQUAL   						= XACML1.ID_FUNCTION_TIME_EQUAL;
-        public static final Identifier ID_FUNCTION_DATETIME_EQUAL       				= XACML1.ID_FUNCTION_DATETIME_EQUAL;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_EQUAL        		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-equal");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_EQUAL      		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-equal");
-        public static final Identifier ID_FUNCTION_STRING_EQUAL_IGNORE_CASE				= new IdentifierImpl(ID_FUNCTION, "string-equal-ignore-case");
-        public static final Identifier ID_FUNCTION_ANYURI_EQUAL 						= XACML1.ID_FUNCTION_ANYURI_EQUAL;
-        public static final Identifier ID_FUNCTION_X500NAME_EQUAL       				= XACML1.ID_FUNCTION_X500NAME_EQUAL;
-        public static final Identifier ID_FUNCTION_RFC822NAME_EQUAL     				= XACML1.ID_FUNCTION_RFC822NAME_EQUAL;
-        public static final Identifier ID_FUNCTION_HEXBINARY_EQUAL      				= XACML1.ID_FUNCTION_HEXBINARY_EQUAL;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_EQUAL   				= XACML1.ID_FUNCTION_BASE64BINARY_EQUAL;
-        public static final Identifier ID_FUNCTION_INTEGER_ADD  						= XACML1.ID_FUNCTION_INTEGER_ADD;
-        public static final Identifier ID_FUNCTION_DOUBLE_ADD   						= XACML1.ID_FUNCTION_DOUBLE_ADD;
-        public static final Identifier ID_FUNCTION_INTEGER_SUBTRACT     				= XACML1.ID_FUNCTION_INTEGER_SUBTRACT;
-        public static final Identifier ID_FUNCTION_DOUBLE_SUBTRACT      				= XACML1.ID_FUNCTION_DOUBLE_SUBTRACT;
-        public static final Identifier ID_FUNCTION_INTEGER_MULTIPLY     				= XACML1.ID_FUNCTION_INTEGER_MULTIPLY;
-        public static final Identifier ID_FUNCTION_DOUBLE_MULTIPLY      				= XACML1.ID_FUNCTION_DOUBLE_MULTIPLY;
-        public static final Identifier ID_FUNCTION_INTEGER_DIVIDE       				= XACML1.ID_FUNCTION_INTEGER_DIVIDE;
-        public static final Identifier ID_FUNCTION_DOUBLE_DIVIDE        				= XACML1.ID_FUNCTION_DOUBLE_DIVIDE;
-        public static final Identifier ID_FUNCTION_INTEGER_MOD  						= XACML1.ID_FUNCTION_INTEGER_MOD;
-        public static final Identifier ID_FUNCTION_INTEGER_ABS  						= XACML1.ID_FUNCTION_INTEGER_ABS;
-        public static final Identifier ID_FUNCTION_DOUBLE_ABS   						= XACML1.ID_FUNCTION_DOUBLE_ABS;
-        public static final Identifier ID_FUNCTION_ROUND        						= XACML1.ID_FUNCTION_ROUND;
-        public static final Identifier ID_FUNCTION_FLOOR        						= XACML1.ID_FUNCTION_FLOOR;
-        public static final Identifier ID_FUNCTION_STRING_NORMALIZE_SPACE       		= XACML1.ID_FUNCTION_STRING_NORMALIZE_SPACE;
-        public static final Identifier ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE       = XACML1.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE;
-        public static final Identifier ID_FUNCTION_DOUBLE_TO_INTEGER    				= XACML1.ID_FUNCTION_DOUBLE_TO_INTEGER;
-        public static final Identifier ID_FUNCTION_INTEGER_TO_DOUBLE    				= XACML1.ID_FUNCTION_INTEGER_TO_DOUBLE;
-        public static final Identifier ID_FUNCTION_OR   								= XACML1.ID_FUNCTION_OR;
-        public static final Identifier ID_FUNCTION_AND  								= XACML1.ID_FUNCTION_AND;
-        public static final Identifier ID_FUNCTION_N_OF 								= XACML1.ID_FUNCTION_N_OF;
-        public static final Identifier ID_FUNCTION_NOT  								= XACML1.ID_FUNCTION_NOT;
-        public static final Identifier ID_FUNCTION_PRESENT      						= XACML1.ID_FUNCTION_PRESENT;
-        public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN 				= XACML1.ID_FUNCTION_INTEGER_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL        = XACML1.ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN    				= XACML1.ID_FUNCTION_INTEGER_LESS_THAN;
-        public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN  				= XACML1.ID_FUNCTION_DOUBLE_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL 		= XACML1.ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN     				= XACML1.ID_FUNCTION_DOUBLE_LESS_THAN;
-        public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL    		= XACML1.ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION 		= new IdentifierImpl(ID_FUNCTION, "dateTime-add-dayTimeDuration");
-        public static final Identifier ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION       = new IdentifierImpl(ID_FUNCTION, "dateTime-add-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION    = new IdentifierImpl(ID_FUNCTION, "dateTime-subtract-dayTimeDuration");
-        public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION  = new IdentifierImpl(ID_FUNCTION, "dateTime-subtract-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_DATE_ADD_YEARMONTHDURATION   		= new IdentifierImpl(ID_FUNCTION, "date-add-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION      = new IdentifierImpl(ID_FUNCTION, "date-subtract-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_STRING_GREATER_THAN  				= XACML1.ID_FUNCTION_STRING_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL 		= XACML1.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_STRING_LESS_THAN     				= XACML1.ID_FUNCTION_STRING_LESS_THAN;
-        public static final Identifier ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL    		= XACML1.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_TIME_GREATER_THAN    				= XACML1.ID_FUNCTION_TIME_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_TIME_LESS_THAN       				= XACML1.ID_FUNCTION_TIME_LESS_THAN;
-        public static final Identifier ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL      		= XACML1.ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_TIME_IN_RANGE						= XACML2.ID_FUNCTION_TIME_IN_RANGE;
-        public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN        		= XACML1.ID_FUNCTION_DATETIME_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL       = XACML1.ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN   				= XACML1.ID_FUNCTION_DATETIME_LESS_THAN;
-        public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL  		= XACML1.ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DATE_GREATER_THAN    				= XACML1.ID_FUNCTION_DATE_GREATER_THAN;
-        public static final Identifier ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_DATE_LESS_THAN       				= XACML1.ID_FUNCTION_DATE_LESS_THAN;
-        public static final Identifier ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL      		= XACML1.ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL;
-        public static final Identifier ID_FUNCTION_STRING_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_STRING_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_STRING_BAG_SIZE      				= XACML1.ID_FUNCTION_STRING_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_STRING_IS_IN 						= XACML1.ID_FUNCTION_STRING_IS_IN;
-        public static final Identifier ID_FUNCTION_STRING_BAG   						= XACML1.ID_FUNCTION_STRING_BAG;
-        public static final Identifier ID_FUNCTION_BOOLEAN_ONE_AND_ONLY 				= XACML1.ID_FUNCTION_BOOLEAN_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_BOOLEAN_BAG_SIZE     				= XACML1.ID_FUNCTION_BOOLEAN_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_BOOLEAN_IS_IN        				= XACML1.ID_FUNCTION_BOOLEAN_IS_IN;
-        public static final Identifier ID_FUNCTION_BOOLEAN_BAG  						= XACML1.ID_FUNCTION_BOOLEAN_BAG;
-        public static final Identifier ID_FUNCTION_INTEGER_ONE_AND_ONLY 				= XACML1.ID_FUNCTION_INTEGER_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_INTEGER_BAG_SIZE     				= XACML1.ID_FUNCTION_INTEGER_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_INTEGER_IS_IN        				= XACML1.ID_FUNCTION_INTEGER_IS_IN;
-        public static final Identifier ID_FUNCTION_INTEGER_BAG  						= XACML1.ID_FUNCTION_INTEGER_BAG;
-        public static final Identifier ID_FUNCTION_DOUBLE_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_DOUBLE_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_DOUBLE_BAG_SIZE      				= XACML1.ID_FUNCTION_DOUBLE_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_DOUBLE_IS_IN 						= XACML1.ID_FUNCTION_DOUBLE_IS_IN;
-        public static final Identifier ID_FUNCTION_DOUBLE_BAG   						= XACML1.ID_FUNCTION_DOUBLE_BAG;
-        public static final Identifier ID_FUNCTION_TIME_ONE_AND_ONLY    				= XACML1.ID_FUNCTION_TIME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_TIME_BAG_SIZE        				= XACML1.ID_FUNCTION_TIME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_TIME_IS_IN   						= XACML1.ID_FUNCTION_TIME_IS_IN;
-        public static final Identifier ID_FUNCTION_TIME_BAG     						= XACML1.ID_FUNCTION_TIME_BAG;
-        public static final Identifier ID_FUNCTION_DATE_ONE_AND_ONLY    				= XACML1.ID_FUNCTION_DATE_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_DATE_BAG_SIZE        				= XACML1.ID_FUNCTION_DATE_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_DATE_IS_IN   						= XACML1.ID_FUNCTION_DATE_IS_IN;
-        public static final Identifier ID_FUNCTION_DATE_BAG     						= XACML1.ID_FUNCTION_DATE_BAG;
-        public static final Identifier ID_FUNCTION_DATETIME_ONE_AND_ONLY        		= XACML1.ID_FUNCTION_DATETIME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_DATETIME_BAG_SIZE    				= XACML1.ID_FUNCTION_DATETIME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_DATETIME_IS_IN       				= XACML1.ID_FUNCTION_DATETIME_IS_IN;
-        public static final Identifier ID_FUNCTION_DATETIME_BAG 						= XACML1.ID_FUNCTION_DATETIME_BAG;
-        public static final Identifier ID_FUNCTION_ANYURI_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_ANYURI_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_ANYURI_BAG_SIZE      				= XACML1.ID_FUNCTION_ANYURI_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_ANYURI_IS_IN 						= XACML1.ID_FUNCTION_ANYURI_IS_IN;
-        public static final Identifier ID_FUNCTION_ANYURI_BAG   						= XACML1.ID_FUNCTION_ANYURI_BAG;
-        public static final Identifier ID_FUNCTION_HEXBINARY_ONE_AND_ONLY       		= XACML1.ID_FUNCTION_HEXBINARY_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_HEXBINARY_BAG_SIZE   				= XACML1.ID_FUNCTION_HEXBINARY_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_HEXBINARY_IS_IN      				= XACML1.ID_FUNCTION_HEXBINARY_IS_IN;
-        public static final Identifier ID_FUNCTION_HEXBINARY_BAG        				= XACML1.ID_FUNCTION_HEXBINARY_BAG;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY    		= XACML1.ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_BAG_SIZE        		= XACML1.ID_FUNCTION_BASE64BINARY_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_IS_IN   				= XACML1.ID_FUNCTION_BASE64BINARY_IS_IN;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_BAG     				= XACML1.ID_FUNCTION_BASE64BINARY_BAG;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY 		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-one-and-only");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE     		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-bag-size");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_IS_IN        		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-is-in");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG  				= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-bag");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY       = new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-one-and-only");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE   		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-bag-size");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_IS_IN      		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-is-in");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG        		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-bag");
-        public static final Identifier ID_FUNCTION_X500NAME_ONE_AND_ONLY        		= XACML1.ID_FUNCTION_X500NAME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_X500NAME_BAG_SIZE    				= XACML1.ID_FUNCTION_X500NAME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_X500NAME_IS_IN       				= XACML1.ID_FUNCTION_X500NAME_IS_IN;
-        public static final Identifier ID_FUNCTION_X500NAME_BAG 						= XACML1.ID_FUNCTION_X500NAME_BAG;
-        public static final Identifier ID_FUNCTION_RFC822NAME_ONE_AND_ONLY      		= XACML1.ID_FUNCTION_RFC822NAME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_RFC822NAME_BAG_SIZE  				= XACML1.ID_FUNCTION_RFC822NAME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_RFC822NAME_IS_IN     				= XACML1.ID_FUNCTION_RFC822NAME_IS_IN;
-        public static final Identifier ID_FUNCTION_RFC822NAME_BAG       				= XACML1.ID_FUNCTION_RFC822NAME_BAG;
-        public static final Identifier ID_FUNCTION_IPADDRESS_ONE_AND_ONLY      			= XACML2.ID_FUNCTION_IPADDRESS_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_IPADDRESS_BAG_SIZE  					= XACML2.ID_FUNCTION_IPADDRESS_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_IPADDRESS_IS_IN     					= XACML2.ID_FUNCTION_IPADDRESS_IS_IN;
-        public static final Identifier ID_FUNCTION_IPADDRESS_BAG       					= XACML2.ID_FUNCTION_IPADDRESS_BAG;
-        public static final Identifier ID_FUNCTION_DNSNAME_ONE_AND_ONLY      			= XACML2.ID_FUNCTION_DNSNAME_ONE_AND_ONLY;
-        public static final Identifier ID_FUNCTION_DNSNAME_BAG_SIZE  					= XACML2.ID_FUNCTION_DNSNAME_BAG_SIZE;
-        public static final Identifier ID_FUNCTION_DNSNAME_IS_IN     					= XACML2.ID_FUNCTION_DNSNAME_IS_IN;
-        public static final Identifier ID_FUNCTION_DNSNAME_BAG       					= XACML2.ID_FUNCTION_DNSNAME_BAG;
-        public static final Identifier ID_FUNCTION_STRING_CONCATENATE					= XACML2.ID_FUNCTION_STRING_CONCATENATE;
-        public static final Identifier ID_FUNCTION_BOOLEAN_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "boolean-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_BOOLEAN					= new IdentifierImpl(ID_FUNCTION, "string-from-boolean");
-        public static final Identifier ID_FUNCTION_INTEGER_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "integer-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_INTEGER					= new IdentifierImpl(ID_FUNCTION, "string-from-integer");
-        public static final Identifier ID_FUNCTION_DOUBLE_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "double-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_DOUBLE					= new IdentifierImpl(ID_FUNCTION, "string-from-double");
-        public static final Identifier ID_FUNCTION_TIME_FROM_STRING						= new IdentifierImpl(ID_FUNCTION, "time-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_TIME						= new IdentifierImpl(ID_FUNCTION, "string-from-time");
-        public static final Identifier ID_FUNCTION_DATE_FROM_STRING						= new IdentifierImpl(ID_FUNCTION, "date-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_DATE						= new IdentifierImpl(ID_FUNCTION, "string-from-date");
-        public static final Identifier ID_FUNCTION_DATETIME_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "dateTime-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_DATETIME					= new IdentifierImpl(ID_FUNCTION, "string-from-dateTime");
-        public static final Identifier ID_FUNCTION_ANYURI_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "anyURI-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_ANYURI					= new IdentifierImpl(ID_FUNCTION, "string-from-anyURI");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_FROM_STRING			= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_DAYTIMEDURATION			= new IdentifierImpl(ID_FUNCTION, "string-from-dayTimeDuration");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_FROM_STRING		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_YEARMONTHDURATION		= new IdentifierImpl(ID_FUNCTION, "string-from-yearMonthDuration");
-        public static final Identifier ID_FUNCTION_X500NAME_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "x500Name-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_X500NAME					= new IdentifierImpl(ID_FUNCTION, "string-from-x500Name");
-        public static final Identifier ID_FUNCTION_RFC822NAME_FROM_STRING				= new IdentifierImpl(ID_FUNCTION, "rfc822Name-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_RFC822NAME				= new IdentifierImpl(ID_FUNCTION, "string-from-rfc822Name");
-        public static final Identifier ID_FUNCTION_IPADDRESS_FROM_STRING				= new IdentifierImpl(ID_FUNCTION, "ipAddress-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_IPADDRESS				= new IdentifierImpl(ID_FUNCTION, "string-from-ipAddress");
-        public static final Identifier ID_FUNCTION_DNSNAME_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "dnsName-from-string");
-        public static final Identifier ID_FUNCTION_STRING_FROM_DNSNAME					= new IdentifierImpl(ID_FUNCTION, "string-from-dnsName");
-        public static final Identifier ID_FUNCTION_STRING_STARTS_WITH					= new IdentifierImpl(ID_FUNCTION, "string-starts-with");
-        public static final Identifier ID_FUNCTION_ANYURI_STARTS_WITH					= new IdentifierImpl(ID_FUNCTION, "anyURI-starts-with");
-        public static final Identifier ID_FUNCTION_STRING_ENDS_WITH						= new IdentifierImpl(ID_FUNCTION, "string-ends-with");
-        public static final Identifier ID_FUNCTION_ANYURI_ENDS_WITH						= new IdentifierImpl(ID_FUNCTION, "anyURI-ends-with");
-        public static final Identifier ID_FUNCTION_STRING_CONTAINS						= new IdentifierImpl(ID_FUNCTION, "string-contains");
-        public static final Identifier ID_FUNCTION_ANYURI_CONTAINS						= new IdentifierImpl(ID_FUNCTION, "anyURI-contains");
-        public static final Identifier ID_FUNCTION_STRING_SUBSTRING						= new IdentifierImpl(ID_FUNCTION, "string-substring");
-        public static final Identifier ID_FUNCTION_ANYURI_SUBSTRING						= new IdentifierImpl(ID_FUNCTION, "anyURI-substring");
-        public static final Identifier ID_FUNCTION_ANY_OF       						= new IdentifierImpl(ID_FUNCTION, "any-of");
-        public static final Identifier ID_FUNCTION_ALL_OF       						= new IdentifierImpl(ID_FUNCTION, "all-of");
-        public static final Identifier ID_FUNCTION_ANY_OF_ANY   						= new IdentifierImpl(ID_FUNCTION, "any-of-any");
-        public static final Identifier ID_FUNCTION_ALL_OF_ANY   						= XACML1.ID_FUNCTION_ALL_OF_ANY;
-        public static final Identifier ID_FUNCTION_ANY_OF_ALL   						= XACML1.ID_FUNCTION_ANY_OF_ALL;
-        public static final Identifier ID_FUNCTION_ALL_OF_ALL   						= XACML1.ID_FUNCTION_ALL_OF_ALL;
-        public static final Identifier ID_FUNCTION_MAP  								= new IdentifierImpl(ID_FUNCTION, "map");
-        public static final Identifier ID_FUNCTION_X500NAME_MATCH        				= XACML1.ID_FUNCTION_X500NAME_MATCH;
-        public static final Identifier ID_FUNCTION_RFC822NAME_MATCH      				= XACML1.ID_FUNCTION_RFC822NAME_MATCH;
-        public static final Identifier ID_FUNCTION_STRING_REGEXP_MATCH   				= XACML1.ID_FUNCTION_STRING_REGEXP_MATCH;
-        public static final Identifier ID_FUNCTION_ANYURI_REGEXP_MATCH					= XACML2.ID_FUNCTION_ANYURI_REGEXP_MATCH;
-        public static final Identifier ID_FUNCTION_IPADDRESS_REGEXP_MATCH				= XACML2.ID_FUNCTION_IPADDRESS_REGEXP_MATCH;
-        public static final Identifier ID_FUNCTION_DNSNAME_REGEXP_MATCH					= XACML2.ID_FUNCTION_DNSNAME_REGEXP_MATCH;
-        public static final Identifier ID_FUNCTION_RFC822NAME_REGEXP_MATCH				= XACML2.ID_FUNCTION_RFC822NAME_REGEXP_MATCH;
-        public static final Identifier ID_FUNCTION_X500NAME_REGEXP_MATCH				= XACML2.ID_FUNCTION_X500NAME_REGEXP_MATCH;
-        public static final Identifier ID_FUNCTION_XPATH_NODE_COUNT      				= new IdentifierImpl(ID_FUNCTION, "xpath-node-count");
-        public static final Identifier ID_FUNCTION_XPATH_NODE_EQUAL      				= new IdentifierImpl(ID_FUNCTION, "xpath-node-equal");
-        public static final Identifier ID_FUNCTION_XPATH_NODE_MATCH      				= new IdentifierImpl(ID_FUNCTION, "xpath-node-match");
-        public static final Identifier ID_FUNCTION_STRING_INTERSECTION   				= XACML1.ID_FUNCTION_STRING_INTERSECTION;
-        public static final Identifier ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF 		= XACML1.ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_STRING_UNION  						= XACML1.ID_FUNCTION_STRING_UNION;
-        public static final Identifier ID_FUNCTION_STRING_SUBSET 						= XACML1.ID_FUNCTION_STRING_SUBSET;
-        public static final Identifier ID_FUNCTION_STRING_SET_EQUALS     				= XACML1.ID_FUNCTION_STRING_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_BOOLEAN_INTERSECTION  				= XACML1.ID_FUNCTION_BOOLEAN_INTERSECTION;
-        public static final Identifier ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF       = XACML1.ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_BOOLEAN_UNION 						= XACML1.ID_FUNCTION_BOOLEAN_UNION;
-        public static final Identifier ID_FUNCTION_BOOLEAN_SUBSET        				= XACML1.ID_FUNCTION_BOOLEAN_SUBSET;
-        public static final Identifier ID_FUNCTION_BOOLEAN_SET_EQUALS    				= XACML1.ID_FUNCTION_BOOLEAN_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_INTEGER_INTERSECTION  				= XACML1.ID_FUNCTION_INTEGER_INTERSECTION;
-        public static final Identifier ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF       = XACML1.ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_INTEGER_UNION 						= XACML1.ID_FUNCTION_INTEGER_UNION;
-        public static final Identifier ID_FUNCTION_INTEGER_SUBSET        				= XACML1.ID_FUNCTION_INTEGER_SUBSET;
-        public static final Identifier ID_FUNCTION_INTEGER_SET_EQUALS    				= XACML1.ID_FUNCTION_INTEGER_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DOUBLE_INTERSECTION   				= XACML1.ID_FUNCTION_DOUBLE_INTERSECTION;
-        public static final Identifier ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF 		= XACML1.ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_DOUBLE_UNION  						= XACML1.ID_FUNCTION_DOUBLE_UNION;
-        public static final Identifier ID_FUNCTION_DOUBLE_SUBSET 						= XACML1.ID_FUNCTION_DOUBLE_SUBSET;
-        public static final Identifier ID_FUNCTION_DOUBLE_SET_EQUALS     				= XACML1.ID_FUNCTION_DOUBLE_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_TIME_INTERSECTION     				= XACML1.ID_FUNCTION_TIME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF   		= XACML1.ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_TIME_UNION    						= XACML1.ID_FUNCTION_TIME_UNION;
-        public static final Identifier ID_FUNCTION_TIME_SUBSET   						= XACML1.ID_FUNCTION_TIME_SUBSET;
-        public static final Identifier ID_FUNCTION_TIME_SET_EQUALS       				= XACML1.ID_FUNCTION_TIME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DATE_INTERSECTION     				= XACML1.ID_FUNCTION_DATE_INTERSECTION;
-        public static final Identifier ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF   		= XACML1.ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_DATE_UNION    						= XACML1.ID_FUNCTION_DATE_UNION;
-        public static final Identifier ID_FUNCTION_DATE_SUBSET   						= XACML1.ID_FUNCTION_DATE_SUBSET;
-        public static final Identifier ID_FUNCTION_DATE_SET_EQUALS       				= XACML1.ID_FUNCTION_DATE_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DATETIME_INTERSECTION 				= XACML1.ID_FUNCTION_DATETIME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF      = XACML1.ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_DATETIME_UNION        				= XACML1.ID_FUNCTION_DATETIME_UNION;
-        public static final Identifier ID_FUNCTION_DATETIME_SUBSET       				= XACML1.ID_FUNCTION_DATETIME_SUBSET;
-        public static final Identifier ID_FUNCTION_DATETIME_SET_EQUALS   				= XACML1.ID_FUNCTION_DATETIME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_ANYURI_INTERSECTION   				= XACML1.ID_FUNCTION_ANYURI_INTERSECTION;
-        public static final Identifier ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF 		= XACML1.ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_ANYURI_UNION  						= XACML1.ID_FUNCTION_ANYURI_UNION;
-        public static final Identifier ID_FUNCTION_ANYURI_SUBSET 						= XACML1.ID_FUNCTION_ANYURI_SUBSET;
-        public static final Identifier ID_FUNCTION_ANYURI_SET_EQUALS     				= XACML1.ID_FUNCTION_ANYURI_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_HEXBINARY_INTERSECTION        		= XACML1.ID_FUNCTION_HEXBINARY_INTERSECTION;
-        public static final Identifier ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF     = XACML1.ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_HEXBINARY_UNION       				= XACML1.ID_FUNCTION_HEXBINARY_UNION;
-        public static final Identifier ID_FUNCTION_HEXBINARY_SUBSET      				= XACML1.ID_FUNCTION_HEXBINARY_SUBSET;
-        public static final Identifier ID_FUNCTION_HEXBINARY_SET_EQUALS  				= XACML1.ID_FUNCTION_HEXBINARY_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_INTERSECTION     		= XACML1.ID_FUNCTION_BASE64BINARY_INTERSECTION;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF  = XACML1.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_UNION    				= XACML1.ID_FUNCTION_BASE64BINARY_UNION;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_SUBSET   				= XACML1.ID_FUNCTION_BASE64BINARY_SUBSET;
-        public static final Identifier ID_FUNCTION_BASE64BINARY_SET_EQUALS       		= XACML1.ID_FUNCTION_BASE64BINARY_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_INTERSECTION  			= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-intersection");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF	= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_UNION 					= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-union");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SUBSET        			= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-subset");
-        public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS    			= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-set-equals");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_INTERSECTION        	= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-intersection");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF = new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-at-least-one-member-of");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_UNION       			= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-union");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SUBSET      			= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-subset");
-        public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS  			= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-set-equals");
-        public static final Identifier ID_FUNCTION_X500NAME_INTERSECTION 					= XACML1.ID_FUNCTION_X500NAME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF       	= XACML1.ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_X500NAME_UNION        					= XACML1.ID_FUNCTION_X500NAME_UNION;
-        public static final Identifier ID_FUNCTION_X500NAME_SUBSET       					= XACML1.ID_FUNCTION_X500NAME_SUBSET;
-        public static final Identifier ID_FUNCTION_X500NAME_SET_EQUALS   					= XACML1.ID_FUNCTION_X500NAME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_RFC822NAME_INTERSECTION       			= XACML1.ID_FUNCTION_RFC822NAME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF     	= XACML1.ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_RFC822NAME_UNION      					= XACML1.ID_FUNCTION_RFC822NAME_UNION;
-        public static final Identifier ID_FUNCTION_RFC822NAME_SUBSET     					= XACML1.ID_FUNCTION_RFC822NAME_SUBSET;
-        public static final Identifier ID_FUNCTION_RFC822NAME_SET_EQUALS 					= XACML1.ID_FUNCTION_RFC822NAME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_IPADDRESS_INTERSECTION       			= XACML2.ID_FUNCTION_IPADDRESS_INTERSECTION;
-        public static final Identifier ID_FUNCTION_IPADDRESS_AT_LEAST_ONE_MEMBER_OF     	= XACML2.ID_FUNCTION_IPADDRESS_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_IPADDRESS_UNION      					= XACML2.ID_FUNCTION_IPADDRESS_UNION;
-        public static final Identifier ID_FUNCTION_IPADDRESS_SUBSET     					= XACML2.ID_FUNCTION_IPADDRESS_SUBSET;
-        public static final Identifier ID_FUNCTION_IPADDRESS_SET_EQUALS 					= XACML2.ID_FUNCTION_IPADDRESS_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_DNSNAME_INTERSECTION       				= XACML2.ID_FUNCTION_DNSNAME_INTERSECTION;
-        public static final Identifier ID_FUNCTION_DNSNAME_AT_LEAST_ONE_MEMBER_OF     		= XACML2.ID_FUNCTION_DNSNAME_AT_LEAST_ONE_MEMBER_OF;
-        public static final Identifier ID_FUNCTION_DNSNAME_UNION      						= XACML2.ID_FUNCTION_DNSNAME_UNION;
-        public static final Identifier ID_FUNCTION_DNSNAME_SUBSET     						= XACML2.ID_FUNCTION_DNSNAME_SUBSET;
-        public static final Identifier ID_FUNCTION_DNSNAME_SET_EQUALS 						= XACML2.ID_FUNCTION_DNSNAME_SET_EQUALS;
-        public static final Identifier ID_FUNCTION_ACCESS_PERMITTED							 = new IdentifierImpl(ID_FUNCTION, "access-permitted");
-        
-        
-        /*
-         * Profiles
-         */
-        public static final Identifier ID_PROFILE							= new IdentifierImpl(ID_XACML, XACML.PROFILE);
-        public static final Identifier ID_PROFILES							= new IdentifierImpl(ID_XACML, XACML.PROFILES);
-        
-        /*
-         * XACML v3.0 Administration and Delegation Profile Version 1.0 
-         */
-        public static final Identifier ID_PROFILE_ADMINISTRATION_REDUCTION		= new IdentifierImpl(ID_PROFILE, "administration:reduction");
-        public static final Identifier ID_DELEGATION							= new IdentifierImpl(ID_XACML, "delegation");
-        public static final Identifier ID_DELEGATION_DECISION					= new IdentifierImpl(ID_DELEGATION, "decision");
-        public static final Identifier ID_ATTRIBUTE_CATEGORY_DELEGATE			= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, "delegate");
-        public static final Identifier ID_ATTRIBUTE_CATEGORY_DELEGATION_INFO	= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, "delegation-info");
-        public static final Identifier ID_ATTRIBUTE_CATEGORY_DELEGATED			= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, "delegated");
-        
-        /*
-         * SAML 2.0 Profile of XACML, Version 2.0
-         */
-        public static final Identifier ID_PROFILE_SAML2_0_V2									= new IdentifierImpl(ID_PROFILE, "saml2.0:v2");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_POLICIES							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "policies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_ADVICESAML							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "adviceSAML");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZTOKEN							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzToken");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_ATTRS_ALL							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "attrs:all");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "SOAP");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_AUTHZQUERY					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "authzQuery");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_ATTRASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "attrAssertion");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION						= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecision");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_NOPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "noPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_WITHPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "withPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST				= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecisionWSTrust");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_WITHPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "withPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_NOPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "noPolicies");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "schema");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_ASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "assertion");
-        public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_PROTOCOL					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "protocol");
+    /*
+     * Section 10.2.7 Data-types
+     */
+    public static final Identifier ID_DATATYPE_STRING				= XACML.ID_DATATYPE_STRING;
+    public static final Identifier ID_DATATYPE_BOOLEAN				= XACML.ID_DATATYPE_BOOLEAN;
+    public static final Identifier ID_DATATYPE_INTEGER				= XACML.ID_DATATYPE_INTEGER;
+    public static final Identifier ID_DATATYPE_DOUBLE				= XACML.ID_DATATYPE_DOUBLE;
+    public static final Identifier ID_DATATYPE_TIME					= XACML.ID_DATATYPE_TIME;
+    public static final Identifier ID_DATATYPE_DATE					= XACML.ID_DATATYPE_DATE;
+    public static final Identifier ID_DATATYPE_DATETIME				= XACML.ID_DATATYPE_DATETIME;
+    public static final Identifier ID_DATATYPE_DAYTIMEDURATION		= XACML.ID_DATATYPE_DAYTIMEDURATION;
+    public static final Identifier ID_DATATYPE_YEARMONTHDURATION	= XACML.ID_DATATYPE_YEARMONTHDURATION;
+    public static final Identifier ID_DATATYPE_ANYURI				= XACML.ID_DATATYPE_ANYURI;
+    public static final Identifier ID_DATATYPE_HEXBINARY			= XACML.ID_DATATYPE_HEXBINARY;
+    public static final Identifier ID_DATATYPE_BASE64BINARY			= XACML.ID_DATATYPE_BASE64BINARY;
+    public static final Identifier ID_DATATYPE_RFC822NAME			= XACML1.ID_DATATYPE_RFC822NAME;
+    public static final Identifier ID_DATATYPE_X500NAME				= XACML1.ID_DATATYPE_X500NAME;
+    public static final Identifier ID_DATATYPE_IPADDRESS			= XACML2.ID_DATATYPE_IPADDRESS;
+    public static final Identifier ID_DATATYPE_DNSNAME				= XACML2.ID_DATATYPE_DNSNAME;
 
-        /*
-         * XACML v3.0 Hierarchical Resource Profile Version 1.0
-         */
-        public static final Identifier ID_PROFILE_HIERARCHICAL							= new IdentifierImpl(ID_PROFILE, "hierarchical");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_ATTRIBUTE_NODE_ID		= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "attribute-node-id");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_ID				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "xml-node-id");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_URI_NODE_ID				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "URI-node-id");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_URI_REFERENCE_NODE_ID	= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "URI-reference-node-id");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_ID			= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "non-xml-node-id");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "xml-node-req");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ			= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "non-xml-node-req");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_PARENT				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-parent");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_ANCESTOR			= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-ancestor");
-        public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_ANCESTOR_OR_SELF	= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-ancestor-or-self");
-        
-        public static final Identifier ID_CONTENT_SELECTOR						= new IdentifierImpl(ID_XACML, "content-selector");
-        public static final Identifier ID_RESOURCE_DOCUMENT_ID					= XACML2.ID_RESOURCE_DOCUMENT_ID;
-        public static final Identifier ID_RESOURCE_RESOURCE_PARENT				= XACML2.ID_RESOURCE_RESOURCE_PARENT;
-        public static final Identifier ID_RESOURCE_RESOURCE_ANCESTOR			= XACML2.ID_RESOURCE_RESOURCE_ANCESTOR;
-        public static final Identifier ID_RESOURCE_RESOURCE_ANCESTOR_OR_SELF	= XACML2.ID_RESOURCE_RESOURCE_ANCESTOR_OR_SELF;
-        
-        /*
-         * XACML v3.0 Multiple Decision Profile Version 1.0
-         */
-        public static final Identifier ID_PROFILE_MULTIPLE									= new IdentifierImpl(ID_PROFILE, "multiple");
-        public static final Identifier ID_PROFILE_MULTIPLE_SCOPE							= new IdentifierImpl(ID_PROFILE_MULTIPLE, "scope");
-        public static final Identifier ID_PROFILE_MULTIPLE_XPATH_EXPRESSION					= new IdentifierImpl(ID_PROFILE_MULTIPLE, "xpath-expression");
-        public static final Identifier ID_PROFILE_MULTIPLE_REPEATED_ATTRIBUTE_CATEGORIES	= new IdentifierImpl(ID_PROFILE_MULTIPLE, "repeated-attribute-categories");
-        public static final Identifier ID_PROFILE_MULTIPLE_REFERENCE						= new IdentifierImpl(ID_PROFILE_MULTIPLE, "reference");
-        public static final Identifier ID_PROFILE_MULTIPLE_COMBINED_DECISION				= new IdentifierImpl(ID_PROFILE_MULTIPLE, "combined-decision");
-        
-        public static final Identifier ID_MULTIPLE_CONTENT_SELECTOR							= new IdentifierImpl(ID_XACML, "multiple:content-selector");
+    public static final Identifier ID_DATATYPE						= new IdentifierImpl(ID_XACML, XACML.DATA_TYPE);
+    public static final Identifier ID_DATATYPE_XPATHEXPRESSION		= new IdentifierImpl(ID_DATATYPE, "xpathExpression");
+
+    /*
+     * Section 10.2.8 Functions
+     */
+
+    public static final Identifier ID_FUNCTION_STRING_EQUAL 						= XACML1.ID_FUNCTION_STRING_EQUAL;
+    public static final Identifier ID_FUNCTION_BOOLEAN_EQUAL        				= XACML1.ID_FUNCTION_BOOLEAN_EQUAL;
+    public static final Identifier ID_FUNCTION_INTEGER_EQUAL        				= XACML1.ID_FUNCTION_INTEGER_EQUAL;
+    public static final Identifier ID_FUNCTION_DOUBLE_EQUAL 						= XACML1.ID_FUNCTION_DOUBLE_EQUAL;
+    public static final Identifier ID_FUNCTION_DATE_EQUAL   						= XACML1.ID_FUNCTION_DATE_EQUAL;
+    public static final Identifier ID_FUNCTION_TIME_EQUAL   						= XACML1.ID_FUNCTION_TIME_EQUAL;
+    public static final Identifier ID_FUNCTION_DATETIME_EQUAL       				= XACML1.ID_FUNCTION_DATETIME_EQUAL;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_EQUAL        		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-equal");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_EQUAL      		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-equal");
+    public static final Identifier ID_FUNCTION_STRING_EQUAL_IGNORE_CASE				= new IdentifierImpl(ID_FUNCTION, "string-equal-ignore-case");
+    public static final Identifier ID_FUNCTION_ANYURI_EQUAL 						= XACML1.ID_FUNCTION_ANYURI_EQUAL;
+    public static final Identifier ID_FUNCTION_X500NAME_EQUAL       				= XACML1.ID_FUNCTION_X500NAME_EQUAL;
+    public static final Identifier ID_FUNCTION_RFC822NAME_EQUAL     				= XACML1.ID_FUNCTION_RFC822NAME_EQUAL;
+    public static final Identifier ID_FUNCTION_HEXBINARY_EQUAL      				= XACML1.ID_FUNCTION_HEXBINARY_EQUAL;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_EQUAL   				= XACML1.ID_FUNCTION_BASE64BINARY_EQUAL;
+    public static final Identifier ID_FUNCTION_INTEGER_ADD  						= XACML1.ID_FUNCTION_INTEGER_ADD;
+    public static final Identifier ID_FUNCTION_DOUBLE_ADD   						= XACML1.ID_FUNCTION_DOUBLE_ADD;
+    public static final Identifier ID_FUNCTION_INTEGER_SUBTRACT     				= XACML1.ID_FUNCTION_INTEGER_SUBTRACT;
+    public static final Identifier ID_FUNCTION_DOUBLE_SUBTRACT      				= XACML1.ID_FUNCTION_DOUBLE_SUBTRACT;
+    public static final Identifier ID_FUNCTION_INTEGER_MULTIPLY     				= XACML1.ID_FUNCTION_INTEGER_MULTIPLY;
+    public static final Identifier ID_FUNCTION_DOUBLE_MULTIPLY      				= XACML1.ID_FUNCTION_DOUBLE_MULTIPLY;
+    public static final Identifier ID_FUNCTION_INTEGER_DIVIDE       				= XACML1.ID_FUNCTION_INTEGER_DIVIDE;
+    public static final Identifier ID_FUNCTION_DOUBLE_DIVIDE        				= XACML1.ID_FUNCTION_DOUBLE_DIVIDE;
+    public static final Identifier ID_FUNCTION_INTEGER_MOD  						= XACML1.ID_FUNCTION_INTEGER_MOD;
+    public static final Identifier ID_FUNCTION_INTEGER_ABS  						= XACML1.ID_FUNCTION_INTEGER_ABS;
+    public static final Identifier ID_FUNCTION_DOUBLE_ABS   						= XACML1.ID_FUNCTION_DOUBLE_ABS;
+    public static final Identifier ID_FUNCTION_ROUND        						= XACML1.ID_FUNCTION_ROUND;
+    public static final Identifier ID_FUNCTION_FLOOR        						= XACML1.ID_FUNCTION_FLOOR;
+    public static final Identifier ID_FUNCTION_STRING_NORMALIZE_SPACE       		= XACML1.ID_FUNCTION_STRING_NORMALIZE_SPACE;
+    public static final Identifier ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE       = XACML1.ID_FUNCTION_STRING_NORMALIZE_TO_LOWER_CASE;
+    public static final Identifier ID_FUNCTION_DOUBLE_TO_INTEGER    				= XACML1.ID_FUNCTION_DOUBLE_TO_INTEGER;
+    public static final Identifier ID_FUNCTION_INTEGER_TO_DOUBLE    				= XACML1.ID_FUNCTION_INTEGER_TO_DOUBLE;
+    public static final Identifier ID_FUNCTION_OR   								= XACML1.ID_FUNCTION_OR;
+    public static final Identifier ID_FUNCTION_AND  								= XACML1.ID_FUNCTION_AND;
+    public static final Identifier ID_FUNCTION_N_OF 								= XACML1.ID_FUNCTION_N_OF;
+    public static final Identifier ID_FUNCTION_NOT  								= XACML1.ID_FUNCTION_NOT;
+    public static final Identifier ID_FUNCTION_PRESENT      						= XACML1.ID_FUNCTION_PRESENT;
+    public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN 				= XACML1.ID_FUNCTION_INTEGER_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL        = XACML1.ID_FUNCTION_INTEGER_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN    				= XACML1.ID_FUNCTION_INTEGER_LESS_THAN;
+    public static final Identifier ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_INTEGER_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN  				= XACML1.ID_FUNCTION_DOUBLE_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL 		= XACML1.ID_FUNCTION_DOUBLE_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN     				= XACML1.ID_FUNCTION_DOUBLE_LESS_THAN;
+    public static final Identifier ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL    		= XACML1.ID_FUNCTION_DOUBLE_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DATETIME_ADD_DAYTIMEDURATION 		= new IdentifierImpl(ID_FUNCTION, "dateTime-add-dayTimeDuration");
+    public static final Identifier ID_FUNCTION_DATETIME_ADD_YEARMONTHDURATION       = new IdentifierImpl(ID_FUNCTION, "dateTime-add-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_DAYTIMEDURATION    = new IdentifierImpl(ID_FUNCTION, "dateTime-subtract-dayTimeDuration");
+    public static final Identifier ID_FUNCTION_DATETIME_SUBTRACT_YEARMONTHDURATION  = new IdentifierImpl(ID_FUNCTION, "dateTime-subtract-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_DATE_ADD_YEARMONTHDURATION   		= new IdentifierImpl(ID_FUNCTION, "date-add-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_DATE_SUBTRACT_YEARMONTHDURATION      = new IdentifierImpl(ID_FUNCTION, "date-subtract-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_STRING_GREATER_THAN  				= XACML1.ID_FUNCTION_STRING_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL 		= XACML1.ID_FUNCTION_STRING_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_STRING_LESS_THAN     				= XACML1.ID_FUNCTION_STRING_LESS_THAN;
+    public static final Identifier ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL    		= XACML1.ID_FUNCTION_STRING_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_TIME_GREATER_THAN    				= XACML1.ID_FUNCTION_TIME_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_TIME_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_TIME_LESS_THAN       				= XACML1.ID_FUNCTION_TIME_LESS_THAN;
+    public static final Identifier ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL      		= XACML1.ID_FUNCTION_TIME_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_TIME_IN_RANGE						= XACML2.ID_FUNCTION_TIME_IN_RANGE;
+    public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN        		= XACML1.ID_FUNCTION_DATETIME_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL       = XACML1.ID_FUNCTION_DATETIME_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN   				= XACML1.ID_FUNCTION_DATETIME_LESS_THAN;
+    public static final Identifier ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL  		= XACML1.ID_FUNCTION_DATETIME_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DATE_GREATER_THAN    				= XACML1.ID_FUNCTION_DATE_GREATER_THAN;
+    public static final Identifier ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL   		= XACML1.ID_FUNCTION_DATE_GREATER_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_DATE_LESS_THAN       				= XACML1.ID_FUNCTION_DATE_LESS_THAN;
+    public static final Identifier ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL      		= XACML1.ID_FUNCTION_DATE_LESS_THAN_OR_EQUAL;
+    public static final Identifier ID_FUNCTION_STRING_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_STRING_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_STRING_BAG_SIZE      				= XACML1.ID_FUNCTION_STRING_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_STRING_IS_IN 						= XACML1.ID_FUNCTION_STRING_IS_IN;
+    public static final Identifier ID_FUNCTION_STRING_BAG   						= XACML1.ID_FUNCTION_STRING_BAG;
+    public static final Identifier ID_FUNCTION_BOOLEAN_ONE_AND_ONLY 				= XACML1.ID_FUNCTION_BOOLEAN_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_BOOLEAN_BAG_SIZE     				= XACML1.ID_FUNCTION_BOOLEAN_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_BOOLEAN_IS_IN        				= XACML1.ID_FUNCTION_BOOLEAN_IS_IN;
+    public static final Identifier ID_FUNCTION_BOOLEAN_BAG  						= XACML1.ID_FUNCTION_BOOLEAN_BAG;
+    public static final Identifier ID_FUNCTION_INTEGER_ONE_AND_ONLY 				= XACML1.ID_FUNCTION_INTEGER_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_INTEGER_BAG_SIZE     				= XACML1.ID_FUNCTION_INTEGER_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_INTEGER_IS_IN        				= XACML1.ID_FUNCTION_INTEGER_IS_IN;
+    public static final Identifier ID_FUNCTION_INTEGER_BAG  						= XACML1.ID_FUNCTION_INTEGER_BAG;
+    public static final Identifier ID_FUNCTION_DOUBLE_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_DOUBLE_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_DOUBLE_BAG_SIZE      				= XACML1.ID_FUNCTION_DOUBLE_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_DOUBLE_IS_IN 						= XACML1.ID_FUNCTION_DOUBLE_IS_IN;
+    public static final Identifier ID_FUNCTION_DOUBLE_BAG   						= XACML1.ID_FUNCTION_DOUBLE_BAG;
+    public static final Identifier ID_FUNCTION_TIME_ONE_AND_ONLY    				= XACML1.ID_FUNCTION_TIME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_TIME_BAG_SIZE        				= XACML1.ID_FUNCTION_TIME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_TIME_IS_IN   						= XACML1.ID_FUNCTION_TIME_IS_IN;
+    public static final Identifier ID_FUNCTION_TIME_BAG     						= XACML1.ID_FUNCTION_TIME_BAG;
+    public static final Identifier ID_FUNCTION_DATE_ONE_AND_ONLY    				= XACML1.ID_FUNCTION_DATE_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_DATE_BAG_SIZE        				= XACML1.ID_FUNCTION_DATE_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_DATE_IS_IN   						= XACML1.ID_FUNCTION_DATE_IS_IN;
+    public static final Identifier ID_FUNCTION_DATE_BAG     						= XACML1.ID_FUNCTION_DATE_BAG;
+    public static final Identifier ID_FUNCTION_DATETIME_ONE_AND_ONLY        		= XACML1.ID_FUNCTION_DATETIME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_DATETIME_BAG_SIZE    				= XACML1.ID_FUNCTION_DATETIME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_DATETIME_IS_IN       				= XACML1.ID_FUNCTION_DATETIME_IS_IN;
+    public static final Identifier ID_FUNCTION_DATETIME_BAG 						= XACML1.ID_FUNCTION_DATETIME_BAG;
+    public static final Identifier ID_FUNCTION_ANYURI_ONE_AND_ONLY  				= XACML1.ID_FUNCTION_ANYURI_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_ANYURI_BAG_SIZE      				= XACML1.ID_FUNCTION_ANYURI_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_ANYURI_IS_IN 						= XACML1.ID_FUNCTION_ANYURI_IS_IN;
+    public static final Identifier ID_FUNCTION_ANYURI_BAG   						= XACML1.ID_FUNCTION_ANYURI_BAG;
+    public static final Identifier ID_FUNCTION_HEXBINARY_ONE_AND_ONLY       		= XACML1.ID_FUNCTION_HEXBINARY_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_HEXBINARY_BAG_SIZE   				= XACML1.ID_FUNCTION_HEXBINARY_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_HEXBINARY_IS_IN      				= XACML1.ID_FUNCTION_HEXBINARY_IS_IN;
+    public static final Identifier ID_FUNCTION_HEXBINARY_BAG        				= XACML1.ID_FUNCTION_HEXBINARY_BAG;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY    		= XACML1.ID_FUNCTION_BASE64BINARY_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_BAG_SIZE        		= XACML1.ID_FUNCTION_BASE64BINARY_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_IS_IN   				= XACML1.ID_FUNCTION_BASE64BINARY_IS_IN;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_BAG     				= XACML1.ID_FUNCTION_BASE64BINARY_BAG;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_ONE_AND_ONLY 		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-one-and-only");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG_SIZE     		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-bag-size");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_IS_IN        		= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-is-in");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_BAG  				= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-bag");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_ONE_AND_ONLY       = new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-one-and-only");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG_SIZE   		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-bag-size");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_IS_IN      		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-is-in");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_BAG        		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-bag");
+    public static final Identifier ID_FUNCTION_X500NAME_ONE_AND_ONLY        		= XACML1.ID_FUNCTION_X500NAME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_X500NAME_BAG_SIZE    				= XACML1.ID_FUNCTION_X500NAME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_X500NAME_IS_IN       				= XACML1.ID_FUNCTION_X500NAME_IS_IN;
+    public static final Identifier ID_FUNCTION_X500NAME_BAG 						= XACML1.ID_FUNCTION_X500NAME_BAG;
+    public static final Identifier ID_FUNCTION_RFC822NAME_ONE_AND_ONLY      		= XACML1.ID_FUNCTION_RFC822NAME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_RFC822NAME_BAG_SIZE  				= XACML1.ID_FUNCTION_RFC822NAME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_RFC822NAME_IS_IN     				= XACML1.ID_FUNCTION_RFC822NAME_IS_IN;
+    public static final Identifier ID_FUNCTION_RFC822NAME_BAG       				= XACML1.ID_FUNCTION_RFC822NAME_BAG;
+    public static final Identifier ID_FUNCTION_IPADDRESS_ONE_AND_ONLY      			= XACML2.ID_FUNCTION_IPADDRESS_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_IPADDRESS_BAG_SIZE  					= XACML2.ID_FUNCTION_IPADDRESS_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_IPADDRESS_IS_IN     					= XACML2.ID_FUNCTION_IPADDRESS_IS_IN;
+    public static final Identifier ID_FUNCTION_IPADDRESS_BAG       					= XACML2.ID_FUNCTION_IPADDRESS_BAG;
+    public static final Identifier ID_FUNCTION_DNSNAME_ONE_AND_ONLY      			= XACML2.ID_FUNCTION_DNSNAME_ONE_AND_ONLY;
+    public static final Identifier ID_FUNCTION_DNSNAME_BAG_SIZE  					= XACML2.ID_FUNCTION_DNSNAME_BAG_SIZE;
+    public static final Identifier ID_FUNCTION_DNSNAME_IS_IN     					= XACML2.ID_FUNCTION_DNSNAME_IS_IN;
+    public static final Identifier ID_FUNCTION_DNSNAME_BAG       					= XACML2.ID_FUNCTION_DNSNAME_BAG;
+    public static final Identifier ID_FUNCTION_STRING_CONCATENATE					= XACML2.ID_FUNCTION_STRING_CONCATENATE;
+    public static final Identifier ID_FUNCTION_BOOLEAN_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "boolean-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_BOOLEAN					= new IdentifierImpl(ID_FUNCTION, "string-from-boolean");
+    public static final Identifier ID_FUNCTION_INTEGER_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "integer-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_INTEGER					= new IdentifierImpl(ID_FUNCTION, "string-from-integer");
+    public static final Identifier ID_FUNCTION_DOUBLE_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "double-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_DOUBLE					= new IdentifierImpl(ID_FUNCTION, "string-from-double");
+    public static final Identifier ID_FUNCTION_TIME_FROM_STRING						= new IdentifierImpl(ID_FUNCTION, "time-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_TIME						= new IdentifierImpl(ID_FUNCTION, "string-from-time");
+    public static final Identifier ID_FUNCTION_DATE_FROM_STRING						= new IdentifierImpl(ID_FUNCTION, "date-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_DATE						= new IdentifierImpl(ID_FUNCTION, "string-from-date");
+    public static final Identifier ID_FUNCTION_DATETIME_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "dateTime-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_DATETIME					= new IdentifierImpl(ID_FUNCTION, "string-from-dateTime");
+    public static final Identifier ID_FUNCTION_ANYURI_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "anyURI-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_ANYURI					= new IdentifierImpl(ID_FUNCTION, "string-from-anyURI");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_FROM_STRING			= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_DAYTIMEDURATION			= new IdentifierImpl(ID_FUNCTION, "string-from-dayTimeDuration");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_FROM_STRING		= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_YEARMONTHDURATION		= new IdentifierImpl(ID_FUNCTION, "string-from-yearMonthDuration");
+    public static final Identifier ID_FUNCTION_X500NAME_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "x500Name-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_X500NAME					= new IdentifierImpl(ID_FUNCTION, "string-from-x500Name");
+    public static final Identifier ID_FUNCTION_RFC822NAME_FROM_STRING				= new IdentifierImpl(ID_FUNCTION, "rfc822Name-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_RFC822NAME				= new IdentifierImpl(ID_FUNCTION, "string-from-rfc822Name");
+    public static final Identifier ID_FUNCTION_IPADDRESS_FROM_STRING				= new IdentifierImpl(ID_FUNCTION, "ipAddress-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_IPADDRESS				= new IdentifierImpl(ID_FUNCTION, "string-from-ipAddress");
+    public static final Identifier ID_FUNCTION_DNSNAME_FROM_STRING					= new IdentifierImpl(ID_FUNCTION, "dnsName-from-string");
+    public static final Identifier ID_FUNCTION_STRING_FROM_DNSNAME					= new IdentifierImpl(ID_FUNCTION, "string-from-dnsName");
+    public static final Identifier ID_FUNCTION_STRING_STARTS_WITH					= new IdentifierImpl(ID_FUNCTION, "string-starts-with");
+    public static final Identifier ID_FUNCTION_ANYURI_STARTS_WITH					= new IdentifierImpl(ID_FUNCTION, "anyURI-starts-with");
+    public static final Identifier ID_FUNCTION_STRING_ENDS_WITH						= new IdentifierImpl(ID_FUNCTION, "string-ends-with");
+    public static final Identifier ID_FUNCTION_ANYURI_ENDS_WITH						= new IdentifierImpl(ID_FUNCTION, "anyURI-ends-with");
+    public static final Identifier ID_FUNCTION_STRING_CONTAINS						= new IdentifierImpl(ID_FUNCTION, "string-contains");
+    public static final Identifier ID_FUNCTION_ANYURI_CONTAINS						= new IdentifierImpl(ID_FUNCTION, "anyURI-contains");
+    public static final Identifier ID_FUNCTION_STRING_SUBSTRING						= new IdentifierImpl(ID_FUNCTION, "string-substring");
+    public static final Identifier ID_FUNCTION_ANYURI_SUBSTRING						= new IdentifierImpl(ID_FUNCTION, "anyURI-substring");
+    public static final Identifier ID_FUNCTION_ANY_OF       						= new IdentifierImpl(ID_FUNCTION, "any-of");
+    public static final Identifier ID_FUNCTION_ALL_OF       						= new IdentifierImpl(ID_FUNCTION, "all-of");
+    public static final Identifier ID_FUNCTION_ANY_OF_ANY   						= new IdentifierImpl(ID_FUNCTION, "any-of-any");
+    public static final Identifier ID_FUNCTION_ALL_OF_ANY   						= XACML1.ID_FUNCTION_ALL_OF_ANY;
+    public static final Identifier ID_FUNCTION_ANY_OF_ALL   						= XACML1.ID_FUNCTION_ANY_OF_ALL;
+    public static final Identifier ID_FUNCTION_ALL_OF_ALL   						= XACML1.ID_FUNCTION_ALL_OF_ALL;
+    public static final Identifier ID_FUNCTION_MAP  								= new IdentifierImpl(ID_FUNCTION, "map");
+    public static final Identifier ID_FUNCTION_X500NAME_MATCH        				= XACML1.ID_FUNCTION_X500NAME_MATCH;
+    public static final Identifier ID_FUNCTION_RFC822NAME_MATCH      				= XACML1.ID_FUNCTION_RFC822NAME_MATCH;
+    public static final Identifier ID_FUNCTION_STRING_REGEXP_MATCH   				= XACML1.ID_FUNCTION_STRING_REGEXP_MATCH;
+    public static final Identifier ID_FUNCTION_ANYURI_REGEXP_MATCH					= XACML2.ID_FUNCTION_ANYURI_REGEXP_MATCH;
+    public static final Identifier ID_FUNCTION_IPADDRESS_REGEXP_MATCH				= XACML2.ID_FUNCTION_IPADDRESS_REGEXP_MATCH;
+    public static final Identifier ID_FUNCTION_DNSNAME_REGEXP_MATCH					= XACML2.ID_FUNCTION_DNSNAME_REGEXP_MATCH;
+    public static final Identifier ID_FUNCTION_RFC822NAME_REGEXP_MATCH				= XACML2.ID_FUNCTION_RFC822NAME_REGEXP_MATCH;
+    public static final Identifier ID_FUNCTION_X500NAME_REGEXP_MATCH				= XACML2.ID_FUNCTION_X500NAME_REGEXP_MATCH;
+    public static final Identifier ID_FUNCTION_XPATH_NODE_COUNT      				= new IdentifierImpl(ID_FUNCTION, "xpath-node-count");
+    public static final Identifier ID_FUNCTION_XPATH_NODE_EQUAL      				= new IdentifierImpl(ID_FUNCTION, "xpath-node-equal");
+    public static final Identifier ID_FUNCTION_XPATH_NODE_MATCH      				= new IdentifierImpl(ID_FUNCTION, "xpath-node-match");
+    public static final Identifier ID_FUNCTION_STRING_INTERSECTION   				= XACML1.ID_FUNCTION_STRING_INTERSECTION;
+    public static final Identifier ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF 		= XACML1.ID_FUNCTION_STRING_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_STRING_UNION  						= XACML1.ID_FUNCTION_STRING_UNION;
+    public static final Identifier ID_FUNCTION_STRING_SUBSET 						= XACML1.ID_FUNCTION_STRING_SUBSET;
+    public static final Identifier ID_FUNCTION_STRING_SET_EQUALS     				= XACML1.ID_FUNCTION_STRING_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_BOOLEAN_INTERSECTION  				= XACML1.ID_FUNCTION_BOOLEAN_INTERSECTION;
+    public static final Identifier ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF       = XACML1.ID_FUNCTION_BOOLEAN_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_BOOLEAN_UNION 						= XACML1.ID_FUNCTION_BOOLEAN_UNION;
+    public static final Identifier ID_FUNCTION_BOOLEAN_SUBSET        				= XACML1.ID_FUNCTION_BOOLEAN_SUBSET;
+    public static final Identifier ID_FUNCTION_BOOLEAN_SET_EQUALS    				= XACML1.ID_FUNCTION_BOOLEAN_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_INTEGER_INTERSECTION  				= XACML1.ID_FUNCTION_INTEGER_INTERSECTION;
+    public static final Identifier ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF       = XACML1.ID_FUNCTION_INTEGER_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_INTEGER_UNION 						= XACML1.ID_FUNCTION_INTEGER_UNION;
+    public static final Identifier ID_FUNCTION_INTEGER_SUBSET        				= XACML1.ID_FUNCTION_INTEGER_SUBSET;
+    public static final Identifier ID_FUNCTION_INTEGER_SET_EQUALS    				= XACML1.ID_FUNCTION_INTEGER_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DOUBLE_INTERSECTION   				= XACML1.ID_FUNCTION_DOUBLE_INTERSECTION;
+    public static final Identifier ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF 		= XACML1.ID_FUNCTION_DOUBLE_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_DOUBLE_UNION  						= XACML1.ID_FUNCTION_DOUBLE_UNION;
+    public static final Identifier ID_FUNCTION_DOUBLE_SUBSET 						= XACML1.ID_FUNCTION_DOUBLE_SUBSET;
+    public static final Identifier ID_FUNCTION_DOUBLE_SET_EQUALS     				= XACML1.ID_FUNCTION_DOUBLE_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_TIME_INTERSECTION     				= XACML1.ID_FUNCTION_TIME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF   		= XACML1.ID_FUNCTION_TIME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_TIME_UNION    						= XACML1.ID_FUNCTION_TIME_UNION;
+    public static final Identifier ID_FUNCTION_TIME_SUBSET   						= XACML1.ID_FUNCTION_TIME_SUBSET;
+    public static final Identifier ID_FUNCTION_TIME_SET_EQUALS       				= XACML1.ID_FUNCTION_TIME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DATE_INTERSECTION     				= XACML1.ID_FUNCTION_DATE_INTERSECTION;
+    public static final Identifier ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF   		= XACML1.ID_FUNCTION_DATE_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_DATE_UNION    						= XACML1.ID_FUNCTION_DATE_UNION;
+    public static final Identifier ID_FUNCTION_DATE_SUBSET   						= XACML1.ID_FUNCTION_DATE_SUBSET;
+    public static final Identifier ID_FUNCTION_DATE_SET_EQUALS       				= XACML1.ID_FUNCTION_DATE_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DATETIME_INTERSECTION 				= XACML1.ID_FUNCTION_DATETIME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF      = XACML1.ID_FUNCTION_DATETIME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_DATETIME_UNION        				= XACML1.ID_FUNCTION_DATETIME_UNION;
+    public static final Identifier ID_FUNCTION_DATETIME_SUBSET       				= XACML1.ID_FUNCTION_DATETIME_SUBSET;
+    public static final Identifier ID_FUNCTION_DATETIME_SET_EQUALS   				= XACML1.ID_FUNCTION_DATETIME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_ANYURI_INTERSECTION   				= XACML1.ID_FUNCTION_ANYURI_INTERSECTION;
+    public static final Identifier ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF 		= XACML1.ID_FUNCTION_ANYURI_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_ANYURI_UNION  						= XACML1.ID_FUNCTION_ANYURI_UNION;
+    public static final Identifier ID_FUNCTION_ANYURI_SUBSET 						= XACML1.ID_FUNCTION_ANYURI_SUBSET;
+    public static final Identifier ID_FUNCTION_ANYURI_SET_EQUALS     				= XACML1.ID_FUNCTION_ANYURI_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_HEXBINARY_INTERSECTION        		= XACML1.ID_FUNCTION_HEXBINARY_INTERSECTION;
+    public static final Identifier ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF     = XACML1.ID_FUNCTION_HEXBINARY_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_HEXBINARY_UNION       				= XACML1.ID_FUNCTION_HEXBINARY_UNION;
+    public static final Identifier ID_FUNCTION_HEXBINARY_SUBSET      				= XACML1.ID_FUNCTION_HEXBINARY_SUBSET;
+    public static final Identifier ID_FUNCTION_HEXBINARY_SET_EQUALS  				= XACML1.ID_FUNCTION_HEXBINARY_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_INTERSECTION     		= XACML1.ID_FUNCTION_BASE64BINARY_INTERSECTION;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF  = XACML1.ID_FUNCTION_BASE64BINARY_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_UNION    				= XACML1.ID_FUNCTION_BASE64BINARY_UNION;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_SUBSET   				= XACML1.ID_FUNCTION_BASE64BINARY_SUBSET;
+    public static final Identifier ID_FUNCTION_BASE64BINARY_SET_EQUALS       		= XACML1.ID_FUNCTION_BASE64BINARY_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_INTERSECTION  			= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-intersection");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_AT_LEAST_ONE_MEMBER_OF	= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_UNION 					= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-union");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SUBSET        			= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-subset");
+    public static final Identifier ID_FUNCTION_DAYTIMEDURATION_SET_EQUALS    			= new IdentifierImpl(ID_FUNCTION, "dayTimeDuration-set-equals");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_INTERSECTION        	= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-intersection");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_AT_LEAST_ONE_MEMBER_OF = new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-at-least-one-member-of");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_UNION       			= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-union");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SUBSET      			= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-subset");
+    public static final Identifier ID_FUNCTION_YEARMONTHDURATION_SET_EQUALS  			= new IdentifierImpl(ID_FUNCTION, "yearMonthDuration-set-equals");
+    public static final Identifier ID_FUNCTION_X500NAME_INTERSECTION 					= XACML1.ID_FUNCTION_X500NAME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF       	= XACML1.ID_FUNCTION_X500NAME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_X500NAME_UNION        					= XACML1.ID_FUNCTION_X500NAME_UNION;
+    public static final Identifier ID_FUNCTION_X500NAME_SUBSET       					= XACML1.ID_FUNCTION_X500NAME_SUBSET;
+    public static final Identifier ID_FUNCTION_X500NAME_SET_EQUALS   					= XACML1.ID_FUNCTION_X500NAME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_RFC822NAME_INTERSECTION       			= XACML1.ID_FUNCTION_RFC822NAME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF     	= XACML1.ID_FUNCTION_RFC822NAME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_RFC822NAME_UNION      					= XACML1.ID_FUNCTION_RFC822NAME_UNION;
+    public static final Identifier ID_FUNCTION_RFC822NAME_SUBSET     					= XACML1.ID_FUNCTION_RFC822NAME_SUBSET;
+    public static final Identifier ID_FUNCTION_RFC822NAME_SET_EQUALS 					= XACML1.ID_FUNCTION_RFC822NAME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_IPADDRESS_INTERSECTION       			= XACML2.ID_FUNCTION_IPADDRESS_INTERSECTION;
+    public static final Identifier ID_FUNCTION_IPADDRESS_AT_LEAST_ONE_MEMBER_OF     	= XACML2.ID_FUNCTION_IPADDRESS_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_IPADDRESS_UNION      					= XACML2.ID_FUNCTION_IPADDRESS_UNION;
+    public static final Identifier ID_FUNCTION_IPADDRESS_SUBSET     					= XACML2.ID_FUNCTION_IPADDRESS_SUBSET;
+    public static final Identifier ID_FUNCTION_IPADDRESS_SET_EQUALS 					= XACML2.ID_FUNCTION_IPADDRESS_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_DNSNAME_INTERSECTION       				= XACML2.ID_FUNCTION_DNSNAME_INTERSECTION;
+    public static final Identifier ID_FUNCTION_DNSNAME_AT_LEAST_ONE_MEMBER_OF     		= XACML2.ID_FUNCTION_DNSNAME_AT_LEAST_ONE_MEMBER_OF;
+    public static final Identifier ID_FUNCTION_DNSNAME_UNION      						= XACML2.ID_FUNCTION_DNSNAME_UNION;
+    public static final Identifier ID_FUNCTION_DNSNAME_SUBSET     						= XACML2.ID_FUNCTION_DNSNAME_SUBSET;
+    public static final Identifier ID_FUNCTION_DNSNAME_SET_EQUALS 						= XACML2.ID_FUNCTION_DNSNAME_SET_EQUALS;
+    public static final Identifier ID_FUNCTION_ACCESS_PERMITTED							 = new IdentifierImpl(ID_FUNCTION, "access-permitted");
+
+
+    /*
+     * Profiles
+     */
+    public static final Identifier ID_PROFILE							= new IdentifierImpl(ID_XACML, XACML.PROFILE);
+    public static final Identifier ID_PROFILES							= new IdentifierImpl(ID_XACML, XACML.PROFILES);
+
+    /*
+     * XACML v3.0 Administration and Delegation Profile Version 1.0
+     */
+    public static final Identifier ID_PROFILE_ADMINISTRATION_REDUCTION		= new IdentifierImpl(ID_PROFILE, "administration:reduction");
+    public static final Identifier ID_DELEGATION							= new IdentifierImpl(ID_XACML, "delegation");
+    public static final Identifier ID_DELEGATION_DECISION					= new IdentifierImpl(ID_DELEGATION, "decision");
+    public static final Identifier ID_ATTRIBUTE_CATEGORY_DELEGATE			= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, "delegate");
+    public static final Identifier ID_ATTRIBUTE_CATEGORY_DELEGATION_INFO	= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, "delegation-info");
+    public static final Identifier ID_ATTRIBUTE_CATEGORY_DELEGATED			= new IdentifierImpl(ID_ATTRIBUTE_CATEGORY, "delegated");
+
+    /*
+     * SAML 2.0 Profile of XACML, Version 2.0
+     */
+    public static final Identifier ID_PROFILE_SAML2_0_V2									= new IdentifierImpl(ID_PROFILE, "saml2.0:v2");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_POLICIES							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "policies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_ADVICESAML							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "adviceSAML");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZTOKEN							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzToken");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_ATTRS_ALL							= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "attrs:all");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "SOAP");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_AUTHZQUERY					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "authzQuery");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SOAP_ATTRASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SOAP, "attrAssertion");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION						= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecision");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_NOPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "noPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISION_WITHPOLICIES			= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISION, "withPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST				= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "authzDecisionWSTrust");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_WITHPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "withPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST_NOPOLICIES	= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_AUTHZDECISIONWSTRUST, "noPolicies");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA								= new IdentifierImpl(ID_PROFILE_SAML2_0_V2, "schema");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_ASSERTION					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "assertion");
+    public static final Identifier ID_PROFILE_SAML2_0_V2_SCHEMA_PROTOCOL					= new IdentifierImpl(ID_PROFILE_SAML2_0_V2_SCHEMA, "protocol");
+
+    /*
+     * XACML v3.0 Hierarchical Resource Profile Version 1.0
+     */
+    public static final Identifier ID_PROFILE_HIERARCHICAL							= new IdentifierImpl(ID_PROFILE, "hierarchical");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_ATTRIBUTE_NODE_ID		= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "attribute-node-id");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_ID				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "xml-node-id");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_URI_NODE_ID				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "URI-node-id");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_URI_REFERENCE_NODE_ID	= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "URI-reference-node-id");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_ID			= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "non-xml-node-id");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_XML_NODE_REQ				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "xml-node-req");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ			= new IdentifierImpl(ID_PROFILE_HIERARCHICAL, "non-xml-node-req");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_PARENT				= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-parent");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_ANCESTOR			= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-ancestor");
+    public static final Identifier ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ_RESOURCE_ANCESTOR_OR_SELF	= new IdentifierImpl(ID_PROFILE_HIERARCHICAL_NON_XML_NODE_REQ, "resource-ancestor-or-self");
+
+    public static final Identifier ID_CONTENT_SELECTOR						= new IdentifierImpl(ID_XACML, "content-selector");
+    public static final Identifier ID_RESOURCE_DOCUMENT_ID					= XACML2.ID_RESOURCE_DOCUMENT_ID;
+    public static final Identifier ID_RESOURCE_RESOURCE_PARENT				= XACML2.ID_RESOURCE_RESOURCE_PARENT;
+    public static final Identifier ID_RESOURCE_RESOURCE_ANCESTOR			= XACML2.ID_RESOURCE_RESOURCE_ANCESTOR;
+    public static final Identifier ID_RESOURCE_RESOURCE_ANCESTOR_OR_SELF	= XACML2.ID_RESOURCE_RESOURCE_ANCESTOR_OR_SELF;
+
+    /*
+     * XACML v3.0 Multiple Decision Profile Version 1.0
+     */
+    public static final Identifier ID_PROFILE_MULTIPLE									= new IdentifierImpl(ID_PROFILE, "multiple");
+    public static final Identifier ID_PROFILE_MULTIPLE_SCOPE							= new IdentifierImpl(ID_PROFILE_MULTIPLE, "scope");
+    public static final Identifier ID_PROFILE_MULTIPLE_XPATH_EXPRESSION					= new IdentifierImpl(ID_PROFILE_MULTIPLE, "xpath-expression");
+    public static final Identifier ID_PROFILE_MULTIPLE_REPEATED_ATTRIBUTE_CATEGORIES	= new IdentifierImpl(ID_PROFILE_MULTIPLE, "repeated-attribute-categories");
+    public static final Identifier ID_PROFILE_MULTIPLE_REFERENCE						= new IdentifierImpl(ID_PROFILE_MULTIPLE, "reference");
+    public static final Identifier ID_PROFILE_MULTIPLE_COMBINED_DECISION				= new IdentifierImpl(ID_PROFILE_MULTIPLE, "combined-decision");
+
+    public static final Identifier ID_MULTIPLE_CONTENT_SELECTOR							= new IdentifierImpl(ID_XACML, "multiple:content-selector");
     public static final Identifier ID_RESOURCE_SCOPE									= XACML2.ID_RESOURCE_SCOPE;
-    
+
     /*
      * XACML v3.0 Core and Hierarchical Role Based Access Control (RBAC) Profile Version 1.0
      */
     public static final Identifier ID_PROFILES_RBAC_CORE_HIERARCHICAL				= new IdentifierImpl(ID_PROFILES, "rback:core-hierarchical");
     public static final Identifier ID_SUBJECT_ROLE									= XACML2.ID_SUBJECT_ROLE;
-    public static final Identifier ID_SUBJECT_CATEGORY_ROLE_ENABLEMENT_AUTHORITY	= XACML2.ID_SUBJECT_CATEGORY_ROLE_ENABLEMENT_AUTHORITY;  
+    public static final Identifier ID_SUBJECT_CATEGORY_ROLE_ENABLEMENT_AUTHORITY	= XACML2.ID_SUBJECT_CATEGORY_ROLE_ENABLEMENT_AUTHORITY;
     public static final Identifier ID_ACTIONS_HASPRIVILEGESOFROLE					= XACML2.ID_ACTIONS_HASPRIVILEGESFROLE;
     public static final Identifier ID_ACTIONS_ENABLEROLE							= XACML2.ID_ACTIONS_ENABLEROLE;
-    
+
     /*
      * XACML v3.0 Privacy Policy Profile Version 1.0
      */
     public static final Identifier ID_RESOURCE_PURPOSE	= XACML2.ID_RESOURCE_PURPOSE;
     public static final Identifier ID_ACTION_PURPOSE	= XACML2.ID_ACTION_PURPOSE;
-    
+
     /*
      * XACML v3.0 XML Digital Signature Profile Version 1.0
      */
-    
+
     /*
      * XACML Intellectual Property Control (IPC) Profile Version 1.0
      */
@@ -649,7 +649,7 @@
     public static final Identifier ID_IPC_RESOURCE_VALID_AGREEMENT_EXISTS							= new IdentifierImpl(ID_IPC_RESOURCE, "valid-agreement-exists");
     public static final Identifier ID_IPC_RESOURCE_NUMBER_OF_VALID_AGREEMENTS						= new IdentifierImpl(ID_IPC_RESOURCE, "number-of-valid-agreements");
     public static final Identifier ID_IPC_RESOURCE_WORK_EFFORT										= new IdentifierImpl(ID_IPC_RESOURCE, "work-effort");
-    public static final Identifier ID_IPC_RESOURCE_AUTHORIZED_END_USE								= new IdentifierImpl(ID_IPC_RESOURCE, "authorized-end-use");    
+    public static final Identifier ID_IPC_RESOURCE_AUTHORIZED_END_USE								= new IdentifierImpl(ID_IPC_RESOURCE, "authorized-end-use");
     public static final Identifier ID_IPC_RESOURCE_AUTHORIZED_END_USE_DESIGN						= new IdentifierImpl(ID_IPC_RESOURCE_AUTHORIZED_END_USE, "design");
     public static final Identifier ID_IPC_RESOURCE_AUTHORIZED_END_USE_MANUFACTURE					= new IdentifierImpl(ID_IPC_RESOURCE_AUTHORIZED_END_USE, "manufacture");
     public static final Identifier ID_IPC_RESOURCE_AUTHORIZED_END_USE_MAINTENANCE					= new IdentifierImpl(ID_IPC_RESOURCE_AUTHORIZED_END_USE, "maintenance");
@@ -672,7 +672,7 @@
     public static final Identifier ID_IPC_OBLIGATION												= new IdentifierImpl(ID_IPC, "obligation");
     public static final Identifier ID_IPC_OBLIGATION_ENCRYPT										= new IdentifierImpl(ID_IPC_OBLIGATION, "encrypt");
     public static final Identifier ID_IPC_OBLIGATION_MARKING										= new IdentifierImpl(ID_IPC_OBLIGATION, "marking");
-    
+
     /*
      * XACML 3.0 Export Compliance-US (EC-US) Profile Version 1.0
      */
@@ -690,7 +690,7 @@
     public static final Identifier ID_EC_US_SUBJECT_CURRENT_NATIONALITY		= new IdentifierImpl(ID_EC_US_SUBJECT, "current-nationality");
     public static final Identifier ID_EC_US_SUBJECT_ORGANIZATION			= new IdentifierImpl(ID_EC_US_SUBJECT, "organization");
     public static final Identifier ID_EC_US_SUBJECT_US_PERSON				= new IdentifierImpl(ID_EC_US_SUBJECT, "us-person");
-    
+
     /*
      * REST Profile of XACML v3.0 Version 1.0
      */
@@ -698,11 +698,11 @@
     public static final Identifier ID_PROFILE_REST_HTTP		= new IdentifierImpl(ID_PROFILE_REST, "http");
     public static final Identifier ID_PROFILE_REST_HOME		= new IdentifierImpl(ID_PROFILE_REST, "home");
     public static final Identifier ID_PROFILE_REST_PDP		= new IdentifierImpl(ID_PROFILE_REST, "pdp");
-    
+
     /*
      * Request/Response Interface based on JSON and HTTP for XACML 3.0 Version 1.0
      */
-    
+
     /*
      * XACML 3.0 Additional Combining Algorithms Profile Version 1.0
      */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/package-info.java
index 25e611c..9bcb5e1 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,9 +33,9 @@
 
 /**
  * Provides the interfaces common to the XACML 3.0 Policy Enforcement Point (PEP), Policy Decision Point (PDP), and Policy Information Point (PIP) APIs.
- * 
+ *
  * Provides the interface for implementing a Policy Administration Point (PAP) API.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPEngine.java
index 83a61d8..4ac0b76 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,74 +34,74 @@
 import java.util.Set;
 
 public interface PAPEngine {
-        
-        
-        //
-        // Group-level operations
-        //
-        
-        public PDPGroup					getDefaultGroup() throws PAPException;
-        
-        public void						SetDefaultGroup(PDPGroup group) throws PAPException;
 
-        public Set<PDPGroup>			getPDPGroups() throws PAPException;
-        
-        public PDPGroup					getGroup(String id) throws PAPException;
-        
-        public void						newGroup(String name, String description) throws PAPException, NullPointerException;
-        
-        public void						updateGroup(PDPGroup group) throws PAPException;
-        
-        /**
-         * @param group - to delete
-         * @param newGroup - Group where any PDP's in the group will be moved to. Can be NULL if there are no PDP's in the group.
-         * @throws PAPException
-         * @throws NullPointerException
-         */
-        public void						removeGroup(PDPGroup group, PDPGroup newGroup) throws PAPException, NullPointerException;
 
-        public PDPGroup					getPDPGroup(PDP pdp) throws PAPException;
-        
-        public PDPGroup					getPDPGroup(String pdpId) throws PAPException;
-        
-        /**
-         * Special case - for REST this contacts the PDP for status Details, but the non-RESTful version is never called
-         */
-        public PDPStatus				getStatus(PDP pdp) throws PAPException;
-        
-        
-        
-        //
-        // PDP operations
-        //
-        
-        public PDP						getPDP(String pdpId) throws PAPException;
-        
-        public void						newPDP(String id, PDPGroup group, String name, String description) throws PAPException, NullPointerException;
-        
-        public void						movePDP(PDP pdp, PDPGroup newGroup) throws PAPException;
-        
-        public void						updatePDP(PDP pdp) throws PAPException;
-        
-        public void						removePDP(PDP pdp) throws PAPException;
-        
-        
-        //
-        // Policy operations
-        //
-        
+    //
+    // Group-level operations
+    //
+
+    public PDPGroup					getDefaultGroup() throws PAPException;
+
+    public void						SetDefaultGroup(PDPGroup group) throws PAPException;
+
+    public Set<PDPGroup>			getPDPGroups() throws PAPException;
+
+    public PDPGroup					getGroup(String id) throws PAPException;
+
+    public void						newGroup(String name, String description) throws PAPException, NullPointerException;
+
+    public void						updateGroup(PDPGroup group) throws PAPException;
+
+    /**
+     * @param group - to delete
+     * @param newGroup - Group where any PDP's in the group will be moved to. Can be NULL if there are no PDP's in the group.
+     * @throws PAPException
+     * @throws NullPointerException
+     */
+    public void						removeGroup(PDPGroup group, PDPGroup newGroup) throws PAPException, NullPointerException;
+
+    public PDPGroup					getPDPGroup(PDP pdp) throws PAPException;
+
+    public PDPGroup					getPDPGroup(String pdpId) throws PAPException;
+
+    /**
+     * Special case - for REST this contacts the PDP for status Details, but the non-RESTful version is never called
+     */
+    public PDPStatus				getStatus(PDP pdp) throws PAPException;
+
+
+
+    //
+    // PDP operations
+    //
+
+    public PDP						getPDP(String pdpId) throws PAPException;
+
+    public void						newPDP(String id, PDPGroup group, String name, String description) throws PAPException, NullPointerException;
+
+    public void						movePDP(PDP pdp, PDPGroup newGroup) throws PAPException;
+
+    public void						updatePDP(PDP pdp) throws PAPException;
+
+    public void						removePDP(PDP pdp) throws PAPException;
+
+
+    //
+    // Policy operations
+    //
+
 //TODO - This is a degenerate form for making group-level changes because it makes only one change to one file.
 //TODO		We really want to be able to make multiple changes to the group in one operation, including changing a file from root to referenced and back.
-//TODO	This method should be replaced with two methods: 
+//TODO	This method should be replaced with two methods:
 //TODO		public boolean copyFile(String policyId, PDPGroup group, InputStream policy) throws PAPException
 //TODO				(just copy the file and throw exception if the copy fails)
 //TODO		public PDPGroup updateGroup(group) throws PAPException
 //TODO   			where the group has been changed locally to the way we want it to be on the server.
-        public void						publishPolicy(String id, String name, boolean isRoot, InputStream policy, PDPGroup group) throws PAPException;
-        
-        // copy the given policy file into the group's directory, but do not include the policy in the group's policy set
-        public void						copyPolicy(PDPPolicy policy, PDPGroup group) throws PAPException;
-        
-        public void						removePolicy(PDPPolicy policy, PDPGroup group) throws PAPException;
-        
+    public void						publishPolicy(String id, String name, boolean isRoot, InputStream policy, PDPGroup group) throws PAPException;
+
+    // copy the given policy file into the group's directory, but do not include the policy in the group's policy set
+    public void						copyPolicy(PDPPolicy policy, PDPGroup group) throws PAPException;
+
+    public void						removePolicy(PDPPolicy policy, PDPGroup group) throws PAPException;
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPEngineFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPEngineFactory.java
index 2709fb0..9b91b7b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPEngineFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,78 +37,78 @@
 import com.att.research.xacml.util.XACMLProperties;
 
 public abstract class PAPEngineFactory {
-        private static final String	FACTORYID	= XACMLProperties.PROP_PAP_PAPENGINEFACTORY;
-        private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.pap.StdEngineFactory";
-        
-        /**
-         * The constructor is protected to prevent instantiation of the class.
-         */
-        protected PAPEngineFactory() {
-        }
-        
-        /**
-         * The constructor is protected to prevent instantiation of the class.
-         */
-        protected PAPEngineFactory(Properties properties) {
-        }
-        
-        /**
-         * Creates a new <code>PAPEngineFactory</code> instance by examining initialization resources from
-         * various places to determine the class to instantiate and return.
-         * 
-         * @return an instance of an object that extends <code>PAPEngineFactory</code> to use in creating <code>PAPEngine</code> objects.
-         * @throws FactoryException
-         */
-        public static PAPEngineFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PAPEngineFactory.class);
-        }
-        
-        /**
-         * Creates a new <code>PAPEngineFactory</code> instance by examining initialization resources from
-         * various places to determine the class to instantiate and return.
-         * 
-         * @return an instance of an object that extends <code>PAPEngineFactory</code> to use in creating <code>PAPEngine</code> objects.
-         * @throws FactoryException
-         */
-        public static PAPEngineFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PAPEngineFactory.class, properties);
-        }
-        
-        /**
-         * Creates a new <code>PAPEngineFactory</code> instance using the given class name and <code>ClassLoader</code>.  If the
-         * <code>ClassLoader</code> is null, use the default thread class loader.
-         * 
-         * @param factoryClassName the <code>String</code> name of the factory class to instantiate
-         * @param classLoader the <code>ClassLoader</code> to use to load the factory class
-         * @return an instance of an object that extends <code>PAPEngineFactory</code> to use in creating <code>PAPEngine</code> objects.
-         */
-        public static PAPEngineFactory newInstance(String factoryClassName, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(factoryClassName, PAPEngineFactory.class, classLoader, false);
-        }
-        
-        /**
-         * Creates a new <code>PAPEngineFactory</code> instance using the given class name and the default thread class loader.
-         * 
-         * @param factoryClassName the <code>String</code> name of the factory class to instantiate
-         * @return an instance of an object that extends <code>PAPEngineFactory</code> to use in creating <code>PAPEngine</code> objects.
-         */
-        public static PAPEngineFactory newInstance(String factoryClassName) throws FactoryException {
-                return FactoryFinder.newInstance(factoryClassName, PAPEngineFactory.class, null, true);
-        }
-        
-        /**
-         * Creates a new <code>PAPEngine</code> based on the configured <code>PAPEngineFactory</code>.
-         * 
-         * @return a new <code>PAPEngine</code>
-         * @throws com.att.research.xacml.api.pap.PAPException
-         */
-        public abstract PAPEngine newEngine() throws FactoryException, PAPException;
-        
-        /**
-         * Creates a new <code>PAPEngine</code> based on the configured <code>PAPEngineFactory</code>.
-         * 
-         * @return a new <code>PAPEngine</code>
-         * @throws com.att.research.xacml.api.pap.PAPException
-         */
-        public abstract PAPEngine newEngine(Properties properties) throws FactoryException, PAPException;
+    private static final String	FACTORYID	= XACMLProperties.PROP_PAP_PAPENGINEFACTORY;
+    private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.pap.StdEngineFactory";
+
+    /**
+     * The constructor is protected to prevent instantiation of the class.
+     */
+    protected PAPEngineFactory() {
+    }
+
+    /**
+     * The constructor is protected to prevent instantiation of the class.
+     */
+    protected PAPEngineFactory(Properties properties) {
+    }
+
+    /**
+     * Creates a new <code>PAPEngineFactory</code> instance by examining initialization resources from
+     * various places to determine the class to instantiate and return.
+     *
+     * @return an instance of an object that extends <code>PAPEngineFactory</code> to use in creating <code>PAPEngine</code> objects.
+     * @throws FactoryException
+     */
+    public static PAPEngineFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PAPEngineFactory.class);
+    }
+
+    /**
+     * Creates a new <code>PAPEngineFactory</code> instance by examining initialization resources from
+     * various places to determine the class to instantiate and return.
+     *
+     * @return an instance of an object that extends <code>PAPEngineFactory</code> to use in creating <code>PAPEngine</code> objects.
+     * @throws FactoryException
+     */
+    public static PAPEngineFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PAPEngineFactory.class, properties);
+    }
+
+    /**
+     * Creates a new <code>PAPEngineFactory</code> instance using the given class name and <code>ClassLoader</code>.  If the
+     * <code>ClassLoader</code> is null, use the default thread class loader.
+     *
+     * @param factoryClassName the <code>String</code> name of the factory class to instantiate
+     * @param classLoader the <code>ClassLoader</code> to use to load the factory class
+     * @return an instance of an object that extends <code>PAPEngineFactory</code> to use in creating <code>PAPEngine</code> objects.
+     */
+    public static PAPEngineFactory newInstance(String factoryClassName, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(factoryClassName, PAPEngineFactory.class, classLoader, false);
+    }
+
+    /**
+     * Creates a new <code>PAPEngineFactory</code> instance using the given class name and the default thread class loader.
+     *
+     * @param factoryClassName the <code>String</code> name of the factory class to instantiate
+     * @return an instance of an object that extends <code>PAPEngineFactory</code> to use in creating <code>PAPEngine</code> objects.
+     */
+    public static PAPEngineFactory newInstance(String factoryClassName) throws FactoryException {
+        return FactoryFinder.newInstance(factoryClassName, PAPEngineFactory.class, null, true);
+    }
+
+    /**
+     * Creates a new <code>PAPEngine</code> based on the configured <code>PAPEngineFactory</code>.
+     *
+     * @return a new <code>PAPEngine</code>
+     * @throws com.att.research.xacml.api.pap.PAPException
+     */
+    public abstract PAPEngine newEngine() throws FactoryException, PAPException;
+
+    /**
+     * Creates a new <code>PAPEngine</code> based on the configured <code>PAPEngineFactory</code>.
+     *
+     * @return a new <code>PAPEngine</code>
+     * @throws com.att.research.xacml.api.pap.PAPException
+     */
+    public abstract PAPEngine newEngine(Properties properties) throws FactoryException, PAPException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPException.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPException.java
index 6d65a55..9523b6e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PAPException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -31,25 +31,25 @@
 package com.att.research.xacml.api.pap;
 
 public class PAPException extends Exception {
-        private static final long serialVersionUID = 8291987599333392339L;
+    private static final long serialVersionUID = 8291987599333392339L;
 
-        public PAPException() {
-        }
+    public PAPException() {
+    }
 
-        public PAPException(String message) {
-                super(message);
-        }
+    public PAPException(String message) {
+        super(message);
+    }
 
-        public PAPException(Throwable cause) {
-                super(cause);
-        }
+    public PAPException(Throwable cause) {
+        super(cause);
+    }
 
-        public PAPException(String message, Throwable cause) {
-                super(message, cause);
-        }
+    public PAPException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-        public PAPException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-                super(message, cause, enableSuppression, writableStackTrace);
-        }
+    public PAPException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDP.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDP.java
index ccadbae..46136de 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDP.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDP.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,27 +40,28 @@
 /*
  * The following allows us to use Jackson to convert sub-types of this type into JSON and back to objects.
  */
-@JsonTypeInfo(  
-            use = JsonTypeInfo.Id.NAME,  
-            include = JsonTypeInfo.As.PROPERTY,  
-            property = "PDPType")  
-@JsonSubTypes({  
-            @Type(value = StdPDP.class, name = "StdPDP") })
+@JsonTypeInfo(
+    use = JsonTypeInfo.Id.NAME,
+    include = JsonTypeInfo.As.PROPERTY,
+    property = "PDPType")
+@JsonSubTypes({
+    @Type(value = StdPDP.class, name = "StdPDP")
+})
 public interface PDP {
-        
-        public String 						getId();
-        
-        public String						getName();
-        
-        public void							setName(String name);
-        
-        public String						getDescription();
-        
-        public void							setDescription(String description);
-        
-        public PDPStatus					getStatus();
 
-        public Set<PDPPolicy>	 			getPolicies();
+    public String 						getId();
 
-        public Set<PDPPIPConfig> 			getPipConfigs();
+    public String						getName();
+
+    public void							setName(String name);
+
+    public String						getDescription();
+
+    public void							setDescription(String description);
+
+    public PDPStatus					getStatus();
+
+    public Set<PDPPolicy>	 			getPolicies();
+
+    public Set<PDPPIPConfig> 			getPipConfigs();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPGroup.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPGroup.java
index 7510a44..1fb0865 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPGroup.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPGroup.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,45 +34,45 @@
 import java.util.Set;
 
 public interface PDPGroup {
-        
-        /*
-         * The ID is a string that is unique within the current set of groups.
-         * It is generated by the code.
-         * It is distinct from the name in that the ID must be able to be a directory name
-         * and a key in a properties file.
-         * The ID does not need to be unique forever.  It just needs to distinguish this group from other groups that currently exist.
-         */
-        public String						getId();
-        
-        public boolean						isDefaultGroup();
-        
-        /*
-         * The name is a free-form string that is user input.
-         */
-        public String 						getName();
-        
-        public void							setName(String name);
-        
-        public String 						getDescription();
-        
-        public void							setDescription(String description);
-        
-        public PDPGroupStatus				getStatus();
 
-        public Set<PDP> 					getPdps();
-        
-        public Set<PDPPolicy>	 			getPolicies();
-        
-        public PDPPolicy					getPolicy(String id);
+    /*
+     * The ID is a string that is unique within the current set of groups.
+     * It is generated by the code.
+     * It is distinct from the name in that the ID must be able to be a directory name
+     * and a key in a properties file.
+     * The ID does not need to be unique forever.  It just needs to distinguish this group from other groups that currently exist.
+     */
+    public String						getId();
 
-        public Properties		 			getPolicyProperties();
+    public boolean						isDefaultGroup();
 
-        public Set<PDPPIPConfig> 			getPipConfigs();
-        
-        public PDPPIPConfig					getPipConfig(String id);
-        
-        public Properties		 			getPipConfigProperties();
+    /*
+     * The name is a free-form string that is user input.
+     */
+    public String 						getName();
 
-        public void							repair();
-                
+    public void							setName(String name);
+
+    public String 						getDescription();
+
+    public void							setDescription(String description);
+
+    public PDPGroupStatus				getStatus();
+
+    public Set<PDP> 					getPdps();
+
+    public Set<PDPPolicy>	 			getPolicies();
+
+    public PDPPolicy					getPolicy(String id);
+
+    public Properties		 			getPolicyProperties();
+
+    public Set<PDPPIPConfig> 			getPipConfigs();
+
+    public PDPPIPConfig					getPipConfig(String id);
+
+    public Properties		 			getPipConfigProperties();
+
+    public void							repair();
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPGroupStatus.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPGroupStatus.java
index 7ff4c5a..cb13153 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPGroupStatus.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPGroupStatus.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,53 +41,54 @@
 /*
  * The following allows us to use Jackson to convert sub-types of this type into JSON and back to objects.
  */
-@JsonTypeInfo(  
-            use = JsonTypeInfo.Id.NAME,  
-            include = JsonTypeInfo.As.PROPERTY,  
-            property = "PDPGroupStatusType")  
-@JsonSubTypes({  
-            @Type(value = StdPDPGroupStatus.class, name = "StdPDPGroupStatus") }) 
+@JsonTypeInfo(
+    use = JsonTypeInfo.Id.NAME,
+    include = JsonTypeInfo.As.PROPERTY,
+    property = "PDPGroupStatusType")
+@JsonSubTypes({
+    @Type(value = StdPDPGroupStatus.class, name = "StdPDPGroupStatus")
+})
 public interface PDPGroupStatus {
-        
-        public enum Status {
-                OK,
-                OUT_OF_SYNCH,
-                LOAD_ERRORS,
-                UPDATING_CONFIGURATION,
-                UNKNOWN
-        }
-        
-        Status						getStatus();
-        
-        public Set<String>			getLoadErrors();
-        
-        public Set<String>			getLoadWarnings();
-        
-        public Set<PDPPolicy>		getLoadedPolicies();
-        
-        public Set<PDPPolicy>		getFailedPolicies();
-        
-        public boolean				policiesOK();
-        
-        public Set<PDPPIPConfig>	getLoadedPipConfigs();
-        
-        public Set<PDPPIPConfig>	getFailedPipConfigs();
-        
-        public boolean				pipConfigOK();
-        
-        public Set<PDP>				getInSynchPDPs();
-        
-        public Set<PDP>				getOutOfSynchPDPs();
-        
-        public Set<PDP>				getFailedPDPs();
-        
-        public Set<PDP>				getUpdatingPDPs();
-        
-        public Set<PDP>				getLastUpdateFailedPDPs();
-        
-        public Set<PDP>				getUnknownStatusPDPs();
-        
-        public boolean				pdpsOK();
 
-        public boolean				isGroupOk();
+    public enum Status {
+        OK,
+        OUT_OF_SYNCH,
+        LOAD_ERRORS,
+        UPDATING_CONFIGURATION,
+        UNKNOWN
+    }
+
+    Status						getStatus();
+
+    public Set<String>			getLoadErrors();
+
+    public Set<String>			getLoadWarnings();
+
+    public Set<PDPPolicy>		getLoadedPolicies();
+
+    public Set<PDPPolicy>		getFailedPolicies();
+
+    public boolean				policiesOK();
+
+    public Set<PDPPIPConfig>	getLoadedPipConfigs();
+
+    public Set<PDPPIPConfig>	getFailedPipConfigs();
+
+    public boolean				pipConfigOK();
+
+    public Set<PDP>				getInSynchPDPs();
+
+    public Set<PDP>				getOutOfSynchPDPs();
+
+    public Set<PDP>				getFailedPDPs();
+
+    public Set<PDP>				getUpdatingPDPs();
+
+    public Set<PDP>				getLastUpdateFailedPDPs();
+
+    public Set<PDP>				getUnknownStatusPDPs();
+
+    public boolean				pdpsOK();
+
+    public boolean				isGroupOk();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPPIPConfig.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPPIPConfig.java
index 35ee4c9..aca88a4 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPPIPConfig.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPPIPConfig.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,24 +41,25 @@
 /*
  * The following allows us to use Jackson to convert sub-types of this type into JSON and back to objects.
  */
-@JsonTypeInfo(  
-            use = JsonTypeInfo.Id.NAME,  
-            include = JsonTypeInfo.As.PROPERTY,  
-            property = "PDPPIPConfigType")  
-@JsonSubTypes({  
-            @Type(value = StdPDPPIPConfig.class, name = "StdPDPPIPConfig") })  
+@JsonTypeInfo(
+    use = JsonTypeInfo.Id.NAME,
+    include = JsonTypeInfo.As.PROPERTY,
+    property = "PDPPIPConfigType")
+@JsonSubTypes({
+    @Type(value = StdPDPPIPConfig.class, name = "StdPDPPIPConfig")
+})
 public interface PDPPIPConfig {
-        
-        public String				getId();
-        
-        public String 				getName();
-        
-        public String				getDescription();
 
-        public String 				getClassname();
+    public String				getId();
 
-        public Map<String,String>	getConfiguration();
-        
-        public boolean				isConfigured();
+    public String 				getName();
+
+    public String				getDescription();
+
+    public String 				getClassname();
+
+    public Map<String,String>	getConfiguration();
+
+    public boolean				isConfigured();
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPPolicy.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPPolicy.java
index d58df35..3ce958a 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPPolicy.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPPolicy.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,30 +43,31 @@
 /*
  * The following allows us to use Jackson to convert sub-types of this type into JSON and back to objects.
  */
-@JsonTypeInfo(  
-            use = JsonTypeInfo.Id.NAME,  
-            include = JsonTypeInfo.As.PROPERTY,  
-            property = "PDPPolicyType")  
-@JsonSubTypes({  
-            @Type(value = StdPDPPolicy.class, name = "StdPDPPolicy") })  
+@JsonTypeInfo(
+    use = JsonTypeInfo.Id.NAME,
+    include = JsonTypeInfo.As.PROPERTY,
+    property = "PDPPolicyType")
+@JsonSubTypes({
+    @Type(value = StdPDPPolicy.class, name = "StdPDPPolicy")
+})
 public interface PDPPolicy {
-        
-        public String 		getId();
-        
-        public String		getName();
-        
-        public String		getPolicyId();
-        
-        public String		getDescription();
 
-        public String 		getVersion();
-        public int[]		getVersionInts();
-        
-        public boolean		isRoot();
-        
-        public boolean		isValid();
+    public String 		getId();
 
-        public InputStream 	getStream() throws PAPException, IOException;
+    public String		getName();
 
-        public URI			getLocation() throws PAPException, IOException;
+    public String		getPolicyId();
+
+    public String		getDescription();
+
+    public String 		getVersion();
+    public int[]		getVersionInts();
+
+    public boolean		isRoot();
+
+    public boolean		isValid();
+
+    public InputStream 	getStream() throws PAPException, IOException;
+
+    public URI			getLocation() throws PAPException, IOException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPStatus.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPStatus.java
index d5e1c46..20b5905 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPStatus.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/PDPStatus.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,45 +41,46 @@
 /*
  * The following allows us to use Jackson to convert sub-types of this type into JSON and back to objects.
  */
-@JsonTypeInfo(  
-            use = JsonTypeInfo.Id.NAME,  
-            include = JsonTypeInfo.As.PROPERTY,  
-            property = "PDPStatusType")  
-@JsonSubTypes({  
-            @Type(value = StdPDPStatus.class, name = "StdPDPStatus") }) 
+@JsonTypeInfo(
+    use = JsonTypeInfo.Id.NAME,
+    include = JsonTypeInfo.As.PROPERTY,
+    property = "PDPStatusType")
+@JsonSubTypes({
+    @Type(value = StdPDPStatus.class, name = "StdPDPStatus")
+})
 public interface PDPStatus {
-        
-        public enum Status {
-                UP_TO_DATE,
-                OUT_OF_SYNCH,
-                LOAD_ERRORS,
-                UPDATING_CONFIGURATION,
-                LAST_UPDATE_FAILED,
-                UNKNOWN,
-                NO_SUCH_HOST,
-                CANNOT_CONNECT
-        }
-        
-        public Status				getStatus();
-        
-        public Set<String>			getLoadErrors();
-        
-        public Set<String>			getLoadWarnings();
-        
-        public Set<PDPPolicy>		getLoadedPolicies();
-        
-        public Set<PDPPolicy>		getLoadedRootPolicies();
-        
-        public Set<PDPPolicy>		getFailedPolicies();
-        
-        public boolean				policiesOK();
-        
-        public Set<PDPPIPConfig>	getLoadedPipConfigs();
-        
-        public Set<PDPPIPConfig>	getFailedPipConfigs();
-        
-        public boolean				pipConfigOK();
-        
-        public boolean				isOk();
+
+    public enum Status {
+        UP_TO_DATE,
+        OUT_OF_SYNCH,
+        LOAD_ERRORS,
+        UPDATING_CONFIGURATION,
+        LAST_UPDATE_FAILED,
+        UNKNOWN,
+        NO_SUCH_HOST,
+        CANNOT_CONNECT
+    }
+
+    public Status				getStatus();
+
+    public Set<String>			getLoadErrors();
+
+    public Set<String>			getLoadWarnings();
+
+    public Set<PDPPolicy>		getLoadedPolicies();
+
+    public Set<PDPPolicy>		getLoadedRootPolicies();
+
+    public Set<PDPPolicy>		getFailedPolicies();
+
+    public boolean				policiesOK();
+
+    public Set<PDPPIPConfig>	getLoadedPipConfigs();
+
+    public Set<PDPPIPConfig>	getFailedPipConfigs();
+
+    public boolean				pipConfigOK();
+
+    public boolean				isOk();
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/package-info.java
index a516ff5..4200ef3 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pap/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -29,10 +29,10 @@
  *                     All Rights Reserved
  */
 /**
- * 
+ *
  * The PAP interface's defined here are an attempt at defining an API for PAP implementations. There is nothing in
  * the XACML 3.0 specification for doing so. Thus, this API is open to suggestions and is simply optional to utilize.
- * 
+ *
  * @author pameladragosh
  *
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPEngine.java
index b02e21f..b1868e0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,32 +39,32 @@
 
 /**
  * PEPEngine is the interface that applications use to make policy queries against a XACML 3.0 policy engine.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface PDPEngine {
-        /**
-         * Evaluates the given {@link com.att.research.xacml.api.Request} using this <code>PDPEngine</code>'s
-         * Policy Sets to determine if the given <code>Request</code> is allowed.
-         * 
-         * @param pepRequest the <code>Request</code> to evaluate
-         * @return a {@link com.att.research.xacml.api.Response} indicating the decision
-         */
-        public Response decide(Request pepRequest) throws PDPException;
-        
-        /**
-         * Gets the <code>Collection</code> of <code>URI</code>s that represent the profiles supported by this <code>PDPEngine</code>.
-         * 
-         * @return an <code>Collection</code> over the <code>URI</code>s that represent the profiles supported by this <code>PDPEngine</code>.
-         */
-        public Collection<URI> getProfiles();
-        
-        /**
-         * Determines if this <code>PDPEngine</code> supports the given <code>URI</code> profile.
-         * 
-         * @param uriProfile the <code>URI</code> representing the profile feature requested.
-         * @return true if the profile is supported, else false
-         */
-        public boolean hasProfile(URI uriProfile);
+    /**
+     * Evaluates the given {@link com.att.research.xacml.api.Request} using this <code>PDPEngine</code>'s
+     * Policy Sets to determine if the given <code>Request</code> is allowed.
+     *
+     * @param pepRequest the <code>Request</code> to evaluate
+     * @return a {@link com.att.research.xacml.api.Response} indicating the decision
+     */
+    public Response decide(Request pepRequest) throws PDPException;
+
+    /**
+     * Gets the <code>Collection</code> of <code>URI</code>s that represent the profiles supported by this <code>PDPEngine</code>.
+     *
+     * @return an <code>Collection</code> over the <code>URI</code>s that represent the profiles supported by this <code>PDPEngine</code>.
+     */
+    public Collection<URI> getProfiles();
+
+    /**
+     * Determines if this <code>PDPEngine</code> supports the given <code>URI</code> profile.
+     *
+     * @param uriProfile the <code>URI</code> representing the profile feature requested.
+     * @return true if the profile is supported, else false
+     */
+    public boolean hasProfile(URI uriProfile);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPEngineFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPEngineFactory.java
index 4a45bbb..06c23d5 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPEngineFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,167 +40,167 @@
 
 /**
  * PDPEngineFactory provides the interface for creating {@link com.att.research.xacml.pep.PDPEngine} instances.
- * 
+ *
  * @author car
  * @version ${Revision}
  */
 public abstract class PDPEngineFactory {
-        private static final String	FACTORYID					= XACMLProperties.PROP_PDPENGINEFACTORY;
-        private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.ATTPDPEngineFactory";
-        
-        private Decision defaultBehavior	= Decision.INDETERMINATE;
-        private ScopeResolver scopeResolver;
-        
-        protected static Decision getConfiguredDefaultBehavior() {
-                String defaultDecisionString = XACMLProperties.getProperty(XACMLProperties.PROP_PDP_BEHAVIOR);
-                if (defaultDecisionString != null && defaultDecisionString.length() > 0) {
-                        return Decision.get(defaultDecisionString);
-                } else {
-                        return null;
-                }
-        }
-        
-        protected static Decision getConfiguredDefaultBehavior(Properties properties) {
-                String defaultDecisionString = properties.getProperty(XACMLProperties.PROP_PDP_BEHAVIOR);
-                if (defaultDecisionString != null && defaultDecisionString.length() > 0) {
-                        return Decision.get(defaultDecisionString);
-                } else {
-                        return null;
-                }
-        }
-        
-        /**
-         * The constructor is protected to prevent instantiation of the class.
-         */
-        protected PDPEngineFactory() {
-        }
-        
-        /**
-         * The constructor is protected to prevent instantiation of the class.
-         */
-        protected PDPEngineFactory(Properties properties) {
-        }
-        
-        /**
-         * Creates a new <code>PDPEngineFactory</code> instance by examining initialization resources from
-         * various places to determine the class to instantiate and return.
-         * 
-         * @return an instance of an object that extends <code>PDPEngineFactory</code> to use in creating <code>PDPEngine</code> objects.
-         */
-        public static PDPEngineFactory newInstance() throws FactoryException {
-                PDPEngineFactory pdpEngineFactory	= FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PDPEngineFactory.class);
-                Decision defaultDecisionBehavior	= getConfiguredDefaultBehavior();
-                if (defaultDecisionBehavior != null) {
-                        pdpEngineFactory.setDefaultBehavior(defaultDecisionBehavior);
-                }
-                return pdpEngineFactory;
-        }
-        
-        /**
-         * Creates a new <code>PDPEngineFactory</code> instance by examining initialization resources from
-         * various places to determine the class to instantiate and return.
-         * 
-         * @return an instance of an object that extends <code>PDPEngineFactory</code> to use in creating <code>PDPEngine</code> objects.
-         */
-        public static PDPEngineFactory newInstance(Properties properties) throws FactoryException {
-                PDPEngineFactory pdpEngineFactory	= FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PDPEngineFactory.class, properties);
-                Decision defaultDecisionBehavior	= getConfiguredDefaultBehavior(properties);
-                if (defaultDecisionBehavior != null) {
-                        pdpEngineFactory.setDefaultBehavior(defaultDecisionBehavior);
-                }
-                return pdpEngineFactory;
-        }
-        
-        /**
-         * Creates a new <code>PDPEngineFactory</code> instance using the given class name and <code>ClassLoader</code>.  If the
-         * <code>ClassLoader</code> is null, use the default thread class loader.
-         * 
-         * @param factoryClassName the <code>String</code> name of the factory class to instantiate
-         * @param classLoader the <code>ClassLoader</code> to use to load the factory class
-         * @return an instance of an object that extends <code>PDPEngineFactory</code> to use in creating <code>PDPEngine</code> objects.
-         */
-        public static PDPEngineFactory newInstance(String factoryClassName, ClassLoader classLoader) throws FactoryException {
-                PDPEngineFactory pdpEngineFactory	=  FactoryFinder.newInstance(factoryClassName, PDPEngineFactory.class, classLoader, false);
-                Decision defaultDecisionBehavior	= getConfiguredDefaultBehavior();
-                if (defaultDecisionBehavior != null) {
-                        pdpEngineFactory.setDefaultBehavior(defaultDecisionBehavior);
-                }
-                return pdpEngineFactory;
-        }
-        
-        /**
-         * Creates a new <code>PDPEngineFactory</code> instance using the given class name and the default thread class loader.
-         * 
-         * @param factoryClassName the <code>String</code> name of the factory class to instantiate
-         * @return an instance of an object that extends <code>PDPEngineFactory</code> to use in creating <code>PDPEngine</code> objects.
-         */
-        public static PDPEngineFactory newInstance(String factoryClassName) throws FactoryException {
-                PDPEngineFactory pdpEngineFactory	= FactoryFinder.newInstance(factoryClassName, PDPEngineFactory.class, null, true);
-                Decision defaultDecisionBehavior	= getConfiguredDefaultBehavior();
-                if (defaultDecisionBehavior != null) {
-                        pdpEngineFactory.setDefaultBehavior(defaultDecisionBehavior);
-                }
-                return pdpEngineFactory;
-        }
-        
-        /**
-         * Creates a new <code>PDPEngine</code> using the default policy set and {@link com.att.research.xacml.api.pip.PIPFinder}.
-         * 
-         * @return a new <code>PDPEngine</code>
-         */
-        public abstract PDPEngine newEngine() throws FactoryException;
-        
-        /**
-         * Creates a new <code>PDPEngine</code> using the default policy set and {@link com.att.research.xacml.api.pip.PIPFinder}.
-         * 
-         * @return a new <code>PDPEngine</code>
-         */
-        public abstract PDPEngine newEngine(Properties properties) throws FactoryException;
-        
-        /*
-         * TODO: There needs to be an interface where you can request a PDPEngine based on a set of profiles.  This could be quite complex,
-         * with required and optional profile values specified.
-         */
-        
-        /**
-         * Gets the default <code>Decision</code> that a <code>PDPEngine</code> created from this <code>PDPEngineFactory</code>
-         * will return when there is no applicable root policy.
-         * 
-         * @return the <code>Decision</code> that a <code>PDPEngine</code> created from this <code>PDPEngineFactory</code.
-         * will return when there is no applicable root policy.
-         */
-        public Decision getDefaultBehavior() {
-                return this.defaultBehavior;
-        }
-        
-        /**
-         * Sets the default <code>Decision</code> that a <code>PDPEngine</code> created from this <code>PDPEngineFactory</code>
-         * will return when there is no applicable root policy.
-         * 
-         * @param decision the <code>Decision</code> to return
-         */
-        public void setDefaultBehavior(Decision decision) {
-                this.defaultBehavior	= decision;
-        }
+    private static final String	FACTORYID					= XACMLProperties.PROP_PDPENGINEFACTORY;
+    private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacmlatt.pdp.ATTPDPEngineFactory";
 
-        /**
-         * Gets the current {@link ScopeResolver} used by <code>PDPEngine</code>s created with this
-         * <code>PDPEngineFactory</code> will use to expand scope attributes in a <code>Request</code>.
-         * 
-         * @return the current <code>ScopeResolver</code> for this <code>PDPEngineFactory</code>
-         */
-        public ScopeResolver getScopeResolver() {
-                return this.scopeResolver;
+    private Decision defaultBehavior	= Decision.INDETERMINATE;
+    private ScopeResolver scopeResolver;
+
+    protected static Decision getConfiguredDefaultBehavior() {
+        String defaultDecisionString = XACMLProperties.getProperty(XACMLProperties.PROP_PDP_BEHAVIOR);
+        if (defaultDecisionString != null && defaultDecisionString.length() > 0) {
+            return Decision.get(defaultDecisionString);
+        } else {
+            return null;
         }
-        
-        /**
-         * Sets the <code>ScopeResolver</code> used by <code>PDPEngine</code>s created with this
-         * <code>PDPEngineFactory</code>.
-         * 
-         * @param scopeResolverIn
-         */
-        public void setScopeResolver(ScopeResolver scopeResolverIn) {
-                this.scopeResolver	= scopeResolverIn;
+    }
+
+    protected static Decision getConfiguredDefaultBehavior(Properties properties) {
+        String defaultDecisionString = properties.getProperty(XACMLProperties.PROP_PDP_BEHAVIOR);
+        if (defaultDecisionString != null && defaultDecisionString.length() > 0) {
+            return Decision.get(defaultDecisionString);
+        } else {
+            return null;
         }
-        
+    }
+
+    /**
+     * The constructor is protected to prevent instantiation of the class.
+     */
+    protected PDPEngineFactory() {
+    }
+
+    /**
+     * The constructor is protected to prevent instantiation of the class.
+     */
+    protected PDPEngineFactory(Properties properties) {
+    }
+
+    /**
+     * Creates a new <code>PDPEngineFactory</code> instance by examining initialization resources from
+     * various places to determine the class to instantiate and return.
+     *
+     * @return an instance of an object that extends <code>PDPEngineFactory</code> to use in creating <code>PDPEngine</code> objects.
+     */
+    public static PDPEngineFactory newInstance() throws FactoryException {
+        PDPEngineFactory pdpEngineFactory	= FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PDPEngineFactory.class);
+        Decision defaultDecisionBehavior	= getConfiguredDefaultBehavior();
+        if (defaultDecisionBehavior != null) {
+            pdpEngineFactory.setDefaultBehavior(defaultDecisionBehavior);
+        }
+        return pdpEngineFactory;
+    }
+
+    /**
+     * Creates a new <code>PDPEngineFactory</code> instance by examining initialization resources from
+     * various places to determine the class to instantiate and return.
+     *
+     * @return an instance of an object that extends <code>PDPEngineFactory</code> to use in creating <code>PDPEngine</code> objects.
+     */
+    public static PDPEngineFactory newInstance(Properties properties) throws FactoryException {
+        PDPEngineFactory pdpEngineFactory	= FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PDPEngineFactory.class, properties);
+        Decision defaultDecisionBehavior	= getConfiguredDefaultBehavior(properties);
+        if (defaultDecisionBehavior != null) {
+            pdpEngineFactory.setDefaultBehavior(defaultDecisionBehavior);
+        }
+        return pdpEngineFactory;
+    }
+
+    /**
+     * Creates a new <code>PDPEngineFactory</code> instance using the given class name and <code>ClassLoader</code>.  If the
+     * <code>ClassLoader</code> is null, use the default thread class loader.
+     *
+     * @param factoryClassName the <code>String</code> name of the factory class to instantiate
+     * @param classLoader the <code>ClassLoader</code> to use to load the factory class
+     * @return an instance of an object that extends <code>PDPEngineFactory</code> to use in creating <code>PDPEngine</code> objects.
+     */
+    public static PDPEngineFactory newInstance(String factoryClassName, ClassLoader classLoader) throws FactoryException {
+        PDPEngineFactory pdpEngineFactory	=  FactoryFinder.newInstance(factoryClassName, PDPEngineFactory.class, classLoader, false);
+        Decision defaultDecisionBehavior	= getConfiguredDefaultBehavior();
+        if (defaultDecisionBehavior != null) {
+            pdpEngineFactory.setDefaultBehavior(defaultDecisionBehavior);
+        }
+        return pdpEngineFactory;
+    }
+
+    /**
+     * Creates a new <code>PDPEngineFactory</code> instance using the given class name and the default thread class loader.
+     *
+     * @param factoryClassName the <code>String</code> name of the factory class to instantiate
+     * @return an instance of an object that extends <code>PDPEngineFactory</code> to use in creating <code>PDPEngine</code> objects.
+     */
+    public static PDPEngineFactory newInstance(String factoryClassName) throws FactoryException {
+        PDPEngineFactory pdpEngineFactory	= FactoryFinder.newInstance(factoryClassName, PDPEngineFactory.class, null, true);
+        Decision defaultDecisionBehavior	= getConfiguredDefaultBehavior();
+        if (defaultDecisionBehavior != null) {
+            pdpEngineFactory.setDefaultBehavior(defaultDecisionBehavior);
+        }
+        return pdpEngineFactory;
+    }
+
+    /**
+     * Creates a new <code>PDPEngine</code> using the default policy set and {@link com.att.research.xacml.api.pip.PIPFinder}.
+     *
+     * @return a new <code>PDPEngine</code>
+     */
+    public abstract PDPEngine newEngine() throws FactoryException;
+
+    /**
+     * Creates a new <code>PDPEngine</code> using the default policy set and {@link com.att.research.xacml.api.pip.PIPFinder}.
+     *
+     * @return a new <code>PDPEngine</code>
+     */
+    public abstract PDPEngine newEngine(Properties properties) throws FactoryException;
+
+    /*
+     * TODO: There needs to be an interface where you can request a PDPEngine based on a set of profiles.  This could be quite complex,
+     * with required and optional profile values specified.
+     */
+
+    /**
+     * Gets the default <code>Decision</code> that a <code>PDPEngine</code> created from this <code>PDPEngineFactory</code>
+     * will return when there is no applicable root policy.
+     *
+     * @return the <code>Decision</code> that a <code>PDPEngine</code> created from this <code>PDPEngineFactory</code.
+     * will return when there is no applicable root policy.
+     */
+    public Decision getDefaultBehavior() {
+        return this.defaultBehavior;
+    }
+
+    /**
+     * Sets the default <code>Decision</code> that a <code>PDPEngine</code> created from this <code>PDPEngineFactory</code>
+     * will return when there is no applicable root policy.
+     *
+     * @param decision the <code>Decision</code> to return
+     */
+    public void setDefaultBehavior(Decision decision) {
+        this.defaultBehavior	= decision;
+    }
+
+    /**
+     * Gets the current {@link ScopeResolver} used by <code>PDPEngine</code>s created with this
+     * <code>PDPEngineFactory</code> will use to expand scope attributes in a <code>Request</code>.
+     *
+     * @return the current <code>ScopeResolver</code> for this <code>PDPEngineFactory</code>
+     */
+    public ScopeResolver getScopeResolver() {
+        return this.scopeResolver;
+    }
+
+    /**
+     * Sets the <code>ScopeResolver</code> used by <code>PDPEngine</code>s created with this
+     * <code>PDPEngineFactory</code>.
+     *
+     * @param scopeResolverIn
+     */
+    public void setScopeResolver(ScopeResolver scopeResolverIn) {
+        this.scopeResolver	= scopeResolverIn;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPException.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPException.java
index ef26d98..278501f 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/PDPException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,30 +33,30 @@
 /**
  * PEPException extends <code>Exception</code> to implement exceptions thrown by {@link PDPEngine} and {@link com.att.research.xacml.api.pdp.PDPEngineFactory}
  * classes.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class PDPException extends Exception {
-        private static final long serialVersionUID = -4287919889460770831L;
+    private static final long serialVersionUID = -4287919889460770831L;
 
-        public PDPException() {
-        }
+    public PDPException() {
+    }
 
-        public PDPException(String message) {
-                super(message);
-        }
+    public PDPException(String message) {
+        super(message);
+    }
 
-        public PDPException(Throwable cause) {
-                super(cause);
-        }
+    public PDPException(Throwable cause) {
+        super(cause);
+    }
 
-        public PDPException(String message, Throwable cause) {
-                super(message, cause);
-        }
+    public PDPException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-        public PDPException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-                super(message, cause, enableSuppression, writableStackTrace);
-        }
+    public PDPException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeQualifier.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeQualifier.java
index ef88bd1..8b36398 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeQualifier.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeQualifier.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,32 +32,32 @@
 
 /**
  * ScopeQualifier enumerates the values of the "scope" attribute in requests.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public enum ScopeQualifier {
-        CHILDREN("Children"),
-        DESCENDANTS("Descendants"),
-        IMMEDIATE("Immediate")
-        ;
-        
-        private String name;
-        
-        private ScopeQualifier(String nameIn) {
-                this.name	= nameIn;
+    CHILDREN("Children"),
+    DESCENDANTS("Descendants"),
+    IMMEDIATE("Immediate")
+    ;
+
+    private String name;
+
+    private ScopeQualifier(String nameIn) {
+        this.name	= nameIn;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public static ScopeQualifier getScopeQualifier(String name) {
+        for (ScopeQualifier sc: ScopeQualifier.values()) {
+            if (sc.getName().equals(name)) {
+                return sc;
+            }
         }
-        
-        public String getName() {
-                return this.name;
-        }
-        
-        public static ScopeQualifier getScopeQualifier(String name) {
-                for (ScopeQualifier sc: ScopeQualifier.values()) {
-                        if (sc.getName().equals(name)) {
-                                return sc;
-                        }
-                }
-                return null;
-        }
+        return null;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolver.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolver.java
index 8672366..4a16579 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolver.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,20 +35,20 @@
 /**
  * ScopeResolver is the interface that objects implement that can be used to resolve attribute scopes to individual
  * identifiers.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public interface ScopeResolver {
-        /**
-         * Examines the given {@link com.att.research.xacml.api.Attribute} representing a resource identifier for a hierarchical
-         * resource and returns an <code>Iterator</code> over a set of <code>Attribute</code>s representing individual resource identifiers
-         * that are part of the requested hierarchy as specified by the {@link com.att.research.xacml.api.pdp.ScopeQualifier}.
-         * 
-         * @param attributeResourceId the <code>Attribute</code> for the resource identifier
-         * @param scopeQualifier the <code>ScopeQualifier</code> determining which nodes are returned
-         * @return a {@link com.att.research.xacml.api.pdp.ScopeResolverResult} with the results of the request
-         * @throws ScopeResolverException if there is an error resolving the resource identifier to a scope.
-         */
-        public ScopeResolverResult resolveScope(Attribute attributeResourceId, ScopeQualifier scopeQualifier) throws ScopeResolverException;
+    /**
+     * Examines the given {@link com.att.research.xacml.api.Attribute} representing a resource identifier for a hierarchical
+     * resource and returns an <code>Iterator</code> over a set of <code>Attribute</code>s representing individual resource identifiers
+     * that are part of the requested hierarchy as specified by the {@link com.att.research.xacml.api.pdp.ScopeQualifier}.
+     *
+     * @param attributeResourceId the <code>Attribute</code> for the resource identifier
+     * @param scopeQualifier the <code>ScopeQualifier</code> determining which nodes are returned
+     * @return a {@link com.att.research.xacml.api.pdp.ScopeResolverResult} with the results of the request
+     * @throws ScopeResolverException if there is an error resolving the resource identifier to a scope.
+     */
+    public ScopeResolverResult resolveScope(Attribute attributeResourceId, ScopeQualifier scopeQualifier) throws ScopeResolverException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolverException.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolverException.java
index ca16f2c..c87d07c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolverException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolverException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,30 +32,30 @@
 
 /**
  * ScopeResolverException is thrown by the {@link ScopeResolver} interface methods.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class ScopeResolverException extends Exception {
-        private static final long serialVersionUID = -5818416719823811113L;
+    private static final long serialVersionUID = -5818416719823811113L;
 
-        public ScopeResolverException() {
-        }
+    public ScopeResolverException() {
+    }
 
-        public ScopeResolverException(String message) {
-                super(message);
-        }
+    public ScopeResolverException(String message) {
+        super(message);
+    }
 
-        public ScopeResolverException(Throwable cause) {
-                super(cause);
-        }
+    public ScopeResolverException(Throwable cause) {
+        super(cause);
+    }
 
-        public ScopeResolverException(String message, Throwable cause) {
-                super(message, cause);
-        }
+    public ScopeResolverException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-        public ScopeResolverException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-                super(message, cause, enableSuppression, writableStackTrace);
-        }
+    public ScopeResolverException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolverResult.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolverResult.java
index 2419fd5..2b43736 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolverResult.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/ScopeResolverResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,22 +38,22 @@
 /**
  * ScopeResolverResult is the interface for objects returned by the {@link ScopeResolver}'s
  * <code>resolveScope</code> method.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public interface ScopeResolverResult {
-        /*
-         * Gets the {@link com.att.research.xacml.api.Status} for the scope resolution request.
-         * 
-         * @return the <code>Status</code> of the scope resolution request
-         */
-        public Status getStatus();
-        
-        /*
-         * Gets an <code>Iterator</code> over {@link com.att.research.xacml.api.Attribute}s resolved from a scope resolution request.
-         * 
-         * @return an <code>Iterator</code> over the <code>Attribute</code>s resolved from a scope resolution request.
-         */
-        public Iterator<Attribute> getAttributes();
+    /*
+     * Gets the {@link com.att.research.xacml.api.Status} for the scope resolution request.
+     *
+     * @return the <code>Status</code> of the scope resolution request
+     */
+    public Status getStatus();
+
+    /*
+     * Gets an <code>Iterator</code> over {@link com.att.research.xacml.api.Attribute}s resolved from a scope resolution request.
+     *
+     * @return an <code>Iterator</code> over the <code>Attribute</code>s resolved from a scope resolution request.
+     */
+    public Iterator<Attribute> getAttributes();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/package-info.java
index aa33569..e41b97d 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pdp/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacml.api.pdp contains the XACML API for that PDP implementations must meet to be used by the standard PEP
  * implementation.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPEngine.java
index 5bb4da9..36f0def 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,17 +36,17 @@
 
 /**
  * PEPEngine is the interface that applications use to make policy queries against a XACML 3.0 policy engine.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface PEPEngine {
-        /**
-         * Instantiates a Policy Decision Point (PDP) to evaluate the given {@link com.att.research.xacml.api.Request} using its
-         * Policy Sets to determine if the given <code>Request</code> is allowed.
-         * 
-         * @param pepRequest the <code>Request</code> to evaluate
-         * @return a {@link com.att.research.xacml.api.Response} indicating the decision
-         */
-        public Response decide(Request pepRequest) throws PEPException;
+    /**
+     * Instantiates a Policy Decision Point (PDP) to evaluate the given {@link com.att.research.xacml.api.Request} using its
+     * Policy Sets to determine if the given <code>Request</code> is allowed.
+     *
+     * @param pepRequest the <code>Request</code> to evaluate
+     * @return a {@link com.att.research.xacml.api.Response} indicating the decision
+     */
+    public Response decide(Request pepRequest) throws PEPException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPEngineFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPEngineFactory.java
index 25862d1..1a9aae5 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPEngineFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,80 +39,80 @@
 
 /**
  * PEPEngineFactory provides the interface for creating {@link PEPEngine} instances.
- * 
+ *
  * @author car
  * @version ${Revision}
  */
 public abstract class PEPEngineFactory {
-        private static final String	FACTORYID	= XACMLProperties.PROP_PEPENGINEFACTORY;
-        private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.pep.StdEngineFactory";
-        
-        /**
-         * The constructor is protected to prevent instantiation of the class.
-         */
-        protected PEPEngineFactory() {
-        }
-        
-        /**
-         * The constructor is protected to prevent instantiation of the class.
-         */
-        protected PEPEngineFactory(Properties properties) {
-        }
-        
-        /**
-         * Creates a new <code>PEPEngineFactory</code> instance by examining initialization resources from
-         * various places to determine the class to instantiate and return.
-         * 
-         * @return an instance of an object that extends <code>PEPEngineFactory</code> to use in creating <code>PEPEngine</code> objects.
-         */
-        public static PEPEngineFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PEPEngineFactory.class);
-        }
-        
-        
-        /**
-         * Creates a new <code>PEPEngineFactory</code> instance by examining initialization resources from
-         * various places to determine the class to instantiate and return.
-         * 
-         * @return an instance of an object that extends <code>PEPEngineFactory</code> to use in creating <code>PEPEngine</code> objects.
-         */
-        public static PEPEngineFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PEPEngineFactory.class, properties);
-        }
-        
-        /**
-         * Creates a new <code>PEPEngineFactory</code> instance using the given class name and <code>ClassLoader</code>.  If the
-         * <code>ClassLoader</code> is null, use the default thread class loader.
-         * 
-         * @param factoryClassName the <code>String</code> name of the factory class to instantiate
-         * @param classLoader the <code>ClassLoader</code> to use to load the factory class
-         * @return an instance of an object that extends <code>PEPEngineFactory</code> to use in creating <code>PEPEngine</code> objects.
-         */
-        public static PEPEngineFactory newInstance(String factoryClassName, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(factoryClassName, PEPEngineFactory.class, classLoader, false);
-        }
-        
-        /**
-         * Creates a new <code>PEPEngineFactory</code> instance using the given class name and the default thread class loader.
-         * 
-         * @param factoryClassName the <code>String</code> name of the factory class to instantiate
-         * @return an instance of an object that extends <code>PEPEngineFactory</code> to use in creating <code>PEPEngine</code> objects.
-         */
-        public static PEPEngineFactory newInstance(String factoryClassName) throws FactoryException {
-                return FactoryFinder.newInstance(factoryClassName, PEPEngineFactory.class, null, true);
-        }
-        
-        /**
-         * Creates a new <code>PEPEngine</code> based on the configured <code>PEPEngineFactory</code>.
-         * 
-         * @return a new <code>PEPEngine</code>
-         */
-        public abstract PEPEngine newEngine() throws PEPException;
-        
-        /**
-         * Creates a new <code>PEPEngine</code> based on the configured <code>PEPEngineFactory</code>.
-         * 
-         * @return a new <code>PEPEngine</code>
-         */
-        public abstract PEPEngine newEngine(Properties properties) throws PEPException;
+    private static final String	FACTORYID	= XACMLProperties.PROP_PEPENGINEFACTORY;
+    private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.pep.StdEngineFactory";
+
+    /**
+     * The constructor is protected to prevent instantiation of the class.
+     */
+    protected PEPEngineFactory() {
+    }
+
+    /**
+     * The constructor is protected to prevent instantiation of the class.
+     */
+    protected PEPEngineFactory(Properties properties) {
+    }
+
+    /**
+     * Creates a new <code>PEPEngineFactory</code> instance by examining initialization resources from
+     * various places to determine the class to instantiate and return.
+     *
+     * @return an instance of an object that extends <code>PEPEngineFactory</code> to use in creating <code>PEPEngine</code> objects.
+     */
+    public static PEPEngineFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PEPEngineFactory.class);
+    }
+
+
+    /**
+     * Creates a new <code>PEPEngineFactory</code> instance by examining initialization resources from
+     * various places to determine the class to instantiate and return.
+     *
+     * @return an instance of an object that extends <code>PEPEngineFactory</code> to use in creating <code>PEPEngine</code> objects.
+     */
+    public static PEPEngineFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PEPEngineFactory.class, properties);
+    }
+
+    /**
+     * Creates a new <code>PEPEngineFactory</code> instance using the given class name and <code>ClassLoader</code>.  If the
+     * <code>ClassLoader</code> is null, use the default thread class loader.
+     *
+     * @param factoryClassName the <code>String</code> name of the factory class to instantiate
+     * @param classLoader the <code>ClassLoader</code> to use to load the factory class
+     * @return an instance of an object that extends <code>PEPEngineFactory</code> to use in creating <code>PEPEngine</code> objects.
+     */
+    public static PEPEngineFactory newInstance(String factoryClassName, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(factoryClassName, PEPEngineFactory.class, classLoader, false);
+    }
+
+    /**
+     * Creates a new <code>PEPEngineFactory</code> instance using the given class name and the default thread class loader.
+     *
+     * @param factoryClassName the <code>String</code> name of the factory class to instantiate
+     * @return an instance of an object that extends <code>PEPEngineFactory</code> to use in creating <code>PEPEngine</code> objects.
+     */
+    public static PEPEngineFactory newInstance(String factoryClassName) throws FactoryException {
+        return FactoryFinder.newInstance(factoryClassName, PEPEngineFactory.class, null, true);
+    }
+
+    /**
+     * Creates a new <code>PEPEngine</code> based on the configured <code>PEPEngineFactory</code>.
+     *
+     * @return a new <code>PEPEngine</code>
+     */
+    public abstract PEPEngine newEngine() throws PEPException;
+
+    /**
+     * Creates a new <code>PEPEngine</code> based on the configured <code>PEPEngineFactory</code>.
+     *
+     * @return a new <code>PEPEngine</code>
+     */
+    public abstract PEPEngine newEngine(Properties properties) throws PEPException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPException.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPException.java
index 1d1a5d3..d4a592b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/PEPException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,30 +33,30 @@
 /**
  * PEPException extends <code>Exception</code> to implement exceptions thrown by {@link PEPEngine} and {@link com.att.research.xacml.api.pep.PEPEngineFactory}
  * classes.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class PEPException extends Exception {
-        private static final long serialVersionUID = 5438207617158925229L;
+    private static final long serialVersionUID = 5438207617158925229L;
 
-        public PEPException() {
-        }
+    public PEPException() {
+    }
 
-        public PEPException(String message) {
-                super(message);
-        }
+    public PEPException(String message) {
+        super(message);
+    }
 
-        public PEPException(Throwable cause) {
-                super(cause);
-        }
+    public PEPException(Throwable cause) {
+        super(cause);
+    }
 
-        public PEPException(String message, Throwable cause) {
-                super(message, cause);
-        }
+    public PEPException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-        public PEPException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-                super(message, cause, enableSuppression, writableStackTrace);
-        }
+    public PEPException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/package-info.java
index b987025..fe6add6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pep/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 
 /**
  * com.att.research.xacml.api.pep contains the XACML API for the PEP interface
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPEngine.java
index 0b16a89..1b74f4b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,49 +34,49 @@
 
 /**
  * PIPEngine is the interface that objects implement that do look-up of {@link com.att.research.xacml.api.Attribute}s.
- * 
+ *
  * @author car
- * @version $Revision: 1.2 $ 
+ * @version $Revision: 1.2 $
  */
 public interface PIPEngine {
-        /**
-         * Gets the <code>String</code> name identifying this <code>PIPEngine</code>.  Names do not need to be unique.
-         * 
-         * @return the <code>String</code> name of this <code>PIPEngine</code>>
-         */
-        public String getName();
-        
-        /**
-         * Gets the <code>String</code> description of this <code>PIPEngine</code>.
-         * 
-         * @return the <code>String</code> description of this <code>PIPEngine</code>.
-         */
-        public String getDescription();
-        
-        /**
-         * Returns a list of PIPRequests required by the Engine to return an attribute(s).
-         * 
-         * @return Collection of required attributes
-         */
-        public Collection<PIPRequest>	attributesRequired();
-        
-        /**
-         * Returns a list of PIPRequest objects that the Engine can return.
-         * 
-         * @return Collection of provided attributes
-         */
-        public Collection<PIPRequest>	attributesProvided();
-        
-        /**
-         * Retrieves <code>Attribute</code>s that match the given {@link com.att.research.xacml.api.pip.PIPRequest}.
-         * The {@link com.att.research.xacml.api.pip.PIPResponse} may contain multiple <code>Attribute</code>s and they
-         * do not need to match the <code>PIPRequest</code>.  In this way, a <code>PIPEngine</code> may compute multiple
-         * related <code>Attribute</code>s at once.
-         * 
-         * @param pipRequest the <code>PIPRequest</code> defining which <code>Attribute</code>s should be retrieved
-         * @param pipFinder the <code>PIPFinder</code> to use for retrieving supporting attribute values
-         * @return a {@link com.att.research.xacml.pip.PIPResponse} with the results of the request
-         * @throws PIPException if there is an error retrieving the <code>Attribute</code>s.
-         */
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException;
+    /**
+     * Gets the <code>String</code> name identifying this <code>PIPEngine</code>.  Names do not need to be unique.
+     *
+     * @return the <code>String</code> name of this <code>PIPEngine</code>>
+     */
+    public String getName();
+
+    /**
+     * Gets the <code>String</code> description of this <code>PIPEngine</code>.
+     *
+     * @return the <code>String</code> description of this <code>PIPEngine</code>.
+     */
+    public String getDescription();
+
+    /**
+     * Returns a list of PIPRequests required by the Engine to return an attribute(s).
+     *
+     * @return Collection of required attributes
+     */
+    public Collection<PIPRequest>	attributesRequired();
+
+    /**
+     * Returns a list of PIPRequest objects that the Engine can return.
+     *
+     * @return Collection of provided attributes
+     */
+    public Collection<PIPRequest>	attributesProvided();
+
+    /**
+     * Retrieves <code>Attribute</code>s that match the given {@link com.att.research.xacml.api.pip.PIPRequest}.
+     * The {@link com.att.research.xacml.api.pip.PIPResponse} may contain multiple <code>Attribute</code>s and they
+     * do not need to match the <code>PIPRequest</code>.  In this way, a <code>PIPEngine</code> may compute multiple
+     * related <code>Attribute</code>s at once.
+     *
+     * @param pipRequest the <code>PIPRequest</code> defining which <code>Attribute</code>s should be retrieved
+     * @param pipFinder the <code>PIPFinder</code> to use for retrieving supporting attribute values
+     * @return a {@link com.att.research.xacml.pip.PIPResponse} with the results of the request
+     * @throws PIPException if there is an error retrieving the <code>Attribute</code>s.
+     */
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPException.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPException.java
index 6263b2a..81bec57 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,57 +33,57 @@
 /**
  * PIPException extends <code>Exception</code> to represent errors that can occur as a result of querying a
  * {@link PIPEngine} for {@link com.att.research.xacml.api.Attribute}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class PIPException extends Exception {
-        private static final long serialVersionUID = -6656926395983776184L;
-        private PIPRequest pipRequest;
-        private PIPEngine pipEngine;
-        
-        public PIPException() {
-        }
+    private static final long serialVersionUID = -6656926395983776184L;
+    private PIPRequest pipRequest;
+    private PIPEngine pipEngine;
 
-        public PIPException(String message) {
-                super(message);
-        }
+    public PIPException() {
+    }
 
-        public PIPException(Throwable cause) {
-                super(cause);
-        }
+    public PIPException(String message) {
+        super(message);
+    }
 
-        public PIPException(String message, Throwable cause) {
-                super(message, cause);
-        }
-        
-        public PIPException(PIPEngine pipEngineIn, PIPRequest pipRequestIn, String message, Throwable cause) {
-                this(message, cause);
-                this.pipEngine	= pipEngineIn;
-                this.pipRequest	= pipRequestIn;
-        }
-        
-        public PIPException(PIPEngine pipEngineIn, PIPRequest pipRequestIn, String message) {
-                this(message);
-                this.pipEngine	= pipEngineIn;
-                this.pipRequest	= pipRequestIn;
-        }
+    public PIPException(Throwable cause) {
+        super(cause);
+    }
 
-        /**
-         * Gets the <code>PIPRequest</code> that caused this <code>PIPException</code>
-         * 
-         * @return the <code>PIPRequest</code> that caused this <code>PIPException</code>
-         */
-        public PIPRequest getPIPRequest() {
-                return this.pipRequest;
-        }
-        
-        /**
-         * Gets the <code>PIPEngine</code> that caused this <code>PIPException</code>.
-         * 
-         * @return the <code>PIPEngine</code> that caused this <code>PIPException</code>
-         */
-        public PIPEngine getPIPEngine() {
-                return this.pipEngine;
-        }
+    public PIPException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public PIPException(PIPEngine pipEngineIn, PIPRequest pipRequestIn, String message, Throwable cause) {
+        this(message, cause);
+        this.pipEngine	= pipEngineIn;
+        this.pipRequest	= pipRequestIn;
+    }
+
+    public PIPException(PIPEngine pipEngineIn, PIPRequest pipRequestIn, String message) {
+        this(message);
+        this.pipEngine	= pipEngineIn;
+        this.pipRequest	= pipRequestIn;
+    }
+
+    /**
+     * Gets the <code>PIPRequest</code> that caused this <code>PIPException</code>
+     *
+     * @return the <code>PIPRequest</code> that caused this <code>PIPException</code>
+     */
+    public PIPRequest getPIPRequest() {
+        return this.pipRequest;
+    }
+
+    /**
+     * Gets the <code>PIPEngine</code> that caused this <code>PIPException</code>.
+     *
+     * @return the <code>PIPEngine</code> that caused this <code>PIPException</code>
+     */
+    public PIPEngine getPIPEngine() {
+        return this.pipEngine;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPFinder.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPFinder.java
index 3384cde..a8d6ac0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPFinder.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPFinder.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,61 +35,61 @@
 /**
  * PIPFinder is the interface objects implement that can query multiple sources of {@link com.att.research.xacml.api.Attribute}s based
  * on a {@link com.att.research.xacml.api.pip.PIPRequest}.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public interface PIPFinder {
-        /**
-         * Retrieves <code>Attribute</code>s that based on the given {@link com.att.research.xacml.api.pip.PIPRequest}.
-         * The {@link com.att.research.xacml.api.pip.PIPResponse} may contain multiple <code>Attribute</code>s and they
-         * do not need to match the <code>PIPRequest</code>.  In this way, a <code>PIPFinder</code> may compute multiple
-         * related <code>Attribute</code>s at once.
-         * 
-         * @param pipRequest the <code>PIPRequest</code> defining which <code>Attribute</code>s should be retrieved
-         * @param excude the (optional) <code>PIPEngine</code> to exclude from searches for the given <code>PIPRequest</code>
-         * @return a {@link com.att.research.xacml.pip.PIPResponse} with the results of the request
-         * @throws PIPException if there is an error retrieving the <code>Attribute</code>s.
-         */
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException;
-        
-        /**
-         * Retrieves <code>Attribute</code>s that match the given {@link com.att.research.xacml.api.pip.PIPRequest}.
-         * The {@link com.att.research.xacml.api.pip.PIPResponse} should only include a single {@link com.att.research.xacml.api.Attribute}
-         * with {@link com.att.research.xacml.api.AttributeValue}s whose data type matches the request.
-         * 
-         * @param pipRequest the <code>PIPRequest</code> defining which <code>Attribute</code>s should be retrieved
-         * @param excude the (optional) <code>PIPEngine</code> to exclude from searches for the given <code>PIPRequest</code>
-         * @return a {@link com.att.research.xacml.pip.PIPResponse} with the results of the request
-         * @throws PIPException if there is an error retrieving the <code>Attribute</code>s.
-         */
-        public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException;
-        
-        /**
-         * Retrieves <code>Attribute</code>s that based on the given <code>PIPRequest</code> as above.  If the
-         * <code>PIPFinder</code> invokes the <code>getAttributes</code> method on any child <code>PIPEngine</code>s,
-         * it should use the supplied <code>PIPFinder</code> rather than itself in the call.
-         * 
-         * @param pipRequest
-         * @param exclude
-         * @param pipFinderParent
-         * @return
-         * @throws PIPException
-         */
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException;
-        
-        /**
-         * Retrieves <code>Attribute</code>s that match the given <code>PIPRequest</code> as above.  If the
-         * <code>PIPFinder</code> invokes the <code>getAttributes</code> method on any child <code>PIPEngine</code>s,
-         * it should use the supplied <code>PIPFinder</code> rather than itself in the call.
-         * 
-         * @param pipRequest
-         * @param exclude
-         * @param pipFinderParent
-         * @return
-         * @throws PIPException
-         */
-        public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException;
-        
-        public Collection<PIPEngine>	getPIPEngines();
+    /**
+     * Retrieves <code>Attribute</code>s that based on the given {@link com.att.research.xacml.api.pip.PIPRequest}.
+     * The {@link com.att.research.xacml.api.pip.PIPResponse} may contain multiple <code>Attribute</code>s and they
+     * do not need to match the <code>PIPRequest</code>.  In this way, a <code>PIPFinder</code> may compute multiple
+     * related <code>Attribute</code>s at once.
+     *
+     * @param pipRequest the <code>PIPRequest</code> defining which <code>Attribute</code>s should be retrieved
+     * @param excude the (optional) <code>PIPEngine</code> to exclude from searches for the given <code>PIPRequest</code>
+     * @return a {@link com.att.research.xacml.pip.PIPResponse} with the results of the request
+     * @throws PIPException if there is an error retrieving the <code>Attribute</code>s.
+     */
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException;
+
+    /**
+     * Retrieves <code>Attribute</code>s that match the given {@link com.att.research.xacml.api.pip.PIPRequest}.
+     * The {@link com.att.research.xacml.api.pip.PIPResponse} should only include a single {@link com.att.research.xacml.api.Attribute}
+     * with {@link com.att.research.xacml.api.AttributeValue}s whose data type matches the request.
+     *
+     * @param pipRequest the <code>PIPRequest</code> defining which <code>Attribute</code>s should be retrieved
+     * @param excude the (optional) <code>PIPEngine</code> to exclude from searches for the given <code>PIPRequest</code>
+     * @return a {@link com.att.research.xacml.pip.PIPResponse} with the results of the request
+     * @throws PIPException if there is an error retrieving the <code>Attribute</code>s.
+     */
+    public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException;
+
+    /**
+     * Retrieves <code>Attribute</code>s that based on the given <code>PIPRequest</code> as above.  If the
+     * <code>PIPFinder</code> invokes the <code>getAttributes</code> method on any child <code>PIPEngine</code>s,
+     * it should use the supplied <code>PIPFinder</code> rather than itself in the call.
+     *
+     * @param pipRequest
+     * @param exclude
+     * @param pipFinderParent
+     * @return
+     * @throws PIPException
+     */
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException;
+
+    /**
+     * Retrieves <code>Attribute</code>s that match the given <code>PIPRequest</code> as above.  If the
+     * <code>PIPFinder</code> invokes the <code>getAttributes</code> method on any child <code>PIPEngine</code>s,
+     * it should use the supplied <code>PIPFinder</code> rather than itself in the call.
+     *
+     * @param pipRequest
+     * @param exclude
+     * @param pipFinderParent
+     * @return
+     * @throws PIPException
+     */
+    public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException;
+
+    public Collection<PIPEngine>	getPIPEngines();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPFinderFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPFinderFactory.java
index 8bf8aeb..e48bc6a 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPFinderFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPFinderFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,62 +38,62 @@
 
 /**
  * PIPFinderFactory is the factory class for getting the configured {@link PIPFinder}.
- * 
+ *
  * @author car
  * @version $Revision: 1.4 $
  */
 public abstract class PIPFinderFactory {
-        private static final String	FACTORYID					= XACMLProperties.PROP_PIPFINDERFACTORY;
-        private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.pip.StdPIPFinderFactory";
-        
-        protected Properties properties = null;
-        
-        /**
-         * Protected constructor so this class cannot be instantiated.
-         */
-        protected PIPFinderFactory() {
-        }
+    private static final String	FACTORYID					= XACMLProperties.PROP_PIPFINDERFACTORY;
+    private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.pip.StdPIPFinderFactory";
 
-        /**
-         * Protected constructor so this class cannot be instantiated.
-         */
-        protected PIPFinderFactory(Properties properties) {
-                this.properties = properties;
-        }
+    protected Properties properties = null;
 
-        /**
-         * Gets an instance of the configured <code>PIPFinderFactory</code> class.
-         * 
-         * @return the configured <code>PIPFinderFactory</code>
-         * @throws FactoryException if there is an error instantiating the factory
-         */
-        public static PIPFinderFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PIPFinderFactory.class);
-        }
-        
-        public static PIPFinderFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PIPFinderFactory.class, properties);
-        }
-        
-        public static PIPFinderFactory newInstance(String factoryClassName, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(factoryClassName, PIPFinderFactory.class, classLoader, false);
-        }
-        
-        public static PIPFinderFactory newInstance(String factoryClassName) throws FactoryException {
-                return FactoryFinder.newInstance(factoryClassName, PIPFinderFactory.class, null, true);
-        }
-        
-        /**
-         * Gets an instance of the configured <code>PIPFinder</code> class.
-         * 
-         * @return an instance of the configured <code>PIPFinder</code>
-         */
-        abstract public PIPFinder getFinder() throws PIPException ;
+    /**
+     * Protected constructor so this class cannot be instantiated.
+     */
+    protected PIPFinderFactory() {
+    }
 
-        /**
-         * Gets an instance of the configured <code>PIPFinder</code> class.
-         * 
-         * @return an instance of the configured <code>PIPFinder</code>
-         */
-        abstract public PIPFinder getFinder(Properties properties) throws PIPException ;
+    /**
+     * Protected constructor so this class cannot be instantiated.
+     */
+    protected PIPFinderFactory(Properties properties) {
+        this.properties = properties;
+    }
+
+    /**
+     * Gets an instance of the configured <code>PIPFinderFactory</code> class.
+     *
+     * @return the configured <code>PIPFinderFactory</code>
+     * @throws FactoryException if there is an error instantiating the factory
+     */
+    public static PIPFinderFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PIPFinderFactory.class);
+    }
+
+    public static PIPFinderFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, PIPFinderFactory.class, properties);
+    }
+
+    public static PIPFinderFactory newInstance(String factoryClassName, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(factoryClassName, PIPFinderFactory.class, classLoader, false);
+    }
+
+    public static PIPFinderFactory newInstance(String factoryClassName) throws FactoryException {
+        return FactoryFinder.newInstance(factoryClassName, PIPFinderFactory.class, null, true);
+    }
+
+    /**
+     * Gets an instance of the configured <code>PIPFinder</code> class.
+     *
+     * @return an instance of the configured <code>PIPFinder</code>
+     */
+    abstract public PIPFinder getFinder() throws PIPException ;
+
+    /**
+     * Gets an instance of the configured <code>PIPFinder</code> class.
+     *
+     * @return an instance of the configured <code>PIPFinder</code>
+     */
+    abstract public PIPFinder getFinder(Properties properties) throws PIPException ;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPRequest.java
index 3e69a04..de920db 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,37 +35,37 @@
 /**
  * PIPRequest is the interface that objects implement to represent a request to a {@link PIPEngine} to retrieve
  * attributes with values that meet a given request.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface PIPRequest {
-        /**
-         * Gets the {@link com.att.research.xacml.api.Identifier} of the category of the attributes to retrieve.
-         * 
-         * @return the <code>Identifier</code> for the category of the attributes to retrieve
-         */ 
-        public Identifier getCategory();
-        
-        /**
-         * Gets the <code>Identifier</code> of the attributes to retrieve.
-         * 
-         * @return the <code>Identifier</code> of the attributes to retrieve.
-         */
-        public Identifier getAttributeId();
-        
-        /**
-         * Gets the <code>Identifier</code> of the requested data type for attribute values.
-         * 
-         * @return the <code>Identifier</code> of the requested data type for attribute values
-         */
-        public Identifier getDataTypeId();
-        
-        /**
-         * Gets the <code>String</code> issuer identifier for the attributes to retrieve.
-         * 
-         * @return the <code>String</code> issuer identifier for the attributes to retrieve or null if there is no requirement to match the issuer.
-         */
-        public String getIssuer();
-        
+    /**
+     * Gets the {@link com.att.research.xacml.api.Identifier} of the category of the attributes to retrieve.
+     *
+     * @return the <code>Identifier</code> for the category of the attributes to retrieve
+     */
+    public Identifier getCategory();
+
+    /**
+     * Gets the <code>Identifier</code> of the attributes to retrieve.
+     *
+     * @return the <code>Identifier</code> of the attributes to retrieve.
+     */
+    public Identifier getAttributeId();
+
+    /**
+     * Gets the <code>Identifier</code> of the requested data type for attribute values.
+     *
+     * @return the <code>Identifier</code> of the requested data type for attribute values
+     */
+    public Identifier getDataTypeId();
+
+    /**
+     * Gets the <code>String</code> issuer identifier for the attributes to retrieve.
+     *
+     * @return the <code>String</code> issuer identifier for the attributes to retrieve or null if there is no requirement to match the issuer.
+     */
+    public String getIssuer();
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPResponse.java
index 4913ba3..c401a94 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/PIPResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,31 +37,31 @@
 
 /**
  * PIPResponse is the interface that objects implement that represent a response from a {@link PIPEngine}.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
-public interface PIPResponse {	
-        /**
-         * Gets the {@link com.att.research.xacml.api.Status} of the request to retrieve attributes from a <code>PIPEngine</code>.
-         * 
-         * @return the <code>Status</code> of the request to retrieve attributes from a <code>PIPEngine</code>
-         */
-        public Status getStatus();
-        
-        /**
-         * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s returned from a {@link PIPEngine}.
-         * The caller must not modify the returned <code>Collection</code>.  The implementation is free to enforce this with unmodifiable collections.
-         * 
-         * @return The <code>Collection</code> of <code>Attribute</code>s returned or an empty list if none are found
-         */
-        public Collection<Attribute> getAttributes();
-        
-        /**
-         * Determines if this <code>PIPResponse</code> is simple or not.  A simple <code>PIPResponse</code> contains a single
-         * {@link com.att.research.xacml.api.Attribute} whose {@link com.att.research.xacml.api.AttributeValue}s are all of the same data type.
-         * 
-         * @return true if this <code>PIPResponse</code> is simple, else false.
-         */
-        public boolean isSimple();
+public interface PIPResponse {
+    /**
+     * Gets the {@link com.att.research.xacml.api.Status} of the request to retrieve attributes from a <code>PIPEngine</code>.
+     *
+     * @return the <code>Status</code> of the request to retrieve attributes from a <code>PIPEngine</code>
+     */
+    public Status getStatus();
+
+    /**
+     * Gets the <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s returned from a {@link PIPEngine}.
+     * The caller must not modify the returned <code>Collection</code>.  The implementation is free to enforce this with unmodifiable collections.
+     *
+     * @return The <code>Collection</code> of <code>Attribute</code>s returned or an empty list if none are found
+     */
+    public Collection<Attribute> getAttributes();
+
+    /**
+     * Determines if this <code>PIPResponse</code> is simple or not.  A simple <code>PIPResponse</code> contains a single
+     * {@link com.att.research.xacml.api.Attribute} whose {@link com.att.research.xacml.api.AttributeValue}s are all of the same data type.
+     *
+     * @return true if this <code>PIPResponse</code> is simple, else false.
+     */
+    public boolean isSimple();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/package-info.java
index d5829e9..09fc984 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/pip/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 
 /**
  * com.att.research.xacml.api.pip contains an API for PIP providers and PIP users
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEngine.java
index 7bbad0d..3eb003f 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,23 +34,23 @@
 /**
  * Defines the API for objects that serve as handlers for {@link TraceEvent}s.  <code>TraceEngine</code>s
  * are instantiated with {@link com.att.research.xacml.api.trace.TraceEngineFactory} objects.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public interface TraceEngine {
-        /**
-         * Processes the given {@link TraceEvent}.
-         * 
-         * @param traceEvent the <code>TraceEvent</code> to process
-         */
-        public void trace(TraceEvent<?> traceEvent);
-        
-        /**
-         * Returns true if this <code>TraceEngine</code> would actually process a {@link TraceEvent}.  This
-         * is useful to avoid creating new <code>TraceEvent</code> objects that will just be ignored.
-         * 
-         * @return true if this <code>TraceEngine</code> would perform an action on a <code>TraceEvent</code>.
-         */
-        public boolean isTracing();
+    /**
+     * Processes the given {@link TraceEvent}.
+     *
+     * @param traceEvent the <code>TraceEvent</code> to process
+     */
+    public void trace(TraceEvent<?> traceEvent);
+
+    /**
+     * Returns true if this <code>TraceEngine</code> would actually process a {@link TraceEvent}.  This
+     * is useful to avoid creating new <code>TraceEvent</code> objects that will just be ignored.
+     *
+     * @return true if this <code>TraceEngine</code> would perform an action on a <code>TraceEvent</code>.
+     */
+    public boolean isTracing();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEngineFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEngineFactory.java
index 453630c..0923ca9 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEngineFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,80 +40,80 @@
 /**
  * Provides methods for creating instances of the {@link TraceEngine} interface.  This may be used by PDP, PEP, or PIP
  * implementations to provide tracing facilities that are useful for validating that XACML Policies and PolicySets operate as expected.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public abstract class TraceEngineFactory {
-        private static final String	FACTORYID					= XACMLProperties.PROP_TRACEENGINEFACTORY;
-        private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.trace.NullTraceEngineFactory";
-        
-        protected Properties properties = null;
-        
-        protected TraceEngineFactory() {
-        }
-        
-        protected TraceEngineFactory(Properties properties) {
-                this.properties = properties;
-        }
-        
-        /**
-         * Gets an instance of the <code>TraceEngineFactory</code> class using standard factory lookup methods defined by
-         * the {@link com.att.research.xacml.util.FactoryFinder} class.
-         * 
-         * @return an instance of the <code>TraceEngineFactory</code> class.
-         * @throws FactoryException if there is an error finding a <code>TraceEngineFactory</code>
-         */
-        public static TraceEngineFactory newInstance() throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, TraceEngineFactory.class);
-        }
-        
-        /**
-         * Gets an instance of the <code>TraceEngineFactory</code> class using standard factory lookup methods defined by
-         * the {@link com.att.research.xacml.util.FactoryFinder} class.
-         * 
-         * @return an instance of the <code>TraceEngineFactory</code> class.
-         * @throws FactoryException if there is an error finding a <code>TraceEngineFactory</code>
-         */
-        public static TraceEngineFactory newInstance(Properties properties) throws FactoryException {
-                return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, TraceEngineFactory.class, properties);
-        }
-        
-        /**
-         * Gets an instance of the <code>TraceEngineFactory</code> class using the given <code>String</code> class name, and <code>ClassLoader</code>>
-         * 
-         * @param className the <code>String</code> name of the <code>Class</code> extending <code>TraceEngineFactory</code> to load
-         * @param classLoader the <code>ClassLoader</code> to use
-         * @return an instance of the <code>TraceEngineFactory</code>
-         * @throws FactoryException if there is an error loading the <code>TraceEngineFactory</code> class or creating an instance from it.
-         */
-        public static TraceEngineFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
-                return FactoryFinder.newInstance(className, TraceEngineFactory.class, classLoader, false);
-        }
-        
-        /**
-         * Gets an instance of the <code>TraceEngineFactory</code> class using the given <code>String</code> class name, and the standard
-         * <code>ClassLoader</code>>
-         * 
-         * @param className the <code>String</code> name of the <code>Class</code> extending <code>TraceEngineFactory</code> to load
-         * @return an instance of the <code>TraceEngineFactory</code>
-         * @throws FactoryException if there is an error loading the <code>TraceEngineFactory</code> class or creating an instance from it.
-         */
-        public static TraceEngineFactory newInstance(String className) throws FactoryException {
-                return FactoryFinder.newInstance(className, TraceEngineFactory.class, null, true);
-        }
-        
-        /**
-         * Gets an instance of the {@link TraceEngine} interface to use for posting {@link TraceEvent}s.
-         * 
-         * @return an instance of the <code>TraceEngine</code> interface
-         */
-        public abstract TraceEngine getTraceEngine();
-        
-        /**
-         * Gets an instance of the {@link TraceEngine} interface to use for posting {@link TraceEvent}s.
-         * 
-         * @return an instance of the <code>TraceEngine</code> interface
-         */
-        public abstract TraceEngine getTraceEngine(Properties properties);
+    private static final String	FACTORYID					= XACMLProperties.PROP_TRACEENGINEFACTORY;
+    private static final String	DEFAULT_FACTORY_CLASSNAME	= "com.att.research.xacml.std.trace.NullTraceEngineFactory";
+
+    protected Properties properties = null;
+
+    protected TraceEngineFactory() {
+    }
+
+    protected TraceEngineFactory(Properties properties) {
+        this.properties = properties;
+    }
+
+    /**
+     * Gets an instance of the <code>TraceEngineFactory</code> class using standard factory lookup methods defined by
+     * the {@link com.att.research.xacml.util.FactoryFinder} class.
+     *
+     * @return an instance of the <code>TraceEngineFactory</code> class.
+     * @throws FactoryException if there is an error finding a <code>TraceEngineFactory</code>
+     */
+    public static TraceEngineFactory newInstance() throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, TraceEngineFactory.class);
+    }
+
+    /**
+     * Gets an instance of the <code>TraceEngineFactory</code> class using standard factory lookup methods defined by
+     * the {@link com.att.research.xacml.util.FactoryFinder} class.
+     *
+     * @return an instance of the <code>TraceEngineFactory</code> class.
+     * @throws FactoryException if there is an error finding a <code>TraceEngineFactory</code>
+     */
+    public static TraceEngineFactory newInstance(Properties properties) throws FactoryException {
+        return FactoryFinder.find(FACTORYID, DEFAULT_FACTORY_CLASSNAME, TraceEngineFactory.class, properties);
+    }
+
+    /**
+     * Gets an instance of the <code>TraceEngineFactory</code> class using the given <code>String</code> class name, and <code>ClassLoader</code>>
+     *
+     * @param className the <code>String</code> name of the <code>Class</code> extending <code>TraceEngineFactory</code> to load
+     * @param classLoader the <code>ClassLoader</code> to use
+     * @return an instance of the <code>TraceEngineFactory</code>
+     * @throws FactoryException if there is an error loading the <code>TraceEngineFactory</code> class or creating an instance from it.
+     */
+    public static TraceEngineFactory newInstance(String className, ClassLoader classLoader) throws FactoryException {
+        return FactoryFinder.newInstance(className, TraceEngineFactory.class, classLoader, false);
+    }
+
+    /**
+     * Gets an instance of the <code>TraceEngineFactory</code> class using the given <code>String</code> class name, and the standard
+     * <code>ClassLoader</code>>
+     *
+     * @param className the <code>String</code> name of the <code>Class</code> extending <code>TraceEngineFactory</code> to load
+     * @return an instance of the <code>TraceEngineFactory</code>
+     * @throws FactoryException if there is an error loading the <code>TraceEngineFactory</code> class or creating an instance from it.
+     */
+    public static TraceEngineFactory newInstance(String className) throws FactoryException {
+        return FactoryFinder.newInstance(className, TraceEngineFactory.class, null, true);
+    }
+
+    /**
+     * Gets an instance of the {@link TraceEngine} interface to use for posting {@link TraceEvent}s.
+     *
+     * @return an instance of the <code>TraceEngine</code> interface
+     */
+    public abstract TraceEngine getTraceEngine();
+
+    /**
+     * Gets an instance of the {@link TraceEngine} interface to use for posting {@link TraceEvent}s.
+     *
+     * @return an instance of the <code>TraceEngine</code> interface
+     */
+    public abstract TraceEngine getTraceEngine(Properties properties);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEvent.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEvent.java
index cb1fe0f..c459a80 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEvent.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/TraceEvent.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,39 +35,39 @@
 
 /**
  * Defines the API for objects that represent traceable events during evaluation of a XACML Policy or PolicySet.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
- * 
+ *
  * @param T the java <code>Class</code> of the traced object wrapped by the <code>TraceEvent</code>
  */
 public interface TraceEvent<T> {
-        /**
-         * Gets the timestamp as a <code>Date</code> when this <code>TraceEvent</code> occurred.
-         * 
-         * @return the timestamp as a <code>Date</code> when this <code>TraceEvent</code> occurred.
-         */
-        public Date getTimestamp();
-        
-        /**
-         * Gets the <code>String</code> message associated with this <code>TraceEvent</code>.  If there is no message,
-         * the implementation may return <code>null</code>.
-         * 
-         * @return the <code>String</code> message associated with this <code>TraceEvent</code>.
-         */
-        public String getMessage();
-        
-        /**
-         * Gets the {@link Traceable} that created this <code>TraceEvent</code>
-         * 
-         * @return the <code>Traceable</code> that created this <code>TraceEvent</code>.
-         */
-        public Traceable getCause();
-        
-        /**
-         * Gets the <code>T</code> object representing the value of this <code>TraceEvent</code>.
-         * 
-         * @return the <code>T</code> object representing the value of this <code>TraceEvent</code>. 
-         */
-        public T getValue();
+    /**
+     * Gets the timestamp as a <code>Date</code> when this <code>TraceEvent</code> occurred.
+     *
+     * @return the timestamp as a <code>Date</code> when this <code>TraceEvent</code> occurred.
+     */
+    public Date getTimestamp();
+
+    /**
+     * Gets the <code>String</code> message associated with this <code>TraceEvent</code>.  If there is no message,
+     * the implementation may return <code>null</code>.
+     *
+     * @return the <code>String</code> message associated with this <code>TraceEvent</code>.
+     */
+    public String getMessage();
+
+    /**
+     * Gets the {@link Traceable} that created this <code>TraceEvent</code>
+     *
+     * @return the <code>Traceable</code> that created this <code>TraceEvent</code>.
+     */
+    public Traceable getCause();
+
+    /**
+     * Gets the <code>T</code> object representing the value of this <code>TraceEvent</code>.
+     *
+     * @return the <code>T</code> object representing the value of this <code>TraceEvent</code>.
+     */
+    public T getValue();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/Traceable.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/Traceable.java
index 6c2975b..c88854a 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/Traceable.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/Traceable.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,25 +34,25 @@
 /**
  * Defines the API for objects that can be set as the "cause" in a {@link com.att.research.xacml.api.trace.TraceEvent}.  Objects
  * cause a <code>TraceEvent</code> through methods called during the evaluation of a XACML Policy or PolicySet.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public interface Traceable {
-        /**
-         * Gets the <code>String</code> identifier for the object that caused the {@link com.att.research.xacml.api.trace.TraceEvent} as a result
-         * of a policy evaluation method.
-         * Implementations must not return <code>null</code>.
-         * 
-         * @return the <code>String</code> identifier for the object that caused the <code>TraceEvent</code>.
-         */
-        public String getTraceId();
-        
-        /**
-         * Gets the <code>Traceable</code> that caused the evaluation method on this <code>Traceable</code> to be called.  If
-         * there is no known causing object, this method should return <code>null</code>.
-         *  
-         * @return the <code>Traceable</code> that caused the evaluation method on this <code>Traceable</code> to be called.
-         */
-        public Traceable getCause();
+    /**
+     * Gets the <code>String</code> identifier for the object that caused the {@link com.att.research.xacml.api.trace.TraceEvent} as a result
+     * of a policy evaluation method.
+     * Implementations must not return <code>null</code>.
+     *
+     * @return the <code>String</code> identifier for the object that caused the <code>TraceEvent</code>.
+     */
+    public String getTraceId();
+
+    /**
+     * Gets the <code>Traceable</code> that caused the evaluation method on this <code>Traceable</code> to be called.  If
+     * there is no known causing object, this method should return <code>null</code>.
+     *
+     * @return the <code>Traceable</code> that caused the evaluation method on this <code>Traceable</code> to be called.
+     */
+    public Traceable getCause();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/package-info.java
index e932e8a..f1693bc 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/api/trace/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -31,7 +31,7 @@
 
 /**
  * Interfaces for objects that implement policy evaluation tracing.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/package-info.java
index 3d2b537..2c801b7 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,11 +34,11 @@
 /**
  * Provides base interfaces and standard implementation classes for applications using the "eXtensible Access Control Markup Language (XACML) Version 3.0"
  * to provide ABAC access control for resources and actions.
- * 
- * The packages in com.att.research.api define Java Interfaces only. 
- * 
+ *
+ * The packages in com.att.research.api define Java Interfaces only.
+ *
  * The packages in com.att.research.std define standard implementations of the com.att.research.api interfaces.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/IdentifierImpl.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/IdentifierImpl.java
index 0d1f67b..3081e92 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/IdentifierImpl.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/IdentifierImpl.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,77 +39,77 @@
 
 /**
  * IdentifierImpl provides a common implementation of the {@link com.att.research.xacml.api.Identifier} interface with a stored, fixed <code>URI</code>.
- *  
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class IdentifierImpl implements Identifier {
-        private URI	uri;
-        
-        /**
-         * Creates a new <code>IdentifierImpl</code> with the given <code>URI</code> id.
-         * 
-         * @param uriIn the <code>URI</code> for the identifier
-         */
-        public IdentifierImpl(URI uriIn) {
-                if (uriIn == null) {
-                        throw new IllegalArgumentException("Null URI");
-                }
-                this.uri	= uriIn;
-        }
-        
-        /**
-         * Creates a new <code>IdentifierImp</code> with the given <code>String</code> id.
-         * 
-         * @param idIn the <code>String</code> for the category id
-         */
-        public IdentifierImpl(String idIn) {
-                this(URI.create(idIn));
-        }
-        
-        public IdentifierImpl(Identifier identifierBase, String id) {
-                this(URI.create(identifierBase.stringValue() + ":" + id));
-        }
-        
-        public static Identifier gensym(String pfx) {
-                UUID uuid	= UUID.randomUUID();
-                return new IdentifierImpl(pfx + ":" + uuid.toString());
-        }
-        
-        public static Identifier gensym() {
-                return gensym("urn:gensym");
-        }
+    private URI	uri;
 
-        @Override
-        public URI getUri() {
-                return this.uri;
+    /**
+     * Creates a new <code>IdentifierImpl</code> with the given <code>URI</code> id.
+     *
+     * @param uriIn the <code>URI</code> for the identifier
+     */
+    public IdentifierImpl(URI uriIn) {
+        if (uriIn == null) {
+            throw new IllegalArgumentException("Null URI");
         }
+        this.uri	= uriIn;
+    }
 
-        @Override
-        public String toString() {
-                return this.stringValue();
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof Identifier)) {
-                        return false;
-                } else {
-                        return ObjUtil.equalsAllowNull(this.getUri(), ((Identifier)obj).getUri());
-                }
-        }
-        
-        @Override
-        public int hashCode() {
-                URI thisURI	= this.getUri();
-                return (thisURI == null ? super.hashCode() : thisURI.hashCode());
-        }
+    /**
+     * Creates a new <code>IdentifierImp</code> with the given <code>String</code> id.
+     *
+     * @param idIn the <code>String</code> for the category id
+     */
+    public IdentifierImpl(String idIn) {
+        this(URI.create(idIn));
+    }
 
-        @Override
-        public String stringValue() {
-                URI thisURI	= this.getUri();
-                return (thisURI == null ? null : thisURI.toString());
+    public IdentifierImpl(Identifier identifierBase, String id) {
+        this(URI.create(identifierBase.stringValue() + ":" + id));
+    }
+
+    public static Identifier gensym(String pfx) {
+        UUID uuid	= UUID.randomUUID();
+        return new IdentifierImpl(pfx + ":" + uuid.toString());
+    }
+
+    public static Identifier gensym() {
+        return gensym("urn:gensym");
+    }
+
+    @Override
+    public URI getUri() {
+        return this.uri;
+    }
+
+    @Override
+    public String toString() {
+        return this.stringValue();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof Identifier)) {
+            return false;
+        } else {
+            return ObjUtil.equalsAllowNull(this.getUri(), ((Identifier)obj).getUri());
         }
+    }
+
+    @Override
+    public int hashCode() {
+        URI thisURI	= this.getUri();
+        return (thisURI == null ? super.hashCode() : thisURI.hashCode());
+    }
+
+    @Override
+    public String stringValue() {
+        URI thisURI	= this.getUri();
+        return (thisURI == null ? null : thisURI.toString());
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAdvice.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAdvice.java
index 2e2cea2..0574ef1 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAdvice.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAdvice.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,58 +39,58 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.Advice} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdAdvice extends Wrapper<Advice> implements Advice {
-        /**
-         * Creates an immutable <code>StdAdvice</code> that wraps the given {@link com.att.research.xacml.api.Advice}.
-         * 
-         * @param advice the <code>Advice</code> object to wrap in the new <code>StdAdvice</code>
-         */
-        public StdAdvice(Advice advice) {
-                super(advice);
-        }
-        
-        /**
-         * Creates an immutable <code>StdAdvice</code> with the given {@link com.att.research.xacml.api.Identifier} as the XACML AdviceId
-         * and the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s representing the XACML AttributeAssignment elements.
-         * 
-         * @param adviceId the <code>Identifier</code> representing the XACML AdviceId
-         * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s representing the XACML AttributeAssignment elements.
-         */
-        public StdAdvice(Identifier adviceId, Collection<AttributeAssignment> attributeAssignmentsIn) {
-                this(new StdMutableAdvice(adviceId, attributeAssignmentsIn));
-        }
-        
-        /**
-         * Creates an immutable <code>StdAdvice</code> with the given {@link com.att.research.xacml.api.Identifier} as the XACML AdviceId and
-         * an empty list of <code>AttributeAssignment</code>s.
-         * 
-         * @param adviceId the <code>Identifier</code> representing the XACML AdviceId
-         */
-        public StdAdvice(Identifier adviceId) {
-                this(new StdMutableAdvice(adviceId));
-        }
-        
-        /**
-         * Creates a copy of the given {@link com.att.research.xacml.api.Advice}.
-         * 
-         * @param advice the <code>Advice</code> to copy
-         * @return a new <code>StdAdvice</code> that is a copy of the given <code>Advice</code>.
-         */
-        public static StdAdvice copy(Advice advice) {
-                return new StdAdvice(advice.getId(), advice.getAttributeAssignments());
-        }
+    /**
+     * Creates an immutable <code>StdAdvice</code> that wraps the given {@link com.att.research.xacml.api.Advice}.
+     *
+     * @param advice the <code>Advice</code> object to wrap in the new <code>StdAdvice</code>
+     */
+    public StdAdvice(Advice advice) {
+        super(advice);
+    }
 
-        @Override
-        public Identifier getId() {
-                return this.getWrappedObject().getId();
-        }
+    /**
+     * Creates an immutable <code>StdAdvice</code> with the given {@link com.att.research.xacml.api.Identifier} as the XACML AdviceId
+     * and the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s representing the XACML AttributeAssignment elements.
+     *
+     * @param adviceId the <code>Identifier</code> representing the XACML AdviceId
+     * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s representing the XACML AttributeAssignment elements.
+     */
+    public StdAdvice(Identifier adviceId, Collection<AttributeAssignment> attributeAssignmentsIn) {
+        this(new StdMutableAdvice(adviceId, attributeAssignmentsIn));
+    }
 
-        @Override
-        public Collection<AttributeAssignment> getAttributeAssignments() {
-                return this.getWrappedObject().getAttributeAssignments();
-        }
+    /**
+     * Creates an immutable <code>StdAdvice</code> with the given {@link com.att.research.xacml.api.Identifier} as the XACML AdviceId and
+     * an empty list of <code>AttributeAssignment</code>s.
+     *
+     * @param adviceId the <code>Identifier</code> representing the XACML AdviceId
+     */
+    public StdAdvice(Identifier adviceId) {
+        this(new StdMutableAdvice(adviceId));
+    }
+
+    /**
+     * Creates a copy of the given {@link com.att.research.xacml.api.Advice}.
+     *
+     * @param advice the <code>Advice</code> to copy
+     * @return a new <code>StdAdvice</code> that is a copy of the given <code>Advice</code>.
+     */
+    public static StdAdvice copy(Advice advice) {
+        return new StdAdvice(advice.getId(), advice.getAttributeAssignments());
+    }
+
+    @Override
+    public Identifier getId() {
+        return this.getWrappedObject().getId();
+    }
+
+    @Override
+    public Collection<AttributeAssignment> getAttributeAssignments() {
+        return this.getWrappedObject().getAttributeAssignments();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttribute.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttribute.java
index fc71152..20e7982 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttribute.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttribute.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,102 +41,102 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.Attribute} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdAttribute extends Wrapper<Attribute> implements Attribute {
-        /**
-         * Creates an immutable <code>StdAttribute</code> that wraps the given {@link com.att.research.xacml.api.Attribute}.
-         * 
-         * @param attribute the <code>Attribute</code> wrapped by this <code>StdAttribute</code>.
-         */
-        public StdAttribute(Attribute attribute) {
-                super(attribute);
-        }
-        
-        /**
-         * Creates an immutable <code>StdAttribute</code> with the given {@link com.att.research.xacml.api.Identifier}s representing the XACML Category and
-         * AttributeId, a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeValue}s representing the 
-         * XACML AttributeValue elements, the given <code>String</code> Issuer, and the given <code>boolean</code> indicating whether the new <code>StdAttribute</code>
-         * should be returned as part of a decision Result.
-         * 
-         * @param categoryIdIn the <code>Identifier</code> representing the XACML Category
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId
-         * @param valuesIn the <code>Collection</code> of <code>AttributeValue</code>s
-         * @param issuerIn the <code>String</code> Issuer
-         * @param includeInResultsIn the <code>boolean</code> IncludeInResults
-         */
-        public StdAttribute(Identifier categoryIdIn, Identifier attributeIdIn, Collection<AttributeValue<?>> valuesIn, String issuerIn, boolean includeInResultsIn) {
-                this(new StdMutableAttribute(categoryIdIn, attributeIdIn, valuesIn, issuerIn, includeInResultsIn));
-        }
+    /**
+     * Creates an immutable <code>StdAttribute</code> that wraps the given {@link com.att.research.xacml.api.Attribute}.
+     *
+     * @param attribute the <code>Attribute</code> wrapped by this <code>StdAttribute</code>.
+     */
+    public StdAttribute(Attribute attribute) {
+        super(attribute);
+    }
 
-        /**
-         * Creates an immutable <code>StdAttribute</code> with the given {@link com.att.research.xacml.api.Identifier}s representing the XACML Category and
-         * AttributeId, the {@link com.att.research.xacml.api.AttributeValue}s representing a single 
-         * XACML AttributeValue element, the given <code>String</code> Issuer, and the given <code>boolean</code> indicating whether the new <code>StdAttribute</code>
-         * should be returned as part of a decision Result.
-         * 
-         * @param categoryIdIn the <code>Identifier</code> representing the XACML Category
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId
-         * @param valueIn the <code>AttributeValue</code>
-         * @param issuerIn the <code>String</code> Issuer
-         * @param includeInResultsIn the <code>boolean</code> IncludeInResults
-         */
-        public StdAttribute(Identifier categoryIdIn, Identifier attributeIdIn, AttributeValue<?> valueIn, String issuerIn, boolean includeInResultsIn) {
-                this(new StdMutableAttribute(categoryIdIn, attributeIdIn, valueIn, issuerIn, includeInResultsIn));
-        }
+    /**
+     * Creates an immutable <code>StdAttribute</code> with the given {@link com.att.research.xacml.api.Identifier}s representing the XACML Category and
+     * AttributeId, a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeValue}s representing the
+     * XACML AttributeValue elements, the given <code>String</code> Issuer, and the given <code>boolean</code> indicating whether the new <code>StdAttribute</code>
+     * should be returned as part of a decision Result.
+     *
+     * @param categoryIdIn the <code>Identifier</code> representing the XACML Category
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId
+     * @param valuesIn the <code>Collection</code> of <code>AttributeValue</code>s
+     * @param issuerIn the <code>String</code> Issuer
+     * @param includeInResultsIn the <code>boolean</code> IncludeInResults
+     */
+    public StdAttribute(Identifier categoryIdIn, Identifier attributeIdIn, Collection<AttributeValue<?>> valuesIn, String issuerIn, boolean includeInResultsIn) {
+        this(new StdMutableAttribute(categoryIdIn, attributeIdIn, valuesIn, issuerIn, includeInResultsIn));
+    }
 
-        /**
-         * Creates an immutable <code>StdAttribute</code> with the given {@link com.att.research.xacml.api.Identifier}s representing the XACML Category and
-         * AttributeId, and the {@link com.att.research.xacml.api.AttributeValue}s representing a single 
-         * XACML AttributeValue element.
-         * 
-         * @param categoryIdIn the <code>Identifier</code> representing the XACML Category
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId
-         * @param valueIn the <code>AttributeValue</code>
-         */
-        public StdAttribute(Identifier categoryIdIn, Identifier attributeIdIn, AttributeValue<?> valueIn) {
-                this(new StdMutableAttribute(categoryIdIn, attributeIdIn, valueIn));
-        }
-        
-        /**
-         * Gets a new <code>StdAttribute</code> that is a copy of the given {@link com.att.research.xacml.api.Attribute}.
-         * 
-         * @param attribute the <code>Attribute</code> to copy
-         * @return a new <code>StdAttribute</code> that is a copy of the given <code>Attribute</code>
-         */
-        public static StdAttribute copy(Attribute attribute) {
-                return new StdAttribute(attribute.getCategory(), attribute.getAttributeId(), attribute.getValues(), attribute.getIssuer(), attribute.getIncludeInResults());
-        }
+    /**
+     * Creates an immutable <code>StdAttribute</code> with the given {@link com.att.research.xacml.api.Identifier}s representing the XACML Category and
+     * AttributeId, the {@link com.att.research.xacml.api.AttributeValue}s representing a single
+     * XACML AttributeValue element, the given <code>String</code> Issuer, and the given <code>boolean</code> indicating whether the new <code>StdAttribute</code>
+     * should be returned as part of a decision Result.
+     *
+     * @param categoryIdIn the <code>Identifier</code> representing the XACML Category
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId
+     * @param valueIn the <code>AttributeValue</code>
+     * @param issuerIn the <code>String</code> Issuer
+     * @param includeInResultsIn the <code>boolean</code> IncludeInResults
+     */
+    public StdAttribute(Identifier categoryIdIn, Identifier attributeIdIn, AttributeValue<?> valueIn, String issuerIn, boolean includeInResultsIn) {
+        this(new StdMutableAttribute(categoryIdIn, attributeIdIn, valueIn, issuerIn, includeInResultsIn));
+    }
 
-        @Override
-        public Identifier getAttributeId() {
-                return this.getWrappedObject().getAttributeId();
-        }
+    /**
+     * Creates an immutable <code>StdAttribute</code> with the given {@link com.att.research.xacml.api.Identifier}s representing the XACML Category and
+     * AttributeId, and the {@link com.att.research.xacml.api.AttributeValue}s representing a single
+     * XACML AttributeValue element.
+     *
+     * @param categoryIdIn the <code>Identifier</code> representing the XACML Category
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId
+     * @param valueIn the <code>AttributeValue</code>
+     */
+    public StdAttribute(Identifier categoryIdIn, Identifier attributeIdIn, AttributeValue<?> valueIn) {
+        this(new StdMutableAttribute(categoryIdIn, attributeIdIn, valueIn));
+    }
 
-        @Override
-        public Identifier getCategory() {
-                return this.getWrappedObject().getCategory();
-        }
+    /**
+     * Gets a new <code>StdAttribute</code> that is a copy of the given {@link com.att.research.xacml.api.Attribute}.
+     *
+     * @param attribute the <code>Attribute</code> to copy
+     * @return a new <code>StdAttribute</code> that is a copy of the given <code>Attribute</code>
+     */
+    public static StdAttribute copy(Attribute attribute) {
+        return new StdAttribute(attribute.getCategory(), attribute.getAttributeId(), attribute.getValues(), attribute.getIssuer(), attribute.getIncludeInResults());
+    }
 
-        @Override
-        public Collection<AttributeValue<?>> getValues() {
-                return this.getWrappedObject().getValues();
-        }
+    @Override
+    public Identifier getAttributeId() {
+        return this.getWrappedObject().getAttributeId();
+    }
 
-        @Override
-        public <T> Iterator<AttributeValue<T>> findValues(DataType<T> dataType) {
-                return this.getWrappedObject().findValues(dataType);
-        }
+    @Override
+    public Identifier getCategory() {
+        return this.getWrappedObject().getCategory();
+    }
 
-        @Override
-        public String getIssuer() {
-                return this.getWrappedObject().getIssuer();
-        }
+    @Override
+    public Collection<AttributeValue<?>> getValues() {
+        return this.getWrappedObject().getValues();
+    }
 
-        @Override
-        public boolean getIncludeInResults() {
-                return this.getWrappedObject().getIncludeInResults();
-        }
+    @Override
+    public <T> Iterator<AttributeValue<T>> findValues(DataType<T> dataType) {
+        return this.getWrappedObject().findValues(dataType);
+    }
+
+    @Override
+    public String getIssuer() {
+        return this.getWrappedObject().getIssuer();
+    }
+
+    @Override
+    public boolean getIncludeInResults() {
+        return this.getWrappedObject().getIncludeInResults();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeAssignment.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeAssignment.java
index 1b086c6..5b702d0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeAssignment.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeAssignment.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,68 +37,68 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.AttributeAssignment} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdAttributeAssignment extends Wrapper<AttributeAssignment> implements AttributeAssignment {
-        /**
-         * Creates a new immutable <code>StdAttributeAssignment</code> that wraps the given {@link com.att.research.xacml.api.AttributeAssignment}.
-         * The caller agrees not to modify the given <code>AttributeAssignment</code> as long as the new <code>StdAttributeAssignment</code> refers
-         * to it.
-         * 
-         * @param attributeAssignment the <code>AttributeAssignment</code> to be wrapped by the new <code>StdAttributeAssignment</code>.
-         */
-        public StdAttributeAssignment(AttributeAssignment attributeAssignment) {
-                super(attributeAssignment);
-        }
-        
-        /**
-         * Creates a new immutable <code>StdAttributeAssignment</code> with the given {@link com.att.research.xacml.api.Identifier}s representing the XACML
-         * Category and AttributeId of the Attribute to be assigned, the given <code>String</code> issuer, and the given {@link com.att.research.xacml.api.AttributeValue}
-         * representing the value to assign to the Attribute.
-         * 
-         * @param categoryIn the <code>Identifier</code> representing the Category of the Attribute to be assigned
-         * @param attributeIdIn the <code>Identifier</code> representing the AttributeId of the Attribute to be assigned
-         * @param issuerIn the <code>String</code> representing the Issuer of the Attribute to be assigned
-         * @param attributeValueIn the <code>AttributeValue</code> representing the AttributeValue to be assigned to the Attribute
-         */
-        public StdAttributeAssignment(Identifier categoryIn, Identifier attributeIdIn, String issuerIn, AttributeValue<?> attributeValueIn) {
-                this(new StdMutableAttributeAssignment(categoryIn, attributeIdIn, issuerIn, attributeValueIn));
-        }
-        
-        /**
-         * Creates a new immutable <code>StdAttributeAssignment</code> by copying the given {@link com.att.research.xacml.api.AttributeAssignment}.
-         * 
-         * @param attributeAssignment the <code>AttributeAssignment</code> to copy
-         * @return a new <code>StdAttributeAssignment</code> copied from the given <code>AttributeAssignment</code>
-         */
-        public static StdAttributeAssignment copy(AttributeAssignment attributeAssignment) {
-                return new StdAttributeAssignment(attributeAssignment.getCategory(), attributeAssignment.getAttributeId(), attributeAssignment.getIssuer(), attributeAssignment.getAttributeValue());
-        }
+    /**
+     * Creates a new immutable <code>StdAttributeAssignment</code> that wraps the given {@link com.att.research.xacml.api.AttributeAssignment}.
+     * The caller agrees not to modify the given <code>AttributeAssignment</code> as long as the new <code>StdAttributeAssignment</code> refers
+     * to it.
+     *
+     * @param attributeAssignment the <code>AttributeAssignment</code> to be wrapped by the new <code>StdAttributeAssignment</code>.
+     */
+    public StdAttributeAssignment(AttributeAssignment attributeAssignment) {
+        super(attributeAssignment);
+    }
 
-        @Override
-        public Identifier getAttributeId() {
-                return this.getWrappedObject().getAttributeId();
-        }
+    /**
+     * Creates a new immutable <code>StdAttributeAssignment</code> with the given {@link com.att.research.xacml.api.Identifier}s representing the XACML
+     * Category and AttributeId of the Attribute to be assigned, the given <code>String</code> issuer, and the given {@link com.att.research.xacml.api.AttributeValue}
+     * representing the value to assign to the Attribute.
+     *
+     * @param categoryIn the <code>Identifier</code> representing the Category of the Attribute to be assigned
+     * @param attributeIdIn the <code>Identifier</code> representing the AttributeId of the Attribute to be assigned
+     * @param issuerIn the <code>String</code> representing the Issuer of the Attribute to be assigned
+     * @param attributeValueIn the <code>AttributeValue</code> representing the AttributeValue to be assigned to the Attribute
+     */
+    public StdAttributeAssignment(Identifier categoryIn, Identifier attributeIdIn, String issuerIn, AttributeValue<?> attributeValueIn) {
+        this(new StdMutableAttributeAssignment(categoryIn, attributeIdIn, issuerIn, attributeValueIn));
+    }
 
-        @Override
-        public Identifier getCategory() {
-                return this.getWrappedObject().getCategory();
-        }
+    /**
+     * Creates a new immutable <code>StdAttributeAssignment</code> by copying the given {@link com.att.research.xacml.api.AttributeAssignment}.
+     *
+     * @param attributeAssignment the <code>AttributeAssignment</code> to copy
+     * @return a new <code>StdAttributeAssignment</code> copied from the given <code>AttributeAssignment</code>
+     */
+    public static StdAttributeAssignment copy(AttributeAssignment attributeAssignment) {
+        return new StdAttributeAssignment(attributeAssignment.getCategory(), attributeAssignment.getAttributeId(), attributeAssignment.getIssuer(), attributeAssignment.getAttributeValue());
+    }
 
-        @Override
-        public String getIssuer() {
-                return this.getWrappedObject().getIssuer();
-        }
+    @Override
+    public Identifier getAttributeId() {
+        return this.getWrappedObject().getAttributeId();
+    }
 
-        @Override
-        public Identifier getDataTypeId() {
-                return this.getWrappedObject().getDataTypeId();
-        }
+    @Override
+    public Identifier getCategory() {
+        return this.getWrappedObject().getCategory();
+    }
 
-        @Override
-        public AttributeValue<?> getAttributeValue() {
-                return this.getWrappedObject().getAttributeValue();
-        }
+    @Override
+    public String getIssuer() {
+        return this.getWrappedObject().getIssuer();
+    }
+
+    @Override
+    public Identifier getDataTypeId() {
+        return this.getWrappedObject().getDataTypeId();
+    }
+
+    @Override
+    public AttributeValue<?> getAttributeValue() {
+        return this.getWrappedObject().getAttributeValue();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeCategory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeCategory.java
index 4cc9925..e905367 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeCategory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeCategory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,51 +40,51 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.AttributeCategory} interface.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdAttributeCategory extends Wrapper<AttributeCategory> implements AttributeCategory {
-        /**
-         * Creates an immutable <code>StdAttributeCategory</code> that wraps the given {@link com.att.research.xacml.api.AttributeCategory}.
-         * The caller agrees to no longer modify the given <code>AttributeCategory</code> while it is wrapped by the <code>StdAttributeCategory</code>>
-         * 
-         * @param attributeCategory the <code>AttributeCategory</code> to wrap.
-         */
-        public StdAttributeCategory(AttributeCategory attributeCategory) {
-                super(attributeCategory);
-        }
-        
-        /**
-         * Creates a new <code>StdAttributeCategory</code> with the given {@link com.att.research.xacml.api.Identifier} representing its
-         * XACML Category, and the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s as its XACML Attributes.
-         * The <code>Collection</code> is copied; changes made to the <code>Collection</code> after creating the new <code>StdAttributeCategory</code>
-         * are not reflected in the <code>StdAttributeCategory</code>.
-         * 
-         * @param identifierCategory the <code>Identifier</code> for the XACML Category for the new <code>StdAttributeCategory</code>.
-         * @param listAttributes a <code>Collection</code> of <code>Attribute</code>s for the new <code>StdAttributeCategory</code>.
-         */
-        public StdAttributeCategory(Identifier identifierCategory, Collection<Attribute> listAttributes) {
-                this(new StdMutableAttributeCategory(identifierCategory, listAttributes));
-        }
+    /**
+     * Creates an immutable <code>StdAttributeCategory</code> that wraps the given {@link com.att.research.xacml.api.AttributeCategory}.
+     * The caller agrees to no longer modify the given <code>AttributeCategory</code> while it is wrapped by the <code>StdAttributeCategory</code>>
+     *
+     * @param attributeCategory the <code>AttributeCategory</code> to wrap.
+     */
+    public StdAttributeCategory(AttributeCategory attributeCategory) {
+        super(attributeCategory);
+    }
 
-        @Override
-        public Identifier getCategory() {
-                return this.getWrappedObject().getCategory();
-        }
+    /**
+     * Creates a new <code>StdAttributeCategory</code> with the given {@link com.att.research.xacml.api.Identifier} representing its
+     * XACML Category, and the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s as its XACML Attributes.
+     * The <code>Collection</code> is copied; changes made to the <code>Collection</code> after creating the new <code>StdAttributeCategory</code>
+     * are not reflected in the <code>StdAttributeCategory</code>.
+     *
+     * @param identifierCategory the <code>Identifier</code> for the XACML Category for the new <code>StdAttributeCategory</code>.
+     * @param listAttributes a <code>Collection</code> of <code>Attribute</code>s for the new <code>StdAttributeCategory</code>.
+     */
+    public StdAttributeCategory(Identifier identifierCategory, Collection<Attribute> listAttributes) {
+        this(new StdMutableAttributeCategory(identifierCategory, listAttributes));
+    }
 
-        @Override
-        public Collection<Attribute> getAttributes() {
-                return this.getWrappedObject().getAttributes();
-        }
-        
-        @Override
-        public Iterator<Attribute> getAttributes(Identifier attributeId) {
-                return this.getWrappedObject().getAttributes(attributeId);
-        }
-        
-        @Override
-        public boolean hasAttributes(Identifier attributeId) {
-                return this.getWrappedObject().hasAttributes(attributeId);
-        }
+    @Override
+    public Identifier getCategory() {
+        return this.getWrappedObject().getCategory();
+    }
+
+    @Override
+    public Collection<Attribute> getAttributes() {
+        return this.getWrappedObject().getAttributes();
+    }
+
+    @Override
+    public Iterator<Attribute> getAttributes(Identifier attributeId) {
+        return this.getWrappedObject().getAttributes(attributeId);
+    }
+
+    @Override
+    public boolean hasAttributes(Identifier attributeId) {
+        return this.getWrappedObject().hasAttributes(attributeId);
+    }
 }
\ No newline at end of file
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeValue.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeValue.java
index 6bbdda6..cf6ad35 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeValue.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdAttributeValue.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,126 +36,126 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.AttributeValue} interface.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
- * 
+ *
  * @param <T> the java type of the object representing the value of the XACML AttributeValue element represented by the <code>StdAttributeValue</code>
  */
 public class StdAttributeValue<T> implements AttributeValue<T> {
-        private Identifier	dataTypeId;
-        private T			value;
-        private Identifier xpathCategory;
-        
-        /**
-         * Creates a new <code>StdAttributeValue</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML data type id
-         * and the given object representing the value.  The <code>xpathCategoryIn</code> is optional and is only needed for <code>StdAttributeValue</code>s
-         * whose <code>dataTypeIdIn</code> is XPathExpression.
-         * 
-         * @param dataTypeIdIn the <code>Identifier</code> representing the XACML data type id for the new <code>StdAttributeValue</code>
-         * @param valueIn the object representing the value of the XACML AttributeValue element represented by the new <code>StdAttributeValue</code>.
-         * @param xpathCategoryIn the <code>Identifier</code> representing the XACML XPathCategory id for the new <code>StdAttributeValue</code>
+    private Identifier	dataTypeId;
+    private T			value;
+    private Identifier xpathCategory;
+
+    /**
+     * Creates a new <code>StdAttributeValue</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML data type id
+     * and the given object representing the value.  The <code>xpathCategoryIn</code> is optional and is only needed for <code>StdAttributeValue</code>s
+     * whose <code>dataTypeIdIn</code> is XPathExpression.
+     *
+     * @param dataTypeIdIn the <code>Identifier</code> representing the XACML data type id for the new <code>StdAttributeValue</code>
+     * @param valueIn the object representing the value of the XACML AttributeValue element represented by the new <code>StdAttributeValue</code>.
+     * @param xpathCategoryIn the <code>Identifier</code> representing the XACML XPathCategory id for the new <code>StdAttributeValue</code>
+     */
+    public StdAttributeValue(Identifier dataTypeIdIn, T valueIn, Identifier xpathCategoryIn) {
+        this.dataTypeId		= dataTypeIdIn;
+        this.value			= valueIn;
+        this.xpathCategory	= xpathCategoryIn;
+    }
+
+    /**
+     * Creates a new <code>StdAttributeValue</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML data type id
+     * and the given object representing the value.
+     *
+     * @param dataTypeIdIn the <code>Identifier</code> representing the XACML data type id for the new <code>StdAttributeValue</code>
+     * @param valueIn the object representing the value of the XACML AttributeValue element represented by the new <code>StdAttributeValue</code>.
+     */
+    public StdAttributeValue(Identifier dataTypeIdIn, T valueIn) {
+        this(dataTypeIdIn, valueIn, null);
+    }
+
+    @Override
+    public Identifier getDataTypeId() {
+        return this.dataTypeId;
+    }
+
+    @Override
+    public T getValue() {
+        return this.value;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                 + ((dataTypeId == null) ? 0 : dataTypeId.hashCode());
+        result = prime * result + ((value == null) ? 0 : value.hashCode());
+        result = prime * result
+                 + ((xpathCategory == null) ? 0 : xpathCategory.hashCode());
+        return result;
+    }
+
+    /**
+     * Determines if the given <code>Object</code> is an <code>AttributeValue</code> and is equivalent to this
+     * <code>AttributeValue</code>>
+     *
+     * Two <code>AttributeValue</code> objects are equivalent if they have the same data type <code>Identifier</code>
+     * and the value of the <code>getValue</code> method for the first <code>equals</code> the value of the <code>getValue</code>
+     * method of the second.
+     *
+     * @param obj the <code>Object</code> to compare this <code>AttributeValue</code> to
+     * @return true if the data type <code>Identifier</code>s and <code>getValue</code> values are <code>equal</code>.
+     */
+    @Override
+    public boolean equals(Object obj) {
+        /*
+         * If the object is null or not an AttributeValue, then it cannot be equal to this object.
+         * If this AttributeValue's data type id is not set, we cannot compare it to another AttributeValue.
          */
-        public StdAttributeValue(Identifier dataTypeIdIn, T valueIn, Identifier xpathCategoryIn) {
-                this.dataTypeId		= dataTypeIdIn;
-                this.value			= valueIn;
-                this.xpathCategory	= xpathCategoryIn;
+        if (obj == null || !(this.getClass().isInstance(obj))) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            AttributeValue<?> attributeValueObj	= this.getClass().cast(obj);
+            return ObjUtil.equalsAllowNull(this.getDataTypeId(), attributeValueObj.getDataTypeId()) &&
+                   ObjUtil.equalsAllowNull(this.getValue(), attributeValueObj.getValue());
         }
-        
-        /**
-         * Creates a new <code>StdAttributeValue</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML data type id
-         * and the given object representing the value.
-         * 
-         * @param dataTypeIdIn the <code>Identifier</code> representing the XACML data type id for the new <code>StdAttributeValue</code>
-         * @param valueIn the object representing the value of the XACML AttributeValue element represented by the new <code>StdAttributeValue</code>.
-         */
-        public StdAttributeValue(Identifier dataTypeIdIn, T valueIn) {
-                this(dataTypeIdIn, valueIn, null);
-        }
+    }
 
-        @Override
-        public Identifier getDataTypeId() {
-                return this.dataTypeId;
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump	= null;
+        if ((objectToDump = this.getDataTypeId()) != null) {
+            stringBuilder.append("dataTypeId=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
+        if ((objectToDump = this.getValue()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("value=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        if ((objectToDump = this.getXPathCategory()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("xpathCategory=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
-        @Override
-        public T getValue() {
-                return this.value;
-        }
-        
-        @Override
-        public int hashCode() {
-                final int prime = 31;
-                int result = 1;
-                result = prime * result
-                                + ((dataTypeId == null) ? 0 : dataTypeId.hashCode());
-                result = prime * result + ((value == null) ? 0 : value.hashCode());
-                result = prime * result
-                                + ((xpathCategory == null) ? 0 : xpathCategory.hashCode());
-                return result;
-        }
-
-        /**
-         * Determines if the given <code>Object</code> is an <code>AttributeValue</code> and is equivalent to this
-         * <code>AttributeValue</code>>
-         * 
-         * Two <code>AttributeValue</code> objects are equivalent if they have the same data type <code>Identifier</code>
-         * and the value of the <code>getValue</code> method for the first <code>equals</code> the value of the <code>getValue</code>
-         * method of the second.
-         * 
-         * @param obj the <code>Object</code> to compare this <code>AttributeValue</code> to
-         * @return true if the data type <code>Identifier</code>s and <code>getValue</code> values are <code>equal</code>.
-         */
-        @Override
-        public boolean equals(Object obj) {
-                /*
-                 * If the object is null or not an AttributeValue, then it cannot be equal to this object.
-                 * If this AttributeValue's data type id is not set, we cannot compare it to another AttributeValue.
-                 */
-                if (obj == null || !(this.getClass().isInstance(obj))) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
-                } else {
-                        AttributeValue<?> attributeValueObj	= this.getClass().cast(obj);
-                        return ObjUtil.equalsAllowNull(this.getDataTypeId(), attributeValueObj.getDataTypeId()) &&
-                                        ObjUtil.equalsAllowNull(this.getValue(), attributeValueObj.getValue());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump	= null;
-                if ((objectToDump = this.getDataTypeId()) != null) {
-                        stringBuilder.append("dataTypeId=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getValue()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("value=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getXPathCategory()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("xpathCategory=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
-
-        @Override
-        public Identifier getXPathCategory() {
-                return this.xpathCategory;
-        }
+    @Override
+    public Identifier getXPathCategory() {
+        return this.xpathCategory;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdDataTypeFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdDataTypeFactory.java
index 0282219..0871435 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdDataTypeFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdDataTypeFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,57 +41,57 @@
 /**
  * Implements the {@link com.att.research.xacml.api.DataTypeFactory} interface to support all of the data types in the XACML 3.0
  * specification.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public class StdDataTypeFactory extends DataTypeFactory {
-        private static final Map<Identifier,DataType<?>> mapIdentifiersToDataTypes	= new HashMap<Identifier,DataType<?>>();
-        private static boolean mapNeedsInit												= true;
-        
-        private static void registerDataType(DataType<?> dataType) {
-                if (dataType != null && dataType.getId() != null) {
-                        mapIdentifiersToDataTypes.put(dataType.getId(), dataType);
-                }
+    private static final Map<Identifier,DataType<?>> mapIdentifiersToDataTypes	= new HashMap<Identifier,DataType<?>>();
+    private static boolean mapNeedsInit												= true;
+
+    private static void registerDataType(DataType<?> dataType) {
+        if (dataType != null && dataType.getId() != null) {
+            mapIdentifiersToDataTypes.put(dataType.getId(), dataType);
         }
-        
-        private static void initMap() {
+    }
+
+    private static void initMap() {
+        if (mapNeedsInit) {
+            synchronized(mapIdentifiersToDataTypes) {
                 if (mapNeedsInit) {
-                        synchronized(mapIdentifiersToDataTypes) {
-                                if (mapNeedsInit) {
-                                        registerDataType(DataTypes.DT_ANYURI);
-                                        registerDataType(DataTypes.DT_BASE64BINARY);
-                                        registerDataType(DataTypes.DT_BOOLEAN);
-                                        registerDataType(DataTypes.DT_DATE);
-                                        registerDataType(DataTypes.DT_DATETIME);
-                                        registerDataType(DataTypes.DT_DAYTIMEDURATION);
-                                        registerDataType(DataTypes.DT_DNSNAME);
-                                        registerDataType(DataTypes.DT_DOUBLE);
-                                        registerDataType(DataTypes.DT_HEXBINARY);
-                                        registerDataType(DataTypes.DT_INTEGER);
-                                        registerDataType(DataTypes.DT_IPADDRESS);
-                                        registerDataType(DataTypes.DT_RFC822NAME);
-                                        registerDataType(DataTypes.DT_STRING);
-                                        registerDataType(DataTypes.DT_TIME);
-                                        registerDataType(DataTypes.DT_X500NAME);
-                                        registerDataType(DataTypes.DT_XPATHEXPRESSION);
-                                        registerDataType(DataTypes.DT_YEARMONTHDURATION);
-                                        mapNeedsInit	= false;
-                                }
-                        }
+                    registerDataType(DataTypes.DT_ANYURI);
+                    registerDataType(DataTypes.DT_BASE64BINARY);
+                    registerDataType(DataTypes.DT_BOOLEAN);
+                    registerDataType(DataTypes.DT_DATE);
+                    registerDataType(DataTypes.DT_DATETIME);
+                    registerDataType(DataTypes.DT_DAYTIMEDURATION);
+                    registerDataType(DataTypes.DT_DNSNAME);
+                    registerDataType(DataTypes.DT_DOUBLE);
+                    registerDataType(DataTypes.DT_HEXBINARY);
+                    registerDataType(DataTypes.DT_INTEGER);
+                    registerDataType(DataTypes.DT_IPADDRESS);
+                    registerDataType(DataTypes.DT_RFC822NAME);
+                    registerDataType(DataTypes.DT_STRING);
+                    registerDataType(DataTypes.DT_TIME);
+                    registerDataType(DataTypes.DT_X500NAME);
+                    registerDataType(DataTypes.DT_XPATHEXPRESSION);
+                    registerDataType(DataTypes.DT_YEARMONTHDURATION);
+                    mapNeedsInit	= false;
                 }
+            }
         }
-        
-        /**
-         * Creates a new <code>StdDataTypeFactory</code> and initializes the mapping from {@link com.att.research.xacml.api.Identifier}s for XACML
-         * data types to the {@link com.att.research.xacml.api.DataType} class instance that implements that data type.
-         */
-        public StdDataTypeFactory() {
-                initMap();
-        }
-        
-        @Override
-        public DataType<?> getDataType(Identifier dataTypeId) {
-                return mapIdentifiersToDataTypes.get(dataTypeId);
-        }
+    }
+
+    /**
+     * Creates a new <code>StdDataTypeFactory</code> and initializes the mapping from {@link com.att.research.xacml.api.Identifier}s for XACML
+     * data types to the {@link com.att.research.xacml.api.DataType} class instance that implements that data type.
+     */
+    public StdDataTypeFactory() {
+        initMap();
+    }
+
+    @Override
+    public DataType<?> getDataType(Identifier dataTypeId) {
+        return mapIdentifiersToDataTypes.get(dataTypeId);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIdReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIdReference.java
index 5b7d0e2..178389c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIdReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIdReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,79 +37,79 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.IdReference} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdIdReference implements IdReference {
-        private Identifier	id;
-        private Version		version;
-        
-        /**
-         * Creates a new <code>StdIdReference</code> with the given {@link com.att.research.xacml.api.Identifier} representing the
-         * XACML PolicyId or PolicySetId, and the given {@link com.att.research.xacml.api.Version} representing the PolicyVersion or PolicySetVersion.
-         * 
-         * @param idIn the <code>Identifier</code> representing the PolicyId or PolicySetId.
-         * @param versionIn the <code>Version</code> representing the PolicyVersion or PolicySetVersion.
-         */
-        public StdIdReference(Identifier idIn, Version versionIn) {
-                this.id			= idIn;
-                this.version	= versionIn;
-        }
-        
-        /**
-         * Creates a new <code>StdIdReference</code> with the given {@link com.att.research.xacml.api.Identifier} representing the
-         * XACML PolicyId or PolicySetId.
-         * 
-         * @param idIn the <code>Identifier</code> representing the PolicyId or PolicySetId.
-         */
-        public StdIdReference(Identifier idIn) {
-                this(idIn, null);
-        }
-        
-        @Override
-        public Identifier getId() {
-                return this.id;
-        }
+    private Identifier	id;
+    private Version		version;
 
-        @Override
-        public Version getVersion() {
-                return this.version;
+    /**
+     * Creates a new <code>StdIdReference</code> with the given {@link com.att.research.xacml.api.Identifier} representing the
+     * XACML PolicyId or PolicySetId, and the given {@link com.att.research.xacml.api.Version} representing the PolicyVersion or PolicySetVersion.
+     *
+     * @param idIn the <code>Identifier</code> representing the PolicyId or PolicySetId.
+     * @param versionIn the <code>Version</code> representing the PolicyVersion or PolicySetVersion.
+     */
+    public StdIdReference(Identifier idIn, Version versionIn) {
+        this.id			= idIn;
+        this.version	= versionIn;
+    }
+
+    /**
+     * Creates a new <code>StdIdReference</code> with the given {@link com.att.research.xacml.api.Identifier} representing the
+     * XACML PolicyId or PolicySetId.
+     *
+     * @param idIn the <code>Identifier</code> representing the PolicyId or PolicySetId.
+     */
+    public StdIdReference(Identifier idIn) {
+        this(idIn, null);
+    }
+
+    @Override
+    public Identifier getId() {
+        return this.id;
+    }
+
+    @Override
+    public Version getVersion() {
+        return this.version;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof IdReference)) {
+            return false;
+        } else {
+            IdReference objIdReference	= (IdReference)obj;
+            return ObjUtil.equalsAllowNull(this.getId(), objIdReference.getId()) &&
+                   ObjUtil.equalsAllowNull(this.getVersion(), objIdReference.getVersion());
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof IdReference)) {
-                        return false;
-                } else {
-                        IdReference objIdReference	= (IdReference)obj;
-                        return ObjUtil.equalsAllowNull(this.getId(), objIdReference.getId()) &&
-                                        ObjUtil.equalsAllowNull(this.getVersion(), objIdReference.getVersion());
-                }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump;
+
+        if ((objectToDump = this.getId()) != null) {
+            stringBuilder.append("id=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump;
-                
-                if ((objectToDump = this.getId()) != null) {
-                        stringBuilder.append("id=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getVersion()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("version=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        if ((objectToDump = this.getVersion()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("version=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIdReferenceMatch.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIdReferenceMatch.java
index 64697af..b7ed082 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIdReferenceMatch.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIdReferenceMatch.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,101 +37,101 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.IdReferenceMatch} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdIdReferenceMatch implements IdReferenceMatch {
-        private Identifier		id;
-        private VersionMatch	version;
-        private VersionMatch	earliestVersion;
-        private VersionMatch	latestVersion;
+    private Identifier		id;
+    private VersionMatch	version;
+    private VersionMatch	earliestVersion;
+    private VersionMatch	latestVersion;
 
-        /**
-         * Creates a new <code>StdIdReferenceMatch</code> with the given {@link com.att.research.xacml.api.Identifier} representing the PolicyId or PolicySetId
-         * to match, and the given set of {@link com.att.research.xacml.api.VersionMatch} objects specifying which XACML Versions are acceptable.
-         * 
-         * @param idIn the <code>Identifier</code> representing the PolicyId or PolicySetId.
-         * @param versionIn the <code>VersionMatch</code> for an exact match against the current Version of a Policy or PolicySet (may be null)
-         * @param earliestVersionIn the <code>VersionMatch</code> for a lower-bound match against the current Version of a Policy or PolicySet (may be null)
-         * @param latestVersionIn the <code>VersionMatch</code> for an upper-bound match against the current Version of a Policy or PolicySet (may be null)
-         */
-        public StdIdReferenceMatch(Identifier idIn, VersionMatch versionIn, VersionMatch earliestVersionIn, VersionMatch latestVersionIn) {
-                this.id			= idIn;
-                this.version			= versionIn;
-                this.earliestVersion	= earliestVersionIn;
-                this.latestVersion		= latestVersionIn;
+    /**
+     * Creates a new <code>StdIdReferenceMatch</code> with the given {@link com.att.research.xacml.api.Identifier} representing the PolicyId or PolicySetId
+     * to match, and the given set of {@link com.att.research.xacml.api.VersionMatch} objects specifying which XACML Versions are acceptable.
+     *
+     * @param idIn the <code>Identifier</code> representing the PolicyId or PolicySetId.
+     * @param versionIn the <code>VersionMatch</code> for an exact match against the current Version of a Policy or PolicySet (may be null)
+     * @param earliestVersionIn the <code>VersionMatch</code> for a lower-bound match against the current Version of a Policy or PolicySet (may be null)
+     * @param latestVersionIn the <code>VersionMatch</code> for an upper-bound match against the current Version of a Policy or PolicySet (may be null)
+     */
+    public StdIdReferenceMatch(Identifier idIn, VersionMatch versionIn, VersionMatch earliestVersionIn, VersionMatch latestVersionIn) {
+        this.id			= idIn;
+        this.version			= versionIn;
+        this.earliestVersion	= earliestVersionIn;
+        this.latestVersion		= latestVersionIn;
+    }
+
+    @Override
+    public Identifier getId() {
+        return this.id;
+    }
+
+    @Override
+    public VersionMatch getVersion() {
+        return this.version;
+    }
+
+    @Override
+    public VersionMatch getEarliestVersion() {
+        return this.earliestVersion;
+    }
+
+    @Override
+    public VersionMatch getLatestVersion() {
+        return this.latestVersion;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof IdReferenceMatch)) {
+            return false;
+        } else {
+            IdReferenceMatch objIdReferenceMatch	= (IdReferenceMatch)id;
+            return ObjUtil.equalsAllowNull(this.getId(), objIdReferenceMatch.getId()) &&
+                   ObjUtil.equalsAllowNull(this.getVersion(), objIdReferenceMatch.getVersion()) &&
+                   ObjUtil.equalsAllowNull(this.getEarliestVersion(), objIdReferenceMatch.getEarliestVersion()) &&
+                   ObjUtil.equalsAllowNull(this.getLatestVersion(), objIdReferenceMatch.getLatestVersion());
         }
-        
-        @Override
-        public Identifier getId() {
-                return this.id;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+
+        boolean needsComma	= false;
+        Object	objectToDump;
+        if ((objectToDump = this.getId()) != null) {
+            stringBuilder.append("id=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma		= true;
         }
-        
-        @Override
-        public VersionMatch getVersion() {
-                return this.version;
+        if ((objectToDump = this.getVersion()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("version=");
+            stringBuilder.append(objectToDump.toString());
         }
-        
-        @Override
-        public VersionMatch getEarliestVersion() {
-                return this.earliestVersion;
+        if ((objectToDump = this.getEarliestVersion()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append(",earliestVersion=");
+            stringBuilder.append(objectToDump);
         }
-        
-        @Override
-        public VersionMatch getLatestVersion() {
-                return this.latestVersion;
+        if ((objectToDump = this.getLatestVersion()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append(",latestVersion=");
+            stringBuilder.append(objectToDump);
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof IdReferenceMatch)) {
-                        return false;
-                } else {
-                        IdReferenceMatch objIdReferenceMatch	= (IdReferenceMatch)id;
-                        return ObjUtil.equalsAllowNull(this.getId(), objIdReferenceMatch.getId()) &&
-                                        ObjUtil.equalsAllowNull(this.getVersion(), objIdReferenceMatch.getVersion()) &&
-                                        ObjUtil.equalsAllowNull(this.getEarliestVersion(), objIdReferenceMatch.getEarliestVersion()) &&
-                                        ObjUtil.equalsAllowNull(this.getLatestVersion(), objIdReferenceMatch.getLatestVersion());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                
-                boolean needsComma	= false;
-                Object	objectToDump;
-                if ((objectToDump = this.getId()) != null) {
-                        stringBuilder.append("id=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma		= true;
-                }
-                if ((objectToDump = this.getVersion()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("version=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getEarliestVersion()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append(",earliestVersion=");
-                        stringBuilder.append(objectToDump);
-                }
-                if ((objectToDump = this.getLatestVersion()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append(",latestVersion=");
-                        stringBuilder.append(objectToDump);
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIndividualDecisionRequestGenerator.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIndividualDecisionRequestGenerator.java
index 7cac60c..f00f13d 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIndividualDecisionRequestGenerator.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdIndividualDecisionRequestGenerator.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -60,542 +60,542 @@
 import com.att.research.xacml.std.datatypes.XPathExpressionWrapper;
 
 /**
- * StdIndividualDecisionRequestGenerator is a utility that PDP developers can use to take an original 
+ * StdIndividualDecisionRequestGenerator is a utility that PDP developers can use to take an original
  * {@link com.att.research.xacml.api.Request} and turn it into a sequence of individual decision <code>Request</code>s.
  * This class implements all of the multiple-decision profiles specified in "XACML v3.0 Multiple Decision Profile Version 1.0"
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class StdIndividualDecisionRequestGenerator {
-        private static final Identifier[] idArray			= new Identifier[0];
-        private static final Status STATUS_NO_ATTRIBUTES	= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "No attributes");
-        private static final Status STATUS_NO_XMLID			= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "No xml:id");
-        private static final Status STATUS_NO_CATEGORY		= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "No category");
-        private static final Status STATUS_NO_RESOURCE_ID	= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "No " + XACML3.ID_RESOURCE_RESOURCE_ID.stringValue() + " attributes");
-        
-        private Log logger									= LogFactory.getLog(StdIndividualDecisionRequestGenerator.class);
-        private Request originalRequest;
-        private List<Request> individualDecisionRequests	= new ArrayList<Request>();
-        private ScopeResolver scopeResolver;
-        
-        private static StdMutableRequestAttributes removeMultipleContentSelector(RequestAttributes requestAttributes) {
-                StdMutableRequestAttributes stdRequestAttributes	= new StdMutableRequestAttributes();
-                stdRequestAttributes.setCategory(requestAttributes.getCategory());
-                stdRequestAttributes.setContentRoot(requestAttributes.getContentRoot());
-                stdRequestAttributes.setXmlId(requestAttributes.getXmlId());
-                for (Attribute attribute: requestAttributes.getAttributes()) {
-                        if (!attribute.getAttributeId().equals(XACML3.ID_MULTIPLE_CONTENT_SELECTOR)) {
-                                stdRequestAttributes.add(attribute);
-                        }
-                }
-                return stdRequestAttributes;
+    private static final Identifier[] idArray			= new Identifier[0];
+    private static final Status STATUS_NO_ATTRIBUTES	= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "No attributes");
+    private static final Status STATUS_NO_XMLID			= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "No xml:id");
+    private static final Status STATUS_NO_CATEGORY		= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "No category");
+    private static final Status STATUS_NO_RESOURCE_ID	= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "No " + XACML3.ID_RESOURCE_RESOURCE_ID.stringValue() + " attributes");
+
+    private Log logger									= LogFactory.getLog(StdIndividualDecisionRequestGenerator.class);
+    private Request originalRequest;
+    private List<Request> individualDecisionRequests	= new ArrayList<Request>();
+    private ScopeResolver scopeResolver;
+
+    private static StdMutableRequestAttributes removeMultipleContentSelector(RequestAttributes requestAttributes) {
+        StdMutableRequestAttributes stdRequestAttributes	= new StdMutableRequestAttributes();
+        stdRequestAttributes.setCategory(requestAttributes.getCategory());
+        stdRequestAttributes.setContentRoot(requestAttributes.getContentRoot());
+        stdRequestAttributes.setXmlId(requestAttributes.getXmlId());
+        for (Attribute attribute: requestAttributes.getAttributes()) {
+            if (!attribute.getAttributeId().equals(XACML3.ID_MULTIPLE_CONTENT_SELECTOR)) {
+                stdRequestAttributes.add(attribute);
+            }
         }
-        
-        /**
-         * Does a depth-first recursion on the <code>RequestAttribute</code>s that have a multiple:content-selector and generates all
-         * possible combinations of these attributes with the <code>ReqeustAttribute</code>s wthout a multiple:content-selector attribute.
-         * 
-         * @param listRequestAttributes the <code>List</code> of <code>RequestAttribute</code>s for the new <code>Request</code>s
-         * @param listPos the position within the <code>List</code>
-         * @param requestInProgress the <code>StdMutableRequest</code> with all of the processed <code>RequestAttribute</code>s so far
-         */
-        private void explodeOnContentSelector(List<RequestAttributes> listRequestAttributes, int listPos, StdMutableRequest requestInProgress) {
-                int listSize	= listRequestAttributes.size();
-                while (listPos < listSize) {
-                        RequestAttributes requestAttributes	= listRequestAttributes.get(listPos++);
-                        if (requestAttributes.hasAttributes(XACML3.ID_MULTIPLE_CONTENT_SELECTOR)) {
-                                /*
-                                 * Get the single Attribute for the multiple content selector
-                                 */
-                                Iterator<Attribute> iterAttributesMultipleContentSelector	= requestAttributes.getAttributes(XACML3.ID_MULTIPLE_CONTENT_SELECTOR);
-                                assert(iterAttributesMultipleContentSelector != null && iterAttributesMultipleContentSelector.hasNext());
-                                Attribute attributeMultipleContentSelector	= iterAttributesMultipleContentSelector.next();
-                                if (iterAttributesMultipleContentSelector.hasNext()) {
-                                        this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "multiple " + XACML3.ID_MULTIPLE_CONTENT_SELECTOR.stringValue() + " in category " + requestAttributes.getCategory().stringValue())));
-                                        return;
-                                }
-                                
-                                /*
-                                 * Get all of the XPathExpression values for this attribute, evaluate them against the Content node
-                                 */
-                                Iterator<AttributeValue<XPathExpressionWrapper>> iterXPathExpressions	= attributeMultipleContentSelector.findValues(DataTypes.DT_XPATHEXPRESSION);
-                                if (iterXPathExpressions == null || !iterXPathExpressions.hasNext()) {
-                                        this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "no XPathExpression values in " + XACML3.ID_MULTIPLE_CONTENT_SELECTOR.stringValue() + " in category " + requestAttributes.getCategory().stringValue())));
-                                        return;
-                                }
-                                
-                                /*
-                                 * Get the single XPathExpression and return an error if there is more than one.  This may not be strictly necessary.  We could
-                                 * explode all of the XPathExpressions, but for now assume only one is allowed.
-                                 */
-                                AttributeValue<XPathExpressionWrapper> attributeValueXPathExpression	= iterXPathExpressions.next();
-                                if (iterXPathExpressions.hasNext()) {
-                                        this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "multiple XPathExpression values in " + XACML3.ID_MULTIPLE_CONTENT_SELECTOR.stringValue() + " in category " + requestAttributes.getCategory().stringValue())));
-                                        return;
-                                }
-                                XPathExpressionWrapper xpathExpression							= attributeValueXPathExpression.getValue();
-                                if (xpathExpression == null) {
-                                        this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "null XPathExpression")));
-                                        return;
-                                }
-                                
-                                /*
-                                 * Get the NodeList so we know how many results will be returned
-                                 */
-                                NodeList nodeListXPathExpressionResults	= requestAttributes.getContentNodeListByXpathExpression(xpathExpression);
-                                if (nodeListXPathExpressionResults == null || nodeListXPathExpressionResults.getLength() == 0) {
-                                        this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "no matching nodes in the Content for XPathExpression " + xpathExpression.toString() + " in category " + requestAttributes.getCategory().stringValue())));
-                                        return;
-                                }
-                                
-                                /*
-                                 * For each matching node, create a new XPathExpression with an array accessor
-                                 */
-                                for (int i = 0 ; i < nodeListXPathExpressionResults.getLength() ; i++) {
-                                        try {
-                                                StdMutableRequestAttributes requestAttributesSingleContentSelector	= removeMultipleContentSelector(requestAttributes);
-                                                XPathExpressionWrapper xpathExpressionWrapperSingle					= new XPathExpressionWrapper(xpathExpression.getNamespaceContext(), xpathExpression.getPath() + "[" + (i+1) + "]");
-                                                Attribute attributeContentSelector									= new StdMutableAttribute(attributeMultipleContentSelector.getCategory(), 
-                                                                                                                                                                                                                           XACML3.ID_CONTENT_SELECTOR, 
-                                                                                                                                                                                                                           DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xpathExpressionWrapperSingle), 
-                                                                                                                                                                                                                           attributeMultipleContentSelector.getIssuer(), 
-                                                                                                                                                                                                                           attributeMultipleContentSelector.getIncludeInResults());	
-                                                requestAttributesSingleContentSelector.add(attributeContentSelector);
-                                                StdMutableRequest stdRequestSingleContentSelector					= new StdMutableRequest(requestInProgress);
-                                                stdRequestSingleContentSelector.add(requestAttributesSingleContentSelector);
-                                                
-                                                /*
-                                                 * Recurse to get the remaining attribute categories
-                                                 */
-                                                this.explodeOnContentSelector(listRequestAttributes, listPos, stdRequestSingleContentSelector);
-                                        } catch (Exception ex) {
-                                                this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage())));
-                                                return;
-                                        }
-                                }
-                                
-                                /*
-                                 * Once we have exploded values at this point in the list, we just return as the list will have been
-                                 * completely processed in the recursion
-                                 */
-                                return;
-                        } else {
-                                requestInProgress.add(requestAttributes);
-                        }
-                }
-                
+        return stdRequestAttributes;
+    }
+
+    /**
+     * Does a depth-first recursion on the <code>RequestAttribute</code>s that have a multiple:content-selector and generates all
+     * possible combinations of these attributes with the <code>ReqeustAttribute</code>s wthout a multiple:content-selector attribute.
+     *
+     * @param listRequestAttributes the <code>List</code> of <code>RequestAttribute</code>s for the new <code>Request</code>s
+     * @param listPos the position within the <code>List</code>
+     * @param requestInProgress the <code>StdMutableRequest</code> with all of the processed <code>RequestAttribute</code>s so far
+     */
+    private void explodeOnContentSelector(List<RequestAttributes> listRequestAttributes, int listPos, StdMutableRequest requestInProgress) {
+        int listSize	= listRequestAttributes.size();
+        while (listPos < listSize) {
+            RequestAttributes requestAttributes	= listRequestAttributes.get(listPos++);
+            if (requestAttributes.hasAttributes(XACML3.ID_MULTIPLE_CONTENT_SELECTOR)) {
                 /*
-                 * If we get here, then the request in progress is complete and should be added to the set
+                 * Get the single Attribute for the multiple content selector
                  */
-                this.individualDecisionRequests.add(requestInProgress);
-        }
-        
-        /**
-         * Checks to see if there are any categories that include an attribute with a "multiple:content-selector" identifier.  If so,
-         * the multiple content selectors are resolved to individual content-selectors.
-         * 
-         * @param request
-         */
-        protected void processContentSelectors(Request request) {
-                Iterator<RequestAttributes> iterRequestAttributes	= request.getRequestAttributes().iterator();
-                if (!iterRequestAttributes.hasNext()) {
-                        this.individualDecisionRequests.add(request);
-                        return;
+                Iterator<Attribute> iterAttributesMultipleContentSelector	= requestAttributes.getAttributes(XACML3.ID_MULTIPLE_CONTENT_SELECTOR);
+                assert(iterAttributesMultipleContentSelector != null && iterAttributesMultipleContentSelector.hasNext());
+                Attribute attributeMultipleContentSelector	= iterAttributesMultipleContentSelector.next();
+                if (iterAttributesMultipleContentSelector.hasNext()) {
+                    this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "multiple " + XACML3.ID_MULTIPLE_CONTENT_SELECTOR.stringValue() + " in category " + requestAttributes.getCategory().stringValue())));
+                    return;
                 }
-                
+
                 /*
-                 * Quick check for any categories with a multiple:content-selector attribute
+                 * Get all of the XPathExpression values for this attribute, evaluate them against the Content node
                  */
-                boolean hasMultipleContentSelectors				= false;
-                while (!hasMultipleContentSelectors && iterRequestAttributes.hasNext()) {
-                        hasMultipleContentSelectors	= iterRequestAttributes.next().hasAttributes(XACML3.ID_MULTIPLE_CONTENT_SELECTOR);
+                Iterator<AttributeValue<XPathExpressionWrapper>> iterXPathExpressions	= attributeMultipleContentSelector.findValues(DataTypes.DT_XPATHEXPRESSION);
+                if (iterXPathExpressions == null || !iterXPathExpressions.hasNext()) {
+                    this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "no XPathExpression values in " + XACML3.ID_MULTIPLE_CONTENT_SELECTOR.stringValue() + " in category " + requestAttributes.getCategory().stringValue())));
+                    return;
                 }
-                
+
                 /*
-                 * Iterate over all of the categories and see if there are any attributes in them with a multiple:content-selector
+                 * Get the single XPathExpression and return an error if there is more than one.  This may not be strictly necessary.  We could
+                 * explode all of the XPathExpressions, but for now assume only one is allowed.
                  */
-                if (!hasMultipleContentSelectors) {
-                        this.individualDecisionRequests.add(request);
-                } else {
-                        List<RequestAttributes> listRequestAttributes	= new ArrayList<RequestAttributes>();
-                        listRequestAttributes.addAll(request.getRequestAttributes());
-                        
-                        StdMutableRequest stdRequestInProgress	= new StdMutableRequest();
-                        stdRequestInProgress.setRequestDefaults(request.getRequestDefaults());
-                        stdRequestInProgress.setReturnPolicyIdList(request.getReturnPolicyIdList());
-                        this.explodeOnContentSelector(listRequestAttributes, 0, stdRequestInProgress);
+                AttributeValue<XPathExpressionWrapper> attributeValueXPathExpression	= iterXPathExpressions.next();
+                if (iterXPathExpressions.hasNext()) {
+                    this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "multiple XPathExpression values in " + XACML3.ID_MULTIPLE_CONTENT_SELECTOR.stringValue() + " in category " + requestAttributes.getCategory().stringValue())));
+                    return;
                 }
-        }
-        
-        private static StdMutableRequest removeResources(Request request) {
-                StdMutableRequest stdRequest	= new StdMutableRequest(request.getStatus());
-                stdRequest.setCombinedDecision(request.getCombinedDecision());
-                stdRequest.setRequestDefaults(request.getRequestDefaults());
-                stdRequest.setReturnPolicyIdList(request.getReturnPolicyIdList());
-        
-                Iterator<RequestAttributes> iterRequestAttributes	= request.getRequestAttributes().iterator();
-                if (iterRequestAttributes != null) {
-                        while (iterRequestAttributes.hasNext()) {
-                                RequestAttributes requestAttributes	= iterRequestAttributes.next();
-                                if (requestAttributes.getCategory() == null || !requestAttributes.getCategory().equals(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE)) {
-                                        stdRequest.add(requestAttributes);
-                                }
-                        }
+                XPathExpressionWrapper xpathExpression							= attributeValueXPathExpression.getValue();
+                if (xpathExpression == null) {
+                    this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "null XPathExpression")));
+                    return;
                 }
-                return stdRequest;
-        }
-        
-        /**
-         * Creates a duplicate of the given <code>RequestAttributes</code> with any resource-id and scope
-         * attributes removed.
-         * 
-         * @param requestAttributes the original <code>RequestAttributes</code>.
-         * @return
-         */
-        private static StdMutableRequestAttributes removeScopeAttributes(RequestAttributes requestAttributes) {
-                StdMutableRequestAttributes stdRequestAttributes	= new StdMutableRequestAttributes();
-                stdRequestAttributes.setCategory(requestAttributes.getCategory());
-                stdRequestAttributes.setContentRoot(requestAttributes.getContentRoot());
-                stdRequestAttributes.setXmlId(requestAttributes.getXmlId());
-                
-                for (Attribute attribute: requestAttributes.getAttributes()) {
-                        Identifier identifierAttribute	= attribute.getAttributeId();
-                        if (!identifierAttribute.equals(XACML3.ID_RESOURCE_RESOURCE_ID) && !identifierAttribute.equals(XACML3.ID_RESOURCE_SCOPE)) {
-                                stdRequestAttributes.add(attribute);
-                        }
-                }
-                return stdRequestAttributes;
-        }
-        
-        /**
-         * Gets the <code>ScopeQualifier</code> specified in the given <code>RequestAttributes</code>.
-         * 
-         * @param requestAttributes
-         * @return
-         * @throws com.att.research.xacml.api.pdp.ScopeResolverException
-         */
-        private static ScopeQualifier getScopeQualifier(RequestAttributes requestAttributes) throws ScopeResolverException {
-                Iterator<Attribute> iterAttributesScope	= requestAttributes.getAttributes(XACML3.ID_RESOURCE_SCOPE);
-                if (iterAttributesScope == null || !iterAttributesScope.hasNext()) {
-                        return null;
-                }
-                
-                Attribute attributeScope	= iterAttributesScope.next();
-                if (iterAttributesScope.hasNext()) {
-                        throw new ScopeResolverException("More than one " + XACML3.ID_RESOURCE_SCOPE.stringValue() + " attribute");
-                }
-                
-                Iterator<AttributeValue<?>> iterAttributeValuesScope	= attributeScope.getValues().iterator();
-                if (!iterAttributeValuesScope.hasNext()) {
-                        throw new ScopeResolverException("No values for " + XACML3.ID_RESOURCE_SCOPE.stringValue() + " atribute");
-                }
-                ScopeQualifier scopeQualifier	= null;
-                while (scopeQualifier == null && iterAttributeValuesScope.hasNext()) {
-                        AttributeValue<?> attributeValueScope				= iterAttributeValuesScope.next();
-                        AttributeValue<String> attributeValueScopeString	= null;
-                        try {
-                                attributeValueScopeString	= DataTypes.DT_STRING.convertAttributeValue(attributeValueScope);
-                                if (attributeValueScopeString != null) {
-                                        scopeQualifier	= ScopeQualifier.getScopeQualifier(attributeValueScopeString.getValue());
-                                }
-                        } catch (Exception ex) {
-                                
-                        }
-                }
-                if (scopeQualifier == null) {
-                        throw new ScopeResolverException("No valid values for " + XACML3.ID_RESOURCE_SCOPE.stringValue() + " attribute");
-                }
-                return scopeQualifier;
-        }
-        
-        /**
-         * Checks to see if there are any categories that include an attribute with a "scope" identifier.  If so, the scopes are expanded
-         * and individual decision requests are generated with the expanded scopes.
-         * 
-         * @param request
-         */
-        protected void processScopes(Request request) {
-                assert(request.getStatus() == null || request.getStatus().isOk());
-                
+
                 /*
-                 * If there is no scope resolver, then just move on to the content selectors
+                 * Get the NodeList so we know how many results will be returned
                  */
-                if (this.scopeResolver == null) {
-                        this.processContentSelectors(request);
-                        return;
+                NodeList nodeListXPathExpressionResults	= requestAttributes.getContentNodeListByXpathExpression(xpathExpression);
+                if (nodeListXPathExpressionResults == null || nodeListXPathExpressionResults.getLength() == 0) {
+                    this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "no matching nodes in the Content for XPathExpression " + xpathExpression.toString() + " in category " + requestAttributes.getCategory().stringValue())));
+                    return;
                 }
-                
+
                 /*
-                 * Scope only applies to the resource category, so just get the RequestAttributes for that.  At this point there should be at most one.
+                 * For each matching node, create a new XPathExpression with an array accessor
                  */
-                Iterator<RequestAttributes> iterRequestAttributesResource	= request.getRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);
-                if (iterRequestAttributesResource == null || !iterRequestAttributesResource.hasNext()) {
-                        this.processContentSelectors(request);
-                        return;
-                }
-                RequestAttributes requestAttributesResource	= iterRequestAttributesResource.next();
-                assert(!iterRequestAttributesResource.hasNext());
-                
-                /*
-                 * Get the requested scope
-                 */
-                ScopeQualifier scopeQualifier	= null;
-                try {
-                        scopeQualifier	= getScopeQualifier(requestAttributesResource);
-                } catch (ScopeResolverException ex) {
-                        this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage())));
-                        return;
-                }
-                if (scopeQualifier == null) {
-                        this.processContentSelectors(request);
-                        return;
-                }
-                
-                /*
-                 * Get the resource-id attributes and iterate over them, generating individual resource id values using the scope
-                 * resolver.
-                 */
-                Iterator<Attribute> iterAttributesResourceId	= requestAttributesResource.getAttributes(XACML3.ID_RESOURCE_RESOURCE_ID);
-                if (iterAttributesResourceId == null || !iterAttributesResourceId.hasNext()) {
-                        this.individualDecisionRequests.add(new StdMutableRequest(STATUS_NO_RESOURCE_ID));
-                        return;
-                }
-                
-                /*
-                 * Make a copy of the request attributes with the scope and resource ID values removed.
-                 */
-                StdMutableRequestAttributes requestAttributesBase	= removeScopeAttributes(requestAttributesResource);
-                
-                /*
-                 * Set up the basic Request to match the input request but with no resource attributes
-                 */
-                StdMutableRequest stdRequest	= removeResources(request);
-                
-                boolean bAtLeastOne	= false;
-                while (iterAttributesResourceId.hasNext()) {
-                        Attribute attributeResourceId	= iterAttributesResourceId.next();
-                        ScopeResolverResult scopeResolverResult					= null;
-                        try {
-                                scopeResolverResult	= this.scopeResolver.resolveScope(attributeResourceId, scopeQualifier);
-                        } catch (ScopeResolverException ex) {
-                                this.logger.error("ScopeResolverException resolving " + attributeResourceId.toString() + ": " + ex.getMessage(), ex);
-                        }
-                        if (scopeResolverResult.getStatus() != null && !scopeResolverResult.getStatus().isOk()) {
-                                this.individualDecisionRequests.add(new StdMutableRequest(scopeResolverResult.getStatus()));
-                                return;
-                        }
-                        Iterator<Attribute> iterAttributesResourceIdResolved	= scopeResolverResult.getAttributes();
-                        if (iterAttributesResourceIdResolved != null) {
-                                while (iterAttributesResourceIdResolved.hasNext()) {
-                                        StdMutableRequestAttributes stdRequestAttributes	= new StdMutableRequestAttributes(requestAttributesBase);
-                                        stdRequestAttributes.add(iterAttributesResourceIdResolved.next());
-                                        StdMutableRequest stdRequestExploded				= new StdMutableRequest(stdRequest);
-                                        stdRequestExploded.add(stdRequestAttributes);
-                                        this.processContentSelectors(stdRequestExploded);
-                                        bAtLeastOne	= true;
-                                }
-                        }
-                }
-                if (!bAtLeastOne) {
-                        this.logger.warn("No scopes expanded.  Using original resource ids");
-                        iterAttributesResourceId	= requestAttributesResource.getAttributes(XACML3.ID_RESOURCE_RESOURCE_ID);
-                        assert(iterAttributesResourceId != null);
-                        while (iterAttributesResourceId.hasNext()) {
-                                requestAttributesBase.add(iterAttributesResourceId.next());
-                        }
-                        stdRequest.add(requestAttributesBase);
-                        this.processContentSelectors(stdRequest);
-                }
-        }
-        
-        /**
-         * Checks to see if the category with the <code>Identifier</code> at the current <code>Iterator</code> position has
-         * multiple <code>RequestAttribute</code>s associated with it.  If so, then for each copy, explode on the remaining categories.  Otherwise
-         * store the single value in the requestInProgress and explode on the remaining values.
-         * 
-         * @param identifiers
-         * @param pos
-         * @param requestInProgress
-         * @param mapCategories
-         */
-        private void explodeOnCategory(Identifier[] identifiers, int pos, StdMutableRequest requestInProgress, Map<Identifier,List<RequestAttributes>> mapCategories) {
-                if (pos >= identifiers.length) {
+                for (int i = 0 ; i < nodeListXPathExpressionResults.getLength() ; i++) {
+                    try {
+                        StdMutableRequestAttributes requestAttributesSingleContentSelector	= removeMultipleContentSelector(requestAttributes);
+                        XPathExpressionWrapper xpathExpressionWrapperSingle					= new XPathExpressionWrapper(xpathExpression.getNamespaceContext(), xpathExpression.getPath() + "[" + (i+1) + "]");
+                        Attribute attributeContentSelector									= new StdMutableAttribute(attributeMultipleContentSelector.getCategory(),
+                                XACML3.ID_CONTENT_SELECTOR,
+                                DataTypes.DT_XPATHEXPRESSION.createAttributeValue(xpathExpressionWrapperSingle),
+                                attributeMultipleContentSelector.getIssuer(),
+                                attributeMultipleContentSelector.getIncludeInResults());
+                        requestAttributesSingleContentSelector.add(attributeContentSelector);
+                        StdMutableRequest stdRequestSingleContentSelector					= new StdMutableRequest(requestInProgress);
+                        stdRequestSingleContentSelector.add(requestAttributesSingleContentSelector);
+
                         /*
-                         * Tail out of the recursion by performing the next stage of processing on the request in proress
+                         * Recurse to get the remaining attribute categories
                          */
-                        this.processScopes(requestInProgress);
-                } else {
-                        List<RequestAttributes> listCategoryAttributes	= mapCategories.get(identifiers[pos]);
-                        assert(listCategoryAttributes != null && listCategoryAttributes.size() > 0);
-                        if (listCategoryAttributes.size() == 1) {
-                                requestInProgress.add(listCategoryAttributes.get(0));
-                                this.explodeOnCategory(identifiers, pos+1, requestInProgress, mapCategories);
-                        } else {
-                                for (RequestAttributes requestAttributes : listCategoryAttributes) {
-                                        StdMutableRequest stdRequestCopy	= new StdMutableRequest(requestInProgress);
-                                        stdRequestCopy.add(requestAttributes);
-                                        this.explodeOnCategory(identifiers, pos+1, stdRequestCopy, mapCategories);
-                                }
-                        }
-                }
-        }
-        
-        /**
-         * Checks to see if the given <code>Request</code> contains instances of repeated categories in the request attributes elements.
-         * 
-         * @param request the <code>Request</code> to check
-         */
-        protected void processRepeatedCategories(Request request) {
-                Iterator<RequestAttributes> iterRequestAttributes		= request.getRequestAttributes().iterator();
-                if (iterRequestAttributes == null || !iterRequestAttributes.hasNext()) {
-                        /*
-                         * There are no attributes to process anyway.  The PDP will give an indeterminate result from this
-                         */
-                        this.individualDecisionRequests.add(request);
+                        this.explodeOnContentSelector(listRequestAttributes, listPos, stdRequestSingleContentSelector);
+                    } catch (Exception ex) {
+                        this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, ex.getMessage())));
                         return;
+                    }
                 }
-                
+
                 /*
-                 * We need to do a quick check for multiple Attributes with the same Category
+                 * Once we have exploded values at this point in the list, we just return as the list will have been
+                 * completely processed in the recursion
                  */
-                boolean bContainsMultiples								= false;
-                Set<Identifier> setCategories	= new HashSet<Identifier>();
-                while (iterRequestAttributes.hasNext() && !bContainsMultiples) {
-                        RequestAttributes requestAttributes	= iterRequestAttributes.next();
-                        Identifier identifierCategory		= requestAttributes.getCategory();
-                        if (identifierCategory == null) {
-                                this.individualDecisionRequests.add(new StdMutableRequest(STATUS_NO_CATEGORY));
-                                return;
-                        }
-                        if (setCategories.contains(identifierCategory)) {
-                                bContainsMultiples	= true;
-                        } else {
-                                setCategories.add(identifierCategory);
-                        }
-                }
-                
-                /*
-                 * If there are no instances of categories with multiple Attributes elements, then no splitting is done here,
-                 * just move on to the next check.
-                 */
-                if (!bContainsMultiples) {
-                        this.processScopes(request);
-                } else {
-                        iterRequestAttributes	= request.getRequestAttributes().iterator();
-                        Map<Identifier,List<RequestAttributes>> mapCategories	= new HashMap<Identifier,List<RequestAttributes>>();
-                        while (iterRequestAttributes.hasNext()) {
-                                RequestAttributes requestAttributes	= iterRequestAttributes.next();
-                                Identifier identifierCategory		= requestAttributes.getCategory();
-                                List<RequestAttributes> listRequestAttributes	= mapCategories.get(identifierCategory);
-                                if (listRequestAttributes == null) {
-                                        listRequestAttributes	= new ArrayList<RequestAttributes>();
-                                        mapCategories.put(identifierCategory, listRequestAttributes);
-                                }
-                                listRequestAttributes.add(requestAttributes);
-                        }
-                        
-                        StdMutableRequest requestRoot	= new StdMutableRequest();
-                        requestRoot.setRequestDefaults(request.getRequestDefaults());
-                        requestRoot.setReturnPolicyIdList(request.getReturnPolicyIdList());
-                        this.explodeOnCategory(mapCategories.keySet().toArray(idArray), 0, requestRoot, mapCategories);
-                }
-        }
-        
-        /**
-         * Tries to resolve the given <code>RequestReference</code> in order to create a fully
-         * qualified <code>Request</code> to pass on to the next stage of individual request processing.
-         * 
-         * @param requestReference
-         */
-        protected Request processMultiRequest(Request requestOriginal, RequestReference requestReference) {
-                Collection<RequestAttributesReference> listRequestAttributesReferences	= requestReference.getAttributesReferences();
-                if (listRequestAttributesReferences.size() == 0) {
-                        return new StdMutableRequest(STATUS_NO_ATTRIBUTES);
-                }
-                
-                StdMutableRequest stdRequest	= new StdMutableRequest(requestOriginal.getStatus());
-                stdRequest.setRequestDefaults(requestOriginal.getRequestDefaults());
-                stdRequest.setReturnPolicyIdList(requestOriginal.getReturnPolicyIdList());
-                for (RequestAttributesReference requestAttributesReference: listRequestAttributesReferences) {
-                        String xmlId	= requestAttributesReference.getReferenceId();
-                        if (xmlId == null) {
-                                return new StdMutableRequest(STATUS_NO_XMLID);
-                        }
-                        RequestAttributes requestAttributes	= requestOriginal.getRequestAttributesByXmlId(xmlId);
-                        if (requestAttributes == null) {
-                                return new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Unresolved xml:id " + xmlId));
-                        } else {
-                                stdRequest.add(requestAttributes);
-                        }
-                }
-                return stdRequest;
-        }
-        
-        /**
-         * Populates the individual decision <code>Request</code>s from the given <code>Request</code>
-         * using all supported profiles.  The process here is documented as step 1. of Section 4 of the XACML document.
-         * 
-         * @param request the <code>Request</code> to explode
-         */
-        protected void createIndividualDecisionRequests(Request request) {
-                /*
-                 * If the request is bad to begin with, just add it to the list and be done.
-                 */
-                if (request.getStatus() != null && !request.getStatus().isOk()) {
-                        this.individualDecisionRequests.add(request);
-                        return;
-                }
-                
-                /*
-                 * Check to see if this Request is a MultiRequest
-                 */
-                Iterator<RequestReference> iterRequestReferences	= request.getMultiRequests().iterator();
-                if (iterRequestReferences != null && iterRequestReferences.hasNext()) {
-                        while (iterRequestReferences.hasNext()) {
-                                Request requestFromReferences	= this.processMultiRequest(request, iterRequestReferences.next());
-                                assert(requestFromReferences != null);
-                                if (requestFromReferences.getStatus() == null || requestFromReferences.getStatus().isOk()) {
-                                        this.processRepeatedCategories(requestFromReferences);
-                                } else {
-                                        /*
-                                         * Just add the bad request to the list.  It will be cause a Result with the same bad status
-                                         * when the PDP actually runs the request.
-                                         */
-                                        this.individualDecisionRequests.add(requestFromReferences);
-                                }
-                        }
-                } else {
-                        this.processRepeatedCategories(request);
-                }
-        }
-        
-        public StdIndividualDecisionRequestGenerator(ScopeResolver scopeResolverIn, Request request) {
-                this.originalRequest	= request;
-                this.scopeResolver		= scopeResolverIn;
-                this.createIndividualDecisionRequests(request);
-        }
-        
-        public StdIndividualDecisionRequestGenerator(Request request) {
-                this(null, request);
+                return;
+            } else {
+                requestInProgress.add(requestAttributes);
+            }
         }
 
-        /**
-         * Gets the original <code>Request</code>.
-         * 
-         * @return the original <code>Request</code>
+        /*
+         * If we get here, then the request in progress is complete and should be added to the set
          */
-        public Request getOriginalRequest() {
-                return this.originalRequest;
+        this.individualDecisionRequests.add(requestInProgress);
+    }
+
+    /**
+     * Checks to see if there are any categories that include an attribute with a "multiple:content-selector" identifier.  If so,
+     * the multiple content selectors are resolved to individual content-selectors.
+     *
+     * @param request
+     */
+    protected void processContentSelectors(Request request) {
+        Iterator<RequestAttributes> iterRequestAttributes	= request.getRequestAttributes().iterator();
+        if (!iterRequestAttributes.hasNext()) {
+            this.individualDecisionRequests.add(request);
+            return;
         }
-        
-        /**
-         * Gets an <code>Iterator</code> over the individual decision <code>Request</code>s for
-         * the original <code>Request</code>.
-         * 
-         * @return an <code>Iterator</code> over the individual decision <code>Request</code>s.
+
+        /*
+         * Quick check for any categories with a multiple:content-selector attribute
          */
-        public Iterator<Request> getIndividualDecisionRequests() {
-                return this.individualDecisionRequests.iterator();
+        boolean hasMultipleContentSelectors				= false;
+        while (!hasMultipleContentSelectors && iterRequestAttributes.hasNext()) {
+            hasMultipleContentSelectors	= iterRequestAttributes.next().hasAttributes(XACML3.ID_MULTIPLE_CONTENT_SELECTOR);
         }
+
+        /*
+         * Iterate over all of the categories and see if there are any attributes in them with a multiple:content-selector
+         */
+        if (!hasMultipleContentSelectors) {
+            this.individualDecisionRequests.add(request);
+        } else {
+            List<RequestAttributes> listRequestAttributes	= new ArrayList<RequestAttributes>();
+            listRequestAttributes.addAll(request.getRequestAttributes());
+
+            StdMutableRequest stdRequestInProgress	= new StdMutableRequest();
+            stdRequestInProgress.setRequestDefaults(request.getRequestDefaults());
+            stdRequestInProgress.setReturnPolicyIdList(request.getReturnPolicyIdList());
+            this.explodeOnContentSelector(listRequestAttributes, 0, stdRequestInProgress);
+        }
+    }
+
+    private static StdMutableRequest removeResources(Request request) {
+        StdMutableRequest stdRequest	= new StdMutableRequest(request.getStatus());
+        stdRequest.setCombinedDecision(request.getCombinedDecision());
+        stdRequest.setRequestDefaults(request.getRequestDefaults());
+        stdRequest.setReturnPolicyIdList(request.getReturnPolicyIdList());
+
+        Iterator<RequestAttributes> iterRequestAttributes	= request.getRequestAttributes().iterator();
+        if (iterRequestAttributes != null) {
+            while (iterRequestAttributes.hasNext()) {
+                RequestAttributes requestAttributes	= iterRequestAttributes.next();
+                if (requestAttributes.getCategory() == null || !requestAttributes.getCategory().equals(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE)) {
+                    stdRequest.add(requestAttributes);
+                }
+            }
+        }
+        return stdRequest;
+    }
+
+    /**
+     * Creates a duplicate of the given <code>RequestAttributes</code> with any resource-id and scope
+     * attributes removed.
+     *
+     * @param requestAttributes the original <code>RequestAttributes</code>.
+     * @return
+     */
+    private static StdMutableRequestAttributes removeScopeAttributes(RequestAttributes requestAttributes) {
+        StdMutableRequestAttributes stdRequestAttributes	= new StdMutableRequestAttributes();
+        stdRequestAttributes.setCategory(requestAttributes.getCategory());
+        stdRequestAttributes.setContentRoot(requestAttributes.getContentRoot());
+        stdRequestAttributes.setXmlId(requestAttributes.getXmlId());
+
+        for (Attribute attribute: requestAttributes.getAttributes()) {
+            Identifier identifierAttribute	= attribute.getAttributeId();
+            if (!identifierAttribute.equals(XACML3.ID_RESOURCE_RESOURCE_ID) && !identifierAttribute.equals(XACML3.ID_RESOURCE_SCOPE)) {
+                stdRequestAttributes.add(attribute);
+            }
+        }
+        return stdRequestAttributes;
+    }
+
+    /**
+     * Gets the <code>ScopeQualifier</code> specified in the given <code>RequestAttributes</code>.
+     *
+     * @param requestAttributes
+     * @return
+     * @throws com.att.research.xacml.api.pdp.ScopeResolverException
+     */
+    private static ScopeQualifier getScopeQualifier(RequestAttributes requestAttributes) throws ScopeResolverException {
+        Iterator<Attribute> iterAttributesScope	= requestAttributes.getAttributes(XACML3.ID_RESOURCE_SCOPE);
+        if (iterAttributesScope == null || !iterAttributesScope.hasNext()) {
+            return null;
+        }
+
+        Attribute attributeScope	= iterAttributesScope.next();
+        if (iterAttributesScope.hasNext()) {
+            throw new ScopeResolverException("More than one " + XACML3.ID_RESOURCE_SCOPE.stringValue() + " attribute");
+        }
+
+        Iterator<AttributeValue<?>> iterAttributeValuesScope	= attributeScope.getValues().iterator();
+        if (!iterAttributeValuesScope.hasNext()) {
+            throw new ScopeResolverException("No values for " + XACML3.ID_RESOURCE_SCOPE.stringValue() + " atribute");
+        }
+        ScopeQualifier scopeQualifier	= null;
+        while (scopeQualifier == null && iterAttributeValuesScope.hasNext()) {
+            AttributeValue<?> attributeValueScope				= iterAttributeValuesScope.next();
+            AttributeValue<String> attributeValueScopeString	= null;
+            try {
+                attributeValueScopeString	= DataTypes.DT_STRING.convertAttributeValue(attributeValueScope);
+                if (attributeValueScopeString != null) {
+                    scopeQualifier	= ScopeQualifier.getScopeQualifier(attributeValueScopeString.getValue());
+                }
+            } catch (Exception ex) {
+
+            }
+        }
+        if (scopeQualifier == null) {
+            throw new ScopeResolverException("No valid values for " + XACML3.ID_RESOURCE_SCOPE.stringValue() + " attribute");
+        }
+        return scopeQualifier;
+    }
+
+    /**
+     * Checks to see if there are any categories that include an attribute with a "scope" identifier.  If so, the scopes are expanded
+     * and individual decision requests are generated with the expanded scopes.
+     *
+     * @param request
+     */
+    protected void processScopes(Request request) {
+        assert(request.getStatus() == null || request.getStatus().isOk());
+
+        /*
+         * If there is no scope resolver, then just move on to the content selectors
+         */
+        if (this.scopeResolver == null) {
+            this.processContentSelectors(request);
+            return;
+        }
+
+        /*
+         * Scope only applies to the resource category, so just get the RequestAttributes for that.  At this point there should be at most one.
+         */
+        Iterator<RequestAttributes> iterRequestAttributesResource	= request.getRequestAttributes(XACML3.ID_ATTRIBUTE_CATEGORY_RESOURCE);
+        if (iterRequestAttributesResource == null || !iterRequestAttributesResource.hasNext()) {
+            this.processContentSelectors(request);
+            return;
+        }
+        RequestAttributes requestAttributesResource	= iterRequestAttributesResource.next();
+        assert(!iterRequestAttributesResource.hasNext());
+
+        /*
+         * Get the requested scope
+         */
+        ScopeQualifier scopeQualifier	= null;
+        try {
+            scopeQualifier	= getScopeQualifier(requestAttributesResource);
+        } catch (ScopeResolverException ex) {
+            this.individualDecisionRequests.add(new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, ex.getMessage())));
+            return;
+        }
+        if (scopeQualifier == null) {
+            this.processContentSelectors(request);
+            return;
+        }
+
+        /*
+         * Get the resource-id attributes and iterate over them, generating individual resource id values using the scope
+         * resolver.
+         */
+        Iterator<Attribute> iterAttributesResourceId	= requestAttributesResource.getAttributes(XACML3.ID_RESOURCE_RESOURCE_ID);
+        if (iterAttributesResourceId == null || !iterAttributesResourceId.hasNext()) {
+            this.individualDecisionRequests.add(new StdMutableRequest(STATUS_NO_RESOURCE_ID));
+            return;
+        }
+
+        /*
+         * Make a copy of the request attributes with the scope and resource ID values removed.
+         */
+        StdMutableRequestAttributes requestAttributesBase	= removeScopeAttributes(requestAttributesResource);
+
+        /*
+         * Set up the basic Request to match the input request but with no resource attributes
+         */
+        StdMutableRequest stdRequest	= removeResources(request);
+
+        boolean bAtLeastOne	= false;
+        while (iterAttributesResourceId.hasNext()) {
+            Attribute attributeResourceId	= iterAttributesResourceId.next();
+            ScopeResolverResult scopeResolverResult					= null;
+            try {
+                scopeResolverResult	= this.scopeResolver.resolveScope(attributeResourceId, scopeQualifier);
+            } catch (ScopeResolverException ex) {
+                this.logger.error("ScopeResolverException resolving " + attributeResourceId.toString() + ": " + ex.getMessage(), ex);
+            }
+            if (scopeResolverResult.getStatus() != null && !scopeResolverResult.getStatus().isOk()) {
+                this.individualDecisionRequests.add(new StdMutableRequest(scopeResolverResult.getStatus()));
+                return;
+            }
+            Iterator<Attribute> iterAttributesResourceIdResolved	= scopeResolverResult.getAttributes();
+            if (iterAttributesResourceIdResolved != null) {
+                while (iterAttributesResourceIdResolved.hasNext()) {
+                    StdMutableRequestAttributes stdRequestAttributes	= new StdMutableRequestAttributes(requestAttributesBase);
+                    stdRequestAttributes.add(iterAttributesResourceIdResolved.next());
+                    StdMutableRequest stdRequestExploded				= new StdMutableRequest(stdRequest);
+                    stdRequestExploded.add(stdRequestAttributes);
+                    this.processContentSelectors(stdRequestExploded);
+                    bAtLeastOne	= true;
+                }
+            }
+        }
+        if (!bAtLeastOne) {
+            this.logger.warn("No scopes expanded.  Using original resource ids");
+            iterAttributesResourceId	= requestAttributesResource.getAttributes(XACML3.ID_RESOURCE_RESOURCE_ID);
+            assert(iterAttributesResourceId != null);
+            while (iterAttributesResourceId.hasNext()) {
+                requestAttributesBase.add(iterAttributesResourceId.next());
+            }
+            stdRequest.add(requestAttributesBase);
+            this.processContentSelectors(stdRequest);
+        }
+    }
+
+    /**
+     * Checks to see if the category with the <code>Identifier</code> at the current <code>Iterator</code> position has
+     * multiple <code>RequestAttribute</code>s associated with it.  If so, then for each copy, explode on the remaining categories.  Otherwise
+     * store the single value in the requestInProgress and explode on the remaining values.
+     *
+     * @param identifiers
+     * @param pos
+     * @param requestInProgress
+     * @param mapCategories
+     */
+    private void explodeOnCategory(Identifier[] identifiers, int pos, StdMutableRequest requestInProgress, Map<Identifier,List<RequestAttributes>> mapCategories) {
+        if (pos >= identifiers.length) {
+            /*
+             * Tail out of the recursion by performing the next stage of processing on the request in proress
+             */
+            this.processScopes(requestInProgress);
+        } else {
+            List<RequestAttributes> listCategoryAttributes	= mapCategories.get(identifiers[pos]);
+            assert(listCategoryAttributes != null && listCategoryAttributes.size() > 0);
+            if (listCategoryAttributes.size() == 1) {
+                requestInProgress.add(listCategoryAttributes.get(0));
+                this.explodeOnCategory(identifiers, pos+1, requestInProgress, mapCategories);
+            } else {
+                for (RequestAttributes requestAttributes : listCategoryAttributes) {
+                    StdMutableRequest stdRequestCopy	= new StdMutableRequest(requestInProgress);
+                    stdRequestCopy.add(requestAttributes);
+                    this.explodeOnCategory(identifiers, pos+1, stdRequestCopy, mapCategories);
+                }
+            }
+        }
+    }
+
+    /**
+     * Checks to see if the given <code>Request</code> contains instances of repeated categories in the request attributes elements.
+     *
+     * @param request the <code>Request</code> to check
+     */
+    protected void processRepeatedCategories(Request request) {
+        Iterator<RequestAttributes> iterRequestAttributes		= request.getRequestAttributes().iterator();
+        if (iterRequestAttributes == null || !iterRequestAttributes.hasNext()) {
+            /*
+             * There are no attributes to process anyway.  The PDP will give an indeterminate result from this
+             */
+            this.individualDecisionRequests.add(request);
+            return;
+        }
+
+        /*
+         * We need to do a quick check for multiple Attributes with the same Category
+         */
+        boolean bContainsMultiples								= false;
+        Set<Identifier> setCategories	= new HashSet<Identifier>();
+        while (iterRequestAttributes.hasNext() && !bContainsMultiples) {
+            RequestAttributes requestAttributes	= iterRequestAttributes.next();
+            Identifier identifierCategory		= requestAttributes.getCategory();
+            if (identifierCategory == null) {
+                this.individualDecisionRequests.add(new StdMutableRequest(STATUS_NO_CATEGORY));
+                return;
+            }
+            if (setCategories.contains(identifierCategory)) {
+                bContainsMultiples	= true;
+            } else {
+                setCategories.add(identifierCategory);
+            }
+        }
+
+        /*
+         * If there are no instances of categories with multiple Attributes elements, then no splitting is done here,
+         * just move on to the next check.
+         */
+        if (!bContainsMultiples) {
+            this.processScopes(request);
+        } else {
+            iterRequestAttributes	= request.getRequestAttributes().iterator();
+            Map<Identifier,List<RequestAttributes>> mapCategories	= new HashMap<Identifier,List<RequestAttributes>>();
+            while (iterRequestAttributes.hasNext()) {
+                RequestAttributes requestAttributes	= iterRequestAttributes.next();
+                Identifier identifierCategory		= requestAttributes.getCategory();
+                List<RequestAttributes> listRequestAttributes	= mapCategories.get(identifierCategory);
+                if (listRequestAttributes == null) {
+                    listRequestAttributes	= new ArrayList<RequestAttributes>();
+                    mapCategories.put(identifierCategory, listRequestAttributes);
+                }
+                listRequestAttributes.add(requestAttributes);
+            }
+
+            StdMutableRequest requestRoot	= new StdMutableRequest();
+            requestRoot.setRequestDefaults(request.getRequestDefaults());
+            requestRoot.setReturnPolicyIdList(request.getReturnPolicyIdList());
+            this.explodeOnCategory(mapCategories.keySet().toArray(idArray), 0, requestRoot, mapCategories);
+        }
+    }
+
+    /**
+     * Tries to resolve the given <code>RequestReference</code> in order to create a fully
+     * qualified <code>Request</code> to pass on to the next stage of individual request processing.
+     *
+     * @param requestReference
+     */
+    protected Request processMultiRequest(Request requestOriginal, RequestReference requestReference) {
+        Collection<RequestAttributesReference> listRequestAttributesReferences	= requestReference.getAttributesReferences();
+        if (listRequestAttributesReferences.size() == 0) {
+            return new StdMutableRequest(STATUS_NO_ATTRIBUTES);
+        }
+
+        StdMutableRequest stdRequest	= new StdMutableRequest(requestOriginal.getStatus());
+        stdRequest.setRequestDefaults(requestOriginal.getRequestDefaults());
+        stdRequest.setReturnPolicyIdList(requestOriginal.getReturnPolicyIdList());
+        for (RequestAttributesReference requestAttributesReference: listRequestAttributesReferences) {
+            String xmlId	= requestAttributesReference.getReferenceId();
+            if (xmlId == null) {
+                return new StdMutableRequest(STATUS_NO_XMLID);
+            }
+            RequestAttributes requestAttributes	= requestOriginal.getRequestAttributesByXmlId(xmlId);
+            if (requestAttributes == null) {
+                return new StdMutableRequest(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Unresolved xml:id " + xmlId));
+            } else {
+                stdRequest.add(requestAttributes);
+            }
+        }
+        return stdRequest;
+    }
+
+    /**
+     * Populates the individual decision <code>Request</code>s from the given <code>Request</code>
+     * using all supported profiles.  The process here is documented as step 1. of Section 4 of the XACML document.
+     *
+     * @param request the <code>Request</code> to explode
+     */
+    protected void createIndividualDecisionRequests(Request request) {
+        /*
+         * If the request is bad to begin with, just add it to the list and be done.
+         */
+        if (request.getStatus() != null && !request.getStatus().isOk()) {
+            this.individualDecisionRequests.add(request);
+            return;
+        }
+
+        /*
+         * Check to see if this Request is a MultiRequest
+         */
+        Iterator<RequestReference> iterRequestReferences	= request.getMultiRequests().iterator();
+        if (iterRequestReferences != null && iterRequestReferences.hasNext()) {
+            while (iterRequestReferences.hasNext()) {
+                Request requestFromReferences	= this.processMultiRequest(request, iterRequestReferences.next());
+                assert(requestFromReferences != null);
+                if (requestFromReferences.getStatus() == null || requestFromReferences.getStatus().isOk()) {
+                    this.processRepeatedCategories(requestFromReferences);
+                } else {
+                    /*
+                     * Just add the bad request to the list.  It will be cause a Result with the same bad status
+                     * when the PDP actually runs the request.
+                     */
+                    this.individualDecisionRequests.add(requestFromReferences);
+                }
+            }
+        } else {
+            this.processRepeatedCategories(request);
+        }
+    }
+
+    public StdIndividualDecisionRequestGenerator(ScopeResolver scopeResolverIn, Request request) {
+        this.originalRequest	= request;
+        this.scopeResolver		= scopeResolverIn;
+        this.createIndividualDecisionRequests(request);
+    }
+
+    public StdIndividualDecisionRequestGenerator(Request request) {
+        this(null, request);
+    }
+
+    /**
+     * Gets the original <code>Request</code>.
+     *
+     * @return the original <code>Request</code>
+     */
+    public Request getOriginalRequest() {
+        return this.originalRequest;
+    }
+
+    /**
+     * Gets an <code>Iterator</code> over the individual decision <code>Request</code>s for
+     * the original <code>Request</code>.
+     *
+     * @return an <code>Iterator</code> over the individual decision <code>Request</code>s.
+     */
+    public Iterator<Request> getIndividualDecisionRequests() {
+        return this.individualDecisionRequests.iterator();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMissingAttributeDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMissingAttributeDetail.java
index ad59059..08ac523 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMissingAttributeDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMissingAttributeDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,99 +39,99 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.MissingAttributeDetail} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdMissingAttributeDetail extends Wrapper<MissingAttributeDetail> implements MissingAttributeDetail {
-        /**
-         * Creates a new immutable <code>StdMissingAttributeDetail</code> that wraps the given {@link com.att.research.xacml.api.MissingAttributeDetail}.
-         * The caller agrees not to modify the <code>MissingAttributeDetail</code> as long as the new <code>StdMissingAttributeDetail</code> refers
-         * to it.
-         * 
-         * @param missingAttributeDetail the <code>MissingAttributeDetail</code> to wrap in the new <code>StdMissingAttributeDetail</code>.
-         */
-        public StdMissingAttributeDetail(MissingAttributeDetail missingAttributeDetail) {
-                super(missingAttributeDetail);
-        }
-        
-        /**
-         * Creates a new immutable <code>StdMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
-         * AttributeId, and DataType of the missing Attribute, and the given <code>String</code> Issuer.  If not null, the <code>Collection</code> of
-         * {@link com.att.research.xacml.api.AttributeValue}s is copied into the new <code>StdMutableMissingAttributeDetail</code>.
-         * 
-         * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
-         * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
-         * @param issuerIn the <code>String</code> representing the XACML Issuer (may be null)
-         * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s representing the expected AttributeValues for the missing Attribute
-         */
-        public StdMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn, Collection<AttributeValue<?>> attributeValuesIn) {
-                this(new StdMutableMissingAttributeDetail(categoryIn, attributeIdIn, dataTypeIdIn, issuerIn, attributeValuesIn));
-        }
+    /**
+     * Creates a new immutable <code>StdMissingAttributeDetail</code> that wraps the given {@link com.att.research.xacml.api.MissingAttributeDetail}.
+     * The caller agrees not to modify the <code>MissingAttributeDetail</code> as long as the new <code>StdMissingAttributeDetail</code> refers
+     * to it.
+     *
+     * @param missingAttributeDetail the <code>MissingAttributeDetail</code> to wrap in the new <code>StdMissingAttributeDetail</code>.
+     */
+    public StdMissingAttributeDetail(MissingAttributeDetail missingAttributeDetail) {
+        super(missingAttributeDetail);
+    }
 
-        /**
-         * Creates a new immutable <code>StdMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
-         * AttributeId, and DataType of the missing Attribute, and the given <code>String</code> Issuer.
-         * 
-         * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
-         * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
-         * @param issuerIn the <code>String</code> representing the XACML Issuer (may be null)
-         */
-        public StdMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn) {
-                this(new StdMutableMissingAttributeDetail(categoryIn, attributeIdIn, dataTypeIdIn, issuerIn, null));
-        }
-        
-        /**
-         * Creates a new immutable <code>StdMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
-         * AttributeId, and DataType of the missing Attribute.
-         * 
-         * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
-         * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
-         */
-        public StdMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn) {
-                this(new StdMutableMissingAttributeDetail(categoryIn, attributeIdIn, dataTypeIdIn, null));
-        }
-        
-        /**
-         * Creates a new <code>StdMissingAttributeDetail</code> that is a copy of the given {@link com.att.research.xacml.api.MissingAttributeDetail</code>.
-         * 
-         * @param missingAttributeDetail the <code>MissingAttributeDetail</code> to copy
-         * @return a new <code>StdMissingAttributeDetail</code> that is a copy of the given <code>MissingAttributeDetail</code>.
-         */
-        public static StdMissingAttributeDetail copy(MissingAttributeDetail missingAttributeDetail) {
-                return new StdMissingAttributeDetail(missingAttributeDetail.getCategory(), 
-                                                                                         missingAttributeDetail.getAttributeId(), 
-                                                                                         missingAttributeDetail.getDataTypeId(), 
-                                                                                         missingAttributeDetail.getIssuer(), 
-                                                                                         missingAttributeDetail.getAttributeValues());
-        }
-        
-        @Override
-        public Identifier getCategory() {
-                return this.getWrappedObject().getCategory();
-        }
+    /**
+     * Creates a new immutable <code>StdMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
+     * AttributeId, and DataType of the missing Attribute, and the given <code>String</code> Issuer.  If not null, the <code>Collection</code> of
+     * {@link com.att.research.xacml.api.AttributeValue}s is copied into the new <code>StdMutableMissingAttributeDetail</code>.
+     *
+     * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
+     * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
+     * @param issuerIn the <code>String</code> representing the XACML Issuer (may be null)
+     * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s representing the expected AttributeValues for the missing Attribute
+     */
+    public StdMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn, Collection<AttributeValue<?>> attributeValuesIn) {
+        this(new StdMutableMissingAttributeDetail(categoryIn, attributeIdIn, dataTypeIdIn, issuerIn, attributeValuesIn));
+    }
 
-        @Override
-        public Identifier getAttributeId() {
-                return this.getWrappedObject().getAttributeId();
-        }
+    /**
+     * Creates a new immutable <code>StdMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
+     * AttributeId, and DataType of the missing Attribute, and the given <code>String</code> Issuer.
+     *
+     * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
+     * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
+     * @param issuerIn the <code>String</code> representing the XACML Issuer (may be null)
+     */
+    public StdMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn) {
+        this(new StdMutableMissingAttributeDetail(categoryIn, attributeIdIn, dataTypeIdIn, issuerIn, null));
+    }
 
-        @Override
-        public Identifier getDataTypeId() {
-                return this.getWrappedObject().getDataTypeId();
-        }
+    /**
+     * Creates a new immutable <code>StdMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
+     * AttributeId, and DataType of the missing Attribute.
+     *
+     * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
+     * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
+     */
+    public StdMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn) {
+        this(new StdMutableMissingAttributeDetail(categoryIn, attributeIdIn, dataTypeIdIn, null));
+    }
 
-        @Override
-        public String getIssuer() {
-                return this.getWrappedObject().getIssuer();
-        }
+    /**
+     * Creates a new <code>StdMissingAttributeDetail</code> that is a copy of the given {@link com.att.research.xacml.api.MissingAttributeDetail</code>.
+     *
+     * @param missingAttributeDetail the <code>MissingAttributeDetail</code> to copy
+     * @return a new <code>StdMissingAttributeDetail</code> that is a copy of the given <code>MissingAttributeDetail</code>.
+     */
+    public static StdMissingAttributeDetail copy(MissingAttributeDetail missingAttributeDetail) {
+        return new StdMissingAttributeDetail(missingAttributeDetail.getCategory(),
+                                             missingAttributeDetail.getAttributeId(),
+                                             missingAttributeDetail.getDataTypeId(),
+                                             missingAttributeDetail.getIssuer(),
+                                             missingAttributeDetail.getAttributeValues());
+    }
 
-        @Override
-        public Collection<AttributeValue<?>> getAttributeValues() {
-                return this.getWrappedObject().getAttributeValues();
-        }
+    @Override
+    public Identifier getCategory() {
+        return this.getWrappedObject().getCategory();
+    }
+
+    @Override
+    public Identifier getAttributeId() {
+        return this.getWrappedObject().getAttributeId();
+    }
+
+    @Override
+    public Identifier getDataTypeId() {
+        return this.getWrappedObject().getDataTypeId();
+    }
+
+    @Override
+    public String getIssuer() {
+        return this.getWrappedObject().getIssuer();
+    }
+
+    @Override
+    public Collection<AttributeValue<?>> getAttributeValues() {
+        return this.getWrappedObject().getAttributeValues();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAdvice.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAdvice.java
index 8a44f95..7d1acbb 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAdvice.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAdvice.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,148 +43,148 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.Advice} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableAdvice implements Advice {
-        private static final List<AttributeAssignment> EMPTY_ATTRIBUTE_ASSIGNMENTS	= Collections.unmodifiableList(new ArrayList<AttributeAssignment>());
-        
-        private Identifier id;
-        private List<AttributeAssignment> attributeAssignments;
+    private static final List<AttributeAssignment> EMPTY_ATTRIBUTE_ASSIGNMENTS	= Collections.unmodifiableList(new ArrayList<AttributeAssignment>());
 
-        /**
-         * Creates a new empty <code>StdMutableAdvice</code>.
-         */
-        public StdMutableAdvice() {
-                this.attributeAssignments	= EMPTY_ATTRIBUTE_ASSIGNMENTS;
+    private Identifier id;
+    private List<AttributeAssignment> attributeAssignments;
+
+    /**
+     * Creates a new empty <code>StdMutableAdvice</code>.
+     */
+    public StdMutableAdvice() {
+        this.attributeAssignments	= EMPTY_ATTRIBUTE_ASSIGNMENTS;
+    }
+
+    /**
+     * Creates a new <code>StdMutableAdvice</code> with the given {@link com.att.research.xacml.Identifier} as its unique identifier, and
+     * the given <code>Collection</code> of {@link com.att.research.xacml.AttributeAssignment}s.  A copy of the <code>AttributeAssignment</code>s
+     * is made.
+     *
+     * @param idIn the <code>Identifier</code> that uniquely identifies this <code>StdMutableAdvice</code>.  Should not be null.
+     * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s for this <code>StdMutableAdvice</code>.  May be null.
+     */
+    public StdMutableAdvice(Identifier idIn, Collection<AttributeAssignment> attributeAssignmentsIn) {
+        this();
+        this.id	= idIn;
+        this.attributeAssignments = new ArrayList<AttributeAssignment>();
+        if (attributeAssignmentsIn != null) {
+            this.addAttributeAssignments(attributeAssignmentsIn);
         }
-        
-        /**
-         * Creates a new <code>StdMutableAdvice</code> with the given {@link com.att.research.xacml.Identifier} as its unique identifier, and
-         * the given <code>Collection</code> of {@link com.att.research.xacml.AttributeAssignment}s.  A copy of the <code>AttributeAssignment</code>s
-         * is made.
-         * 
-         * @param idIn the <code>Identifier</code> that uniquely identifies this <code>StdMutableAdvice</code>.  Should not be null.
-         * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s for this <code>StdMutableAdvice</code>.  May be null.
-         */
-        public StdMutableAdvice(Identifier idIn, Collection<AttributeAssignment> attributeAssignmentsIn) {
-                this();
-                this.id	= idIn;
-                this.attributeAssignments = new ArrayList<AttributeAssignment>();
-                if (attributeAssignmentsIn != null) {
-                        this.addAttributeAssignments(attributeAssignmentsIn);
-                }
+    }
+
+    /**
+     * Creates a new <code>StdMutableAdvice</code> with the given {@link com.att.research.xacml.Identifier} as its unique identifier.
+     *
+     * @param idIn the <code>Identifier</code> that uniquely identifies this <code>StdMutableAdvice</code>.  May be null.
+     */
+    public StdMutableAdvice(Identifier idIn) {
+        this(idIn, null);
+        this.attributeAssignments = new ArrayList<AttributeAssignment>();
+    }
+
+    /**
+     * Creates a copy of the given {@link com.att.research.xacml.api.Advice} as a new <code>StdMutableAdvice</code>.
+     *
+     * @param advice the <code>Advice</code> to copy
+     * @return a new <code>StdMutableAdvice</code> that is a copy of the given <code>Advice</code>
+     */
+    public static StdMutableAdvice copy(Advice advice) {
+        return new StdMutableAdvice(advice.getId(), advice.getAttributeAssignments());
+    }
+
+    @Override
+    public Identifier getId() {
+        return this.id;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML AdviceId of the Advice represented by this <code>StdMutableAdvice</code>.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML AdviceId of the Advice represented by this <code>StdMutableAdvice</code>.
+     */
+    public void setId(Identifier identifier) {
+        this.id	= identifier;
+    }
+
+    @Override
+    public Collection<AttributeAssignment> getAttributeAssignments() {
+        return (this.attributeAssignments == EMPTY_ATTRIBUTE_ASSIGNMENTS ? this.attributeAssignments : Collections.unmodifiableList(this.attributeAssignments));
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacml.api.AttributeAssignment} to this <code>StdMutableAdvice</code>>
+     *
+     * @param attributeAssignment the <code>AttributeAssignment</code> to add to this <code>StdMutableAdvice</code>>
+     */
+    public void addAttributeAssignment(AttributeAssignment attributeAssignment) {
+        if (this.attributeAssignments == EMPTY_ATTRIBUTE_ASSIGNMENTS) {
+            this.attributeAssignments	= new ArrayList<AttributeAssignment>();
         }
-        
-        /**
-         * Creates a new <code>StdMutableAdvice</code> with the given {@link com.att.research.xacml.Identifier} as its unique identifier.
-         * 
-         * @param idIn the <code>Identifier</code> that uniquely identifies this <code>StdMutableAdvice</code>.  May be null.
-         */
-        public StdMutableAdvice(Identifier idIn) {
-                this(idIn, null);
-                this.attributeAssignments = new ArrayList<AttributeAssignment>();
+        this.attributeAssignments.add(attributeAssignment);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s to this <code>StdMutableAdvice</code>>
+     *
+     * @param listAttributeAssignments the <code>Collection</code> of <code>AttributeAssignment</code>s to add to this <code>StdMutableAdvice</code>.
+     */
+    public void addAttributeAssignments(Collection<AttributeAssignment> listAttributeAssignments) {
+        if (listAttributeAssignments != null && listAttributeAssignments.size() > 0) {
+            if (this.attributeAssignments == EMPTY_ATTRIBUTE_ASSIGNMENTS) {
+                this.attributeAssignments	= new ArrayList<AttributeAssignment>();
+            }
+            this.attributeAssignments.addAll(listAttributeAssignments);
         }
-        
-        /**
-         * Creates a copy of the given {@link com.att.research.xacml.api.Advice} as a new <code>StdMutableAdvice</code>.
-         * 
-         * @param advice the <code>Advice</code> to copy
-         * @return a new <code>StdMutableAdvice</code> that is a copy of the given <code>Advice</code>
-         */
-        public static StdMutableAdvice copy(Advice advice) {
-                return new StdMutableAdvice(advice.getId(), advice.getAttributeAssignments());
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.AttributeAssignment}s in this <code>StdMutableAdvice</code> to a copy of the
+     * given <code>Collection</code>.
+     *
+     * @param listAttributeAssignments the <code>Collection</code> of <code>AttributeAssignment</code>s to set in this <code>StdMutableAdvice</code>.
+     */
+    public void setAttributeAssignments(Collection<AttributeAssignment> listAttributeAssignments) {
+        this.attributeAssignments	= EMPTY_ATTRIBUTE_ASSIGNMENTS;
+        this.addAttributeAssignments(listAttributeAssignments);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof Advice)) {
+            return false;
+        } else {
+            Advice adviceObj	= (Advice)obj;
+            return (ObjUtil.equalsAllowNull(this.getId(), adviceObj.getId()) &&
+                    ListUtil.equalsAllowNulls(this.getAttributeAssignments(), adviceObj.getAttributeAssignments()));
         }
-        
-        @Override
-        public Identifier getId() {
-                return this.id;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Identifier		identifier		= this.getId();
+        if (identifier != null) {
+            stringBuilder.append("id=");
+            stringBuilder.append(identifier.toString());
+            needsComma	= true;
         }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML AdviceId of the Advice represented by this <code>StdMutableAdvice</code>.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML AdviceId of the Advice represented by this <code>StdMutableAdvice</code>.
-         */
-        public void setId(Identifier identifier) {
-                this.id	= identifier;
+        if (this.attributeAssignments.size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("attributeAssignments=");
+            stringBuilder.append(ListUtil.toString(this.attributeAssignments));
         }
-        
-        @Override
-        public Collection<AttributeAssignment> getAttributeAssignments() {
-                return (this.attributeAssignments == EMPTY_ATTRIBUTE_ASSIGNMENTS ? this.attributeAssignments : Collections.unmodifiableList(this.attributeAssignments));
-        }
-        
-        /**
-         * Adds an {@link com.att.research.xacml.api.AttributeAssignment} to this <code>StdMutableAdvice</code>>
-         * 
-         * @param attributeAssignment the <code>AttributeAssignment</code> to add to this <code>StdMutableAdvice</code>>
-         */
-        public void addAttributeAssignment(AttributeAssignment attributeAssignment) {
-                if (this.attributeAssignments == EMPTY_ATTRIBUTE_ASSIGNMENTS) {
-                        this.attributeAssignments	= new ArrayList<AttributeAssignment>();
-                }
-                this.attributeAssignments.add(attributeAssignment);
-        }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s to this <code>StdMutableAdvice</code>>
-         * 
-         * @param listAttributeAssignments the <code>Collection</code> of <code>AttributeAssignment</code>s to add to this <code>StdMutableAdvice</code>.
-         */
-        public void addAttributeAssignments(Collection<AttributeAssignment> listAttributeAssignments) {
-                if (listAttributeAssignments != null && listAttributeAssignments.size() > 0) {
-                        if (this.attributeAssignments == EMPTY_ATTRIBUTE_ASSIGNMENTS) {
-                                this.attributeAssignments	= new ArrayList<AttributeAssignment>();
-                        }
-                        this.attributeAssignments.addAll(listAttributeAssignments);
-                }
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.AttributeAssignment}s in this <code>StdMutableAdvice</code> to a copy of the
-         * given <code>Collection</code>.
-         * 
-         * @param listAttributeAssignments the <code>Collection</code> of <code>AttributeAssignment</code>s to set in this <code>StdMutableAdvice</code>.
-         */
-        public void setAttributeAssignments(Collection<AttributeAssignment> listAttributeAssignments) {
-                this.attributeAssignments	= EMPTY_ATTRIBUTE_ASSIGNMENTS;
-                this.addAttributeAssignments(listAttributeAssignments);
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof Advice)) {
-                        return false;
-                } else {
-                        Advice adviceObj	= (Advice)obj;
-                        return (ObjUtil.equalsAllowNull(this.getId(), adviceObj.getId()) &&
-                                        ListUtil.equalsAllowNulls(this.getAttributeAssignments(), adviceObj.getAttributeAssignments()));
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Identifier		identifier		= this.getId();
-                if (identifier != null) {
-                        stringBuilder.append("id=");
-                        stringBuilder.append(identifier.toString());
-                        needsComma	= true;
-                }
-                if (this.attributeAssignments.size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("attributeAssignments=");
-                        stringBuilder.append(ListUtil.toString(this.attributeAssignments));
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttribute.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttribute.java
index e9d4433..503b13b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttribute.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttribute.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,292 +46,292 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.Attribute} interface.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableAttribute implements Attribute {
-        private static final List<AttributeValue<?>> EMPTY_ATTRIBUTE_VALUE_LIST	= Collections.unmodifiableList(new ArrayList<AttributeValue<?>>());
-        
-        private Identifier attributeId;
-        private Identifier category;
-        private List<AttributeValue<?>>	values;
-        private String issuer;
-        private boolean includeInResults;
-        
-        /**
-         * Creates a new <code>StdMutableAttribute</code> with an empty list of {@link com.att.research.xacom.api.AttributeValue}s.
-         */
-        public StdMutableAttribute() {
-                this.values	= EMPTY_ATTRIBUTE_VALUE_LIST;
-        }
-        
-        /**
-         * Creates a new <code>StdMutableAttribute</code> with the given {@link com.att.research.xacml.Identifier}s for the XACML 3.0 Category and AttributeId properties,
-         * and the given <code>Collection</code> of {@link com.att.research.xacml.AttributeValue}s.  The <code>String</code> issuer may be null.
-         * 
-         * @param categoryIdIn the <code>Identifier</code> for the XACML 3.0 Category of the new <code>StdMutableAttribute</code>
-         * @param attributeIdIn the <code>Identifier</code> for the XACML 3.0 AttributeId of the new <code>StdMutableAttribute</code>
-         * @param valuesIn the <code>Collection</code> of <code>AttributeValue</code>s for the new <code>StdMutableAttribute</code>
-         * @param issuerIn the <code>String</code> issuer of the new <code>StdMutableAttribute</code>
-         * @param includeInResultsIn the <code>boolean</code> indicating whether this <code>StdMutableAttribute</code> should be in included in the XACML Response to a Request.
-         */
-        public StdMutableAttribute(Identifier categoryIdIn, Identifier attributeIdIn, Collection<AttributeValue<?>> valuesIn, String issuerIn, boolean includeInResultsIn) {
-                this();
-                this.attributeId		= attributeIdIn;
-                this.category			= categoryIdIn;
-                this.setValues(valuesIn);
-                this.issuer				= issuerIn;
-                this.includeInResults	= includeInResultsIn;
-        }
-        
-        public StdMutableAttribute(Attribute attributeCopy) {
-                this(attributeCopy.getCategory(), attributeCopy.getAttributeId(), attributeCopy.getValues(), attributeCopy.getIssuer(), attributeCopy.getIncludeInResults());
-        }
-        
-        /**
-         * Creates a new <code>StdMutableAttribute</code> with the given {@link com.att.research.xacml.Identifier}s for the XACML 3.0 Category and AttributeId properties,
-         * and the given {@link com.att.research.xacml.AttributeValue} as its only value.  The <code>String</code> issuer may be null.
-         * 
-         * @param categoryIdIn the <code>Identifier</code> for the XACML 3.0 Category of the new <code>StdMutableAttribute</code>
-         * @param attributeIdIn the <code>Identifier</code> for the XACML 3.0 AttributeId of the new <code>StdMutableAttribute</code>
-         * @param valueIn the <code>AttributeValue</code> for the new <code>StdMutableAttribute</code>
-         * @param issuerIn the <code>String</code> issuer of the new <code>StdMutableAttribute</code>
-         * @param includeInResultsIn the <code>boolean</code> indicating whether this <code>StdMutableAttribute</code> should be in included in the XACML Response to a Request.
-         */
-        public StdMutableAttribute(Identifier categoryIdIn, Identifier attributeIdIn, AttributeValue<?> valueIn, String issuerIn, boolean includeInResultsIn) {
-                this();
-                this.attributeId		= attributeIdIn;
-                this.category			= categoryIdIn;
-                if (valueIn != null) {
-                        this.addValue(valueIn);
-                }
-                this.issuer				= issuerIn;
-                this.includeInResults	= includeInResultsIn;
-        }
-        
-        /**
-         * Creates a new <code>StdMutableAttribute</code> with the given {@link com.att.research.xacml.Identifier}s for the XACML 3.0 Category and AttributeId properties
-         * and the given {@link com.att.research.xacml.AttributeValue} as its only value.  The issuer is null and the <code>StdMutableAttribute</code> will not be
-         * included in XACML 3.0 responses.
-         * 
-         * @param categoryIdIn the <code>Identifier</code> for the XACML 3.0 Category of the new <code>StdMutableAttribute</code>
-         * @param attributeIdIn the <code>Identifier</code> for the XACML 3.0 AttributeId of the new <code>StdMutableAttribute</code>
-         * @param valueIn the <code>AttributeValue</code> for the new <code>StdMutableAttribute</code>
-         */
-        public StdMutableAttribute(Identifier categoryIdIn, Identifier attributeIdIn, AttributeValue<?> valueIn) {
-                this(categoryIdIn, attributeIdIn, valueIn, null, false);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableAttribute</code> that is a copy of the given {@link com.att.research.xacml.api.Attribute}.
-         * 
-         * @param attribute the <code>Attribute</code> to copy
-         * @return a new <code>StdMutableAttribute</code> that is a copy of the given <code>Attribute</code>.
-         */
-        public static StdMutableAttribute copy(Attribute attribute) {
-                return new StdMutableAttribute(attribute.getCategory(), attribute.getAttributeId(), attribute.getValues(), attribute.getIssuer(), attribute.getIncludeInResults());
-        }
+    private static final List<AttributeValue<?>> EMPTY_ATTRIBUTE_VALUE_LIST	= Collections.unmodifiableList(new ArrayList<AttributeValue<?>>());
 
-        @Override
-        public Identifier getAttributeId() {
-                return this.attributeId;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML AttributeId of the Attribute represented by this <code>StdMutableAttribute</code>>
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML AttributeId of the Attribute represented by this <code>StdMutableAttribute</code>.
-         */
-        public void setAttributeId(Identifier identifier) {
-                this.attributeId	= identifier;
-        }
-        
-        @Override
-        public Identifier getCategory() {
-                return this.category;
-        }
+    private Identifier attributeId;
+    private Identifier category;
+    private List<AttributeValue<?>>	values;
+    private String issuer;
+    private boolean includeInResults;
 
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML Category of the Attribute represented by this <code>StdMutableAttribute</code>.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML Category of the Attribute represented by this <code>StdMutableAttribute</code>.
-         */
-        public void setCategory(Identifier identifier) {
-                this.category	= identifier;
-        }
+    /**
+     * Creates a new <code>StdMutableAttribute</code> with an empty list of {@link com.att.research.xacom.api.AttributeValue}s.
+     */
+    public StdMutableAttribute() {
+        this.values	= EMPTY_ATTRIBUTE_VALUE_LIST;
+    }
 
-        @Override
-        public Collection<AttributeValue<?>> getValues() {
-                return this.values == EMPTY_ATTRIBUTE_VALUE_LIST ? this.values : Collections.unmodifiableCollection(this.values);
-        }
-        
-        /**
-         * Adds an {@link com.att.research.xacml.api.AttributeValue} to this <code>StdMutableAttribute</code>.
-         * 
-         * @param attributeValue the <code>AttributeValue</code> to add to this <code>StdMutableAttribute</code>.
-         */
-        public void addValue(AttributeValue<?> attributeValue) {
-                if (this.values == EMPTY_ATTRIBUTE_VALUE_LIST) {
-                        this.values	= new ArrayList<AttributeValue<?>>();
-                }
-                this.values.add(attributeValue);
-        }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeValue}s to this <code>StdMutableAttribute</code>.
-         * 
-         * @param listAttributeValues the <code>Collection</code> of <code>AttributeValue</code>s to add to this <code>StdMutableAttribute</code>.
-         */
-        public void addValues(Collection<AttributeValue<?>> listAttributeValues) {
-                if (listAttributeValues != null && listAttributeValues.size() > 0) {
-                        if (this.values == EMPTY_ATTRIBUTE_VALUE_LIST) {
-                                this.values	= new ArrayList<AttributeValue<?>>();
-                        }
-                        this.values.addAll(listAttributeValues);
-                }
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.AttributeValue}s in this <code>StdMutableAttribute</code> to a copy of the given
-         * <code>Collection</code>.
-         * 
-         * @param listAttributeValues the <code>Collection</code> of <code>AttributValue</code>s to set in this <code>StdMutableAttribute</code>.
-         */
-        public void setValues(Collection<AttributeValue<?>> listAttributeValues) {
-                this.values	= EMPTY_ATTRIBUTE_VALUE_LIST;
-                this.addValues(listAttributeValues);
-        }
-        
-        @Override
-        public <T> Iterator<AttributeValue<T>> findValues(final DataType<T> dataType) {
-                final Iterator<AttributeValue<?>> iterAttributeValues	= this.values.iterator();
-                return new Iterator<AttributeValue<T>>() {
-                        private AttributeValue<T> findNextMatch() {
-                                AttributeValue<T> attributeValue	= null;
-                                while (attributeValue == null && iterAttributeValues.hasNext()) {
-                                        AttributeValue<?> attributeValueTest	= iterAttributeValues.next();
-                                        if (attributeValueTest.getDataTypeId().equals(dataType.getId())) {
-                                                try {
-                                                        attributeValue	= dataType.convertAttributeValue(attributeValueTest);
-                                                } catch (DataTypeException ex) {
-                                                        // TODO: Should log this somewhere.  It should never happen unless
-                                                        // the implementation of the provided dataType is broken.
-                                                }
-                                        }
-                                }
-                                return attributeValue;
-                        }
-                        
-                        private AttributeValue<T> attributeValueNextMatch	= this.findNextMatch();
-                        
-                        @Override
-                        public boolean hasNext() {
-                                return (this.attributeValueNextMatch != null);
-                        }
+    /**
+     * Creates a new <code>StdMutableAttribute</code> with the given {@link com.att.research.xacml.Identifier}s for the XACML 3.0 Category and AttributeId properties,
+     * and the given <code>Collection</code> of {@link com.att.research.xacml.AttributeValue}s.  The <code>String</code> issuer may be null.
+     *
+     * @param categoryIdIn the <code>Identifier</code> for the XACML 3.0 Category of the new <code>StdMutableAttribute</code>
+     * @param attributeIdIn the <code>Identifier</code> for the XACML 3.0 AttributeId of the new <code>StdMutableAttribute</code>
+     * @param valuesIn the <code>Collection</code> of <code>AttributeValue</code>s for the new <code>StdMutableAttribute</code>
+     * @param issuerIn the <code>String</code> issuer of the new <code>StdMutableAttribute</code>
+     * @param includeInResultsIn the <code>boolean</code> indicating whether this <code>StdMutableAttribute</code> should be in included in the XACML Response to a Request.
+     */
+    public StdMutableAttribute(Identifier categoryIdIn, Identifier attributeIdIn, Collection<AttributeValue<?>> valuesIn, String issuerIn, boolean includeInResultsIn) {
+        this();
+        this.attributeId		= attributeIdIn;
+        this.category			= categoryIdIn;
+        this.setValues(valuesIn);
+        this.issuer				= issuerIn;
+        this.includeInResults	= includeInResultsIn;
+    }
 
-                        @Override
-                        public AttributeValue<T> next() {
-                                AttributeValue<T> attributeValueNext	= this.attributeValueNextMatch;
-                                this.attributeValueNextMatch			= this.findNextMatch();
-                                return attributeValueNext;
-                        }
+    public StdMutableAttribute(Attribute attributeCopy) {
+        this(attributeCopy.getCategory(), attributeCopy.getAttributeId(), attributeCopy.getValues(), attributeCopy.getIssuer(), attributeCopy.getIncludeInResults());
+    }
 
-                        @Override
-                        public void remove() {
-                                throw new UnsupportedOperationException("remove is not supported");
-                        }
-                        
-                };
+    /**
+     * Creates a new <code>StdMutableAttribute</code> with the given {@link com.att.research.xacml.Identifier}s for the XACML 3.0 Category and AttributeId properties,
+     * and the given {@link com.att.research.xacml.AttributeValue} as its only value.  The <code>String</code> issuer may be null.
+     *
+     * @param categoryIdIn the <code>Identifier</code> for the XACML 3.0 Category of the new <code>StdMutableAttribute</code>
+     * @param attributeIdIn the <code>Identifier</code> for the XACML 3.0 AttributeId of the new <code>StdMutableAttribute</code>
+     * @param valueIn the <code>AttributeValue</code> for the new <code>StdMutableAttribute</code>
+     * @param issuerIn the <code>String</code> issuer of the new <code>StdMutableAttribute</code>
+     * @param includeInResultsIn the <code>boolean</code> indicating whether this <code>StdMutableAttribute</code> should be in included in the XACML Response to a Request.
+     */
+    public StdMutableAttribute(Identifier categoryIdIn, Identifier attributeIdIn, AttributeValue<?> valueIn, String issuerIn, boolean includeInResultsIn) {
+        this();
+        this.attributeId		= attributeIdIn;
+        this.category			= categoryIdIn;
+        if (valueIn != null) {
+            this.addValue(valueIn);
         }
+        this.issuer				= issuerIn;
+        this.includeInResults	= includeInResultsIn;
+    }
 
-        @Override
-        public String getIssuer() {
-                return this.issuer;
+    /**
+     * Creates a new <code>StdMutableAttribute</code> with the given {@link com.att.research.xacml.Identifier}s for the XACML 3.0 Category and AttributeId properties
+     * and the given {@link com.att.research.xacml.AttributeValue} as its only value.  The issuer is null and the <code>StdMutableAttribute</code> will not be
+     * included in XACML 3.0 responses.
+     *
+     * @param categoryIdIn the <code>Identifier</code> for the XACML 3.0 Category of the new <code>StdMutableAttribute</code>
+     * @param attributeIdIn the <code>Identifier</code> for the XACML 3.0 AttributeId of the new <code>StdMutableAttribute</code>
+     * @param valueIn the <code>AttributeValue</code> for the new <code>StdMutableAttribute</code>
+     */
+    public StdMutableAttribute(Identifier categoryIdIn, Identifier attributeIdIn, AttributeValue<?> valueIn) {
+        this(categoryIdIn, attributeIdIn, valueIn, null, false);
+    }
+
+    /**
+     * Creates a new <code>StdMutableAttribute</code> that is a copy of the given {@link com.att.research.xacml.api.Attribute}.
+     *
+     * @param attribute the <code>Attribute</code> to copy
+     * @return a new <code>StdMutableAttribute</code> that is a copy of the given <code>Attribute</code>.
+     */
+    public static StdMutableAttribute copy(Attribute attribute) {
+        return new StdMutableAttribute(attribute.getCategory(), attribute.getAttributeId(), attribute.getValues(), attribute.getIssuer(), attribute.getIncludeInResults());
+    }
+
+    @Override
+    public Identifier getAttributeId() {
+        return this.attributeId;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML AttributeId of the Attribute represented by this <code>StdMutableAttribute</code>>
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML AttributeId of the Attribute represented by this <code>StdMutableAttribute</code>.
+     */
+    public void setAttributeId(Identifier identifier) {
+        this.attributeId	= identifier;
+    }
+
+    @Override
+    public Identifier getCategory() {
+        return this.category;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML Category of the Attribute represented by this <code>StdMutableAttribute</code>.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML Category of the Attribute represented by this <code>StdMutableAttribute</code>.
+     */
+    public void setCategory(Identifier identifier) {
+        this.category	= identifier;
+    }
+
+    @Override
+    public Collection<AttributeValue<?>> getValues() {
+        return this.values == EMPTY_ATTRIBUTE_VALUE_LIST ? this.values : Collections.unmodifiableCollection(this.values);
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacml.api.AttributeValue} to this <code>StdMutableAttribute</code>.
+     *
+     * @param attributeValue the <code>AttributeValue</code> to add to this <code>StdMutableAttribute</code>.
+     */
+    public void addValue(AttributeValue<?> attributeValue) {
+        if (this.values == EMPTY_ATTRIBUTE_VALUE_LIST) {
+            this.values	= new ArrayList<AttributeValue<?>>();
         }
-        
-        /**
-         * Sets the <code>String</code> representing the XACML Issuer for this <code>StdMutableAttribute</code>.
-         * 
-         * @param issuerIn the <code>String</code> representing the XACML Issuer for this <code>StdMutableAttribute</code>.
-         */
-        public void setIssuer(String issuerIn) {
-                this.issuer	= issuerIn;
+        this.values.add(attributeValue);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeValue}s to this <code>StdMutableAttribute</code>.
+     *
+     * @param listAttributeValues the <code>Collection</code> of <code>AttributeValue</code>s to add to this <code>StdMutableAttribute</code>.
+     */
+    public void addValues(Collection<AttributeValue<?>> listAttributeValues) {
+        if (listAttributeValues != null && listAttributeValues.size() > 0) {
+            if (this.values == EMPTY_ATTRIBUTE_VALUE_LIST) {
+                this.values	= new ArrayList<AttributeValue<?>>();
+            }
+            this.values.addAll(listAttributeValues);
         }
-        
-        @Override
-        public boolean getIncludeInResults() {
-                return this.includeInResults;
-        }
-        
-        /**
-         * Sets the <code>boolean</code> flag indicating whether the XACML Attribute represented by this <code>StdMutableAttribute</code> should be included in
-         * the XACML Result from a decision including this <code>StdMutableAttribute</code>.
-         *  
-         * @param b if true, this <code>StdMutableAttribute</code> should be included, otherwise not.
-         */
-        public void setIncludeInResults(boolean b) {
-                this.includeInResults	= b;
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (this == obj) {
-                        return true;
-                } else if (obj == null || !(obj instanceof Attribute)) {
-                        return false;
-                } else {
-                        Attribute objAttribute	= (Attribute)obj;
-                        return ObjUtil.equalsAllowNull(this.getCategory(), objAttribute.getCategory()) &&
-                                        ObjUtil.equalsAllowNull(this.getAttributeId(), objAttribute.getAttributeId()) &&
-                                        ObjUtil.equalsAllowNull(this.getIssuer(), objAttribute.getIssuer()) &&
-                                        this.getIncludeInResults() == objAttribute.getIncludeInResults() &&
-                                        ListUtil.equalsAllowNulls(this.getValues(), objAttribute.getValues());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump;
-                if ((objectToDump = this.getAttributeId()) != null) {
-                        stringBuilder.append("attributeId=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma		= true;
-                }
-                if ((objectToDump = this.getCategory()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.AttributeValue}s in this <code>StdMutableAttribute</code> to a copy of the given
+     * <code>Collection</code>.
+     *
+     * @param listAttributeValues the <code>Collection</code> of <code>AttributValue</code>s to set in this <code>StdMutableAttribute</code>.
+     */
+    public void setValues(Collection<AttributeValue<?>> listAttributeValues) {
+        this.values	= EMPTY_ATTRIBUTE_VALUE_LIST;
+        this.addValues(listAttributeValues);
+    }
+
+    @Override
+    public <T> Iterator<AttributeValue<T>> findValues(final DataType<T> dataType) {
+        final Iterator<AttributeValue<?>> iterAttributeValues	= this.values.iterator();
+        return new Iterator<AttributeValue<T>>() {
+            private AttributeValue<T> findNextMatch() {
+                AttributeValue<T> attributeValue	= null;
+                while (attributeValue == null && iterAttributeValues.hasNext()) {
+                    AttributeValue<?> attributeValueTest	= iterAttributeValues.next();
+                    if (attributeValueTest.getDataTypeId().equals(dataType.getId())) {
+                        try {
+                            attributeValue	= dataType.convertAttributeValue(attributeValueTest);
+                        } catch (DataTypeException ex) {
+                            // TODO: Should log this somewhere.  It should never happen unless
+                            // the implementation of the provided dataType is broken.
                         }
-                        stringBuilder.append("category=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
+                    }
                 }
-                Collection<AttributeValue<?>> listValues	= this.getValues();
-                if (listValues.size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("values=");
-                        stringBuilder.append(ListUtil.toString(listValues));
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getIssuer()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("issuer=");
-                        stringBuilder.append((String)objectToDump);
-                        needsComma	= true;
-                }
-                if (needsComma) {
-                        stringBuilder.append(',');
-                        stringBuilder.append("includeInResults=");
-                        stringBuilder.append(this.getIncludeInResults());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+                return attributeValue;
+            }
+
+            private AttributeValue<T> attributeValueNextMatch	= this.findNextMatch();
+
+            @Override
+            public boolean hasNext() {
+                return (this.attributeValueNextMatch != null);
+            }
+
+            @Override
+            public AttributeValue<T> next() {
+                AttributeValue<T> attributeValueNext	= this.attributeValueNextMatch;
+                this.attributeValueNextMatch			= this.findNextMatch();
+                return attributeValueNext;
+            }
+
+            @Override
+            public void remove() {
+                throw new UnsupportedOperationException("remove is not supported");
+            }
+
+        };
+    }
+
+    @Override
+    public String getIssuer() {
+        return this.issuer;
+    }
+
+    /**
+     * Sets the <code>String</code> representing the XACML Issuer for this <code>StdMutableAttribute</code>.
+     *
+     * @param issuerIn the <code>String</code> representing the XACML Issuer for this <code>StdMutableAttribute</code>.
+     */
+    public void setIssuer(String issuerIn) {
+        this.issuer	= issuerIn;
+    }
+
+    @Override
+    public boolean getIncludeInResults() {
+        return this.includeInResults;
+    }
+
+    /**
+     * Sets the <code>boolean</code> flag indicating whether the XACML Attribute represented by this <code>StdMutableAttribute</code> should be included in
+     * the XACML Result from a decision including this <code>StdMutableAttribute</code>.
+     *
+     * @param b if true, this <code>StdMutableAttribute</code> should be included, otherwise not.
+     */
+    public void setIncludeInResults(boolean b) {
+        this.includeInResults	= b;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        } else if (obj == null || !(obj instanceof Attribute)) {
+            return false;
+        } else {
+            Attribute objAttribute	= (Attribute)obj;
+            return ObjUtil.equalsAllowNull(this.getCategory(), objAttribute.getCategory()) &&
+                   ObjUtil.equalsAllowNull(this.getAttributeId(), objAttribute.getAttributeId()) &&
+                   ObjUtil.equalsAllowNull(this.getIssuer(), objAttribute.getIssuer()) &&
+                   this.getIncludeInResults() == objAttribute.getIncludeInResults() &&
+                   ListUtil.equalsAllowNulls(this.getValues(), objAttribute.getValues());
         }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump;
+        if ((objectToDump = this.getAttributeId()) != null) {
+            stringBuilder.append("attributeId=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma		= true;
+        }
+        if ((objectToDump = this.getCategory()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("category=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        Collection<AttributeValue<?>> listValues	= this.getValues();
+        if (listValues.size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("values=");
+            stringBuilder.append(ListUtil.toString(listValues));
+            needsComma	= true;
+        }
+        if ((objectToDump = this.getIssuer()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("issuer=");
+            stringBuilder.append((String)objectToDump);
+            needsComma	= true;
+        }
+        if (needsComma) {
+            stringBuilder.append(',');
+            stringBuilder.append("includeInResults=");
+            stringBuilder.append(this.getIncludeInResults());
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttributeAssignment.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttributeAssignment.java
index 649ec19..ef27ee8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttributeAssignment.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttributeAssignment.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,155 +37,155 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.AttributeAssignment} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableAttributeAssignment implements AttributeAssignment {
-        private Identifier			attributeId;
-        private Identifier			category;
-        private String				issuer;
-        private AttributeValue<?>	attributeValue;
-        
-        /**
-         * Creates an empty <code>StdMutableAttributeAssignment</code>.
-         */
-        public StdMutableAttributeAssignment() {
-                
-        }
-        
-        /**
-         * Creates a new <code>StdMutableAttributeAssignment</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category and
-         * AttributeId, the given <code>String</code> issuer, and the given {@link com.att.research.xacml.api.AttributeValue}.
-         * 
-         * @param categoryIn the <code>Identifier</code> for the XACML Category of the new <code>StdMutableAttributeAssignment</code>
-         * @param attributeIdIn the <code>Identifier</code> for the XACML AttributeId of the new <code>StdMutableAttributeAssignment</code>
-         * @param issuerIn the <code>String</code> issuer for the XACML Attribute
-         * @param attributeValueIn the <code>AttributeValue</code> for the new StdMutableAttributeAssignment
-         */
-        public StdMutableAttributeAssignment(Identifier categoryIn, Identifier attributeIdIn, String issuerIn, AttributeValue<?> attributeValueIn) {
-                this.attributeId	= attributeIdIn;
-                this.category		= categoryIn;
-                this.issuer			= issuerIn;
-                this.attributeValue	= attributeValueIn;
-        }
-        
-        @Override
-        public Identifier getDataTypeId() {
-                return (this.attributeValue == null ? null : this.attributeValue.getDataTypeId());
-        }
-        
-        @Override
-        public AttributeValue<?> getAttributeValue() {
-                return this.attributeValue;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.AttributeValue} representing the value to be assigned to the XACML AttributeId associated with
-         * this <code>StdMutableAttributeAssignment</code>.
-         * 
-         * @param attributeValueIn the <code>AttributeValue</code> representing the value to be assigned to the XACML AttributeId associated with this
-         * <code>StdMutableAttributeAssignment</code>
-         */
-        public void setAttributeValue(AttributeValue<?> attributeValueIn) {
-                this.attributeValue	= attributeValueIn;
-        }
+    private Identifier			attributeId;
+    private Identifier			category;
+    private String				issuer;
+    private AttributeValue<?>	attributeValue;
 
-        @Override
-        public Identifier getAttributeId() {
-                return this.attributeId;
+    /**
+     * Creates an empty <code>StdMutableAttributeAssignment</code>.
+     */
+    public StdMutableAttributeAssignment() {
+
+    }
+
+    /**
+     * Creates a new <code>StdMutableAttributeAssignment</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category and
+     * AttributeId, the given <code>String</code> issuer, and the given {@link com.att.research.xacml.api.AttributeValue}.
+     *
+     * @param categoryIn the <code>Identifier</code> for the XACML Category of the new <code>StdMutableAttributeAssignment</code>
+     * @param attributeIdIn the <code>Identifier</code> for the XACML AttributeId of the new <code>StdMutableAttributeAssignment</code>
+     * @param issuerIn the <code>String</code> issuer for the XACML Attribute
+     * @param attributeValueIn the <code>AttributeValue</code> for the new StdMutableAttributeAssignment
+     */
+    public StdMutableAttributeAssignment(Identifier categoryIn, Identifier attributeIdIn, String issuerIn, AttributeValue<?> attributeValueIn) {
+        this.attributeId	= attributeIdIn;
+        this.category		= categoryIn;
+        this.issuer			= issuerIn;
+        this.attributeValue	= attributeValueIn;
+    }
+
+    @Override
+    public Identifier getDataTypeId() {
+        return (this.attributeValue == null ? null : this.attributeValue.getDataTypeId());
+    }
+
+    @Override
+    public AttributeValue<?> getAttributeValue() {
+        return this.attributeValue;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.AttributeValue} representing the value to be assigned to the XACML AttributeId associated with
+     * this <code>StdMutableAttributeAssignment</code>.
+     *
+     * @param attributeValueIn the <code>AttributeValue</code> representing the value to be assigned to the XACML AttributeId associated with this
+     * <code>StdMutableAttributeAssignment</code>
+     */
+    public void setAttributeValue(AttributeValue<?> attributeValueIn) {
+        this.attributeValue	= attributeValueIn;
+    }
+
+    @Override
+    public Identifier getAttributeId() {
+        return this.attributeId;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML AttributeId to be assigned in this <code>StdMutableAttributeAssignment</code>.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML AttributeId to be assigned in this <code>StdMutableAttributeAssignment</code>
+     */
+    public void setAttributeId(Identifier identifier) {
+        this.attributeId	= identifier;
+    }
+
+    @Override
+    public Identifier getCategory() {
+        return this.category;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML Category of the AttributeId to be assigned in this
+     * <code>StdMutableAttributeAssignment</code>.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML Category of the AttributeId to be assigned in this
+     * <code>StdMutableAttributeAssignment</code>.
+     */
+    public void setCategory(Identifier identifier) {
+        this.category	= identifier;
+    }
+
+    @Override
+    public String getIssuer() {
+        return this.issuer;
+    }
+
+    /**
+     * Sets the <code>String</code> representing the Issuer of the XACML Attribute to be assigned in this <code>StdMutableAttributeAssignment</code>.
+     *
+     * @param issuerIn the <code>String</code> representing the Issuer of the XACML Attribute to be assigned in this <code>StdMutableAttributeAssignment</code>.
+     */
+    public void setIssuer(String issuerIn) {
+        this.issuer	= issuerIn;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof AttributeAssignment)) {
+            return false;
+        } else {
+            AttributeAssignment objAttributeAssignment	= (AttributeAssignment)obj;
+            return ObjUtil.equalsAllowNull(this.getCategory(), objAttributeAssignment.getCategory()) &&
+                   ObjUtil.equalsAllowNull(this.getAttributeId(), objAttributeAssignment.getAttributeId()) &&
+                   ObjUtil.equalsAllowNull(this.getAttributeValue(), objAttributeAssignment.getAttributeValue()) &&
+                   ObjUtil.equalsAllowNull(this.getIssuer(), objAttributeAssignment.getIssuer());
         }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML AttributeId to be assigned in this <code>StdMutableAttributeAssignment</code>.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML AttributeId to be assigned in this <code>StdMutableAttributeAssignment</code>
-         */
-        public void setAttributeId(Identifier identifier) {
-                this.attributeId	= identifier;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump;
+        if ((objectToDump = this.getAttributeId()) != null) {
+            stringBuilder.append("attributeId=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
-        
-        @Override
-        public Identifier getCategory() {
-                return this.category;
+        if ((objectToDump = this.getCategory()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("category=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML Category of the AttributeId to be assigned in this
-         * <code>StdMutableAttributeAssignment</code>.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML Category of the AttributeId to be assigned in this
-         * <code>StdMutableAttributeAssignment</code>. 
-         */
-        public void setCategory(Identifier identifier) {
-                this.category	= identifier;
+        if ((objectToDump = this.getIssuer()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("issuer=");
+            stringBuilder.append((String)objectToDump);
+            needsComma	= true;
         }
-        
-        @Override
-        public String getIssuer() {
-                return this.issuer;
+        if (this.attributeValue != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("attributeValue=");
+            stringBuilder.append(this.attributeValue.toString());
+            needsComma	= true;
         }
-        
-        /**
-         * Sets the <code>String</code> representing the Issuer of the XACML Attribute to be assigned in this <code>StdMutableAttributeAssignment</code>.
-         * 
-         * @param issuerIn the <code>String</code> representing the Issuer of the XACML Attribute to be assigned in this <code>StdMutableAttributeAssignment</code>.
-         */
-        public void setIssuer(String issuerIn) {
-                this.issuer	= issuerIn;
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof AttributeAssignment)) {
-                        return false;
-                } else {
-                        AttributeAssignment objAttributeAssignment	= (AttributeAssignment)obj;
-                        return ObjUtil.equalsAllowNull(this.getCategory(), objAttributeAssignment.getCategory()) &&
-                                        ObjUtil.equalsAllowNull(this.getAttributeId(), objAttributeAssignment.getAttributeId()) &&
-                                        ObjUtil.equalsAllowNull(this.getAttributeValue(), objAttributeAssignment.getAttributeValue()) &&
-                                        ObjUtil.equalsAllowNull(this.getIssuer(), objAttributeAssignment.getIssuer());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump;
-                if ((objectToDump = this.getAttributeId()) != null) {
-                        stringBuilder.append("attributeId=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getCategory()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("category=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getIssuer()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("issuer=");
-                        stringBuilder.append((String)objectToDump);
-                        needsComma	= true;
-                }
-                if (this.attributeValue != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("attributeValue=");
-                        stringBuilder.append(this.attributeValue.toString());
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttributeCategory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttributeCategory.java
index 1e24364..a5416e2 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttributeCategory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableAttributeCategory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -49,147 +49,147 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.AttributeCategory} interface.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableAttributeCategory implements AttributeCategory {
-        private static final List<Attribute> EMPTY_LIST			= Collections.unmodifiableList(new ArrayList<Attribute>());
-        
-        protected Log logger = LogFactory.getLog(this.getClass());
-        private Identifier category;
-        private List<Attribute> attributes 						= new ArrayList<Attribute>();
-        private Map<Identifier,List<Attribute>> attributesById	= new HashMap<Identifier,List<Attribute>>();
-        
-        /**
-         * Builds the <code>Map</code> from {@link com.att.research.xacml.api.Identifier}s for XACML AttributeIds to
-         * {@link com.att.research.xacml.api.Attribute}s.
-         */
-        private void buildMap() {
-                for (Attribute attribute: this.attributes) {
-                        List<Attribute> listAttributes	= this.attributesById.get(attribute.getAttributeId());
-                        if (listAttributes == null) {
-                                listAttributes	= new ArrayList<Attribute>();
-                                this.attributesById.put(attribute.getAttributeId(), listAttributes);
-                        }
-                        listAttributes.add(attribute);
-                }
-        }
-        
-        /**
-         * Creates a new <code>StdMutableAttributeCategory</code> with all default values.
-         */
-        public StdMutableAttributeCategory() {
-                
-        }
-        
-        /**
-         * Creates a new <code>StdMutableAttributeCategory</code> with the given {@link com.att.research.xacml.api.Identifier} representing its
-         * XACML Category, and the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s as its XACML Attributes.
-         * The <code>Collection</code> is copied; changes made to the <code>Collection</code> after creating the new <code>StdMutableAttributeCategory</code>
-         * are not reflected in the <code>StdMutableAttributeCategory</code>.
-         * 
-         * @param identifierCategory the <code>Identifier</code> for the XACML Category for the new <code>StdMutableAttributeCategory</code>.
-         * @param listAttributes a <code>Collection</code> of <code>Attribute</code>s for the new <code>StdMutableAttributeCategory</code>.
-         */
-        public StdMutableAttributeCategory(Identifier identifierCategory, Collection<Attribute> listAttributes) {
-                this.category	= identifierCategory;
-                if (listAttributes != null) {
-                        this.attributes.addAll(listAttributes);
-                        this.buildMap();
-                }
-        }
+    private static final List<Attribute> EMPTY_LIST			= Collections.unmodifiableList(new ArrayList<Attribute>());
 
-        /**
-         * Creates a new <code>StdMutableAttributeCategory</code> that is a copy of the given {@link com.att.research.xacml.api.AttributeCategory}.
-         * 
-         * @param attributeCategory the <code>AttributeCategory</code> to copy
-         */
-        public StdMutableAttributeCategory(AttributeCategory attributeCategory) {
-                this.category	= attributeCategory.getCategory();
-                this.attributes.addAll(attributeCategory.getAttributes());
-                this.buildMap();
-        }
+    protected Log logger = LogFactory.getLog(this.getClass());
+    private Identifier category;
+    private List<Attribute> attributes 						= new ArrayList<Attribute>();
+    private Map<Identifier,List<Attribute>> attributesById	= new HashMap<Identifier,List<Attribute>>();
 
-        @Override
-        public Identifier getCategory() {
-                return this.category;
+    /**
+     * Builds the <code>Map</code> from {@link com.att.research.xacml.api.Identifier}s for XACML AttributeIds to
+     * {@link com.att.research.xacml.api.Attribute}s.
+     */
+    private void buildMap() {
+        for (Attribute attribute: this.attributes) {
+            List<Attribute> listAttributes	= this.attributesById.get(attribute.getAttributeId());
+            if (listAttributes == null) {
+                listAttributes	= new ArrayList<Attribute>();
+                this.attributesById.put(attribute.getAttributeId(), listAttributes);
+            }
+            listAttributes.add(attribute);
         }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML Category of this <code>StdMutableAttributeCategory</code>.
-         * 
-         * @param identifierCategory the <code>Identifier</code> representing the XACML Category of this <code>StdMutableAttributeCategory</code>.
-         */
-        public void setCategory(Identifier identifierCategory) {
-                this.category	= identifierCategory;
-        }
+    }
 
-        @Override
-        public Collection<Attribute> getAttributes() {
-                return Collections.unmodifiableCollection(this.attributes);
-        }
-        
-        /**
-         * Adds a {@link com.att.research.xacml.api.Attribute} to this <code>StdMutableAttributeCategory</code>>
-         * 
-         * @param attribute the <code>Attribute</code> to add
-         */
-        public void add(Attribute attribute) {
-                this.attributes.add(attribute);
-                List<Attribute> listAttributes	= this.attributesById.get(attribute.getAttributeId());
-                if (listAttributes == null) {
-                        listAttributes	= new ArrayList<Attribute>();
-                        this.attributesById.put(attribute.getAttributeId(), listAttributes);
-                }
-                listAttributes.add(attribute);
-        }
-        
-        @Override
-        public Iterator<Attribute> getAttributes(Identifier attributeId) {
-                List<Attribute> listAttributes	= this.attributesById.get(attributeId);
-                return (listAttributes == null ? EMPTY_LIST.iterator() : listAttributes.iterator());
-        }
-        
-        @Override
-        public boolean hasAttributes(Identifier attributeId) {
-                List<Attribute> listAttributes	= this.attributesById.get(attributeId);
-                return (listAttributes != null && listAttributes.size() > 0);
-        }
+    /**
+     * Creates a new <code>StdMutableAttributeCategory</code> with all default values.
+     */
+    public StdMutableAttributeCategory() {
 
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof AttributeCategory)) {
-                        return false;
-                } else {
-                        AttributeCategory objAttributeCategory	= (AttributeCategory)obj;
-                        return ObjUtil.equalsAllowNull(this.getCategory(), objAttributeCategory.getCategory()) &&
-                                        ListUtil.equalsAllowNulls(this.getAttributes(), objAttributeCategory.getAttributes());
-                }
-        }
+    }
 
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump;
-                if ((objectToDump = this.getCategory()) != null) {
-                        stringBuilder.append("category=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if (this.attributes.size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("attributes=");
-                        stringBuilder.append(ListUtil.toString(this.attributes));
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    /**
+     * Creates a new <code>StdMutableAttributeCategory</code> with the given {@link com.att.research.xacml.api.Identifier} representing its
+     * XACML Category, and the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s as its XACML Attributes.
+     * The <code>Collection</code> is copied; changes made to the <code>Collection</code> after creating the new <code>StdMutableAttributeCategory</code>
+     * are not reflected in the <code>StdMutableAttributeCategory</code>.
+     *
+     * @param identifierCategory the <code>Identifier</code> for the XACML Category for the new <code>StdMutableAttributeCategory</code>.
+     * @param listAttributes a <code>Collection</code> of <code>Attribute</code>s for the new <code>StdMutableAttributeCategory</code>.
+     */
+    public StdMutableAttributeCategory(Identifier identifierCategory, Collection<Attribute> listAttributes) {
+        this.category	= identifierCategory;
+        if (listAttributes != null) {
+            this.attributes.addAll(listAttributes);
+            this.buildMap();
         }
+    }
+
+    /**
+     * Creates a new <code>StdMutableAttributeCategory</code> that is a copy of the given {@link com.att.research.xacml.api.AttributeCategory}.
+     *
+     * @param attributeCategory the <code>AttributeCategory</code> to copy
+     */
+    public StdMutableAttributeCategory(AttributeCategory attributeCategory) {
+        this.category	= attributeCategory.getCategory();
+        this.attributes.addAll(attributeCategory.getAttributes());
+        this.buildMap();
+    }
+
+    @Override
+    public Identifier getCategory() {
+        return this.category;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML Category of this <code>StdMutableAttributeCategory</code>.
+     *
+     * @param identifierCategory the <code>Identifier</code> representing the XACML Category of this <code>StdMutableAttributeCategory</code>.
+     */
+    public void setCategory(Identifier identifierCategory) {
+        this.category	= identifierCategory;
+    }
+
+    @Override
+    public Collection<Attribute> getAttributes() {
+        return Collections.unmodifiableCollection(this.attributes);
+    }
+
+    /**
+     * Adds a {@link com.att.research.xacml.api.Attribute} to this <code>StdMutableAttributeCategory</code>>
+     *
+     * @param attribute the <code>Attribute</code> to add
+     */
+    public void add(Attribute attribute) {
+        this.attributes.add(attribute);
+        List<Attribute> listAttributes	= this.attributesById.get(attribute.getAttributeId());
+        if (listAttributes == null) {
+            listAttributes	= new ArrayList<Attribute>();
+            this.attributesById.put(attribute.getAttributeId(), listAttributes);
+        }
+        listAttributes.add(attribute);
+    }
+
+    @Override
+    public Iterator<Attribute> getAttributes(Identifier attributeId) {
+        List<Attribute> listAttributes	= this.attributesById.get(attributeId);
+        return (listAttributes == null ? EMPTY_LIST.iterator() : listAttributes.iterator());
+    }
+
+    @Override
+    public boolean hasAttributes(Identifier attributeId) {
+        List<Attribute> listAttributes	= this.attributesById.get(attributeId);
+        return (listAttributes != null && listAttributes.size() > 0);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof AttributeCategory)) {
+            return false;
+        } else {
+            AttributeCategory objAttributeCategory	= (AttributeCategory)obj;
+            return ObjUtil.equalsAllowNull(this.getCategory(), objAttributeCategory.getCategory()) &&
+                   ListUtil.equalsAllowNulls(this.getAttributes(), objAttributeCategory.getAttributes());
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump;
+        if ((objectToDump = this.getCategory()) != null) {
+            stringBuilder.append("category=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        if (this.attributes.size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("attributes=");
+            stringBuilder.append(ListUtil.toString(this.attributes));
+            needsComma	= true;
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
\ No newline at end of file
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableMissingAttributeDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableMissingAttributeDetail.java
index fb0959d..898fedb 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableMissingAttributeDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableMissingAttributeDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,244 +43,244 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.MissingAttributeDetail} interface.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableMissingAttributeDetail implements MissingAttributeDetail {
-        private static final List<AttributeValue<?>> EMPTY_LIST	= Collections.unmodifiableList(new ArrayList<AttributeValue<?>>());
-        
-        private Identifier category;
-        private Identifier attributeId;
-        private Identifier dataTypeId;
-        private String issuer;
-        private List<AttributeValue<?>>	attributeValues;
-        
-        /**
-         * Creates a new empty <code>StdMutableMissingAttributeDetail</code>.
-         */
-        public StdMutableMissingAttributeDetail() {
-                this.attributeValues	= EMPTY_LIST;
-        }
-        
-        /**
-         * Creates a new <code>StdMutableMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
-         * AttributeId, and DataType of the missing Attribute, and the given <code>String</code> Issuer.  If not null, the <code>Collection</code> of
-         * {@link com.att.research.xacml.api.AttributeValue}s is copied into the new <code>StdMutableMissingAttributeDetail</code>.
-         * 
-         * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
-         * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
-         * @param issuerIn the <code>String</code> representing the XACML Issuer (may be null)
-         * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s representing the expected AttributeValues for the missing Attribute
-         */
-        public StdMutableMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn, Collection<AttributeValue<?>> attributeValuesIn)  {
-                this.category		= categoryIn;
-                this.attributeId	= attributeIdIn;
-                this.dataTypeId		= dataTypeIdIn;
-                this.issuer			= issuerIn;
-                if (attributeValuesIn != null && attributeValuesIn.size() > 0) {
-                        this.attributeValues	= new ArrayList<AttributeValue<?>>();
-                        this.attributeValues.addAll(attributeValuesIn);
-                } else {
-                        this.attributeValues	= EMPTY_LIST;
-                }
-        }
-        
-        /**
-         * Creates a new <code>StdMutableMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
-         * AttributeId, and DataType of the missing Attribute, and the given <code>String</code> Issuer.
-         * 
-         * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
-         * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
-         * @param issuerIn the <code>String</code> representing the XACML Issuer (may be null)
-         */
-        public StdMutableMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn) {
-                this(categoryIn, attributeIdIn, dataTypeIdIn, issuerIn, null);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
-         * AttributeId, and DataType of the missing Attribute.
-         * 
-         * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
-         * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
-         * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
-         */
-        public StdMutableMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn) {
-                this(categoryIn, attributeIdIn, dataTypeIdIn, null);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableMissingAttributeDetail</code> that is a copy of the given {@link com.att.research.xacml.api.MissingAttributeDetail}.
-         * 
-         * @param missingAttributeDetail the <code>MissingAttributeDetail</code> to copy
-         * @return a new <code>StdMutableMissingAttributeDetail</code> that is a copy of the given <code>MissingAttributeDetail</code>.
-         */
-        public static StdMutableMissingAttributeDetail copy(MissingAttributeDetail missingAttributeDetail) {
-                return new StdMutableMissingAttributeDetail(missingAttributeDetail.getCategory(), 
-                                                                                         missingAttributeDetail.getAttributeId(), 
-                                                                                         missingAttributeDetail.getDataTypeId(), 
-                                                                                         missingAttributeDetail.getIssuer(), 
-                                                                                         missingAttributeDetail.getAttributeValues());
-        }
-        
-        @Override
-        public Identifier getCategory() {
-                return this.category;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML Category of the MissingAttributeDetail.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML Category of the MissingAttributeDetail.
-         */
-        public void setCategory(Identifier identifier) {
-                this.category	= identifier;
-        }
-        
-        @Override
-        public Identifier getAttributeId() {
-                return this.attributeId;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML AttributeId of the MissingAttributeDetail.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML AttributeId of the MissingAttributeDetail.
-         */
-        public void setAttributeId(Identifier identifier) {
-                this.attributeId	= identifier;
-        }
-        
-        @Override
-        public Identifier getDataTypeId() {
-                return this.dataTypeId;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML DataTypeId of the MissingAttributeDetail.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML AttributeId of the MissingAttributeDetail.
-         */
-        public void setDataTypeId(Identifier identifier) {
-                this.dataTypeId	= identifier;
-        }
-        
-        @Override
-        public String getIssuer() {
-                return this.issuer;
-        }
-        
-        public void setIssuer(String issuerIn) {
-                this.issuer	= issuerIn;
-        }
+    private static final List<AttributeValue<?>> EMPTY_LIST	= Collections.unmodifiableList(new ArrayList<AttributeValue<?>>());
 
-        @Override
-        public Collection<AttributeValue<?>> getAttributeValues() {
-                return (this.attributeValues == EMPTY_LIST ? this.attributeValues : Collections.unmodifiableCollection(this.attributeValues));
+    private Identifier category;
+    private Identifier attributeId;
+    private Identifier dataTypeId;
+    private String issuer;
+    private List<AttributeValue<?>>	attributeValues;
+
+    /**
+     * Creates a new empty <code>StdMutableMissingAttributeDetail</code>.
+     */
+    public StdMutableMissingAttributeDetail() {
+        this.attributeValues	= EMPTY_LIST;
+    }
+
+    /**
+     * Creates a new <code>StdMutableMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
+     * AttributeId, and DataType of the missing Attribute, and the given <code>String</code> Issuer.  If not null, the <code>Collection</code> of
+     * {@link com.att.research.xacml.api.AttributeValue}s is copied into the new <code>StdMutableMissingAttributeDetail</code>.
+     *
+     * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
+     * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
+     * @param issuerIn the <code>String</code> representing the XACML Issuer (may be null)
+     * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s representing the expected AttributeValues for the missing Attribute
+     */
+    public StdMutableMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn, Collection<AttributeValue<?>> attributeValuesIn)  {
+        this.category		= categoryIn;
+        this.attributeId	= attributeIdIn;
+        this.dataTypeId		= dataTypeIdIn;
+        this.issuer			= issuerIn;
+        if (attributeValuesIn != null && attributeValuesIn.size() > 0) {
+            this.attributeValues	= new ArrayList<AttributeValue<?>>();
+            this.attributeValues.addAll(attributeValuesIn);
+        } else {
+            this.attributeValues	= EMPTY_LIST;
         }
-        
-        /**
-         * Adds an {@link com.att.research.xacml.api.AttributeValue} to this <code>StdMutableMissingAttributeDetail</code>.
-         * 
-         * @param attributeValue the <code>AttributeValue</code> to add to this <code>StdMutableMissingAttributeDetail</code>.
-         */
-        public void addAttributeValue(AttributeValue<?> attributeValue) {
-                if (this.attributeValues == EMPTY_LIST) {
-                        this.attributeValues	= new ArrayList<AttributeValue<?>>();
-                }
-                this.attributeValues.add(attributeValue);
+    }
+
+    /**
+     * Creates a new <code>StdMutableMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
+     * AttributeId, and DataType of the missing Attribute, and the given <code>String</code> Issuer.
+     *
+     * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
+     * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
+     * @param issuerIn the <code>String</code> representing the XACML Issuer (may be null)
+     */
+    public StdMutableMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn) {
+        this(categoryIn, attributeIdIn, dataTypeIdIn, issuerIn, null);
+    }
+
+    /**
+     * Creates a new <code>StdMutableMissingAttributeDetail</code> with the given {@link com.att.research.xacml.api.Identifier}s for the XACML Category,
+     * AttributeId, and DataType of the missing Attribute.
+     *
+     * @param categoryIn the <code>Identifier</code> representing the XACML Category of the missing Attribute
+     * @param attributeIdIn the <code>Identifier</code> representing the XACML AttributeId of the missing Attribute
+     * @param dataTypeIdIn the <code>Identifier</code> representing the XACML DataType of the missing AttributeValue
+     */
+    public StdMutableMissingAttributeDetail(Identifier categoryIn, Identifier attributeIdIn, Identifier dataTypeIdIn) {
+        this(categoryIn, attributeIdIn, dataTypeIdIn, null);
+    }
+
+    /**
+     * Creates a new <code>StdMutableMissingAttributeDetail</code> that is a copy of the given {@link com.att.research.xacml.api.MissingAttributeDetail}.
+     *
+     * @param missingAttributeDetail the <code>MissingAttributeDetail</code> to copy
+     * @return a new <code>StdMutableMissingAttributeDetail</code> that is a copy of the given <code>MissingAttributeDetail</code>.
+     */
+    public static StdMutableMissingAttributeDetail copy(MissingAttributeDetail missingAttributeDetail) {
+        return new StdMutableMissingAttributeDetail(missingAttributeDetail.getCategory(),
+                missingAttributeDetail.getAttributeId(),
+                missingAttributeDetail.getDataTypeId(),
+                missingAttributeDetail.getIssuer(),
+                missingAttributeDetail.getAttributeValues());
+    }
+
+    @Override
+    public Identifier getCategory() {
+        return this.category;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML Category of the MissingAttributeDetail.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML Category of the MissingAttributeDetail.
+     */
+    public void setCategory(Identifier identifier) {
+        this.category	= identifier;
+    }
+
+    @Override
+    public Identifier getAttributeId() {
+        return this.attributeId;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML AttributeId of the MissingAttributeDetail.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML AttributeId of the MissingAttributeDetail.
+     */
+    public void setAttributeId(Identifier identifier) {
+        this.attributeId	= identifier;
+    }
+
+    @Override
+    public Identifier getDataTypeId() {
+        return this.dataTypeId;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML DataTypeId of the MissingAttributeDetail.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML AttributeId of the MissingAttributeDetail.
+     */
+    public void setDataTypeId(Identifier identifier) {
+        this.dataTypeId	= identifier;
+    }
+
+    @Override
+    public String getIssuer() {
+        return this.issuer;
+    }
+
+    public void setIssuer(String issuerIn) {
+        this.issuer	= issuerIn;
+    }
+
+    @Override
+    public Collection<AttributeValue<?>> getAttributeValues() {
+        return (this.attributeValues == EMPTY_LIST ? this.attributeValues : Collections.unmodifiableCollection(this.attributeValues));
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacml.api.AttributeValue} to this <code>StdMutableMissingAttributeDetail</code>.
+     *
+     * @param attributeValue the <code>AttributeValue</code> to add to this <code>StdMutableMissingAttributeDetail</code>.
+     */
+    public void addAttributeValue(AttributeValue<?> attributeValue) {
+        if (this.attributeValues == EMPTY_LIST) {
+            this.attributeValues	= new ArrayList<AttributeValue<?>>();
         }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeValue}s to this <code>StdMutableMissingAttributeDetail</code>.
-         * 
-         * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s to add to this <code>StdMutableMissingAttributeDetail</code>.
-         */
-        public void addAttributeValues(Collection<AttributeValue<?>> attributeValuesIn) {
-                if (attributeValuesIn != null && attributeValuesIn.size() > 0) {
-                        if (this.attributeValues == EMPTY_LIST) {
-                                this.attributeValues	= new ArrayList<AttributeValue<?>>();
-                        }
-                        this.attributeValues.addAll(attributeValuesIn);
-                }
+        this.attributeValues.add(attributeValue);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeValue}s to this <code>StdMutableMissingAttributeDetail</code>.
+     *
+     * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s to add to this <code>StdMutableMissingAttributeDetail</code>.
+     */
+    public void addAttributeValues(Collection<AttributeValue<?>> attributeValuesIn) {
+        if (attributeValuesIn != null && attributeValuesIn.size() > 0) {
+            if (this.attributeValues == EMPTY_LIST) {
+                this.attributeValues	= new ArrayList<AttributeValue<?>>();
+            }
+            this.attributeValues.addAll(attributeValuesIn);
         }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.AtributeValue}s in this <code>StdMutableMissingAttributeDetail</code> to a copy of the given
-         * <code>Collection</code>.  If the <code>Collection</code> is null or empty, the list of <code>AttributeValue</code>s in is set to the empty list.
-         * 
-         * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s to set in this <code>StdMutableMissingAttributeDetail</code>.
-         */
-        public void setAttributeValues(Collection<AttributeValue<?>> attributeValuesIn) {
-                this.attributeValues	= EMPTY_LIST;
-                this.addAttributeValues(attributeValuesIn);
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.AtributeValue}s in this <code>StdMutableMissingAttributeDetail</code> to a copy of the given
+     * <code>Collection</code>.  If the <code>Collection</code> is null or empty, the list of <code>AttributeValue</code>s in is set to the empty list.
+     *
+     * @param attributeValuesIn the <code>Collection</code> of <code>AttributeValue</code>s to set in this <code>StdMutableMissingAttributeDetail</code>.
+     */
+    public void setAttributeValues(Collection<AttributeValue<?>> attributeValuesIn) {
+        this.attributeValues	= EMPTY_LIST;
+        this.addAttributeValues(attributeValuesIn);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof MissingAttributeDetail)) {
+            return false;
+        } else {
+            MissingAttributeDetail objMissingAttributeDetail	= (MissingAttributeDetail)obj;
+            return ObjUtil.equalsAllowNull(this.getCategory(), objMissingAttributeDetail.getCategory()) &&
+                   ObjUtil.equalsAllowNull(this.getAttributeId(), objMissingAttributeDetail.getAttributeId()) &&
+                   ObjUtil.equalsAllowNull(this.getDataTypeId(), objMissingAttributeDetail.getDataTypeId()) &&
+                   ObjUtil.equalsAllowNull(this.getIssuer(), objMissingAttributeDetail.getIssuer()) &&
+                   ListUtil.equalsAllowNulls(this.getAttributeValues(), objMissingAttributeDetail.getAttributeValues());
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof MissingAttributeDetail)) {
-                        return false;
-                } else {
-                        MissingAttributeDetail objMissingAttributeDetail	= (MissingAttributeDetail)obj;
-                        return ObjUtil.equalsAllowNull(this.getCategory(), objMissingAttributeDetail.getCategory()) &&
-                                        ObjUtil.equalsAllowNull(this.getAttributeId(), objMissingAttributeDetail.getAttributeId()) &&
-                                        ObjUtil.equalsAllowNull(this.getDataTypeId(), objMissingAttributeDetail.getDataTypeId()) &&
-                                        ObjUtil.equalsAllowNull(this.getIssuer(), objMissingAttributeDetail.getIssuer()) &&
-                                        ListUtil.equalsAllowNulls(this.getAttributeValues(), objMissingAttributeDetail.getAttributeValues());
-                }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump;
+
+        if ((objectToDump = this.getAttributeId()) != null) {
+            stringBuilder.append("attributeId=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump;
-                
-                if ((objectToDump = this.getAttributeId()) != null) {
-                        stringBuilder.append("attributeId=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getCategory()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("category=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getDataTypeId()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("dataTypeId=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getIssuer()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("issuer=");
-                        stringBuilder.append((String)objectToDump);
-                        needsComma	= true;
-                }
-                Collection<AttributeValue<?>> listAttributeValues	= this.getAttributeValues();
-                if (listAttributeValues.size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("attributeValues=");
-                        stringBuilder.append(ListUtil.toString(listAttributeValues));
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        if ((objectToDump = this.getCategory()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("category=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
+        if ((objectToDump = this.getDataTypeId()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("dataTypeId=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        if ((objectToDump = this.getIssuer()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("issuer=");
+            stringBuilder.append((String)objectToDump);
+            needsComma	= true;
+        }
+        Collection<AttributeValue<?>> listAttributeValues	= this.getAttributeValues();
+        if (listAttributeValues.size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("attributeValues=");
+            stringBuilder.append(ListUtil.toString(listAttributeValues));
+            needsComma	= true;
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableObligation.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableObligation.java
index feed3e3..fcd002d 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableObligation.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableObligation.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,139 +43,139 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.Obligation} interface for XACML Obligation elements.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableObligation implements Obligation {
-        private static final List<AttributeAssignment>	EMPTY_LIST	= Collections.unmodifiableList(new ArrayList<AttributeAssignment>());
-        
-        private Identifier id;
-        private List<AttributeAssignment> attributeAssignments;
-        
-        /**
-         * Creates a new empty <code>StdMutableObligation</code>.
-         */
-        public StdMutableObligation() {
-                this.attributeAssignments	= EMPTY_LIST;
+    private static final List<AttributeAssignment>	EMPTY_LIST	= Collections.unmodifiableList(new ArrayList<AttributeAssignment>());
+
+    private Identifier id;
+    private List<AttributeAssignment> attributeAssignments;
+
+    /**
+     * Creates a new empty <code>StdMutableObligation</code>.
+     */
+    public StdMutableObligation() {
+        this.attributeAssignments	= EMPTY_LIST;
+    }
+
+    /**
+     * Creates a new <code>StdMutableObligation</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML ObligationId
+     * and the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s representing the XACML AttributeAssignments for
+     * the Obligation.
+     *
+     * @param idIn the <code>Identifier</code> representing the XACML ObligationId
+     * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s representing the XACML AttributeAssignments
+     */
+    public StdMutableObligation(Identifier idIn, Collection<AttributeAssignment> attributeAssignmentsIn) {
+        this.id	= idIn;
+        if (attributeAssignmentsIn != null) {
+            this.attributeAssignments	= new ArrayList<AttributeAssignment>();
+            this.attributeAssignments.addAll(attributeAssignmentsIn);
+        } else {
+            this.attributeAssignments	= EMPTY_LIST;
         }
-        
-        /**
-         * Creates a new <code>StdMutableObligation</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML ObligationId
-         * and the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s representing the XACML AttributeAssignments for
-         * the Obligation.
-         * 
-         * @param idIn the <code>Identifier</code> representing the XACML ObligationId
-         * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s representing the XACML AttributeAssignments
-         */
-        public StdMutableObligation(Identifier idIn, Collection<AttributeAssignment> attributeAssignmentsIn) {
-                this.id	= idIn;
-                if (attributeAssignmentsIn != null) {
-                        this.attributeAssignments	= new ArrayList<AttributeAssignment>();
-                        this.attributeAssignments.addAll(attributeAssignmentsIn);
-                } else {
-                        this.attributeAssignments	= EMPTY_LIST;
-                }
+    }
+
+    /**
+     * Creates a new <code>StdMutableObligation</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML ObligationId.
+     *
+     * @param idIn the <code>Identifier</code> representing the XACML ObligationId
+     */
+    public StdMutableObligation(Identifier idIn) {
+        this(idIn, null);
+    }
+
+    @Override
+    public Identifier getId() {
+        return this.id;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML ObligationId for the Obligation represented by this
+     * <code>StdMutableObligation</code>.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML ObligationId for the Obligation represented by this
+     * <code>StdMutableObligation</code>.
+     */
+    public void setId(Identifier identifier) {
+        this.id	= identifier;
+    }
+
+    @Override
+    public Collection<AttributeAssignment> getAttributeAssignments() {
+        return Collections.unmodifiableCollection(this.attributeAssignments);
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacmo.api.AttributeAssignment} to this <code>StdMutableObligation</code>.
+     *
+     * @param attributeAssignment the <code>AttributeAssignment</code> to add to this <code>StdMutableObligation</code>.
+     */
+    public void addAttributeAssignment(AttributeAssignment attributeAssignment) {
+        if (this.attributeAssignments == EMPTY_LIST) {
+            this.attributeAssignments	= new ArrayList<AttributeAssignment>();
         }
-        
-        /**
-         * Creates a new <code>StdMutableObligation</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML ObligationId.
-         * 
-         * @param idIn the <code>Identifier</code> representing the XACML ObligationId
-         */
-        public StdMutableObligation(Identifier idIn) {
-                this(idIn, null);
+        this.attributeAssignments.add(attributeAssignment);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s to this
+     * <code>StdMutableObligation</code>.
+     *
+     * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s to add to this <code>StdMutableObligation</code>.
+     */
+    public void addAttributeAssignments(Collection<AttributeAssignment> attributeAssignmentsIn) {
+        this.attributeAssignments	= EMPTY_LIST;
+        this.addAttributeAssignments(attributeAssignmentsIn);
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.AttributeAssignment}s in this <code>StdMutableObligation</code> to a copy of the
+     * given <code>Collection</code>.
+     *
+     * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s to set in this <code>StdMutableObligation</code>.
+     */
+    public void setAttributeAssignments(Collection<AttributeAssignment> attributeAssignmentsIn) {
+        this.attributeAssignments	= EMPTY_LIST;
+        this.addAttributeAssignments(attributeAssignmentsIn);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof Obligation)) {
+            return false;
+        } else {
+            Obligation objObligation	= (Obligation)obj;
+            return ObjUtil.equalsAllowNull(this.getId(), objObligation.getId()) &&
+                   ListUtil.equalsAllowNulls(this.getAttributeAssignments(), objObligation.getAttributeAssignments());
         }
-        
-        @Override
-        public Identifier getId() {
-                return this.id;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Identifier		identifier		= this.getId();
+        if (identifier != null) {
+            stringBuilder.append("id=");
+            stringBuilder.append(identifier.toString());
+            needsComma	= true;
         }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Identifier} representing the XACML ObligationId for the Obligation represented by this
-         * <code>StdMutableObligation</code>.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML ObligationId for the Obligation represented by this
-         * <code>StdMutableObligation</code>. 
-         */
-        public void setId(Identifier identifier) {
-                this.id	= identifier;
+        Collection<AttributeAssignment>	listAttributeAssignments	= this.getAttributeAssignments();
+        if (listAttributeAssignments.size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("attributeAssignments=");
+            stringBuilder.append(ListUtil.toString(listAttributeAssignments));
+            needsComma	= true;
         }
-        
-        @Override
-        public Collection<AttributeAssignment> getAttributeAssignments() {
-                return Collections.unmodifiableCollection(this.attributeAssignments);
-        }
-        
-        /**
-         * Adds an {@link com.att.research.xacmo.api.AttributeAssignment} to this <code>StdMutableObligation</code>.
-         * 
-         * @param attributeAssignment the <code>AttributeAssignment</code> to add to this <code>StdMutableObligation</code>.
-         */
-        public void addAttributeAssignment(AttributeAssignment attributeAssignment) {
-                if (this.attributeAssignments == EMPTY_LIST) {
-                        this.attributeAssignments	= new ArrayList<AttributeAssignment>();
-                }
-                this.attributeAssignments.add(attributeAssignment);
-        }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s to this
-         * <code>StdMutableObligation</code>.
-         * 
-         * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s to add to this <code>StdMutableObligation</code>.
-         */
-        public void addAttributeAssignments(Collection<AttributeAssignment> attributeAssignmentsIn) {
-                this.attributeAssignments	= EMPTY_LIST;
-                this.addAttributeAssignments(attributeAssignmentsIn);
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.AttributeAssignment}s in this <code>StdMutableObligation</code> to a copy of the
-         * given <code>Collection</code>.
-         * 
-         * @param attributeAssignmentsIn the <code>Collection</code> of <code>AttributeAssignment</code>s to set in this <code>StdMutableObligation</code>.
-         */
-        public void setAttributeAssignments(Collection<AttributeAssignment> attributeAssignmentsIn) {
-                this.attributeAssignments	= EMPTY_LIST;
-                this.addAttributeAssignments(attributeAssignmentsIn);
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof Obligation)) {
-                        return false;
-                } else {
-                        Obligation objObligation	= (Obligation)obj;
-                        return ObjUtil.equalsAllowNull(this.getId(), objObligation.getId()) &&
-                                        ListUtil.equalsAllowNulls(this.getAttributeAssignments(), objObligation.getAttributeAssignments());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Identifier		identifier		= this.getId();
-                if (identifier != null) {
-                        stringBuilder.append("id=");
-                        stringBuilder.append(identifier.toString());
-                        needsComma	= true;
-                }
-                Collection<AttributeAssignment>	listAttributeAssignments	= this.getAttributeAssignments();
-                if (listAttributeAssignments.size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("attributeAssignments=");
-                        stringBuilder.append(ListUtil.toString(listAttributeAssignments));
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequest.java
index 9eb6480..efd955c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -51,347 +51,347 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.Request} interface.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public class StdMutableRequest implements Request {
-        private static final List<RequestReference>	EMPTY_REQUEST_REFERENCE_LIST	= Collections.unmodifiableList(new ArrayList<RequestReference>());
-        private static final List<RequestAttributes> EMPTY_REQUEST_ATTRIBUTES_LIST	= Collections.unmodifiableList(new ArrayList<RequestAttributes>());
-        private static final List<AttributeCategory> EMPTY_ATTRIBUTE_CATEGORY_LIST	= Collections.unmodifiableList(new ArrayList<AttributeCategory>());
-        
-        private Status status;
-        private RequestDefaults	requestDefaults;
-        private boolean	returnPolicyIdList;
-        private boolean	combinedDecision;
-        private List<RequestAttributes> requestAttributes;
-        private List<AttributeCategory> requestAttributesIncludeInResult					= EMPTY_ATTRIBUTE_CATEGORY_LIST;
-        private HashMap<Identifier,List<RequestAttributes>>	requestAttributesByCategoryId	= new HashMap<Identifier,List<RequestAttributes>>();
-        private HashMap<String,RequestAttributes> requestAttributesByXmlId					= new HashMap<String,RequestAttributes>();
-        private List<RequestReference> requestReferences;
-        
-        /**
-         * Creates a new <code>StdMutableRequest</code> with the given parameters.
-         * 
-         * @param statusIn the {@link com.att.research.xacml.api.Status} of the <code>StdMutableRequest</code> representing its validity
-         * @param requestDefaultsIn the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults
-         * @param returnPolicyIdListIn a boolean indicating whether XACML PolicyId and PolicySetIds should be returned with the Results
-         * @param combinedDecisionIn a boolean indicating whether multiple Decision Request Results should be combined into a single Result
-         * @param listRequestAttributes a <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} defining the parameters of the Request
-         * @param listRequestReferences a <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s for multiple decision requests
-         */
-        public StdMutableRequest(Status statusIn, 
-                                          RequestDefaults requestDefaultsIn, 
-                                          boolean returnPolicyIdListIn, 
-                                          boolean combinedDecisionIn, 
-                                          Collection<RequestAttributes> listRequestAttributes, 
-                                          Collection<RequestReference> listRequestReferences) {
-                this.status				= statusIn;
-                this.requestDefaults	= requestDefaultsIn;
-                this.returnPolicyIdList	= returnPolicyIdListIn;
-                this.combinedDecision	= combinedDecisionIn;
-                if (listRequestAttributes != null) {
-                        this.requestAttributes	= new ArrayList<RequestAttributes>();
-                        for (RequestAttributes requestAttributes : listRequestAttributes) {
-                                this.add(requestAttributes);
-                        }
-                } else {
-                        this.requestAttributes	= EMPTY_REQUEST_ATTRIBUTES_LIST;
-                }
-                if (listRequestReferences != null) {
-                        this.requestReferences	= new ArrayList<RequestReference>();
-                        this.requestReferences.addAll(listRequestReferences);
-                } else {
-                        this.requestReferences	= EMPTY_REQUEST_REFERENCE_LIST;
-                }
-        }
-        
-        /**
-         * Creates a new <code>StdMutableRequest</code> with a default {@link com.att.research.xacml.api.Status} and the given parameters.  The default <code>Status</code>
-         * represents a XACML OK Status.
-         * 
-         * @param requestDefaultsIn the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults
-         * @param returnPolicyIdListIn a boolean indicating whether XACML PolicyId and PolicySetIds should be returned with the Results
-         * @param combinedDecisionIn a boolean indicating whether multiple Decision Request Results should be combined into a single Result
-         * @param listRequestAttributes a <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} defining the parameters of the Request
-         * @param listRequestReferences a <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s for multiple decision requests
-         */
-        public StdMutableRequest(RequestDefaults requestDefaultsIn, 
-                                          boolean returnPolicyIdListIn, 
-                                          boolean combinedDecisionIn, 
-                                          Collection<RequestAttributes> listRequestAttributes, 
-                                          Collection<RequestReference> listRequestReferences) {
-                this(null, requestDefaultsIn, returnPolicyIdListIn, combinedDecisionIn, listRequestAttributes, listRequestReferences);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableRequest</code> that is a copy of the given {@link com.att.research.xacml.api.Request}.
-         * 
-         * @param request the <code>Request</code> to copy
-         */
-        public StdMutableRequest(Request request) {
-                this(request.getStatus(),
-                         request.getRequestDefaults(),
-                         request.getReturnPolicyIdList(),
-                         request.getCombinedDecision(),
-                         request.getRequestAttributes(),
-                         request.getMultiRequests()
-                                );
-        }
-        
-        /**
-         * Creates a new <code>StdMutableRequest</code> with default values.
-         */
-        public StdMutableRequest() {
-                this(null, false, false, null, null);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableRequest</code> with the given {@link com.att.research.xacml.api.Status} representing its validity and
-         * defaults for all other attributes.
-         * 
-         * @param statusIn the <code>Status</code> for the new <code>StdMutableRequest</code>
-         */
-        public StdMutableRequest(Status statusIn) {
-                this(statusIn, null, false, false, null, null);
-        }
+    private static final List<RequestReference>	EMPTY_REQUEST_REFERENCE_LIST	= Collections.unmodifiableList(new ArrayList<RequestReference>());
+    private static final List<RequestAttributes> EMPTY_REQUEST_ATTRIBUTES_LIST	= Collections.unmodifiableList(new ArrayList<RequestAttributes>());
+    private static final List<AttributeCategory> EMPTY_ATTRIBUTE_CATEGORY_LIST	= Collections.unmodifiableList(new ArrayList<AttributeCategory>());
 
-        @Override
-        public RequestDefaults getRequestDefaults() {
-                return this.requestDefaults;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.RequestDefaults} interface for this <code>PEPRequest</code>.
-         * 
-         * @param requestDefaultsIn the <code>RequestDefaults</code> to use for this <code>PEPRequest</code>.
-         */
-        public void setRequestDefaults(RequestDefaults requestDefaultsIn) {
-                this.requestDefaults	= requestDefaultsIn;
-        }
+    private Status status;
+    private RequestDefaults	requestDefaults;
+    private boolean	returnPolicyIdList;
+    private boolean	combinedDecision;
+    private List<RequestAttributes> requestAttributes;
+    private List<AttributeCategory> requestAttributesIncludeInResult					= EMPTY_ATTRIBUTE_CATEGORY_LIST;
+    private HashMap<Identifier,List<RequestAttributes>>	requestAttributesByCategoryId	= new HashMap<Identifier,List<RequestAttributes>>();
+    private HashMap<String,RequestAttributes> requestAttributesByXmlId					= new HashMap<String,RequestAttributes>();
+    private List<RequestReference> requestReferences;
 
-        @Override
-        public boolean getReturnPolicyIdList() {
-                return this.returnPolicyIdList;
+    /**
+     * Creates a new <code>StdMutableRequest</code> with the given parameters.
+     *
+     * @param statusIn the {@link com.att.research.xacml.api.Status} of the <code>StdMutableRequest</code> representing its validity
+     * @param requestDefaultsIn the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults
+     * @param returnPolicyIdListIn a boolean indicating whether XACML PolicyId and PolicySetIds should be returned with the Results
+     * @param combinedDecisionIn a boolean indicating whether multiple Decision Request Results should be combined into a single Result
+     * @param listRequestAttributes a <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} defining the parameters of the Request
+     * @param listRequestReferences a <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s for multiple decision requests
+     */
+    public StdMutableRequest(Status statusIn,
+                             RequestDefaults requestDefaultsIn,
+                             boolean returnPolicyIdListIn,
+                             boolean combinedDecisionIn,
+                             Collection<RequestAttributes> listRequestAttributes,
+                             Collection<RequestReference> listRequestReferences) {
+        this.status				= statusIn;
+        this.requestDefaults	= requestDefaultsIn;
+        this.returnPolicyIdList	= returnPolicyIdListIn;
+        this.combinedDecision	= combinedDecisionIn;
+        if (listRequestAttributes != null) {
+            this.requestAttributes	= new ArrayList<RequestAttributes>();
+            for (RequestAttributes requestAttributes : listRequestAttributes) {
+                this.add(requestAttributes);
+            }
+        } else {
+            this.requestAttributes	= EMPTY_REQUEST_ATTRIBUTES_LIST;
         }
-        
-        /**
-         * Sets the flag indicating whether policy ids should be returned with the response to the given request.
-         * 
-         * @param returnPolicyIdListIn if true, policy ids will be returned in the response, otherwise they may not be.
-         */
-        public void setReturnPolicyIdList(boolean returnPolicyIdListIn) {
-                this.returnPolicyIdList	= returnPolicyIdListIn;
+        if (listRequestReferences != null) {
+            this.requestReferences	= new ArrayList<RequestReference>();
+            this.requestReferences.addAll(listRequestReferences);
+        } else {
+            this.requestReferences	= EMPTY_REQUEST_REFERENCE_LIST;
         }
+    }
 
-        @Override
-        public boolean getCombinedDecision() {
-                return this.combinedDecision;
-        }
-        
-        /**
-         * Sets the flag indicating whether multiple requests within this <code>PEPRequest</code> should have their results
-         * combined into a single combined result or if a list of individual results should be maintained.
-         * 
-         * @param combinedDecisionIn if true, multiple results should be combined into a single results
-         */
-        public void setCombinedDecision(boolean combinedDecisionIn) {
-                this.combinedDecision	= combinedDecisionIn;
-        }
+    /**
+     * Creates a new <code>StdMutableRequest</code> with a default {@link com.att.research.xacml.api.Status} and the given parameters.  The default <code>Status</code>
+     * represents a XACML OK Status.
+     *
+     * @param requestDefaultsIn the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults
+     * @param returnPolicyIdListIn a boolean indicating whether XACML PolicyId and PolicySetIds should be returned with the Results
+     * @param combinedDecisionIn a boolean indicating whether multiple Decision Request Results should be combined into a single Result
+     * @param listRequestAttributes a <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} defining the parameters of the Request
+     * @param listRequestReferences a <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s for multiple decision requests
+     */
+    public StdMutableRequest(RequestDefaults requestDefaultsIn,
+                             boolean returnPolicyIdListIn,
+                             boolean combinedDecisionIn,
+                             Collection<RequestAttributes> listRequestAttributes,
+                             Collection<RequestReference> listRequestReferences) {
+        this(null, requestDefaultsIn, returnPolicyIdListIn, combinedDecisionIn, listRequestAttributes, listRequestReferences);
+    }
 
-        @Override
-        public Collection<RequestAttributes> getRequestAttributes() {
-                return Collections.unmodifiableCollection(this.requestAttributes);
-        }
-        
-        @Override
-        public Iterator<RequestAttributes> getRequestAttributes(Identifier categoryId) {
-                List<RequestAttributes>	listRequestAttributesForCategory	= this.requestAttributesByCategoryId.get(categoryId);
-                if (listRequestAttributesForCategory != null) {
-                        return listRequestAttributesForCategory.iterator();
-                } else {
-                        return EMPTY_REQUEST_ATTRIBUTES_LIST.iterator();
-                }
-        }
-        
-        /**
-         * Adds a {@link com.att.research.xacml.api.RequestAttributes} to the <code>RequestAttributes</code> in this <code>StdMutableRequest</code>>
-         * 
-         * @param requestAttributesNew the <code>RequestAttributes</code> to add to this <code>StdMutableRequest</code>
-         * @throws NullPointerException if <code>requestAttributesNew</code> is null or if <code>requestAttributesNew.getCategory()</code> is null
-         */
-        public void add(RequestAttributes requestAttributesNew) {
-                if (this.requestAttributes == EMPTY_REQUEST_ATTRIBUTES_LIST) {
-                        this.requestAttributes	= new ArrayList<RequestAttributes>();
-                }
-                this.requestAttributes.add(requestAttributesNew);
-                List<RequestAttributes>	listRequestAttributesForCategoryId	= this.requestAttributesByCategoryId.get(requestAttributesNew.getCategory());
-                if (listRequestAttributesForCategoryId == null) {
-                        listRequestAttributesForCategoryId	= new ArrayList<RequestAttributes>();
-                        this.requestAttributesByCategoryId.put(requestAttributesNew.getCategory(), listRequestAttributesForCategoryId);
-                }
-                listRequestAttributesForCategoryId.add(requestAttributesNew);		
-                if (requestAttributesNew.getXmlId() != null) {
-                        this.requestAttributesByXmlId.put(requestAttributesNew.getXmlId(), requestAttributesNew);
-                }
-                StdMutableAttributeCategory attributeCategoryIncludeInResult	= null;
-                for (Attribute attribute : requestAttributesNew.getAttributes()) {
-                        if (attribute.getIncludeInResults()) {
-                                if (attributeCategoryIncludeInResult == null) {
-                                        attributeCategoryIncludeInResult	= new StdMutableAttributeCategory();
-                                        attributeCategoryIncludeInResult.setCategory(requestAttributesNew.getCategory());
-                                }
-                                attributeCategoryIncludeInResult.add(attribute);
-                        }
-                }
-                if (attributeCategoryIncludeInResult != null) {
-                        if (this.requestAttributesIncludeInResult == EMPTY_ATTRIBUTE_CATEGORY_LIST) {
-                                this.requestAttributesIncludeInResult	= new ArrayList<AttributeCategory>();
-                        }
-                        this.requestAttributesIncludeInResult.add(attributeCategoryIncludeInResult);
-                }
-        }
+    /**
+     * Creates a new <code>StdMutableRequest</code> that is a copy of the given {@link com.att.research.xacml.api.Request}.
+     *
+     * @param request the <code>Request</code> to copy
+     */
+    public StdMutableRequest(Request request) {
+        this(request.getStatus(),
+             request.getRequestDefaults(),
+             request.getReturnPolicyIdList(),
+             request.getCombinedDecision(),
+             request.getRequestAttributes(),
+             request.getMultiRequests()
+            );
+    }
 
-        @Override
-        public Collection<AttributeCategory> getRequestAttributesIncludedInResult() {
-                // TODO Auto-generated method stub
-                return this.requestAttributesIncludeInResult;
-        }
+    /**
+     * Creates a new <code>StdMutableRequest</code> with default values.
+     */
+    public StdMutableRequest() {
+        this(null, false, false, null, null);
+    }
 
-        @Override
-        public Collection<RequestReference> getMultiRequests() {
-                return Collections.unmodifiableCollection(this.requestReferences);
-        }
-        
-        /**
-         * Adds a {@link com.att.research.xacml.api.RequestReference} to the <code>RequestReference</code>s in this <code>StdMutableRequest</code>.
-         * 
-         * @param requestReference the <code>RequestReference</code> to add
-         */
-        public void add(RequestReference requestReference) {
-                if (this.requestReferences == EMPTY_REQUEST_REFERENCE_LIST) {
-                        this.requestReferences	= new ArrayList<RequestReference>();
-                }
-                this.requestReferences.add(requestReference);
-        }
+    /**
+     * Creates a new <code>StdMutableRequest</code> with the given {@link com.att.research.xacml.api.Status} representing its validity and
+     * defaults for all other attributes.
+     *
+     * @param statusIn the <code>Status</code> for the new <code>StdMutableRequest</code>
+     */
+    public StdMutableRequest(Status statusIn) {
+        this(statusIn, null, false, false, null, null);
+    }
 
-        @Override
-        public RequestAttributes getRequestAttributesByXmlId(String xmlId) {
-                return this.requestAttributesByXmlId.get(xmlId);
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof Request)) {
-                        return false;
-                } else {
-                        Request objRequest	= (Request)obj;
-                        return ObjUtil.equalsAllowNull(this.getStatus(), objRequest.getStatus()) &&
-                                        ObjUtil.equalsAllowNull(this.getRequestDefaults(), objRequest.getRequestDefaults()) &&
-                                        this.getCombinedDecision() == objRequest.getCombinedDecision() &&
-                                        this.getReturnPolicyIdList() == objRequest.getReturnPolicyIdList() &&
-                                        ListUtil.equalsAllowNulls(this.getRequestAttributes(), objRequest.getRequestAttributes()) &&
-                                        ListUtil.equalsAllowNulls(this.getMultiRequests(), objRequest.getMultiRequests());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump;
-                if ((objectToDump = this.getRequestDefaults()) != null) {
-                        stringBuilder.append("requestDefaults=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if (needsComma) {
-                        stringBuilder.append(',');
-                }
-                stringBuilder.append("returnPolicyIdList=");
-                stringBuilder.append(this.getReturnPolicyIdList());
-                stringBuilder.append(",combinedDecision=");
-                stringBuilder.append(this.getCombinedDecision());
-                Collection<RequestAttributes> thisRequestAttributes	= this.getRequestAttributes();
-                if (thisRequestAttributes.size() > 0) {
-                        stringBuilder.append(",requestAttributes=");
-                        stringBuilder.append(ListUtil.toString(thisRequestAttributes));
-                }
-                Collection<RequestReference> thisRequestReferences	= this.getMultiRequests();
-                if (thisRequestReferences.size() > 0) {
-                        stringBuilder.append(",multiRequests=");
-                        stringBuilder.append(ListUtil.toString(thisRequestReferences));
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
-        
-        protected void validate(Attribute attribute) {
-                if (attribute.getAttributeId() == null) {
-                        this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeId"));
-                        return;
-                }
-                Iterator<AttributeValue<?>> iterAttributeValues	= attribute.getValues().iterator();
-                if (!iterAttributeValues.hasNext()) {
-                        this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeValue for Attribute " + attribute.getAttributeId().stringValue()));
-                        return;
-                } else {
-                        while (iterAttributeValues.hasNext()) {
-                                AttributeValue<?> attributeValue	= iterAttributeValues.next();
-                                if (attributeValue.getDataTypeId() == null) {
-                                        this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing DataType in AttributeValue for Attribute " + attribute.getAttributeId().stringValue()));
-                                        return;
-                                } else if (attributeValue.getValue() == null) {
-                                        this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing value in AttributeValue for Attribute " + attribute.getAttributeId().stringValue()));
-                                        return;
-                                }
-                        }
-                }
-        }
-        
-        protected void validate(RequestAttributes requestAttributes) {
-                if (requestAttributes.getCategory() == null) {
-                        this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Category"));
-                        return;
-                }
-                Iterator<Attribute> iterAttributes	= requestAttributes.getAttributes().iterator();
-                if (iterAttributes != null) {
-                        while (iterAttributes.hasNext() && this.status == null) {
-                                this.validate(iterAttributes.next());
-                        }
-                }
-        }
-        
-        /**
-         * Validates that the request has all required elements in it.  For now we just check through all of the
-         * attributes.
-         */
-        protected void validate() {
-                Iterator<RequestAttributes> iterRequestAttributes	= this.getRequestAttributes().iterator();
-                if (iterRequestAttributes != null && iterRequestAttributes.hasNext()) {
-                        while (iterRequestAttributes.hasNext() && this.status == null) {
-                                this.validate(iterRequestAttributes.next());
-                        }
-                }
-        }
+    @Override
+    public RequestDefaults getRequestDefaults() {
+        return this.requestDefaults;
+    }
 
-        @Override
-        public Status getStatus() {
-                if (this.status == null) {
-                        this.validate();
+    /**
+     * Sets the {@link com.att.research.xacml.api.RequestDefaults} interface for this <code>PEPRequest</code>.
+     *
+     * @param requestDefaultsIn the <code>RequestDefaults</code> to use for this <code>PEPRequest</code>.
+     */
+    public void setRequestDefaults(RequestDefaults requestDefaultsIn) {
+        this.requestDefaults	= requestDefaultsIn;
+    }
+
+    @Override
+    public boolean getReturnPolicyIdList() {
+        return this.returnPolicyIdList;
+    }
+
+    /**
+     * Sets the flag indicating whether policy ids should be returned with the response to the given request.
+     *
+     * @param returnPolicyIdListIn if true, policy ids will be returned in the response, otherwise they may not be.
+     */
+    public void setReturnPolicyIdList(boolean returnPolicyIdListIn) {
+        this.returnPolicyIdList	= returnPolicyIdListIn;
+    }
+
+    @Override
+    public boolean getCombinedDecision() {
+        return this.combinedDecision;
+    }
+
+    /**
+     * Sets the flag indicating whether multiple requests within this <code>PEPRequest</code> should have their results
+     * combined into a single combined result or if a list of individual results should be maintained.
+     *
+     * @param combinedDecisionIn if true, multiple results should be combined into a single results
+     */
+    public void setCombinedDecision(boolean combinedDecisionIn) {
+        this.combinedDecision	= combinedDecisionIn;
+    }
+
+    @Override
+    public Collection<RequestAttributes> getRequestAttributes() {
+        return Collections.unmodifiableCollection(this.requestAttributes);
+    }
+
+    @Override
+    public Iterator<RequestAttributes> getRequestAttributes(Identifier categoryId) {
+        List<RequestAttributes>	listRequestAttributesForCategory	= this.requestAttributesByCategoryId.get(categoryId);
+        if (listRequestAttributesForCategory != null) {
+            return listRequestAttributesForCategory.iterator();
+        } else {
+            return EMPTY_REQUEST_ATTRIBUTES_LIST.iterator();
+        }
+    }
+
+    /**
+     * Adds a {@link com.att.research.xacml.api.RequestAttributes} to the <code>RequestAttributes</code> in this <code>StdMutableRequest</code>>
+     *
+     * @param requestAttributesNew the <code>RequestAttributes</code> to add to this <code>StdMutableRequest</code>
+     * @throws NullPointerException if <code>requestAttributesNew</code> is null or if <code>requestAttributesNew.getCategory()</code> is null
+     */
+    public void add(RequestAttributes requestAttributesNew) {
+        if (this.requestAttributes == EMPTY_REQUEST_ATTRIBUTES_LIST) {
+            this.requestAttributes	= new ArrayList<RequestAttributes>();
+        }
+        this.requestAttributes.add(requestAttributesNew);
+        List<RequestAttributes>	listRequestAttributesForCategoryId	= this.requestAttributesByCategoryId.get(requestAttributesNew.getCategory());
+        if (listRequestAttributesForCategoryId == null) {
+            listRequestAttributesForCategoryId	= new ArrayList<RequestAttributes>();
+            this.requestAttributesByCategoryId.put(requestAttributesNew.getCategory(), listRequestAttributesForCategoryId);
+        }
+        listRequestAttributesForCategoryId.add(requestAttributesNew);
+        if (requestAttributesNew.getXmlId() != null) {
+            this.requestAttributesByXmlId.put(requestAttributesNew.getXmlId(), requestAttributesNew);
+        }
+        StdMutableAttributeCategory attributeCategoryIncludeInResult	= null;
+        for (Attribute attribute : requestAttributesNew.getAttributes()) {
+            if (attribute.getIncludeInResults()) {
+                if (attributeCategoryIncludeInResult == null) {
+                    attributeCategoryIncludeInResult	= new StdMutableAttributeCategory();
+                    attributeCategoryIncludeInResult.setCategory(requestAttributesNew.getCategory());
                 }
-                return this.status;
+                attributeCategoryIncludeInResult.add(attribute);
+            }
         }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Status} indicating the validity of this <code>StdMutableRequest</code>.
-         * 
-         * @param statusIn the <code>Status</code> for this <code>StdMutableRequest</code>.
-         */
-        public void setStatus(Status statusIn) {
-                this.status	= statusIn;
+        if (attributeCategoryIncludeInResult != null) {
+            if (this.requestAttributesIncludeInResult == EMPTY_ATTRIBUTE_CATEGORY_LIST) {
+                this.requestAttributesIncludeInResult	= new ArrayList<AttributeCategory>();
+            }
+            this.requestAttributesIncludeInResult.add(attributeCategoryIncludeInResult);
         }
+    }
+
+    @Override
+    public Collection<AttributeCategory> getRequestAttributesIncludedInResult() {
+        // TODO Auto-generated method stub
+        return this.requestAttributesIncludeInResult;
+    }
+
+    @Override
+    public Collection<RequestReference> getMultiRequests() {
+        return Collections.unmodifiableCollection(this.requestReferences);
+    }
+
+    /**
+     * Adds a {@link com.att.research.xacml.api.RequestReference} to the <code>RequestReference</code>s in this <code>StdMutableRequest</code>.
+     *
+     * @param requestReference the <code>RequestReference</code> to add
+     */
+    public void add(RequestReference requestReference) {
+        if (this.requestReferences == EMPTY_REQUEST_REFERENCE_LIST) {
+            this.requestReferences	= new ArrayList<RequestReference>();
+        }
+        this.requestReferences.add(requestReference);
+    }
+
+    @Override
+    public RequestAttributes getRequestAttributesByXmlId(String xmlId) {
+        return this.requestAttributesByXmlId.get(xmlId);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof Request)) {
+            return false;
+        } else {
+            Request objRequest	= (Request)obj;
+            return ObjUtil.equalsAllowNull(this.getStatus(), objRequest.getStatus()) &&
+                   ObjUtil.equalsAllowNull(this.getRequestDefaults(), objRequest.getRequestDefaults()) &&
+                   this.getCombinedDecision() == objRequest.getCombinedDecision() &&
+                   this.getReturnPolicyIdList() == objRequest.getReturnPolicyIdList() &&
+                   ListUtil.equalsAllowNulls(this.getRequestAttributes(), objRequest.getRequestAttributes()) &&
+                   ListUtil.equalsAllowNulls(this.getMultiRequests(), objRequest.getMultiRequests());
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump;
+        if ((objectToDump = this.getRequestDefaults()) != null) {
+            stringBuilder.append("requestDefaults=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        if (needsComma) {
+            stringBuilder.append(',');
+        }
+        stringBuilder.append("returnPolicyIdList=");
+        stringBuilder.append(this.getReturnPolicyIdList());
+        stringBuilder.append(",combinedDecision=");
+        stringBuilder.append(this.getCombinedDecision());
+        Collection<RequestAttributes> thisRequestAttributes	= this.getRequestAttributes();
+        if (thisRequestAttributes.size() > 0) {
+            stringBuilder.append(",requestAttributes=");
+            stringBuilder.append(ListUtil.toString(thisRequestAttributes));
+        }
+        Collection<RequestReference> thisRequestReferences	= this.getMultiRequests();
+        if (thisRequestReferences.size() > 0) {
+            stringBuilder.append(",multiRequests=");
+            stringBuilder.append(ListUtil.toString(thisRequestReferences));
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    protected void validate(Attribute attribute) {
+        if (attribute.getAttributeId() == null) {
+            this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeId"));
+            return;
+        }
+        Iterator<AttributeValue<?>> iterAttributeValues	= attribute.getValues().iterator();
+        if (!iterAttributeValues.hasNext()) {
+            this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing AttributeValue for Attribute " + attribute.getAttributeId().stringValue()));
+            return;
+        } else {
+            while (iterAttributeValues.hasNext()) {
+                AttributeValue<?> attributeValue	= iterAttributeValues.next();
+                if (attributeValue.getDataTypeId() == null) {
+                    this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing DataType in AttributeValue for Attribute " + attribute.getAttributeId().stringValue()));
+                    return;
+                } else if (attributeValue.getValue() == null) {
+                    this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing value in AttributeValue for Attribute " + attribute.getAttributeId().stringValue()));
+                    return;
+                }
+            }
+        }
+    }
+
+    protected void validate(RequestAttributes requestAttributes) {
+        if (requestAttributes.getCategory() == null) {
+            this.setStatus(new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Missing Category"));
+            return;
+        }
+        Iterator<Attribute> iterAttributes	= requestAttributes.getAttributes().iterator();
+        if (iterAttributes != null) {
+            while (iterAttributes.hasNext() && this.status == null) {
+                this.validate(iterAttributes.next());
+            }
+        }
+    }
+
+    /**
+     * Validates that the request has all required elements in it.  For now we just check through all of the
+     * attributes.
+     */
+    protected void validate() {
+        Iterator<RequestAttributes> iterRequestAttributes	= this.getRequestAttributes().iterator();
+        if (iterRequestAttributes != null && iterRequestAttributes.hasNext()) {
+            while (iterRequestAttributes.hasNext() && this.status == null) {
+                this.validate(iterRequestAttributes.next());
+            }
+        }
+    }
+
+    @Override
+    public Status getStatus() {
+        if (this.status == null) {
+            this.validate();
+        }
+        return this.status;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Status} indicating the validity of this <code>StdMutableRequest</code>.
+     *
+     * @param statusIn the <code>Status</code> for this <code>StdMutableRequest</code>.
+     */
+    public void setStatus(Status statusIn) {
+        this.status	= statusIn;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequestAttributes.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequestAttributes.java
index b9ebee8..789b801 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequestAttributes.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequestAttributes.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,146 +46,146 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.RequestAttributes} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableRequestAttributes extends StdMutableAttributeCategory implements RequestAttributes {
-        private Node				contentRoot;
-        private String	 			xmlId;
-        
-        /**
-         * Creates a new <code>StdMutableRequestAttributes</code> with default values.
-         */
-        public StdMutableRequestAttributes() {
-                
+    private Node				contentRoot;
+    private String	 			xmlId;
+
+    /**
+     * Creates a new <code>StdMutableRequestAttributes</code> with default values.
+     */
+    public StdMutableRequestAttributes() {
+
+    }
+
+    /**
+     * Creates a new <code>StdMutableRequestAttributes</code> with the given {@link com.att.research.xacml.api.Identifier} representing its XACML Category,
+     * the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s, the given {@link org.w3c.dom.Node} representing the XACML Content element
+     * and the given <code>String</code> as the optional xml:Id.
+     *
+     * @param identifierCategory the <code>Identifier</code> representing the XACML Category for the new <code>StdMutableRequestAttributes</code>
+     * @param listAttributes the <code>Collection</code> of <code>Attribute</code>s included in the new <code>StdMutableRequestAttributes</code>
+     * @param nodeContentRoot the <code>Node</code> representing the XACML Content element for the new <code>StdMutableRequestAttributes</code>
+     * @param xmlIdIn the <code>String</code> representing the xml:Id of the XACML Attributes element represented by this <code>StdMutableRequestAttributes</code>
+     */
+    public StdMutableRequestAttributes(Identifier identifierCategory, Collection<Attribute> listAttributes, Node nodeContentRoot, String xmlIdIn) {
+        super(identifierCategory, listAttributes);
+        this.contentRoot	= nodeContentRoot;
+        this.xmlId			= xmlIdIn;
+    }
+
+    /**
+     * Creates a new <code>StdMutableRequestAttributes</code> by copying the given {@link com.att.research.xacml.api.RequestAttributes}.
+     *
+     * @param requestAttributes the <code>RequestAttributes</code> to copy
+     */
+    public StdMutableRequestAttributes(RequestAttributes requestAttributes) {
+        super(requestAttributes);
+        this.contentRoot	= requestAttributes.getContentRoot();
+        this.xmlId			= requestAttributes.getXmlId();
+    }
+
+    @Override
+    public String getXmlId() {
+        return this.xmlId;
+    }
+
+    /**
+     * Sets the <code>String</code> xml:Id from the XACML Attributes element represented by this <code>StdMutableRequestAttributes</code>.
+     *
+     * @param xmlIdIn the <code>String</code> representing the xml:Id from the XACML Attributes element represented by this <code>StdMutableRequestAttributes</code>
+     */
+    public void setXmlId(String xmlIdIn) {
+        this.xmlId	= xmlIdIn;
+    }
+
+    @Override
+    public Node getContentRoot() {
+        return this.contentRoot;
+    }
+
+    /**
+     * Sets the {@link org.w3c.dom.Node} representing the XACML Content element for this <code>StdMutableRequestAttributes</code>.
+     *
+     * @param nodeContentRoot the <code>Node</code> representing the XACML Content element for this <code>StdMutableRequestAttributes</code>.
+     */
+    public void setContentRoot(Node nodeContentRoot) {
+        this.contentRoot	= nodeContentRoot;
+    }
+
+    @Override
+    public Node getContentNodeByXpathExpression(XPathExpression xpathExpression) {
+        if (xpathExpression == null) {
+            throw new NullPointerException("Null XPathExpression");
+        }
+        Node	nodeRootThis	= this.getContentRoot();
+        if (nodeRootThis == null) {
+            return null;
+        }
+        Node	matchingNode	= null;
+        try {
+            matchingNode	= (Node)xpathExpression.evaluate(nodeRootThis, XPathConstants.NODE);
+        } catch (XPathExpressionException ex) {
+            this.logger.warn("Failed to retrieve node for \"" + xpathExpression.toString() + "\"", ex);
+        }
+        return matchingNode;
+    }
+
+    @Override
+    public NodeList getContentNodeListByXpathExpression(XPathExpression xpathExpression) {
+        if (xpathExpression == null) {
+            throw new NullPointerException("Null XPathExpression");
+        }
+        Node	nodeRootThis	= this.getContentRoot();
+        if (nodeRootThis == null) {
+            return null;
+        }
+        NodeList	matchingNodeList	= null;
+        try {
+            matchingNodeList	= (NodeList)xpathExpression.evaluate(nodeRootThis, XPathConstants.NODESET);
+        } catch (XPathExpressionException ex) {
+            this.logger.warn("Failed to retrieve nodelist for \"" + xpathExpression.toString() + "\"", ex);
+        }
+        return matchingNodeList;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof RequestAttributes)) {
+            return false;
+        } else {
+            RequestAttributes objRequestAttributes	= (RequestAttributes)obj;
+            return super.equals(objRequestAttributes) &&
+                   ObjUtil.equalsAllowNull(this.getContentRoot(), objRequestAttributes.getContentRoot()) &&
+                   ObjUtil.equalsAllowNull(this.getXmlId(), objRequestAttributes.getXmlId());
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getContentRoot()) != null) {
+            stringBuilder.append(',');
+            stringBuilder.append("contentRoot=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getXmlId()) != null) {
+            stringBuilder.append(',');
+            stringBuilder.append("xmlId=");
+            stringBuilder.append((String)objectToDump);
         }
 
-        /**
-         * Creates a new <code>StdMutableRequestAttributes</code> with the given {@link com.att.research.xacml.api.Identifier} representing its XACML Category,
-         * the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s, the given {@link org.w3c.dom.Node} representing the XACML Content element
-         * and the given <code>String</code> as the optional xml:Id.
-         * 
-         * @param identifierCategory the <code>Identifier</code> representing the XACML Category for the new <code>StdMutableRequestAttributes</code>
-         * @param listAttributes the <code>Collection</code> of <code>Attribute</code>s included in the new <code>StdMutableRequestAttributes</code>
-         * @param nodeContentRoot the <code>Node</code> representing the XACML Content element for the new <code>StdMutableRequestAttributes</code>
-         * @param xmlIdIn the <code>String</code> representing the xml:Id of the XACML Attributes element represented by this <code>StdMutableRequestAttributes</code>
-         */
-        public StdMutableRequestAttributes(Identifier identifierCategory, Collection<Attribute> listAttributes, Node nodeContentRoot, String xmlIdIn) {
-                super(identifierCategory, listAttributes);
-                this.contentRoot	= nodeContentRoot;
-                this.xmlId			= xmlIdIn;
-        }
-
-        /**
-         * Creates a new <code>StdMutableRequestAttributes</code> by copying the given {@link com.att.research.xacml.api.RequestAttributes}.
-         * 
-         * @param requestAttributes the <code>RequestAttributes</code> to copy
-         */
-        public StdMutableRequestAttributes(RequestAttributes requestAttributes) {
-                super(requestAttributes);
-                this.contentRoot	= requestAttributes.getContentRoot();
-                this.xmlId			= requestAttributes.getXmlId();
-        }
-
-        @Override
-        public String getXmlId() {
-                return this.xmlId;
-        }
-        
-        /**
-         * Sets the <code>String</code> xml:Id from the XACML Attributes element represented by this <code>StdMutableRequestAttributes</code>.
-         * 
-         * @param xmlIdIn the <code>String</code> representing the xml:Id from the XACML Attributes element represented by this <code>StdMutableRequestAttributes</code>
-         */
-        public void setXmlId(String xmlIdIn) {
-                this.xmlId	= xmlIdIn;
-        }
-
-        @Override
-        public Node getContentRoot() {
-                return this.contentRoot;
-        }
-        
-        /**
-         * Sets the {@link org.w3c.dom.Node} representing the XACML Content element for this <code>StdMutableRequestAttributes</code>.
-         * 
-         * @param nodeContentRoot the <code>Node</code> representing the XACML Content element for this <code>StdMutableRequestAttributes</code>.
-         */
-        public void setContentRoot(Node nodeContentRoot) {
-                this.contentRoot	= nodeContentRoot;
-        }
-        
-        @Override
-        public Node getContentNodeByXpathExpression(XPathExpression xpathExpression) {
-                if (xpathExpression == null) {
-                        throw new NullPointerException("Null XPathExpression");
-                }
-                Node	nodeRootThis	= this.getContentRoot();
-                if (nodeRootThis == null) {
-                        return null;
-                }
-                Node	matchingNode	= null;
-                try {
-                        matchingNode	= (Node)xpathExpression.evaluate(nodeRootThis, XPathConstants.NODE);
-                } catch (XPathExpressionException ex) {
-                        this.logger.warn("Failed to retrieve node for \"" + xpathExpression.toString() + "\"", ex);
-                }
-                return matchingNode;
-        }
-        
-        @Override
-        public NodeList getContentNodeListByXpathExpression(XPathExpression xpathExpression) {
-                if (xpathExpression == null) {
-                        throw new NullPointerException("Null XPathExpression");
-                }
-                Node	nodeRootThis	= this.getContentRoot();
-                if (nodeRootThis == null) {
-                        return null;
-                }
-                NodeList	matchingNodeList	= null;
-                try {
-                        matchingNodeList	= (NodeList)xpathExpression.evaluate(nodeRootThis, XPathConstants.NODESET);
-                } catch (XPathExpressionException ex) {
-                        this.logger.warn("Failed to retrieve nodelist for \"" + xpathExpression.toString() + "\"", ex);
-                }
-                return matchingNodeList;
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof RequestAttributes)) {
-                        return false;
-                } else {
-                        RequestAttributes objRequestAttributes	= (RequestAttributes)obj;
-                        return super.equals(objRequestAttributes) &&
-                                        ObjUtil.equalsAllowNull(this.getContentRoot(), objRequestAttributes.getContentRoot()) &&
-                                        ObjUtil.equalsAllowNull(this.getXmlId(), objRequestAttributes.getXmlId());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getContentRoot()) != null) {
-                        stringBuilder.append(',');
-                        stringBuilder.append("contentRoot=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getXmlId()) != null) {
-                        stringBuilder.append(',');
-                        stringBuilder.append("xmlId=");
-                        stringBuilder.append((String)objectToDump);
-                }
-
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequestReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequestReference.java
index f6e245b..6f7cc33 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequestReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableRequestReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,66 +41,66 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.RequestReference} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableRequestReference implements RequestReference {
-        private static final List<RequestAttributesReference> EMPTY_LIST		= Collections.unmodifiableList(new ArrayList<RequestAttributesReference>());
-        private List<RequestAttributesReference> requestAttributesReferences	= EMPTY_LIST;
-        
-        /**
-         * Creates a new <code>StdMutableRequestReference</code> with no {@link com.att.research.xacml.api.RequestAttributesReference}s.
-         */
-        public StdMutableRequestReference() {
-        }
-        
-        public StdMutableRequestReference(Collection<RequestAttributesReference> listRequestAttributesReferencesIn) {
-                if (listRequestAttributesReferencesIn != null) {
-                        this.requestAttributesReferences	= new ArrayList<RequestAttributesReference>();
-                        this.requestAttributesReferences.addAll(listRequestAttributesReferencesIn);
-                }
-        }
+    private static final List<RequestAttributesReference> EMPTY_LIST		= Collections.unmodifiableList(new ArrayList<RequestAttributesReference>());
+    private List<RequestAttributesReference> requestAttributesReferences	= EMPTY_LIST;
 
-        @Override
-        public Collection<RequestAttributesReference> getAttributesReferences() {
-                return (this.requestAttributesReferences == EMPTY_LIST ? this.requestAttributesReferences : Collections.unmodifiableCollection(this.requestAttributesReferences));
-        }
+    /**
+     * Creates a new <code>StdMutableRequestReference</code> with no {@link com.att.research.xacml.api.RequestAttributesReference}s.
+     */
+    public StdMutableRequestReference() {
+    }
 
-        /**
-         * Adds a {@link com.att.research.xacml.api.RequestAttributesReference} to this <code>StdMutableRequestReference</code>>
-         * 
-         * @param requestAttributesReference the <code>RequestAttributesReference</code> to add
-         */
-        public void add(RequestAttributesReference requestAttributesReference) {
-                if (this.requestAttributesReferences == EMPTY_LIST) {
-                        this.requestAttributesReferences	= new ArrayList<RequestAttributesReference>();
-                }
-                this.requestAttributesReferences.add(requestAttributesReference);
+    public StdMutableRequestReference(Collection<RequestAttributesReference> listRequestAttributesReferencesIn) {
+        if (listRequestAttributesReferencesIn != null) {
+            this.requestAttributesReferences	= new ArrayList<RequestAttributesReference>();
+            this.requestAttributesReferences.addAll(listRequestAttributesReferencesIn);
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof RequestReference)) {
-                        return false;
-                } else {
-                        RequestReference objRequestReference	= (RequestReference)obj;
-                        return ListUtil.equalsAllowNulls(this.getAttributesReferences(), objRequestReference.getAttributesReferences());
-                }
+    }
+
+    @Override
+    public Collection<RequestAttributesReference> getAttributesReferences() {
+        return (this.requestAttributesReferences == EMPTY_LIST ? this.requestAttributesReferences : Collections.unmodifiableCollection(this.requestAttributesReferences));
+    }
+
+    /**
+     * Adds a {@link com.att.research.xacml.api.RequestAttributesReference} to this <code>StdMutableRequestReference</code>>
+     *
+     * @param requestAttributesReference the <code>RequestAttributesReference</code> to add
+     */
+    public void add(RequestAttributesReference requestAttributesReference) {
+        if (this.requestAttributesReferences == EMPTY_LIST) {
+            this.requestAttributesReferences	= new ArrayList<RequestAttributesReference>();
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                
-                if (this.requestAttributesReferences.size() > 0) {
-                        stringBuilder.append("requestAttributesReferences=");
-                        stringBuilder.append(ListUtil.toString(this.requestAttributesReferences));
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        this.requestAttributesReferences.add(requestAttributesReference);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof RequestReference)) {
+            return false;
+        } else {
+            RequestReference objRequestReference	= (RequestReference)obj;
+            return ListUtil.equalsAllowNulls(this.getAttributesReferences(), objRequestReference.getAttributesReferences());
         }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+
+        if (this.requestAttributesReferences.size() > 0) {
+            stringBuilder.append("requestAttributesReferences=");
+            stringBuilder.append(ListUtil.toString(this.requestAttributesReferences));
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableResponse.java
index f38426c..0ababfa 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,109 +42,109 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.Response} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.3 $
  */
 public class StdMutableResponse implements Response {
-        private static final List<Result>	EMPTY_LIST	= Collections.unmodifiableList(new ArrayList<Result>());
-        
-        private List<Result> results;
-        
-        /**
-         * Creates a new <code>StdMutableResponse</code> with no {@link com.att.research.xacml.api.Result}s.
-         */
-        public StdMutableResponse() {
-                this.results	= EMPTY_LIST;
-        }
-        
-        /**
-         * Creates a new <code>StdMutableResponse</code> with a single {@link com.att.research.xacml.api.Result}.
-         * 
-         * @param resultIn the <code>Result</code> for the new <code>StdMutableResponse</code>.
-         */
-        public StdMutableResponse(Result resultIn) {
-                if (resultIn != null) {
-                        this.results	= new ArrayList<Result>();
-                        this.results.add(resultIn);
-                } else {
-                        this.results	= EMPTY_LIST;
-                }
-        }
-        
-        /**
-         * Creates a new <code>StdMutableResponse</code> with a copy of the {@link com.att.research.xacml.api.Result}s in
-         * the given <code>Collection</code>>
-         * 
-         * @param listResults the <code>Collection</code> of <code>Result</code>s for the new <code>StdMutableResponse</code>
-         */
-        public StdMutableResponse(Collection<Result> listResults) {
-                if (listResults != null && listResults.size() > 0) {
-                        this.results	= new ArrayList<Result>();
-                        this.results.addAll(listResults);
-                } else {
-                        this.results	= EMPTY_LIST;
-                }
-        }
-        
-        /**
-         * Creates a new <code>StdMutableResponse</code> that is a copy of the given {@link com.att.research.xacml.api.Response}.
-         * 
-         * @param copy the <code>Response</code> to copy
-         */
-        public StdMutableResponse(Response copy) {
-                this(copy.getResults());
-        }
+    private static final List<Result>	EMPTY_LIST	= Collections.unmodifiableList(new ArrayList<Result>());
 
-        /**
-         * Creates a new <code>StdMutableResponse</code> with a single {@link com.att.research.xacml.api.Result} defined
-         * by the given {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param status the <code>Status</code> of the <code>Result</code> for the new <code>StdMutableResponse</code>.
-         */
-        public StdMutableResponse(Status status) {
-                this(new StdMutableResult(status));
-        }
-        
-        @Override
-        public Collection<Result> getResults() {
-                return (this.results == EMPTY_LIST ? this.results : Collections.unmodifiableCollection(this.results));
-        }
+    private List<Result> results;
 
-        /**
-         * Adds a {@link com.att.research.xacml.api.Result} to this <code>StdMutableResponse</code>>
-         * 
-         * @param result the <code>Result</code> to add
-         */
-        public void add(Result result) {
-                if (this.results == EMPTY_LIST) {
-                        this.results	= new ArrayList<Result>();
-                }
-                this.results.add(result);
+    /**
+     * Creates a new <code>StdMutableResponse</code> with no {@link com.att.research.xacml.api.Result}s.
+     */
+    public StdMutableResponse() {
+        this.results	= EMPTY_LIST;
+    }
+
+    /**
+     * Creates a new <code>StdMutableResponse</code> with a single {@link com.att.research.xacml.api.Result}.
+     *
+     * @param resultIn the <code>Result</code> for the new <code>StdMutableResponse</code>.
+     */
+    public StdMutableResponse(Result resultIn) {
+        if (resultIn != null) {
+            this.results	= new ArrayList<Result>();
+            this.results.add(resultIn);
+        } else {
+            this.results	= EMPTY_LIST;
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof Response)) {
-                        return false;
-                } else {
-                        Response objResponse	= (Response)obj;
-                        return ListUtil.equalsAllowNulls(this.getResults(), objResponse.getResults());
-                }
+    }
+
+    /**
+     * Creates a new <code>StdMutableResponse</code> with a copy of the {@link com.att.research.xacml.api.Result}s in
+     * the given <code>Collection</code>>
+     *
+     * @param listResults the <code>Collection</code> of <code>Result</code>s for the new <code>StdMutableResponse</code>
+     */
+    public StdMutableResponse(Collection<Result> listResults) {
+        if (listResults != null && listResults.size() > 0) {
+            this.results	= new ArrayList<Result>();
+            this.results.addAll(listResults);
+        } else {
+            this.results	= EMPTY_LIST;
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                Collection<Result> listResults	= this.getResults();
-                if (listResults.size() > 0) {
-                        stringBuilder.append("results=");
-                        stringBuilder.append(ListUtil.toString(listResults));
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    }
+
+    /**
+     * Creates a new <code>StdMutableResponse</code> that is a copy of the given {@link com.att.research.xacml.api.Response}.
+     *
+     * @param copy the <code>Response</code> to copy
+     */
+    public StdMutableResponse(Response copy) {
+        this(copy.getResults());
+    }
+
+    /**
+     * Creates a new <code>StdMutableResponse</code> with a single {@link com.att.research.xacml.api.Result} defined
+     * by the given {@link com.att.research.xacml.api.Status}.
+     *
+     * @param status the <code>Status</code> of the <code>Result</code> for the new <code>StdMutableResponse</code>.
+     */
+    public StdMutableResponse(Status status) {
+        this(new StdMutableResult(status));
+    }
+
+    @Override
+    public Collection<Result> getResults() {
+        return (this.results == EMPTY_LIST ? this.results : Collections.unmodifiableCollection(this.results));
+    }
+
+    /**
+     * Adds a {@link com.att.research.xacml.api.Result} to this <code>StdMutableResponse</code>>
+     *
+     * @param result the <code>Result</code> to add
+     */
+    public void add(Result result) {
+        if (this.results == EMPTY_LIST) {
+            this.results	= new ArrayList<Result>();
         }
+        this.results.add(result);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof Response)) {
+            return false;
+        } else {
+            Response objResponse	= (Response)obj;
+            return ListUtil.equalsAllowNulls(this.getResults(), objResponse.getResults());
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        Collection<Result> listResults	= this.getResults();
+        if (listResults.size() > 0) {
+            stringBuilder.append("results=");
+            stringBuilder.append(ListUtil.toString(listResults));
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableResult.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableResult.java
index 94a30da..8c60e3d 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableResult.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,417 +46,417 @@
 import com.att.research.xacml.util.ObjUtil;
 
 /**
- * Mutable implementation of the {@link com.att.research.xacml.api.Result} 
- * 
+ * Mutable implementation of the {@link com.att.research.xacml.api.Result}
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public class StdMutableResult implements Result {
-        private static final List<Obligation> EMPTY_OBLIGATION_LIST		= Collections.unmodifiableList(new ArrayList<Obligation>());
-        private static final List<Advice> EMPTY_ADVICE_LIST				= Collections.unmodifiableList(new ArrayList<Advice>());
-        private static final List<AttributeCategory> EMPTY_ATTRIBUTES	= Collections.unmodifiableList(new ArrayList<AttributeCategory>());
-        private static final List<IdReference> EMPTY_REFERENCES			= Collections.unmodifiableList(new ArrayList<IdReference>());
-        
-        private Decision decision;
-        private Status status;
-        private List<Obligation> obligations			= new ArrayList<Obligation>();
-        private List<Advice> associatedAdvice			= new ArrayList<Advice>();
-        private List<AttributeCategory>	attributes		= new ArrayList<AttributeCategory>();
-        private List<IdReference> policyIdentifiers		= new ArrayList<IdReference>();
-        private List<IdReference> policySetIdentifiers	= new ArrayList<IdReference>();
+    private static final List<Obligation> EMPTY_OBLIGATION_LIST		= Collections.unmodifiableList(new ArrayList<Obligation>());
+    private static final List<Advice> EMPTY_ADVICE_LIST				= Collections.unmodifiableList(new ArrayList<Advice>());
+    private static final List<AttributeCategory> EMPTY_ATTRIBUTES	= Collections.unmodifiableList(new ArrayList<AttributeCategory>());
+    private static final List<IdReference> EMPTY_REFERENCES			= Collections.unmodifiableList(new ArrayList<IdReference>());
 
-        /**
-         * Creates a new empty <code>StdMutableResult</code>.
-         */
-        public StdMutableResult() {
-                this.obligations			= EMPTY_OBLIGATION_LIST;
-                this.associatedAdvice		= EMPTY_ADVICE_LIST;
-                this.attributes				= EMPTY_ATTRIBUTES;
-                this.policyIdentifiers		= EMPTY_REFERENCES;
-                this.policySetIdentifiers	= EMPTY_REFERENCES;
-        }
-        
-        public StdMutableResult(Result resultCopy) {
-                this(resultCopy.getDecision(), resultCopy.getStatus());
-                this.addObligations(resultCopy.getObligations());
-                this.addAdvice(resultCopy.getAssociatedAdvice());
-                this.addAttributeCategories(resultCopy.getAttributes());
-                this.addPolicyIdentifiers(resultCopy.getPolicyIdentifiers());
-                this.addPolicySetIdentifiers(resultCopy.getPolicySetIdentifiers());
-        }
-        
-        /**
-         * Creates a new <code>StdMutableResult</code> with the given {@link com.att.research.xacml.api.Decision} and {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param decisionIn the <code>Decision</code> for the new <code>StdMutableResult</code>
-         * @param statusIn the <code>Status</code> for the new <code>StdMutableResult</code>
-         */
-        public StdMutableResult(Decision decisionIn, Status statusIn) {
-                this();
-                this.status		= statusIn;
-                this.decision	= decisionIn;
-        }
-        
-        /**
-         * Creates a new <code>StdMutableResult</code> with a {@link com.att.research.xacml.api.Decision} of <code>INDETERMINATE</code> and 
-         * the given {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param statusIn the <code>Status</code> for the new <code>StdMutableResult</code>
-         */
-        public StdMutableResult(Status statusIn) {
-                this(Decision.INDETERMINATE, statusIn);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableResult</code> with the given {@link com.att.research.xacml.api.Decision} and a {@link com.att.research.xacml.api.Status}
-         * of OK.
-         * 
-         * @param decisionIn the <code>Decision</code> for the new <code>StdMutableResult</code>
-         */
-        public StdMutableResult(Decision decisionIn) {
-                this(decisionIn, StdStatus.STATUS_OK);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableResult</code> with the given {@link com.att.research.xacml.api.Decision} and the given set of <code>Collection</code>s
-         * with the details of the result.
-         * 
-         * @param decisionIn the <code>Decision</code> for the new <code>StdMutableResult</code>
-         * @param obligationsIn a <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s for the new <code>StdMutableResult</code>
-         * @param adviceIn a <code>Collection</code> of {@link com.att.research.xacml.api.Advice} objects for the new <code>StdMutableResult</code>
-         * @param attributesIn a <code>Collection</code> of {@link com.att.research.xacml.api.AttributeCategory} objects for the new <code>StdMutableResult</code>
-         * @param policyIdentifiersIn a <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects for the Policy identifiers
-         * @param policySetIdentifiersIn a <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects for the PolicySet identifiers
-         */
-        public StdMutableResult(Decision decisionIn, 
-                        Collection<Obligation> obligationsIn, 
-                        Collection<Advice> adviceIn, 
-                        Collection<AttributeCategory> attributesIn, 
-                        Collection<IdReference> policyIdentifiersIn, 
-                        Collection<IdReference> policySetIdentifiersIn) {
-                this(decisionIn);
-                this.setObligations(obligationsIn);
-                this.setAdvice(adviceIn);
-                this.setAttributeCategories(attributesIn);
-                this.setPolicyIdentifiers(policyIdentifiersIn);
-                this.setPolicySetIdentifiers(policySetIdentifiersIn);
-        }
-        
-        @Override
-        public Decision getDecision() {
-                return this.decision;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Decision} for this <code>StdMutableResult</code>.
-         * 
-         * @param decisionIn the <code>Decision</code> for this <code>StdMutableResult</code>.
-         */
-        public void setDecision(Decision decisionIn) {
-                this.decision	= decisionIn;
-        }
+    private Decision decision;
+    private Status status;
+    private List<Obligation> obligations			= new ArrayList<Obligation>();
+    private List<Advice> associatedAdvice			= new ArrayList<Advice>();
+    private List<AttributeCategory>	attributes		= new ArrayList<AttributeCategory>();
+    private List<IdReference> policyIdentifiers		= new ArrayList<IdReference>();
+    private List<IdReference> policySetIdentifiers	= new ArrayList<IdReference>();
 
-        @Override
-        public Status getStatus() {
-                return this.status;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Status} for this <code>StdMutableResult</code>.
-         * 
-         * @param statusIn the <code>Status</code> for this <code>StdMutableResult</code>.
-         */
-        public void setStatus(Status statusIn) {
-                this.status	= statusIn;
-        }
+    /**
+     * Creates a new empty <code>StdMutableResult</code>.
+     */
+    public StdMutableResult() {
+        this.obligations			= EMPTY_OBLIGATION_LIST;
+        this.associatedAdvice		= EMPTY_ADVICE_LIST;
+        this.attributes				= EMPTY_ATTRIBUTES;
+        this.policyIdentifiers		= EMPTY_REFERENCES;
+        this.policySetIdentifiers	= EMPTY_REFERENCES;
+    }
 
-        @Override
-        public Collection<Obligation> getObligations() {
-                return this.obligations == EMPTY_OBLIGATION_LIST ? this.obligations : Collections.unmodifiableCollection(this.obligations);
-        }
-        
-        /**
-         * Adds an {@link com.att.research.xacml.api.Obligation} to this <code>StdMutableResult</code>.
-         * 
-         * @param obligation the <code>Obligation</code> to add to this <code>StdMutableResult</code>.
-         */
-        public void addObligation(Obligation obligation) {
-                if (this.obligations == EMPTY_OBLIGATION_LIST) {
-                        this.obligations	= new ArrayList<Obligation>();
-                }
-                this.obligations.add(obligation);
-        }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s to this <code>StdMutableResult</code>.
-         * 
-         * @param obligationsIn the <code>Collection</code> of <code>Obligation</code>s to add
-         */
-        public void addObligations(Collection<Obligation> obligationsIn) {
-                if (obligationsIn != null && obligationsIn.size() > 0) {
-                        if (this.obligations == EMPTY_OBLIGATION_LIST) {
-                                this.obligations	= new ArrayList<Obligation>();
-                        }
-                        this.obligations.addAll(obligationsIn);
-                }
-        }
-        
-        /**
-         * Clears any existing {@link com.att.research.xacml.api.Obligation}s from this <code>StdMutableResult</code> and adds
-         * the given <code>Collection</code> of <code>Obligation</code>s.
-         * 
-         * @param obligationsIn the <code>Collection</code> of <code>Obligation</code>s to set in this <code>StdMutableResult</code>.
-         */
-        public void setObligations(Collection<Obligation> obligationsIn) {
-                this.obligations	= EMPTY_OBLIGATION_LIST;
-                this.addObligations(obligationsIn);
-        }
+    public StdMutableResult(Result resultCopy) {
+        this(resultCopy.getDecision(), resultCopy.getStatus());
+        this.addObligations(resultCopy.getObligations());
+        this.addAdvice(resultCopy.getAssociatedAdvice());
+        this.addAttributeCategories(resultCopy.getAttributes());
+        this.addPolicyIdentifiers(resultCopy.getPolicyIdentifiers());
+        this.addPolicySetIdentifiers(resultCopy.getPolicySetIdentifiers());
+    }
 
-        @Override
-        public Collection<Advice> getAssociatedAdvice() {
-                return this.associatedAdvice == EMPTY_ADVICE_LIST ? this.associatedAdvice : Collections.unmodifiableCollection(this.associatedAdvice);
-        }
-        
-        /**
-         * Adds an {@link com.att.research.xacml.api.Advice} to this <code>StdMutableResult</code>.
-         * 
-         * @param advice the <code>Advice</code> to add to this <code>StdMutableResult</code>
-         */
-        public void addAdvice(Advice advice) {
-                if (this.associatedAdvice == EMPTY_ADVICE_LIST) {
-                        this.associatedAdvice	= new ArrayList<Advice>();
-                }
-                this.associatedAdvice.add(advice);
-        }
-        
-        /**
-         * Adds a copy of the {@link com.att.research.xacml.api.Advice} objects in the given <code>Collection</code> to this <code>StdMutableResult</code>>
-         * 
-         * @param adviceIn the <code>Collection</code> of <code>Advice</code> objects to add to this <code>StdMutableResult</code>.
-         */
-        public void addAdvice(Collection<Advice> adviceIn) {
-                if (adviceIn != null && adviceIn.size() > 0) {
-                        if (this.associatedAdvice == EMPTY_ADVICE_LIST) {
-                                this.associatedAdvice	= new ArrayList<Advice>();
-                        }
-                        this.associatedAdvice.addAll(adviceIn);
-                }
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Advice} objects in this <code>StdMutableResult</code> to a copy of the given <code>Collection</code>.
-         * 
-         * @param adviceIn the <code>Collection</code> of <code>Advice</code> objects to set in this <code>StdMutableResult</code>.
-         */
-        public void setAdvice(Collection<Advice> adviceIn) {
-                this.associatedAdvice	= EMPTY_ADVICE_LIST;
-                this.addAdvice(adviceIn);
-        }
+    /**
+     * Creates a new <code>StdMutableResult</code> with the given {@link com.att.research.xacml.api.Decision} and {@link com.att.research.xacml.api.Status}.
+     *
+     * @param decisionIn the <code>Decision</code> for the new <code>StdMutableResult</code>
+     * @param statusIn the <code>Status</code> for the new <code>StdMutableResult</code>
+     */
+    public StdMutableResult(Decision decisionIn, Status statusIn) {
+        this();
+        this.status		= statusIn;
+        this.decision	= decisionIn;
+    }
 
-        @Override
-        public Collection<AttributeCategory> getAttributes() {
-                return this.attributes == EMPTY_ATTRIBUTES ? this.attributes : Collections.unmodifiableCollection(this.attributes);
-        }
-        
-        /**
-         * Adds an {@link com.att.research.xacml.api.Attribute} to this <code>StdMutableResult</code>.
-         * 
-         * @param attribute the <code>Attribute</code> to add to this <code>StdMutableResult</code>.
-         */
-        public void addAttributeCategory(AttributeCategory attribute) {
-                if (this.attributes == EMPTY_ATTRIBUTES) {
-                        this.attributes	= new ArrayList<AttributeCategory>();
-                }
-                this.attributes.add(attribute);
-        }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeCategory}s to this <code>StdMutableResult</code>.
-         * 
-         * @param listAttributeCategories the <code>Collection</code> of <code>AttributeCategory</code>s to add to this <code>StdMutableResult</code>.
-         */
-        public void addAttributeCategories(Collection<AttributeCategory> listAttributeCategories) {
-                if (listAttributeCategories != null && listAttributeCategories.size() > 0) {
-                        if (this.attributes == EMPTY_ATTRIBUTES) {
-                                this.attributes	= new ArrayList<AttributeCategory>();
-                        }
-                        this.attributes.addAll(listAttributeCategories);
-                }
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.AttributeCategory}s in this <code>StdMutableResult</code> to be a copy of the given
-         * <code>Collection</code> or to an empty list if the <code>Collection</code> is null.
-         * 
-         * @param listAttributeCategories the <code>Collection</code> of <code>AttributeCategory</code>s to set in this <code>StdMutableResult</code>
-         */
-        public void setAttributeCategories(Collection<AttributeCategory> listAttributeCategories) {
-                this.attributes	= EMPTY_ATTRIBUTES;
-                this.addAttributeCategories(listAttributeCategories);
-        }
+    /**
+     * Creates a new <code>StdMutableResult</code> with a {@link com.att.research.xacml.api.Decision} of <code>INDETERMINATE</code> and
+     * the given {@link com.att.research.xacml.api.Status}.
+     *
+     * @param statusIn the <code>Status</code> for the new <code>StdMutableResult</code>
+     */
+    public StdMutableResult(Status statusIn) {
+        this(Decision.INDETERMINATE, statusIn);
+    }
 
-        @Override
-        public Collection<IdReference> getPolicyIdentifiers() {
-                return this.policyIdentifiers == EMPTY_REFERENCES ? this.policyIdentifiers : Collections.unmodifiableCollection(this.policyIdentifiers);
-        }
-        
-        /**
-         * Adds an {@link com.att.research.xacml.api.IdReference} as a XACML Policy ID to this <code>StdMutableResult</code>.
-         * 
-         * @param policyIdentifier the <code>Identifier</code> of the Policy to add to this <code>StdMutableResult</code>.
-         */
-        public void addPolicyIdentifier(IdReference policyIdentifier) {
-                if (this.policyIdentifiers == EMPTY_REFERENCES) {
-                        this.policyIdentifiers	= new ArrayList<IdReference>();
-                }
-                this.policyIdentifiers.add(policyIdentifier);
-        }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.IdReference}s representing PolicyIds to this <code>StdMutableResult</code>.
-         * 
-         * @param policyIdentifierList the <code>Collection</code> of <code>IdReference</code> to add
-         */
-        public void addPolicyIdentifiers(Collection<IdReference> policyIdentifierList) {
-                if (policyIdentifierList != null && policyIdentifierList.size() > 0) {
-                        if (this.policyIdentifiers == EMPTY_REFERENCES) {
-                                this.policyIdentifiers	= new ArrayList<IdReference>();
-                        }
-                        this.policyIdentifiers.addAll(policyIdentifierList);
-                }
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.IdReference}s representing PolicyIds in this <code>StdMutableResult</code> to a copy of the given
-         * <code>Collection</code>.
-         * 
-         * @param policyIdentifierList the <code>Collection</code> of <code>IdReference</code>s representing PolicyIds to set in this <code>StdMutableResult</code>
-         */
-        public void setPolicyIdentifiers(Collection<IdReference> policyIdentifierList) {
-                this.policyIdentifiers	= EMPTY_REFERENCES;
-                this.addPolicyIdentifiers(policyIdentifierList);
-        }
+    /**
+     * Creates a new <code>StdMutableResult</code> with the given {@link com.att.research.xacml.api.Decision} and a {@link com.att.research.xacml.api.Status}
+     * of OK.
+     *
+     * @param decisionIn the <code>Decision</code> for the new <code>StdMutableResult</code>
+     */
+    public StdMutableResult(Decision decisionIn) {
+        this(decisionIn, StdStatus.STATUS_OK);
+    }
 
-        @Override
-        public Collection<IdReference> getPolicySetIdentifiers() {
-                return this.policySetIdentifiers == EMPTY_REFERENCES ? this.policySetIdentifiers : Collections.unmodifiableCollection(this.policySetIdentifiers);
-        }
-        
-        /**
-         * Adds an {@link com.att.research.xacml.api.IdReference} as a XACML Policy ID to this <code>StdMutableResult</code>.
-         * 
-         * @param policyIdentifier the <code>Identifier</code> of the Policy to add to this <code>StdMutableResult</code>.
-         */
-        public void addPolicySetIdentifier(IdReference policyIdentifier) {
-                if (this.policySetIdentifiers == EMPTY_REFERENCES) {
-                        this.policySetIdentifiers	= new ArrayList<IdReference>();
-                }
-                this.policySetIdentifiers.add(policyIdentifier);
-        }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.IdReference}s representing PolicySetIds to this <code>StdMutableResult</code>.
-         * 
-         * @param policyIdentifierList the <code>Collection</code> of <code>IdReference</code> to add
-         */
-        public void addPolicySetIdentifiers(Collection<IdReference> policyIdentifierList) {
-                if (policyIdentifierList != null && policyIdentifierList.size() > 0) {
-                        if (this.policySetIdentifiers == EMPTY_REFERENCES) {
-                                this.policySetIdentifiers	= new ArrayList<IdReference>();
-                        }
-                        this.policySetIdentifiers.addAll(policyIdentifierList);
-                }
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.IdReference}s representing PolicySetIds in this <code>StdMutableResult</code> to a copy of the given
-         * <code>Collection</code>.
-         * 
-         * @param policyIdentifierList the <code>Collection</code> of <code>IdReference</code>s representing PolicySetIds to set in this <code>StdMutableResult</code>
-         */
-        public void setPolicySetIdentifiers(Collection<IdReference> policyIdentifierList) {
-                this.policySetIdentifiers	= EMPTY_REFERENCES;
-                this.addPolicySetIdentifiers(policyIdentifierList);
-        }
+    /**
+     * Creates a new <code>StdMutableResult</code> with the given {@link com.att.research.xacml.api.Decision} and the given set of <code>Collection</code>s
+     * with the details of the result.
+     *
+     * @param decisionIn the <code>Decision</code> for the new <code>StdMutableResult</code>
+     * @param obligationsIn a <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s for the new <code>StdMutableResult</code>
+     * @param adviceIn a <code>Collection</code> of {@link com.att.research.xacml.api.Advice} objects for the new <code>StdMutableResult</code>
+     * @param attributesIn a <code>Collection</code> of {@link com.att.research.xacml.api.AttributeCategory} objects for the new <code>StdMutableResult</code>
+     * @param policyIdentifiersIn a <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects for the Policy identifiers
+     * @param policySetIdentifiersIn a <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects for the PolicySet identifiers
+     */
+    public StdMutableResult(Decision decisionIn,
+                            Collection<Obligation> obligationsIn,
+                            Collection<Advice> adviceIn,
+                            Collection<AttributeCategory> attributesIn,
+                            Collection<IdReference> policyIdentifiersIn,
+                            Collection<IdReference> policySetIdentifiersIn) {
+        this(decisionIn);
+        this.setObligations(obligationsIn);
+        this.setAdvice(adviceIn);
+        this.setAttributeCategories(attributesIn);
+        this.setPolicyIdentifiers(policyIdentifiersIn);
+        this.setPolicySetIdentifiers(policySetIdentifiersIn);
+    }
 
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof Result)) {
-                        return false;
-                } else {
-                        Result objResult	= (Result)obj;
-                        return ObjUtil.equalsAllowNull(this.getDecision(), objResult.getDecision()) &&
-                                        ObjUtil.equalsAllowNull(this.getStatus(), objResult.getStatus()) &&
-                                        ListUtil.equalsAllowNulls(this.getObligations(), objResult.getObligations()) &&
-                                        ListUtil.equalsAllowNulls(this.getAssociatedAdvice(), objResult.getAssociatedAdvice()) &&
-                                        ListUtil.equalsAllowNulls(this.getAttributes(), objResult.getAttributes()) &&
-                                        ListUtil.equalsAllowNulls(this.getPolicyIdentifiers(), objResult.getPolicyIdentifiers()) &&
-                                        ListUtil.equalsAllowNulls(this.getPolicySetIdentifiers(), objResult.getPolicySetIdentifiers());
-                }
+    @Override
+    public Decision getDecision() {
+        return this.decision;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Decision} for this <code>StdMutableResult</code>.
+     *
+     * @param decisionIn the <code>Decision</code> for this <code>StdMutableResult</code>.
+     */
+    public void setDecision(Decision decisionIn) {
+        this.decision	= decisionIn;
+    }
+
+    @Override
+    public Status getStatus() {
+        return this.status;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Status} for this <code>StdMutableResult</code>.
+     *
+     * @param statusIn the <code>Status</code> for this <code>StdMutableResult</code>.
+     */
+    public void setStatus(Status statusIn) {
+        this.status	= statusIn;
+    }
+
+    @Override
+    public Collection<Obligation> getObligations() {
+        return this.obligations == EMPTY_OBLIGATION_LIST ? this.obligations : Collections.unmodifiableCollection(this.obligations);
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacml.api.Obligation} to this <code>StdMutableResult</code>.
+     *
+     * @param obligation the <code>Obligation</code> to add to this <code>StdMutableResult</code>.
+     */
+    public void addObligation(Obligation obligation) {
+        if (this.obligations == EMPTY_OBLIGATION_LIST) {
+            this.obligations	= new ArrayList<Obligation>();
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			toDump;
-                if ((toDump = this.getDecision()) != null) {
-                        stringBuilder.append("decision=" + toDump.toString());
-                        needsComma	= true;
-                }
-                if ((toDump = this.getStatus()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("status=");
-                        stringBuilder.append(toDump.toString());
-                        needsComma	= true;
-                }
-                Collection<?> listToDump;
-                if ((listToDump = this.obligations).size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("obligations=");
-                        stringBuilder.append(ListUtil.toString(listToDump));
-                        needsComma	= true;
-                }
-                if ((listToDump = this.associatedAdvice).size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("associatedAdvice=");
-                        stringBuilder.append(ListUtil.toString(listToDump));
-                        needsComma	= true;
-                }
-                if ((listToDump = this.attributes).size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("attributeCategories=");
-                        stringBuilder.append(ListUtil.toString(listToDump));
-                        needsComma	= true;
-                }
-                if ((listToDump = this.policyIdentifiers).size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("policyIdentifiers=");
-                        stringBuilder.append(ListUtil.toString(listToDump));
-                        needsComma	= true;
-                }
-                if ((listToDump = this.policySetIdentifiers).size() > 0) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("policySetIdentifiers=");
-                        stringBuilder.append(ListUtil.toString(listToDump));
-                        needsComma	= true;
-                }
-                stringBuilder.append("}");
-                return stringBuilder.toString();
+        this.obligations.add(obligation);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s to this <code>StdMutableResult</code>.
+     *
+     * @param obligationsIn the <code>Collection</code> of <code>Obligation</code>s to add
+     */
+    public void addObligations(Collection<Obligation> obligationsIn) {
+        if (obligationsIn != null && obligationsIn.size() > 0) {
+            if (this.obligations == EMPTY_OBLIGATION_LIST) {
+                this.obligations	= new ArrayList<Obligation>();
+            }
+            this.obligations.addAll(obligationsIn);
         }
+    }
+
+    /**
+     * Clears any existing {@link com.att.research.xacml.api.Obligation}s from this <code>StdMutableResult</code> and adds
+     * the given <code>Collection</code> of <code>Obligation</code>s.
+     *
+     * @param obligationsIn the <code>Collection</code> of <code>Obligation</code>s to set in this <code>StdMutableResult</code>.
+     */
+    public void setObligations(Collection<Obligation> obligationsIn) {
+        this.obligations	= EMPTY_OBLIGATION_LIST;
+        this.addObligations(obligationsIn);
+    }
+
+    @Override
+    public Collection<Advice> getAssociatedAdvice() {
+        return this.associatedAdvice == EMPTY_ADVICE_LIST ? this.associatedAdvice : Collections.unmodifiableCollection(this.associatedAdvice);
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacml.api.Advice} to this <code>StdMutableResult</code>.
+     *
+     * @param advice the <code>Advice</code> to add to this <code>StdMutableResult</code>
+     */
+    public void addAdvice(Advice advice) {
+        if (this.associatedAdvice == EMPTY_ADVICE_LIST) {
+            this.associatedAdvice	= new ArrayList<Advice>();
+        }
+        this.associatedAdvice.add(advice);
+    }
+
+    /**
+     * Adds a copy of the {@link com.att.research.xacml.api.Advice} objects in the given <code>Collection</code> to this <code>StdMutableResult</code>>
+     *
+     * @param adviceIn the <code>Collection</code> of <code>Advice</code> objects to add to this <code>StdMutableResult</code>.
+     */
+    public void addAdvice(Collection<Advice> adviceIn) {
+        if (adviceIn != null && adviceIn.size() > 0) {
+            if (this.associatedAdvice == EMPTY_ADVICE_LIST) {
+                this.associatedAdvice	= new ArrayList<Advice>();
+            }
+            this.associatedAdvice.addAll(adviceIn);
+        }
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Advice} objects in this <code>StdMutableResult</code> to a copy of the given <code>Collection</code>.
+     *
+     * @param adviceIn the <code>Collection</code> of <code>Advice</code> objects to set in this <code>StdMutableResult</code>.
+     */
+    public void setAdvice(Collection<Advice> adviceIn) {
+        this.associatedAdvice	= EMPTY_ADVICE_LIST;
+        this.addAdvice(adviceIn);
+    }
+
+    @Override
+    public Collection<AttributeCategory> getAttributes() {
+        return this.attributes == EMPTY_ATTRIBUTES ? this.attributes : Collections.unmodifiableCollection(this.attributes);
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacml.api.Attribute} to this <code>StdMutableResult</code>.
+     *
+     * @param attribute the <code>Attribute</code> to add to this <code>StdMutableResult</code>.
+     */
+    public void addAttributeCategory(AttributeCategory attribute) {
+        if (this.attributes == EMPTY_ATTRIBUTES) {
+            this.attributes	= new ArrayList<AttributeCategory>();
+        }
+        this.attributes.add(attribute);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeCategory}s to this <code>StdMutableResult</code>.
+     *
+     * @param listAttributeCategories the <code>Collection</code> of <code>AttributeCategory</code>s to add to this <code>StdMutableResult</code>.
+     */
+    public void addAttributeCategories(Collection<AttributeCategory> listAttributeCategories) {
+        if (listAttributeCategories != null && listAttributeCategories.size() > 0) {
+            if (this.attributes == EMPTY_ATTRIBUTES) {
+                this.attributes	= new ArrayList<AttributeCategory>();
+            }
+            this.attributes.addAll(listAttributeCategories);
+        }
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.AttributeCategory}s in this <code>StdMutableResult</code> to be a copy of the given
+     * <code>Collection</code> or to an empty list if the <code>Collection</code> is null.
+     *
+     * @param listAttributeCategories the <code>Collection</code> of <code>AttributeCategory</code>s to set in this <code>StdMutableResult</code>
+     */
+    public void setAttributeCategories(Collection<AttributeCategory> listAttributeCategories) {
+        this.attributes	= EMPTY_ATTRIBUTES;
+        this.addAttributeCategories(listAttributeCategories);
+    }
+
+    @Override
+    public Collection<IdReference> getPolicyIdentifiers() {
+        return this.policyIdentifiers == EMPTY_REFERENCES ? this.policyIdentifiers : Collections.unmodifiableCollection(this.policyIdentifiers);
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacml.api.IdReference} as a XACML Policy ID to this <code>StdMutableResult</code>.
+     *
+     * @param policyIdentifier the <code>Identifier</code> of the Policy to add to this <code>StdMutableResult</code>.
+     */
+    public void addPolicyIdentifier(IdReference policyIdentifier) {
+        if (this.policyIdentifiers == EMPTY_REFERENCES) {
+            this.policyIdentifiers	= new ArrayList<IdReference>();
+        }
+        this.policyIdentifiers.add(policyIdentifier);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.IdReference}s representing PolicyIds to this <code>StdMutableResult</code>.
+     *
+     * @param policyIdentifierList the <code>Collection</code> of <code>IdReference</code> to add
+     */
+    public void addPolicyIdentifiers(Collection<IdReference> policyIdentifierList) {
+        if (policyIdentifierList != null && policyIdentifierList.size() > 0) {
+            if (this.policyIdentifiers == EMPTY_REFERENCES) {
+                this.policyIdentifiers	= new ArrayList<IdReference>();
+            }
+            this.policyIdentifiers.addAll(policyIdentifierList);
+        }
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.IdReference}s representing PolicyIds in this <code>StdMutableResult</code> to a copy of the given
+     * <code>Collection</code>.
+     *
+     * @param policyIdentifierList the <code>Collection</code> of <code>IdReference</code>s representing PolicyIds to set in this <code>StdMutableResult</code>
+     */
+    public void setPolicyIdentifiers(Collection<IdReference> policyIdentifierList) {
+        this.policyIdentifiers	= EMPTY_REFERENCES;
+        this.addPolicyIdentifiers(policyIdentifierList);
+    }
+
+    @Override
+    public Collection<IdReference> getPolicySetIdentifiers() {
+        return this.policySetIdentifiers == EMPTY_REFERENCES ? this.policySetIdentifiers : Collections.unmodifiableCollection(this.policySetIdentifiers);
+    }
+
+    /**
+     * Adds an {@link com.att.research.xacml.api.IdReference} as a XACML Policy ID to this <code>StdMutableResult</code>.
+     *
+     * @param policyIdentifier the <code>Identifier</code> of the Policy to add to this <code>StdMutableResult</code>.
+     */
+    public void addPolicySetIdentifier(IdReference policyIdentifier) {
+        if (this.policySetIdentifiers == EMPTY_REFERENCES) {
+            this.policySetIdentifiers	= new ArrayList<IdReference>();
+        }
+        this.policySetIdentifiers.add(policyIdentifier);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.IdReference}s representing PolicySetIds to this <code>StdMutableResult</code>.
+     *
+     * @param policyIdentifierList the <code>Collection</code> of <code>IdReference</code> to add
+     */
+    public void addPolicySetIdentifiers(Collection<IdReference> policyIdentifierList) {
+        if (policyIdentifierList != null && policyIdentifierList.size() > 0) {
+            if (this.policySetIdentifiers == EMPTY_REFERENCES) {
+                this.policySetIdentifiers	= new ArrayList<IdReference>();
+            }
+            this.policySetIdentifiers.addAll(policyIdentifierList);
+        }
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.IdReference}s representing PolicySetIds in this <code>StdMutableResult</code> to a copy of the given
+     * <code>Collection</code>.
+     *
+     * @param policyIdentifierList the <code>Collection</code> of <code>IdReference</code>s representing PolicySetIds to set in this <code>StdMutableResult</code>
+     */
+    public void setPolicySetIdentifiers(Collection<IdReference> policyIdentifierList) {
+        this.policySetIdentifiers	= EMPTY_REFERENCES;
+        this.addPolicySetIdentifiers(policyIdentifierList);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof Result)) {
+            return false;
+        } else {
+            Result objResult	= (Result)obj;
+            return ObjUtil.equalsAllowNull(this.getDecision(), objResult.getDecision()) &&
+                   ObjUtil.equalsAllowNull(this.getStatus(), objResult.getStatus()) &&
+                   ListUtil.equalsAllowNulls(this.getObligations(), objResult.getObligations()) &&
+                   ListUtil.equalsAllowNulls(this.getAssociatedAdvice(), objResult.getAssociatedAdvice()) &&
+                   ListUtil.equalsAllowNulls(this.getAttributes(), objResult.getAttributes()) &&
+                   ListUtil.equalsAllowNulls(this.getPolicyIdentifiers(), objResult.getPolicyIdentifiers()) &&
+                   ListUtil.equalsAllowNulls(this.getPolicySetIdentifiers(), objResult.getPolicySetIdentifiers());
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			toDump;
+        if ((toDump = this.getDecision()) != null) {
+            stringBuilder.append("decision=" + toDump.toString());
+            needsComma	= true;
+        }
+        if ((toDump = this.getStatus()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("status=");
+            stringBuilder.append(toDump.toString());
+            needsComma	= true;
+        }
+        Collection<?> listToDump;
+        if ((listToDump = this.obligations).size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("obligations=");
+            stringBuilder.append(ListUtil.toString(listToDump));
+            needsComma	= true;
+        }
+        if ((listToDump = this.associatedAdvice).size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("associatedAdvice=");
+            stringBuilder.append(ListUtil.toString(listToDump));
+            needsComma	= true;
+        }
+        if ((listToDump = this.attributes).size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("attributeCategories=");
+            stringBuilder.append(ListUtil.toString(listToDump));
+            needsComma	= true;
+        }
+        if ((listToDump = this.policyIdentifiers).size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("policyIdentifiers=");
+            stringBuilder.append(ListUtil.toString(listToDump));
+            needsComma	= true;
+        }
+        if ((listToDump = this.policySetIdentifiers).size() > 0) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("policySetIdentifiers=");
+            stringBuilder.append(ListUtil.toString(listToDump));
+            needsComma	= true;
+        }
+        stringBuilder.append("}");
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableStatus.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableStatus.java
index b21fa69..ade1231 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableStatus.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableStatus.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,168 +37,168 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.Status} interface to represent a XACML Status element.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableStatus implements Status {
-        private StatusCode		statusCode;
-        private String			statusMessage;
-        private StatusDetail	statusDetail;
-        
-        /**
-         * Creates a new <code>StdMutableStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, <code>String</code> status message,
-         * and {@link com.att.research.xacml.api.StatusDetail}.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
-         * @param statusMessageIn the <code>String</code> representing the XACML StatusMessage
-         * @param statusDetailIn the <code>StatusDetail</code> representing the XACML StatusDetail
-         */
-        public StdMutableStatus(StatusCode statusCodeIn, String statusMessageIn, StatusDetail statusDetailIn) {
-                this.statusCode		= statusCodeIn;
-                this.statusMessage	= statusMessageIn;
-                this.statusDetail	= statusDetailIn;
-        }
-        
-        /**
-         * Creates a new <code>StdMutableStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, <code>String</code> status message
-         * and no {@link com.att.research.xacml.api.StatusDetail}.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
-         * @param statusMessageIn the <code>String</code> representing the XACML StatusMessage
-         */
-        public StdMutableStatus(StatusCode statusCodeIn, String statusMessageIn) {
-                this(statusCodeIn, statusMessageIn, null);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, a null status message
-         * and no {@link com.att.research.xacml.api.StatusDetail}.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
-         */
-        public StdMutableStatus(StatusCode statusCodeIn) {
-                this(statusCodeIn, null, null);
-        }
-        
-        /**
-         * Creates an empty <code>StdMutableStatus</code>.
-         */
-        public StdMutableStatus() {
-        }
-        
-        /**
-         * Creates a new <code>StdMutableStatus</code> that is a copy of the given {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param status the <code>Status</code> to copy
-         * @return a new <code>StdMutableStatus</code> that is a copy of the given <code>Status</code>.
-         */
-        public static StdMutableStatus copy(Status status) {
-                return new StdMutableStatus(status.getStatusCode(), status.getStatusMessage(), status.getStatusDetail());
-        }
+    private StatusCode		statusCode;
+    private String			statusMessage;
+    private StatusDetail	statusDetail;
 
-        @Override
-        public StatusCode getStatusCode() {
-                return this.statusCode;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.StatusCode} representing the XACML StatusCode for the Status represented by this <code>StdMutableStatus</code>.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode for the Status
-         */
-        public void setStatusCode(StatusCode statusCodeIn) {
-                this.statusCode	= statusCodeIn;
-        }
+    /**
+     * Creates a new <code>StdMutableStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, <code>String</code> status message,
+     * and {@link com.att.research.xacml.api.StatusDetail}.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
+     * @param statusMessageIn the <code>String</code> representing the XACML StatusMessage
+     * @param statusDetailIn the <code>StatusDetail</code> representing the XACML StatusDetail
+     */
+    public StdMutableStatus(StatusCode statusCodeIn, String statusMessageIn, StatusDetail statusDetailIn) {
+        this.statusCode		= statusCodeIn;
+        this.statusMessage	= statusMessageIn;
+        this.statusDetail	= statusDetailIn;
+    }
 
-        @Override
-        public String getStatusMessage() {
-                return this.statusMessage;
-        }
-        
-        /**
-         * Sets the <code>String</code> representing the XACML StatusMessage for the Status represented by this <code>StdMutableStatus</code>.
-         * 
-         * @param message the <code>String</code> representing the XACML StatusMessage for the Status
-         */
-        public void setStatusMessage(String message) {
-                this.statusMessage	= message;
-        }
+    /**
+     * Creates a new <code>StdMutableStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, <code>String</code> status message
+     * and no {@link com.att.research.xacml.api.StatusDetail}.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
+     * @param statusMessageIn the <code>String</code> representing the XACML StatusMessage
+     */
+    public StdMutableStatus(StatusCode statusCodeIn, String statusMessageIn) {
+        this(statusCodeIn, statusMessageIn, null);
+    }
 
-        @Override
-        public StatusDetail getStatusDetail() {
-                return this.statusDetail;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.StatusDetail} representing the XACML StatusDetail for the Status represented by this <code>StdMutableStatus</code>.
-         * 
-         * @param statusDetailIn the <code>StatusDetail</code> representing the XACML StatusDetail for the Status
-         */
-        public void setStatusDetail(StatusDetail statusDetailIn) {
-                this.statusDetail	= statusDetailIn;
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof Status)) {
-                        return false;
-                } else {
-                        Status objStatus	= (Status)obj;
-                        return ObjUtil.equalsAllowNull(this.getStatusCode(), objStatus.getStatusCode()) &&
-                                        ObjUtil.equalsAllowNull(this.getStatusMessage(), objStatus.getStatusMessage()) &&
-                                        ObjUtil.equalsAllowNull(this.getStatusDetail(), objStatus.getStatusDetail());
-                }
-        }
-        
-        @Override
-        public boolean isOk() {
-                StatusCode thisStatusCode	= this.getStatusCode();
-                return (thisStatusCode == null || thisStatusCode.equals(StdStatusCode.STATUS_CODE_OK));
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump;
-                
-                if ((objectToDump = this.getStatusCode()) != null) {
-                        stringBuilder.append("statusCode=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getStatusMessage()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("statusMessage=");
-                        stringBuilder.append((String)objectToDump);
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getStatusDetail()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("statusDetail=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    /**
+     * Creates a new <code>StdMutableStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, a null status message
+     * and no {@link com.att.research.xacml.api.StatusDetail}.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
+     */
+    public StdMutableStatus(StatusCode statusCodeIn) {
+        this(statusCodeIn, null, null);
+    }
 
-        @Override
-        public Status merge(Status status) {
-                if (status == null || !this.getStatusCode().equals(status.getStatusCode()) || status.getStatusDetail() == null) {
-                        return this;
-                } else if (this.getStatusDetail() == null) {
-                        return new StdMutableStatus(this.getStatusCode(), this.getStatusMessage(), status.getStatusDetail());
-                } else {
-                        return new StdMutableStatus(this.getStatusCode(), this.getStatusMessage(), this.getStatusDetail().merge(status.getStatusDetail()));
-                }
+    /**
+     * Creates an empty <code>StdMutableStatus</code>.
+     */
+    public StdMutableStatus() {
+    }
+
+    /**
+     * Creates a new <code>StdMutableStatus</code> that is a copy of the given {@link com.att.research.xacml.api.Status}.
+     *
+     * @param status the <code>Status</code> to copy
+     * @return a new <code>StdMutableStatus</code> that is a copy of the given <code>Status</code>.
+     */
+    public static StdMutableStatus copy(Status status) {
+        return new StdMutableStatus(status.getStatusCode(), status.getStatusMessage(), status.getStatusDetail());
+    }
+
+    @Override
+    public StatusCode getStatusCode() {
+        return this.statusCode;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.StatusCode} representing the XACML StatusCode for the Status represented by this <code>StdMutableStatus</code>.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode for the Status
+     */
+    public void setStatusCode(StatusCode statusCodeIn) {
+        this.statusCode	= statusCodeIn;
+    }
+
+    @Override
+    public String getStatusMessage() {
+        return this.statusMessage;
+    }
+
+    /**
+     * Sets the <code>String</code> representing the XACML StatusMessage for the Status represented by this <code>StdMutableStatus</code>.
+     *
+     * @param message the <code>String</code> representing the XACML StatusMessage for the Status
+     */
+    public void setStatusMessage(String message) {
+        this.statusMessage	= message;
+    }
+
+    @Override
+    public StatusDetail getStatusDetail() {
+        return this.statusDetail;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.StatusDetail} representing the XACML StatusDetail for the Status represented by this <code>StdMutableStatus</code>.
+     *
+     * @param statusDetailIn the <code>StatusDetail</code> representing the XACML StatusDetail for the Status
+     */
+    public void setStatusDetail(StatusDetail statusDetailIn) {
+        this.statusDetail	= statusDetailIn;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof Status)) {
+            return false;
+        } else {
+            Status objStatus	= (Status)obj;
+            return ObjUtil.equalsAllowNull(this.getStatusCode(), objStatus.getStatusCode()) &&
+                   ObjUtil.equalsAllowNull(this.getStatusMessage(), objStatus.getStatusMessage()) &&
+                   ObjUtil.equalsAllowNull(this.getStatusDetail(), objStatus.getStatusDetail());
         }
+    }
+
+    @Override
+    public boolean isOk() {
+        StatusCode thisStatusCode	= this.getStatusCode();
+        return (thisStatusCode == null || thisStatusCode.equals(StdStatusCode.STATUS_CODE_OK));
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump;
+
+        if ((objectToDump = this.getStatusCode()) != null) {
+            stringBuilder.append("statusCode=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        if ((objectToDump = this.getStatusMessage()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("statusMessage=");
+            stringBuilder.append((String)objectToDump);
+            needsComma	= true;
+        }
+        if ((objectToDump = this.getStatusDetail()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("statusDetail=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public Status merge(Status status) {
+        if (status == null || !this.getStatusCode().equals(status.getStatusCode()) || status.getStatusDetail() == null) {
+            return this;
+        } else if (this.getStatusDetail() == null) {
+            return new StdMutableStatus(this.getStatusCode(), this.getStatusMessage(), status.getStatusDetail());
+        } else {
+            return new StdMutableStatus(this.getStatusCode(), this.getStatusMessage(), this.getStatusDetail().merge(status.getStatusDetail()));
+        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableStatusDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableStatusDetail.java
index 4591275..29e5c41 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableStatusDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdMutableStatusDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,134 +41,134 @@
 
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.StatusDetail} interface to implement the XACML StatusDetail element.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdMutableStatusDetail implements StatusDetail {
-        private static final List<MissingAttributeDetail> EMPTY_LIST	= Collections.unmodifiableList(new ArrayList<MissingAttributeDetail>());
-        
-        private List<MissingAttributeDetail>	missingAttributeDetails;
-        
-        /**
-         * Creates a new empty <code>StdMutableStatusDetail</code>.
-         */
-        public StdMutableStatusDetail() {
-                this.missingAttributeDetails	= EMPTY_LIST;
-        }
-        
-        /**
-         * Creates a new <code>StdMutableStatusDetail</code> with a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.MissingAttributeDetail}s.
-         * 
-         * @param missingAttributeDetailsIn the <code>Collection</code> of <code>MissingAttributeDetail</code>s to copy
-         */
-        public StdMutableStatusDetail(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
-                this();
-                this.setMissingAttributeDetails(missingAttributeDetailsIn);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableStatusDetail</code> with the given single {@link com.att.research.xacml.api.MissingAttributeDetail}.
-         * 
-         * @param missingAttributeDetail the <code>MissingAttributeDetail</code> for the new <code>StdMutableStatusDetail</code>.
-         */
-        public StdMutableStatusDetail(MissingAttributeDetail missingAttributeDetail) {
-                this();
-                this.addMissingAttributeDetail(missingAttributeDetail);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableStatusDetail</code> that is a copy of the given {@link com.att.research.xacml.api.StatusDetail}.
-         * 
-         * @param statusDetail the <code>StatusDetail</code> to copy
-         * @return a new <code>StdMutableStatusDetail</code> that is a copy of the given <code>StatusDetail</code>.
-         */
-        public static StdMutableStatusDetail copy(StatusDetail statusDetail) {
-                return new StdMutableStatusDetail(statusDetail.getMissingAttributeDetails());
-        }
-        
-        @Override
-        public Collection<MissingAttributeDetail> getMissingAttributeDetails() {
-                return this.missingAttributeDetails == EMPTY_LIST ? this.missingAttributeDetails : Collections.unmodifiableCollection(this.missingAttributeDetails);
-        }
-        
-        /**
-         * Adds a {@link com.att.research.xacml.api.MissingAttributeDetail} to this <code>StdMutableStatusDetail</code>.
-         * 
-         * @param missingAttributeDetail the <code>MissingAttributeDetail</code> to add to this <code>StdMutableStatusDetail</code>.
-         */
-        public void addMissingAttributeDetail(MissingAttributeDetail missingAttributeDetail) {
-                if (this.missingAttributeDetails == EMPTY_LIST) {
-                        this.missingAttributeDetails	= new ArrayList<MissingAttributeDetail>();
-                }
-                this.missingAttributeDetails.add(missingAttributeDetail);
-        }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.MissingAttributeDetail}s to this <code>StdMutableStatusDetail</code>.
-         * 
-         * @param missingAttributeDetailsIn the <code>Collection</code> of <code>MissingAttributeDetail</code>s to add to this <code>StdMutableStatusDetail</code>.
-         */
-        public void addMissingAttributeDetails(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
-                if (missingAttributeDetailsIn != null && missingAttributeDetailsIn.size() > 0) {
-                        if (this.missingAttributeDetails == EMPTY_LIST) {
-                                this.missingAttributeDetails	= new ArrayList<MissingAttributeDetail>();
-                        }
-                        this.missingAttributeDetails.addAll(missingAttributeDetailsIn);
-                }
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.MissingAttributeDetail}s for this <code>StdMutableStatusDetail</code> to a copy of the given
-         * <code>Collection</code>.
-         * 
-         * @param missingAttributeDetailsIn the <code>Collection</code> of <code>MissingAttributeDetail</code>s to set in this <code>StdMutableStatusDetail</code>.
-         */
-        public void setMissingAttributeDetails(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
-                this.missingAttributeDetails	= EMPTY_LIST;
-                this.addMissingAttributeDetails(missingAttributeDetailsIn);
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof StatusDetail)) {
-                        return false;
-                } else {
-                        StatusDetail objStatusDetail	= (StatusDetail)obj;
-                        return ListUtil.equalsAllowNulls(this.getMissingAttributeDetails(), objStatusDetail.getMissingAttributeDetails());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                
-                Collection<MissingAttributeDetail>	listMissingAttributeDetail	= this.getMissingAttributeDetails();
-                if (listMissingAttributeDetail.size() > 0) {
-                        stringBuilder.append("missingAttributeDetails=[");
-                        stringBuilder.append(ListUtil.toString(listMissingAttributeDetail));
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    private static final List<MissingAttributeDetail> EMPTY_LIST	= Collections.unmodifiableList(new ArrayList<MissingAttributeDetail>());
 
-        @Override
-        public StatusDetail merge(StatusDetail statusDetail) {
-                if (statusDetail == null) {
-                        return this;
-                }
-                Collection<MissingAttributeDetail> listMissingAttributeDetails	= statusDetail.getMissingAttributeDetails();
-                if (listMissingAttributeDetails.size() == 0) {
-                        return this;
-                }
-                if (this.getMissingAttributeDetails().size() == 0) {
-                        return statusDetail;
-                }
-                StdMutableStatusDetail stdStatusDetail	= StdMutableStatusDetail.copy(this);
-                stdStatusDetail.addMissingAttributeDetails(listMissingAttributeDetails);
-                return stdStatusDetail;
+    private List<MissingAttributeDetail>	missingAttributeDetails;
+
+    /**
+     * Creates a new empty <code>StdMutableStatusDetail</code>.
+     */
+    public StdMutableStatusDetail() {
+        this.missingAttributeDetails	= EMPTY_LIST;
+    }
+
+    /**
+     * Creates a new <code>StdMutableStatusDetail</code> with a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.MissingAttributeDetail}s.
+     *
+     * @param missingAttributeDetailsIn the <code>Collection</code> of <code>MissingAttributeDetail</code>s to copy
+     */
+    public StdMutableStatusDetail(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
+        this();
+        this.setMissingAttributeDetails(missingAttributeDetailsIn);
+    }
+
+    /**
+     * Creates a new <code>StdMutableStatusDetail</code> with the given single {@link com.att.research.xacml.api.MissingAttributeDetail}.
+     *
+     * @param missingAttributeDetail the <code>MissingAttributeDetail</code> for the new <code>StdMutableStatusDetail</code>.
+     */
+    public StdMutableStatusDetail(MissingAttributeDetail missingAttributeDetail) {
+        this();
+        this.addMissingAttributeDetail(missingAttributeDetail);
+    }
+
+    /**
+     * Creates a new <code>StdMutableStatusDetail</code> that is a copy of the given {@link com.att.research.xacml.api.StatusDetail}.
+     *
+     * @param statusDetail the <code>StatusDetail</code> to copy
+     * @return a new <code>StdMutableStatusDetail</code> that is a copy of the given <code>StatusDetail</code>.
+     */
+    public static StdMutableStatusDetail copy(StatusDetail statusDetail) {
+        return new StdMutableStatusDetail(statusDetail.getMissingAttributeDetails());
+    }
+
+    @Override
+    public Collection<MissingAttributeDetail> getMissingAttributeDetails() {
+        return this.missingAttributeDetails == EMPTY_LIST ? this.missingAttributeDetails : Collections.unmodifiableCollection(this.missingAttributeDetails);
+    }
+
+    /**
+     * Adds a {@link com.att.research.xacml.api.MissingAttributeDetail} to this <code>StdMutableStatusDetail</code>.
+     *
+     * @param missingAttributeDetail the <code>MissingAttributeDetail</code> to add to this <code>StdMutableStatusDetail</code>.
+     */
+    public void addMissingAttributeDetail(MissingAttributeDetail missingAttributeDetail) {
+        if (this.missingAttributeDetails == EMPTY_LIST) {
+            this.missingAttributeDetails	= new ArrayList<MissingAttributeDetail>();
         }
+        this.missingAttributeDetails.add(missingAttributeDetail);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.MissingAttributeDetail}s to this <code>StdMutableStatusDetail</code>.
+     *
+     * @param missingAttributeDetailsIn the <code>Collection</code> of <code>MissingAttributeDetail</code>s to add to this <code>StdMutableStatusDetail</code>.
+     */
+    public void addMissingAttributeDetails(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
+        if (missingAttributeDetailsIn != null && missingAttributeDetailsIn.size() > 0) {
+            if (this.missingAttributeDetails == EMPTY_LIST) {
+                this.missingAttributeDetails	= new ArrayList<MissingAttributeDetail>();
+            }
+            this.missingAttributeDetails.addAll(missingAttributeDetailsIn);
+        }
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.MissingAttributeDetail}s for this <code>StdMutableStatusDetail</code> to a copy of the given
+     * <code>Collection</code>.
+     *
+     * @param missingAttributeDetailsIn the <code>Collection</code> of <code>MissingAttributeDetail</code>s to set in this <code>StdMutableStatusDetail</code>.
+     */
+    public void setMissingAttributeDetails(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
+        this.missingAttributeDetails	= EMPTY_LIST;
+        this.addMissingAttributeDetails(missingAttributeDetailsIn);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof StatusDetail)) {
+            return false;
+        } else {
+            StatusDetail objStatusDetail	= (StatusDetail)obj;
+            return ListUtil.equalsAllowNulls(this.getMissingAttributeDetails(), objStatusDetail.getMissingAttributeDetails());
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+
+        Collection<MissingAttributeDetail>	listMissingAttributeDetail	= this.getMissingAttributeDetails();
+        if (listMissingAttributeDetail.size() > 0) {
+            stringBuilder.append("missingAttributeDetails=[");
+            stringBuilder.append(ListUtil.toString(listMissingAttributeDetail));
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public StatusDetail merge(StatusDetail statusDetail) {
+        if (statusDetail == null) {
+            return this;
+        }
+        Collection<MissingAttributeDetail> listMissingAttributeDetails	= statusDetail.getMissingAttributeDetails();
+        if (listMissingAttributeDetails.size() == 0) {
+            return this;
+        }
+        if (this.getMissingAttributeDetails().size() == 0) {
+            return statusDetail;
+        }
+        StdMutableStatusDetail stdStatusDetail	= StdMutableStatusDetail.copy(this);
+        stdStatusDetail.addMissingAttributeDetails(listMissingAttributeDetails);
+        return stdStatusDetail;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdObligation.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdObligation.java
index 307a5f3..44e4ac0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdObligation.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdObligation.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,61 +39,61 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.Obligation} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdObligation extends Wrapper<Obligation> implements Obligation {
-        /**
-         * Creates a new immutable <code>StdObligation</code> that wraps the given {@link com.att.research.xacml.api.Obligation}.
-         * The caller agrees not o modify the given <code>Obligation</code> as long as the new <code>StdObligation,</code> refers to it.
-         * 
-         * @param obligation the <code>Obligation</code> to wrap in the new <code>StdObligation</code>.
-         */
-        public StdObligation(Obligation obligation) {
-                super(obligation);
-        }
-        
-        /**
-         * Creates a new immutable <code>StdObligation</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML
-         * ObligationId of the Obligation represented by the new <code>StdObligation</code>.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML ObligationId of the Obligation
-         */
-        public StdObligation(Identifier identifier) {
-                this(new StdMutableObligation(identifier));
-        }
-        
-        /**
-         * Creates a new immutable <code>StdObligation</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML
-         * ObligationId and a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s representing the
-         * AttributeAssignment elements of the Obligation represented by the new <code>StdObligation</code>.
-         * 
-         * @param identifier the <code>Identifier</code> representing the XACML ObligationId of the Obligation
-         * @param attributeAssignments <code>Collection</code> of <code>AttributeAssignment</code>s representing the XACML AttributeAssignments of the Obligation.
-         */
-        public StdObligation(Identifier identifier, Collection<AttributeAssignment> attributeAssignments) {
-                this(new StdMutableObligation(identifier, attributeAssignments));
-        }
-        
-        /**
-         * Creates a new <code>StdObligation</code> as a copy of the given {@link com.att.research.xacml.api.Obligation}.
-         * 
-         * @param obligation the <code>Obligation</code> to copy
-         * @return a new <code>StdObligation</code> copied from the given <code>Obligation</code>.
-         */
-        public static StdObligation copy(Obligation obligation) {
-                return new StdObligation(obligation.getId(), obligation.getAttributeAssignments());
-        }
+    /**
+     * Creates a new immutable <code>StdObligation</code> that wraps the given {@link com.att.research.xacml.api.Obligation}.
+     * The caller agrees not o modify the given <code>Obligation</code> as long as the new <code>StdObligation,</code> refers to it.
+     *
+     * @param obligation the <code>Obligation</code> to wrap in the new <code>StdObligation</code>.
+     */
+    public StdObligation(Obligation obligation) {
+        super(obligation);
+    }
 
-        @Override
-        public Identifier getId() {
-                return this.getWrappedObject().getId();
-        }
+    /**
+     * Creates a new immutable <code>StdObligation</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML
+     * ObligationId of the Obligation represented by the new <code>StdObligation</code>.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML ObligationId of the Obligation
+     */
+    public StdObligation(Identifier identifier) {
+        this(new StdMutableObligation(identifier));
+    }
 
-        @Override
-        public Collection<AttributeAssignment> getAttributeAssignments() {
-                return this.getWrappedObject().getAttributeAssignments();
-        }
+    /**
+     * Creates a new immutable <code>StdObligation</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML
+     * ObligationId and a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.AttributeAssignment}s representing the
+     * AttributeAssignment elements of the Obligation represented by the new <code>StdObligation</code>.
+     *
+     * @param identifier the <code>Identifier</code> representing the XACML ObligationId of the Obligation
+     * @param attributeAssignments <code>Collection</code> of <code>AttributeAssignment</code>s representing the XACML AttributeAssignments of the Obligation.
+     */
+    public StdObligation(Identifier identifier, Collection<AttributeAssignment> attributeAssignments) {
+        this(new StdMutableObligation(identifier, attributeAssignments));
+    }
+
+    /**
+     * Creates a new <code>StdObligation</code> as a copy of the given {@link com.att.research.xacml.api.Obligation}.
+     *
+     * @param obligation the <code>Obligation</code> to copy
+     * @return a new <code>StdObligation</code> copied from the given <code>Obligation</code>.
+     */
+    public static StdObligation copy(Obligation obligation) {
+        return new StdObligation(obligation.getId(), obligation.getAttributeAssignments());
+    }
+
+    @Override
+    public Identifier getId() {
+        return this.getWrappedObject().getId();
+    }
+
+    @Override
+    public Collection<AttributeAssignment> getAttributeAssignments() {
+        return this.getWrappedObject().getAttributeAssignments();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequest.java
index ae549a2..86f7e21 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,108 +44,108 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.Request} interface.
- * 
+ *
  * @author car
  * @version $Revison$
  */
 public class StdRequest extends Wrapper<Request> implements Request {
-        /**
-         * Creates a new <code>StdRequest</code> that is a copy of the given {@link com.att.research.xacml.api.Request}.
-         * 
-         * @param request the <code>Request</code> to copy
-         */
-        public StdRequest(Request request) {
-                super(request);
-        }
-        
-        /**
-         * Creates a new <code>StdMutableRequest</code> with the given parameters.
-         * 
-         * @param statusIn the {@link com.att.research.xacml.api.Status} of the <code>StdMutableRequest</code> representing its validity
-         * @param requestDefaultsIn the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults
-         * @param returnPolicyIdListIn a boolean indicating whether XACML PolicyId and PolicySetIds should be returned with the Results
-         * @param combinedDecisionIn a boolean indicating whether multiple Decision Request Results should be combined into a single Result
-         * @param listRequestAttributes a <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} defining the parameters of the Request
-         * @param listRequestReferences a <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s for multiple decision requests
-         */
-        public StdRequest(Status statusIn, 
-                                          RequestDefaults requestDefaultsIn, 
-                                          boolean returnPolicyIdListIn, 
-                                          boolean combinedDecisionIn, 
-                                          Collection<RequestAttributes> listRequestAttributes, 
-                                          Collection<RequestReference> listRequestReferences) {
-                this(new StdMutableRequest(statusIn, requestDefaultsIn, returnPolicyIdListIn, combinedDecisionIn, listRequestAttributes, listRequestReferences));
-        }
-        
-        /**
-         * Creates a new <code>StdMutableRequest</code> with the given parameters and a default {@link com.att.research.xacmo.api.Status} of OK.
-         * 
-         * @param requestDefaultsIn the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults
-         * @param returnPolicyIdListIn a boolean indicating whether XACML PolicyId and PolicySetIds should be returned with the Results
-         * @param combinedDecisionIn a boolean indicating whether multiple Decision Request Results should be combined into a single Result
-         * @param listRequestAttributes a <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} defining the parameters of the Request
-         * @param listRequestReferences a <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s for multiple decision requests
-         */
-        public StdRequest(RequestDefaults requestDefaultsIn, 
-                                          boolean returnPolicyIdListIn, 
-                                          boolean combinedDecisionIn, 
-                                          Collection<RequestAttributes> listRequestAttributes, 
-                                          Collection<RequestReference> listRequestReferences) {
-                this(new StdMutableRequest(requestDefaultsIn, returnPolicyIdListIn, combinedDecisionIn, listRequestAttributes, listRequestReferences));
-        }
-        
-        /**
-         * Creates a new <code>StdRequest</code> with the given {@link com.att.research.xacml.api.Status} and defaults for all other attributes.
-         * 
-         * @param statusIn the <code>Status</code> for the new <code>StdRequest</code>.
-         */
-        public StdRequest(Status statusIn) {
-                this(new StdMutableRequest(statusIn));
-        }
-        
-        @Override
-        public RequestDefaults getRequestDefaults() {
-                return this.getWrappedObject().getRequestDefaults();
-        }
+    /**
+     * Creates a new <code>StdRequest</code> that is a copy of the given {@link com.att.research.xacml.api.Request}.
+     *
+     * @param request the <code>Request</code> to copy
+     */
+    public StdRequest(Request request) {
+        super(request);
+    }
 
-        @Override
-        public boolean getReturnPolicyIdList() {
-                return this.getWrappedObject().getReturnPolicyIdList();
-        }
+    /**
+     * Creates a new <code>StdMutableRequest</code> with the given parameters.
+     *
+     * @param statusIn the {@link com.att.research.xacml.api.Status} of the <code>StdMutableRequest</code> representing its validity
+     * @param requestDefaultsIn the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults
+     * @param returnPolicyIdListIn a boolean indicating whether XACML PolicyId and PolicySetIds should be returned with the Results
+     * @param combinedDecisionIn a boolean indicating whether multiple Decision Request Results should be combined into a single Result
+     * @param listRequestAttributes a <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} defining the parameters of the Request
+     * @param listRequestReferences a <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s for multiple decision requests
+     */
+    public StdRequest(Status statusIn,
+                      RequestDefaults requestDefaultsIn,
+                      boolean returnPolicyIdListIn,
+                      boolean combinedDecisionIn,
+                      Collection<RequestAttributes> listRequestAttributes,
+                      Collection<RequestReference> listRequestReferences) {
+        this(new StdMutableRequest(statusIn, requestDefaultsIn, returnPolicyIdListIn, combinedDecisionIn, listRequestAttributes, listRequestReferences));
+    }
 
-        @Override
-        public boolean getCombinedDecision() {
-                return this.getWrappedObject().getCombinedDecision();
-        }
+    /**
+     * Creates a new <code>StdMutableRequest</code> with the given parameters and a default {@link com.att.research.xacmo.api.Status} of OK.
+     *
+     * @param requestDefaultsIn the {@link com.att.research.xacml.api.RequestDefaults} representing the XACML RequestDefaults
+     * @param returnPolicyIdListIn a boolean indicating whether XACML PolicyId and PolicySetIds should be returned with the Results
+     * @param combinedDecisionIn a boolean indicating whether multiple Decision Request Results should be combined into a single Result
+     * @param listRequestAttributes a <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributes} defining the parameters of the Request
+     * @param listRequestReferences a <code>Collection</code> of {@link com.att.research.xacml.api.RequestReference}s for multiple decision requests
+     */
+    public StdRequest(RequestDefaults requestDefaultsIn,
+                      boolean returnPolicyIdListIn,
+                      boolean combinedDecisionIn,
+                      Collection<RequestAttributes> listRequestAttributes,
+                      Collection<RequestReference> listRequestReferences) {
+        this(new StdMutableRequest(requestDefaultsIn, returnPolicyIdListIn, combinedDecisionIn, listRequestAttributes, listRequestReferences));
+    }
 
-        @Override
-        public Collection<RequestAttributes> getRequestAttributes() {
-                return this.getWrappedObject().getRequestAttributes();
-        }
-        
-        @Override
-        public Collection<AttributeCategory> getRequestAttributesIncludedInResult() {
-                return this.getWrappedObject().getRequestAttributesIncludedInResult();
-        }
+    /**
+     * Creates a new <code>StdRequest</code> with the given {@link com.att.research.xacml.api.Status} and defaults for all other attributes.
+     *
+     * @param statusIn the <code>Status</code> for the new <code>StdRequest</code>.
+     */
+    public StdRequest(Status statusIn) {
+        this(new StdMutableRequest(statusIn));
+    }
 
-        @Override
-        public Iterator<RequestAttributes> getRequestAttributes(Identifier category) {
-                return this.getWrappedObject().getRequestAttributes(category);
-        }
+    @Override
+    public RequestDefaults getRequestDefaults() {
+        return this.getWrappedObject().getRequestDefaults();
+    }
 
-        @Override
-        public RequestAttributes getRequestAttributesByXmlId(String xmlId) {
-                return this.getWrappedObject().getRequestAttributesByXmlId(xmlId);
-        }
+    @Override
+    public boolean getReturnPolicyIdList() {
+        return this.getWrappedObject().getReturnPolicyIdList();
+    }
 
-        @Override
-        public Collection<RequestReference> getMultiRequests() {
-                return this.getWrappedObject().getMultiRequests();
-        }
+    @Override
+    public boolean getCombinedDecision() {
+        return this.getWrappedObject().getCombinedDecision();
+    }
 
-        @Override
-        public Status getStatus() {
-                return this.getWrappedObject().getStatus();
-        }
+    @Override
+    public Collection<RequestAttributes> getRequestAttributes() {
+        return this.getWrappedObject().getRequestAttributes();
+    }
+
+    @Override
+    public Collection<AttributeCategory> getRequestAttributesIncludedInResult() {
+        return this.getWrappedObject().getRequestAttributesIncludedInResult();
+    }
+
+    @Override
+    public Iterator<RequestAttributes> getRequestAttributes(Identifier category) {
+        return this.getWrappedObject().getRequestAttributes(category);
+    }
+
+    @Override
+    public RequestAttributes getRequestAttributesByXmlId(String xmlId) {
+        return this.getWrappedObject().getRequestAttributesByXmlId(xmlId);
+    }
+
+    @Override
+    public Collection<RequestReference> getMultiRequests() {
+        return this.getWrappedObject().getMultiRequests();
+    }
+
+    @Override
+    public Status getStatus() {
+        return this.getWrappedObject().getStatus();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestAttributes.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestAttributes.java
index 68007b4..8b00b53 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestAttributes.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestAttributes.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,128 +48,128 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.RequestAttributes} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdRequestAttributes extends StdAttributeCategory implements RequestAttributes {
-        private Log logger	= LogFactory.getLog(this.getClass());
-        
-        private Node contentRoot;
-        private String xmlId;
+    private Log logger	= LogFactory.getLog(this.getClass());
 
-        /**
-         * Creates a new <code>StdRequestAttributes</code> with the given {@link com.att.research.xacml.api.Identifier} representing its XACML Category,
-         * the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s, the given {@link org.w3c.dom.Node} representing the XACML Content element
-         * and the given <code>String</code> as the optional xml:Id.
-         * 
-         * @param identifierCategory the <code>Identifier</code> representing the XACML Category for the new <code>StdRequestAttributes</code>
-         * @param listAttributes the <code>Collection</code> of <code>Attribute</code>s included in the new <code>StdRequestAttributes</code>
-         * @param nodeContentRoot the <code>Node</code> representing the XACML Content element for the new <code>StdRequestAttributes</code>
-         * @param xmlIdIn the <code>String</code> representing the xml:Id of the XACML Attributes element represented by this <code>StdRequestAttributes</code>
-         */
-        public StdRequestAttributes(Identifier identifierCategory, Collection<Attribute> listAttributes, Node nodeContentRoot, String xmlIdIn) {
-                super(identifierCategory, listAttributes);
-                this.contentRoot	= nodeContentRoot;
-                this.xmlId			= xmlIdIn;
+    private Node contentRoot;
+    private String xmlId;
+
+    /**
+     * Creates a new <code>StdRequestAttributes</code> with the given {@link com.att.research.xacml.api.Identifier} representing its XACML Category,
+     * the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s, the given {@link org.w3c.dom.Node} representing the XACML Content element
+     * and the given <code>String</code> as the optional xml:Id.
+     *
+     * @param identifierCategory the <code>Identifier</code> representing the XACML Category for the new <code>StdRequestAttributes</code>
+     * @param listAttributes the <code>Collection</code> of <code>Attribute</code>s included in the new <code>StdRequestAttributes</code>
+     * @param nodeContentRoot the <code>Node</code> representing the XACML Content element for the new <code>StdRequestAttributes</code>
+     * @param xmlIdIn the <code>String</code> representing the xml:Id of the XACML Attributes element represented by this <code>StdRequestAttributes</code>
+     */
+    public StdRequestAttributes(Identifier identifierCategory, Collection<Attribute> listAttributes, Node nodeContentRoot, String xmlIdIn) {
+        super(identifierCategory, listAttributes);
+        this.contentRoot	= nodeContentRoot;
+        this.xmlId			= xmlIdIn;
+    }
+
+    /**
+     * Creates a new <code>StdRequestAttributes</code> by copying the given {@link com.att.research.xacml.api.RequestAttributes}.
+     *
+     * @param requestAttributes the <code>RequestAttributes</code> to copy
+     */
+    public StdRequestAttributes(RequestAttributes requestAttributes) {
+        super(requestAttributes);
+        this.contentRoot	= requestAttributes.getContentRoot();
+        this.xmlId			= requestAttributes.getXmlId();
+    }
+
+    @Override
+    public String getXmlId() {
+        return this.xmlId;
+    }
+
+    @Override
+    public Node getContentRoot() {
+        return this.contentRoot;
+    }
+
+    @Override
+    public Node getContentNodeByXpathExpression(XPathExpression xpathExpression) {
+        if (xpathExpression == null) {
+            throw new NullPointerException("Null XPathExpression");
+        }
+        Node	nodeRootThis	= this.getContentRoot();
+        if (nodeRootThis == null) {
+            return null;
+        }
+        Node	matchingNode	= null;
+        try {
+            matchingNode	= (Node)xpathExpression.evaluate(nodeRootThis, XPathConstants.NODE);
+        } catch (XPathExpressionException ex) {
+            this.logger.warn("Failed to retrieve node for \"" + xpathExpression.toString() + "\"", ex);
+        }
+        return matchingNode;
+    }
+
+    @Override
+    public NodeList getContentNodeListByXpathExpression(XPathExpression xpathExpression) {
+        if (xpathExpression == null) {
+            throw new NullPointerException("Null XPathExpression");
+        }
+        Node	nodeRootThis	= this.getContentRoot();
+        if (nodeRootThis == null) {
+            return null;
+        }
+        NodeList	matchingNodeList	= null;
+        try {
+            matchingNodeList	= (NodeList)xpathExpression.evaluate(nodeRootThis, XPathConstants.NODESET);
+        } catch (XPathExpressionException ex) {
+            this.logger.warn("Failed to retrieve nodelist for \"" + xpathExpression.toString() + "\"", ex);
+        }
+        return matchingNodeList;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof RequestAttributes)) {
+            return false;
+        } else {
+            RequestAttributes objRequestAttributes	= (RequestAttributes)obj;
+            // Content nodes need to be handled specially because content.equals(content) does not work unless they are the same object, and
+            // content.isEqualNode(content) only works if the nodes have identical newlines and spaces, which is not what we care about.
+            if (ObjUtil.xmlEqualsAllowNull(this.getContentRoot(), objRequestAttributes.getContentRoot()) == false) {
+                return false;
+            }
+
+            return super.equals(objRequestAttributes) &&
+                   ObjUtil.equalsAllowNull(this.getXmlId(), objRequestAttributes.getXmlId());
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        stringBuilder.append("super=");
+        stringBuilder.append(super.toString());
+
+        Object objectToDump;
+        if ((objectToDump = this.getContentRoot()) != null) {
+            stringBuilder.append(',');
+            stringBuilder.append("contentRoot=");
+            stringBuilder.append(objectToDump.toString());
+        }
+        if ((objectToDump = this.getXmlId()) != null) {
+            stringBuilder.append(',');
+            stringBuilder.append("xmlId=");
+            stringBuilder.append((String)objectToDump);
         }
 
-        /**
-         * Creates a new <code>StdRequestAttributes</code> by copying the given {@link com.att.research.xacml.api.RequestAttributes}.
-         * 
-         * @param requestAttributes the <code>RequestAttributes</code> to copy
-         */
-        public StdRequestAttributes(RequestAttributes requestAttributes) {
-                super(requestAttributes);
-                this.contentRoot	= requestAttributes.getContentRoot();
-                this.xmlId			= requestAttributes.getXmlId();
-        }
-
-        @Override
-        public String getXmlId() {
-                return this.xmlId;
-        }
-
-        @Override
-        public Node getContentRoot() {
-                return this.contentRoot;
-        }
-        
-        @Override
-        public Node getContentNodeByXpathExpression(XPathExpression xpathExpression) {
-                if (xpathExpression == null) {
-                        throw new NullPointerException("Null XPathExpression");
-                }
-                Node	nodeRootThis	= this.getContentRoot();
-                if (nodeRootThis == null) {
-                        return null;
-                }
-                Node	matchingNode	= null;
-                try {
-                        matchingNode	= (Node)xpathExpression.evaluate(nodeRootThis, XPathConstants.NODE);
-                } catch (XPathExpressionException ex) {
-                        this.logger.warn("Failed to retrieve node for \"" + xpathExpression.toString() + "\"", ex);
-                }
-                return matchingNode;
-        }
-        
-        @Override
-        public NodeList getContentNodeListByXpathExpression(XPathExpression xpathExpression) {
-                if (xpathExpression == null) {
-                        throw new NullPointerException("Null XPathExpression");
-                }
-                Node	nodeRootThis	= this.getContentRoot();
-                if (nodeRootThis == null) {
-                        return null;
-                }
-                NodeList	matchingNodeList	= null;
-                try {
-                        matchingNodeList	= (NodeList)xpathExpression.evaluate(nodeRootThis, XPathConstants.NODESET);
-                } catch (XPathExpressionException ex) {
-                        this.logger.warn("Failed to retrieve nodelist for \"" + xpathExpression.toString() + "\"", ex);
-                }
-                return matchingNodeList;
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof RequestAttributes)) {
-                        return false;
-                } else {
-                        RequestAttributes objRequestAttributes	= (RequestAttributes)obj;
-                        // Content nodes need to be handled specially because content.equals(content) does not work unless they are the same object, and
-                        // content.isEqualNode(content) only works if the nodes have identical newlines and spaces, which is not what we care about.
-                        if (ObjUtil.xmlEqualsAllowNull(this.getContentRoot(), objRequestAttributes.getContentRoot()) == false) {
-                                return false;
-                        }
-
-                        return super.equals(objRequestAttributes) &&
-                                        ObjUtil.equalsAllowNull(this.getXmlId(), objRequestAttributes.getXmlId());
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                stringBuilder.append("super=");
-                stringBuilder.append(super.toString());
-                
-                Object objectToDump;
-                if ((objectToDump = this.getContentRoot()) != null) {
-                        stringBuilder.append(',');
-                        stringBuilder.append("contentRoot=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                if ((objectToDump = this.getXmlId()) != null) {
-                        stringBuilder.append(',');
-                        stringBuilder.append("xmlId=");
-                        stringBuilder.append((String)objectToDump);
-                }
-
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestAttributesReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestAttributesReference.java
index 1256db2..c0da1b6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestAttributesReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestAttributesReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,49 +35,49 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.RequestAttributesReference} interface.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdRequestAttributesReference implements RequestAttributesReference {
-        private String	referenceId;
+    private String	referenceId;
 
-        /**
-         * Creates a new <code>StdRequestAttributesReference</code> with the given <code>String</code> representing the xml:Id.
-         * 
-         * @param referenceIdIn the <code>String</code> representing the xml:Id of the XACML AttributesReference represented by the new <code>StdRequestAttributesReference</code>.
-         */
-        public StdRequestAttributesReference(String referenceIdIn) {
-                this.referenceId	= referenceIdIn;
-        }
+    /**
+     * Creates a new <code>StdRequestAttributesReference</code> with the given <code>String</code> representing the xml:Id.
+     *
+     * @param referenceIdIn the <code>String</code> representing the xml:Id of the XACML AttributesReference represented by the new <code>StdRequestAttributesReference</code>.
+     */
+    public StdRequestAttributesReference(String referenceIdIn) {
+        this.referenceId	= referenceIdIn;
+    }
 
-        @Override
-        public String getReferenceId() {
-                return this.referenceId;
+    @Override
+    public String getReferenceId() {
+        return this.referenceId;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof RequestAttributesReference)) {
+            return false;
+        } else {
+            RequestAttributesReference objRequestAttributesReference	= (RequestAttributesReference)obj;
+            return ObjUtil.equalsAllowNull(this.getReferenceId(), objRequestAttributesReference.getReferenceId());
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof RequestAttributesReference)) {
-                        return false;
-                } else {
-                        RequestAttributesReference objRequestAttributesReference	= (RequestAttributesReference)obj;
-                        return ObjUtil.equalsAllowNull(this.getReferenceId(), objRequestAttributesReference.getReferenceId());
-                }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        Object			objectToDump	= this.getReferenceId();
+        if (objectToDump != null) {
+            stringBuilder.append("referenceId=");
+            stringBuilder.append((String)objectToDump);
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                Object			objectToDump	= this.getReferenceId();
-                if (objectToDump != null) {
-                        stringBuilder.append("referenceId=");
-                        stringBuilder.append((String)objectToDump);
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestDefaults.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestDefaults.java
index 709d714..407a355 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestDefaults.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestDefaults.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,55 +38,55 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.RequestDefaults} interface for the XACML RequestDefaults element.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
 public class StdRequestDefaults implements RequestDefaults {
-        private URI xpathVersion;
+    private URI xpathVersion;
 
-        public StdRequestDefaults(URI xpathVersionIn) {
-                this();
-                if (xpathVersionIn != null) {
-                        this.xpathVersion	= xpathVersionIn;
-                }
+    public StdRequestDefaults(URI xpathVersionIn) {
+        this();
+        if (xpathVersionIn != null) {
+            this.xpathVersion	= xpathVersionIn;
         }
-        
-        public StdRequestDefaults() {
-                try {
-                        this.xpathVersion	= new URI(XACML.XPATHVERSION_2_0);
-                } catch (Exception ex) {
-                        
-                }
-        }
+    }
 
-        @Override
-        public URI getXPathVersion() {
-                return this.xpathVersion;
+    public StdRequestDefaults() {
+        try {
+            this.xpathVersion	= new URI(XACML.XPATHVERSION_2_0);
+        } catch (Exception ex) {
+
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof RequestDefaults)) {
-                        return false;
-                } else {
-                        RequestDefaults objRequestDefaults	= (RequestDefaults)obj;
-                        return ObjUtil.equalsAllowNull(this.getXPathVersion(), objRequestDefaults.getXPathVersion());
-                }
+    }
+
+    @Override
+    public URI getXPathVersion() {
+        return this.xpathVersion;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof RequestDefaults)) {
+            return false;
+        } else {
+            RequestDefaults objRequestDefaults	= (RequestDefaults)obj;
+            return ObjUtil.equalsAllowNull(this.getXPathVersion(), objRequestDefaults.getXPathVersion());
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                Object			objectToDump;
-                if ((objectToDump = this.getXPathVersion()) != null) {
-                        stringBuilder.append("xpatherVersion=");
-                        stringBuilder.append(objectToDump.toString());
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        Object			objectToDump;
+        if ((objectToDump = this.getXPathVersion()) != null) {
+            stringBuilder.append("xpatherVersion=");
+            stringBuilder.append(objectToDump.toString());
         }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestReference.java
index 0c76e48..760327a 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdRequestReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,32 +38,32 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.RequestReference} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdRequestReference extends Wrapper<RequestReference> implements RequestReference {
-        /**
-         * Creates a new immutable <code>StdRequestReference</code> that wraps the given {@link com.att.research.xacml.api.RequestReference}.
-         * 
-         * @param requestReference the <code>RequestReference</code> to wrap.
-         */
-        public StdRequestReference(RequestReference requestReference) {
-                super(requestReference);
-        }
-        
-        /**
-         * Creates a new <code>StdRequestReference</code> with a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributesReference}s.
-         * 
-         * @param requestAttributesReferences the <code>Collection</code> of <code>RequestAttributesReference</code>s to copy into the new <code>StdRequestReference</code>>
-         */
-        public StdRequestReference(Collection<RequestAttributesReference> requestAttributesReferences) {
-                this(new StdMutableRequestReference(requestAttributesReferences));
-        }
-        
-        @Override
-        public Collection<RequestAttributesReference> getAttributesReferences() {
-                return this.getWrappedObject().getAttributesReferences();
-        }
+    /**
+     * Creates a new immutable <code>StdRequestReference</code> that wraps the given {@link com.att.research.xacml.api.RequestReference}.
+     *
+     * @param requestReference the <code>RequestReference</code> to wrap.
+     */
+    public StdRequestReference(RequestReference requestReference) {
+        super(requestReference);
+    }
+
+    /**
+     * Creates a new <code>StdRequestReference</code> with a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.RequestAttributesReference}s.
+     *
+     * @param requestAttributesReferences the <code>Collection</code> of <code>RequestAttributesReference</code>s to copy into the new <code>StdRequestReference</code>>
+     */
+    public StdRequestReference(Collection<RequestAttributesReference> requestAttributesReferences) {
+        this(new StdMutableRequestReference(requestAttributesReferences));
+    }
+
+    @Override
+    public Collection<RequestAttributesReference> getAttributesReferences() {
+        return this.getWrappedObject().getAttributesReferences();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdResponse.java
index b1c0ff3..a6248f8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,41 +38,41 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.Response} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdResponse extends Wrapper<Response> implements Response {
-        /**
-         * Creates an immutable <code>StdResponse</code> wrapping the given {@link com.att.research.xacml.api.Response}.
-         * 
-         * @param response the <code>Response</code> to wrap in the new <code>StdResponse</code>
-         */
-        public StdResponse(Response response) {
-                super(response);
-        }
-        
-        /**
-         * Creates a new <code>StdResponse</code> with the single given {@link com.att.research.xacml.api.Result}.
-         * 
-         * @param result the <code>Result</code> for the new <code>StdResponse</code>.
-         */
-        public StdResponse(Result result) {
-                this(new StdMutableResponse(result));
-        }
-        
-        /**
-         * Creates a new <code>StdResponse</code> with a copy of the {@link com.att.research.xacml.api.Result}s in the given <code>Collection</code>.
-         * 
-         * @param listResults the <code>Collection</code> of <code>Result</code>s to copy
-         */
-        public StdResponse(Collection<Result> listResults) {
-                this(new StdMutableResponse(listResults));
-        }
-        
-        @Override
-        public Collection<Result> getResults() {
-                return this.getWrappedObject().getResults();
-        }
+    /**
+     * Creates an immutable <code>StdResponse</code> wrapping the given {@link com.att.research.xacml.api.Response}.
+     *
+     * @param response the <code>Response</code> to wrap in the new <code>StdResponse</code>
+     */
+    public StdResponse(Response response) {
+        super(response);
+    }
+
+    /**
+     * Creates a new <code>StdResponse</code> with the single given {@link com.att.research.xacml.api.Result}.
+     *
+     * @param result the <code>Result</code> for the new <code>StdResponse</code>.
+     */
+    public StdResponse(Result result) {
+        this(new StdMutableResponse(result));
+    }
+
+    /**
+     * Creates a new <code>StdResponse</code> with a copy of the {@link com.att.research.xacml.api.Result}s in the given <code>Collection</code>.
+     *
+     * @param listResults the <code>Collection</code> of <code>Result</code>s to copy
+     */
+    public StdResponse(Collection<Result> listResults) {
+        this(new StdMutableResponse(listResults));
+    }
+
+    @Override
+    public Collection<Result> getResults() {
+        return this.getWrappedObject().getResults();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdResult.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdResult.java
index e0bf36d..91dbe7a 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdResult.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,103 +43,103 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.Result} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdResult extends Wrapper<Result> implements Result {
-        /**
-         * Creates an immutable <code>StdResult</code> by wrapping another {@link com.att.research.xacml.api.Result}.  By creating
-         * this wrapper, the caller is stating they will not modify the wrapped <code>Result</code> any further.
-         * 
-         * @param result the <code>Result</code> to wrap.
-         */
-        public StdResult(Result result) {
-                super(result);
-        }
-        
-        /**
-         * Creates an immutable <code>StdResult</code> with the given {@link com.att.research.xacml.api.Decision} and {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param decision the <code>Decision</code> for the new <code>StdResult</code>
-         * @param status the <code>Status</code> for the new <code>StdResult</code>
-         */
-        public StdResult(Decision decision, Status status) {
-                this(new StdMutableResult(decision, status));
-        }
-        
-        /**
-         * Creates an immutable <code>StdResult</code> with the given {@link com.att.research.xacml.api.Decision} and an OK {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param decision the <code>Decision</code> for the new <code>StdResult</code>
-         */
-        public StdResult(Decision decision) {
-                this(new StdMutableResult(decision));
-        }
-        
-        /**
-         * Creates an immutable <code>StdResult</code> with an <code>INDETERMINATE</code> {@link com.att.research.xacml.api.Decision} and
-         * the given {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param status the <code>Status</code> for the new <code>StdResult</code>>
-         */
-        public StdResult(Status status) {
-                this(new StdMutableResult(status));
-        }
-        
-        /**
-         * Creates an immutable <code>StdResult</code> with the given {@link com.att.research.xacml.api.Decision} and the given set of <code>Collection</code>s
-         * with the details of the result.
-         * 
-         * @param decisionIn the <code>Decision</code> for the new <code>StdMutableResult</code>
-         * @param obligationsIn a <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s for the new <code>StdMutableResult</code>
-         * @param adviceIn a <code>Collection</code> of {@link com.att.research.xacml.api.Advice} objects for the new <code>StdMutableResult</code>
-         * @param attributesIn a <code>Collection</code> of {@link com.att.research.xacml.api.AttributeCategory} objects for the new <code>StdMutableResult</code>
-         * @param policyIdentifiersIn a <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects for the Policy identifiers
-         * @param policySetIdentifiersIn a <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects for the PolicySet identifiers
-         */
-        public StdResult(Decision decisionIn, 
-                        Collection<Obligation> obligationsIn, 
-                        Collection<Advice> adviceIn, 
-                        Collection<AttributeCategory> attributesIn, 
-                        Collection<IdReference> policyIdentifiersIn, 
-                        Collection<IdReference> policySetIdentifiersIn) {
-                this(new StdMutableResult(decisionIn, obligationsIn, adviceIn, attributesIn, policyIdentifiersIn, policySetIdentifiersIn));
-        }
-        
-        @Override
-        public Decision getDecision() {
-                return this.getWrappedObject().getDecision();
-        }
+    /**
+     * Creates an immutable <code>StdResult</code> by wrapping another {@link com.att.research.xacml.api.Result}.  By creating
+     * this wrapper, the caller is stating they will not modify the wrapped <code>Result</code> any further.
+     *
+     * @param result the <code>Result</code> to wrap.
+     */
+    public StdResult(Result result) {
+        super(result);
+    }
 
-        @Override
-        public Status getStatus() {
-                return this.getWrappedObject().getStatus();
-        }
+    /**
+     * Creates an immutable <code>StdResult</code> with the given {@link com.att.research.xacml.api.Decision} and {@link com.att.research.xacml.api.Status}.
+     *
+     * @param decision the <code>Decision</code> for the new <code>StdResult</code>
+     * @param status the <code>Status</code> for the new <code>StdResult</code>
+     */
+    public StdResult(Decision decision, Status status) {
+        this(new StdMutableResult(decision, status));
+    }
 
-        @Override
-        public Collection<Obligation> getObligations() {
-                return this.getWrappedObject().getObligations();
-        }
+    /**
+     * Creates an immutable <code>StdResult</code> with the given {@link com.att.research.xacml.api.Decision} and an OK {@link com.att.research.xacml.api.Status}.
+     *
+     * @param decision the <code>Decision</code> for the new <code>StdResult</code>
+     */
+    public StdResult(Decision decision) {
+        this(new StdMutableResult(decision));
+    }
 
-        @Override
-        public Collection<Advice> getAssociatedAdvice() {
-                return this.getWrappedObject().getAssociatedAdvice();
-        }
+    /**
+     * Creates an immutable <code>StdResult</code> with an <code>INDETERMINATE</code> {@link com.att.research.xacml.api.Decision} and
+     * the given {@link com.att.research.xacml.api.Status}.
+     *
+     * @param status the <code>Status</code> for the new <code>StdResult</code>>
+     */
+    public StdResult(Status status) {
+        this(new StdMutableResult(status));
+    }
 
-        @Override
-        public Collection<AttributeCategory> getAttributes() {
-                return this.getWrappedObject().getAttributes();
-        }
+    /**
+     * Creates an immutable <code>StdResult</code> with the given {@link com.att.research.xacml.api.Decision} and the given set of <code>Collection</code>s
+     * with the details of the result.
+     *
+     * @param decisionIn the <code>Decision</code> for the new <code>StdMutableResult</code>
+     * @param obligationsIn a <code>Collection</code> of {@link com.att.research.xacml.api.Obligation}s for the new <code>StdMutableResult</code>
+     * @param adviceIn a <code>Collection</code> of {@link com.att.research.xacml.api.Advice} objects for the new <code>StdMutableResult</code>
+     * @param attributesIn a <code>Collection</code> of {@link com.att.research.xacml.api.AttributeCategory} objects for the new <code>StdMutableResult</code>
+     * @param policyIdentifiersIn a <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects for the Policy identifiers
+     * @param policySetIdentifiersIn a <code>Collection</code> of {@link com.att.research.xacml.api.IdReference} objects for the PolicySet identifiers
+     */
+    public StdResult(Decision decisionIn,
+                     Collection<Obligation> obligationsIn,
+                     Collection<Advice> adviceIn,
+                     Collection<AttributeCategory> attributesIn,
+                     Collection<IdReference> policyIdentifiersIn,
+                     Collection<IdReference> policySetIdentifiersIn) {
+        this(new StdMutableResult(decisionIn, obligationsIn, adviceIn, attributesIn, policyIdentifiersIn, policySetIdentifiersIn));
+    }
 
-        @Override
-        public Collection<IdReference> getPolicyIdentifiers() {
-                return this.getWrappedObject().getPolicyIdentifiers();
-        }
+    @Override
+    public Decision getDecision() {
+        return this.getWrappedObject().getDecision();
+    }
 
-        @Override
-        public Collection<IdReference> getPolicySetIdentifiers() {
-                return this.getWrappedObject().getPolicySetIdentifiers();
-        }
+    @Override
+    public Status getStatus() {
+        return this.getWrappedObject().getStatus();
+    }
+
+    @Override
+    public Collection<Obligation> getObligations() {
+        return this.getWrappedObject().getObligations();
+    }
+
+    @Override
+    public Collection<Advice> getAssociatedAdvice() {
+        return this.getWrappedObject().getAssociatedAdvice();
+    }
+
+    @Override
+    public Collection<AttributeCategory> getAttributes() {
+        return this.getWrappedObject().getAttributes();
+    }
+
+    @Override
+    public Collection<IdReference> getPolicyIdentifiers() {
+        return this.getWrappedObject().getPolicyIdentifiers();
+    }
+
+    @Override
+    public Collection<IdReference> getPolicySetIdentifiers() {
+        return this.getWrappedObject().getPolicySetIdentifiers();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdScopeResolverResult.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdScopeResolverResult.java
index 0045ec1..18130fa 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdScopeResolverResult.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdScopeResolverResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,68 +42,68 @@
 
 /**
  * StdScopeResolverResult implements the {@link com.att.research.xacml.api.pdp.ScopeResolverResult} interface.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class StdScopeResolverResult implements ScopeResolverResult {
-        private Status status;
-        private List<Attribute> attributes	= new ArrayList<Attribute>();
+    private Status status;
+    private List<Attribute> attributes	= new ArrayList<Attribute>();
 
-        public StdScopeResolverResult(Status statusIn, Collection<Attribute> attributesIn) {
-                this.status	= statusIn;
-                if (attributesIn != null) {
-                        this.attributes.addAll(attributesIn);
-                }
+    public StdScopeResolverResult(Status statusIn, Collection<Attribute> attributesIn) {
+        this.status	= statusIn;
+        if (attributesIn != null) {
+            this.attributes.addAll(attributesIn);
         }
-        
-        public StdScopeResolverResult(Status statusIn) {
-                this(statusIn, null);
-        }
-        
-        public StdScopeResolverResult(Collection<Attribute> attributesIn) {
-                this(StdStatus.STATUS_OK, attributesIn);
-        }
-        
-        @Override
-        public Status getStatus() {
-                return this.status;
-        }
-        
-        public void setStatus(Status statusIn) {
-                this.status	= statusIn;
-        }
+    }
 
-        @Override
-        public Iterator<Attribute> getAttributes() {
-                return this.attributes.iterator();
-        }
-        
-        public void addAttribute(Attribute attribute) {
-                this.attributes.add(attribute);
-        }
+    public StdScopeResolverResult(Status statusIn) {
+        this(statusIn, null);
+    }
 
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                boolean needsComma			= false;
-                
-                Status statusToDump	= this.getStatus();
-                if (statusToDump != null) {
-                        stringBuilder.append("status=");
-                        stringBuilder.append(statusToDump.toString());
-                        needsComma	= true;
-                }
-                Iterator<Attribute> iterAttributes	= this.getAttributes();
-                if (iterAttributes != null && iterAttributes.hasNext()) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("attributes=");
-                        stringBuilder.append(StringUtils.toString(iterAttributes, true));
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    public StdScopeResolverResult(Collection<Attribute> attributesIn) {
+        this(StdStatus.STATUS_OK, attributesIn);
+    }
+
+    @Override
+    public Status getStatus() {
+        return this.status;
+    }
+
+    public void setStatus(Status statusIn) {
+        this.status	= statusIn;
+    }
+
+    @Override
+    public Iterator<Attribute> getAttributes() {
+        return this.attributes.iterator();
+    }
+
+    public void addAttribute(Attribute attribute) {
+        this.attributes.add(attribute);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        boolean needsComma			= false;
+
+        Status statusToDump	= this.getStatus();
+        if (statusToDump != null) {
+            stringBuilder.append("status=");
+            stringBuilder.append(statusToDump.toString());
+            needsComma	= true;
         }
+        Iterator<Attribute> iterAttributes	= this.getAttributes();
+        if (iterAttributes != null && iterAttributes.hasNext()) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("attributes=");
+            stringBuilder.append(StringUtils.toString(iterAttributes, true));
+            needsComma	= true;
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatus.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatus.java
index 2166b59..d155d40 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatus.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatus.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,89 +37,89 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.Status} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdStatus extends Wrapper<Status> implements Status {
-        public static final Status	STATUS_OK	= new StdStatus(StdStatusCode.STATUS_CODE_OK);
-        
-        /**
-         * Creates a new immutable <code>StdStatus</code> that wraps the given {@link com.att.research.xacml.api.Status}.
-         * The caller agrees not to modify the given <code>Status</code> as long as the new <code>StdStatus</code> refers to it.
-         * 
-         * @param status the <code>Status</code> to wrap
-         */
-        public StdStatus(Status status) {
-                super(status);
-        }
+    public static final Status	STATUS_OK	= new StdStatus(StdStatusCode.STATUS_CODE_OK);
 
-        /**
-         * Creates a new <code>StdStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, <code>String</code> status message,
-         * and {@link com.att.research.xacml.api.StatusDetail}.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
-         * @param statusMessageIn the <code>String</code> representing the XACML StatusMessage
-         * @param statusDetailIn the <code>StatusDetail</code> representing the XACML StatusDetail
-         */
-        public StdStatus(StatusCode statusCodeIn, String statusMessageIn, StatusDetail statusDetailIn) {
-                this(new StdMutableStatus(statusCodeIn, statusMessageIn, statusDetailIn));
-        }
-        
-        /**
-         * Creates a new <code>StdStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, <code>String</code> status message
-         * and no {@link com.att.research.xacml.api.StatusDetail}.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
-         * @param statusMessageIn the <code>String</code> representing the XACML StatusMessage
-         */
-        public StdStatus(StatusCode statusCodeIn, String statusMessageIn) {
-                this(new StdMutableStatus(statusCodeIn, statusMessageIn));
-        }
-        
-        /**
-         * Creates a new <code>StdStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, a null status message
-         * and no {@link com.att.research.xacml.api.StatusDetail}.
-         * 
-         * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
-         */
-        public StdStatus(StatusCode statusCodeIn) {
-                this(new StdMutableStatus(statusCodeIn));
-        }
-        
-        /**
-         * Creates a new <code>StdStatus</code> that is a copy of the given {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param status the <code>Status</code> to copy
-         * @return a new <code>StatusStatus</code> that is a copy of the given <code>Status</code>.
-         */
-        public static StdStatus copy(Status status) {
-                return new StdStatus(status.getStatusCode(), status.getStatusMessage(), status.getStatusDetail());
-        }
-        
-        @Override
-        public StatusCode getStatusCode() {
-                return this.getWrappedObject().getStatusCode();
-        }
+    /**
+     * Creates a new immutable <code>StdStatus</code> that wraps the given {@link com.att.research.xacml.api.Status}.
+     * The caller agrees not to modify the given <code>Status</code> as long as the new <code>StdStatus</code> refers to it.
+     *
+     * @param status the <code>Status</code> to wrap
+     */
+    public StdStatus(Status status) {
+        super(status);
+    }
 
-        @Override
-        public String getStatusMessage() {
-                return this.getWrappedObject().getStatusMessage();
-        }
+    /**
+     * Creates a new <code>StdStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, <code>String</code> status message,
+     * and {@link com.att.research.xacml.api.StatusDetail}.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
+     * @param statusMessageIn the <code>String</code> representing the XACML StatusMessage
+     * @param statusDetailIn the <code>StatusDetail</code> representing the XACML StatusDetail
+     */
+    public StdStatus(StatusCode statusCodeIn, String statusMessageIn, StatusDetail statusDetailIn) {
+        this(new StdMutableStatus(statusCodeIn, statusMessageIn, statusDetailIn));
+    }
 
-        @Override
-        public StatusDetail getStatusDetail() {
-                return this.getWrappedObject().getStatusDetail();
-        }
+    /**
+     * Creates a new <code>StdStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, <code>String</code> status message
+     * and no {@link com.att.research.xacml.api.StatusDetail}.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
+     * @param statusMessageIn the <code>String</code> representing the XACML StatusMessage
+     */
+    public StdStatus(StatusCode statusCodeIn, String statusMessageIn) {
+        this(new StdMutableStatus(statusCodeIn, statusMessageIn));
+    }
 
-        @Override
-        public boolean isOk() {
-                return this.getWrappedObject().isOk();
-        }
+    /**
+     * Creates a new <code>StdStatus</code> with the given {@link com.att.research.xacml.api.StatusCode}, a null status message
+     * and no {@link com.att.research.xacml.api.StatusDetail}.
+     *
+     * @param statusCodeIn the <code>StatusCode</code> representing the XACML StatusCode.
+     */
+    public StdStatus(StatusCode statusCodeIn) {
+        this(new StdMutableStatus(statusCodeIn));
+    }
 
-        @Override
-        public Status merge(Status status) {
-                return new StdStatus(this.getWrappedObject().merge(status));
-        }
+    /**
+     * Creates a new <code>StdStatus</code> that is a copy of the given {@link com.att.research.xacml.api.Status}.
+     *
+     * @param status the <code>Status</code> to copy
+     * @return a new <code>StatusStatus</code> that is a copy of the given <code>Status</code>.
+     */
+    public static StdStatus copy(Status status) {
+        return new StdStatus(status.getStatusCode(), status.getStatusMessage(), status.getStatusDetail());
+    }
+
+    @Override
+    public StatusCode getStatusCode() {
+        return this.getWrappedObject().getStatusCode();
+    }
+
+    @Override
+    public String getStatusMessage() {
+        return this.getWrappedObject().getStatusMessage();
+    }
+
+    @Override
+    public StatusDetail getStatusDetail() {
+        return this.getWrappedObject().getStatusDetail();
+    }
+
+    @Override
+    public boolean isOk() {
+        return this.getWrappedObject().isOk();
+    }
+
+    @Override
+    public Status merge(Status status) {
+        return new StdStatus(this.getWrappedObject().merge(status));
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatusCode.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatusCode.java
index 3677de5..2bba531 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatusCode.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatusCode.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,115 +37,115 @@
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.StatusCode} interface to store the major
  * and minor {@link com.att.research.xacml.common.StatusCodeValues} objects associated with a XACML StatusCode element.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class StdStatusCode implements StatusCode {
-        private Identifier			statusCodeValue;
-        private StatusCode			child;
-        
-        public static final StatusCode	STATUS_CODE_OK					= new StdStatusCode(XACML1.ID_STATUS_OK);
-        public static final StatusCode	STATUS_CODE_MISSING_ATTRIBUTE	= new StdStatusCode(XACML1.ID_STATUS_MISSING_ATTRIBUTE);
-        public static final StatusCode	STATUS_CODE_SYNTAX_ERROR		= new StdStatusCode(XACML1.ID_STATUS_SYNTAX_ERROR);
-        public static final StatusCode	STATUS_CODE_PROCESSING_ERROR	= new StdStatusCode(XACML1.ID_STATUS_PROCESSING_ERROR);
-        
-        /**
-         * Creates a new <code>StdStatusCode</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML StatusCode value,
-         * and the given {@link com.att.research.xacml.api.StatusCode} representing the sub-StatusCode.
-         * 
-         * @param statusCodeValueIn the <code>Identifier</code> representing the XACML StatusCode value
-         * @param childIn the <code>StatusCode</code> representing the XACML sub-StatusCode value
-         */
-        public StdStatusCode(Identifier statusCodeValueIn, StatusCode childIn) {
-                this.statusCodeValue	= statusCodeValueIn;
-                this.child				= childIn;
+    private Identifier			statusCodeValue;
+    private StatusCode			child;
+
+    public static final StatusCode	STATUS_CODE_OK					= new StdStatusCode(XACML1.ID_STATUS_OK);
+    public static final StatusCode	STATUS_CODE_MISSING_ATTRIBUTE	= new StdStatusCode(XACML1.ID_STATUS_MISSING_ATTRIBUTE);
+    public static final StatusCode	STATUS_CODE_SYNTAX_ERROR		= new StdStatusCode(XACML1.ID_STATUS_SYNTAX_ERROR);
+    public static final StatusCode	STATUS_CODE_PROCESSING_ERROR	= new StdStatusCode(XACML1.ID_STATUS_PROCESSING_ERROR);
+
+    /**
+     * Creates a new <code>StdStatusCode</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML StatusCode value,
+     * and the given {@link com.att.research.xacml.api.StatusCode} representing the sub-StatusCode.
+     *
+     * @param statusCodeValueIn the <code>Identifier</code> representing the XACML StatusCode value
+     * @param childIn the <code>StatusCode</code> representing the XACML sub-StatusCode value
+     */
+    public StdStatusCode(Identifier statusCodeValueIn, StatusCode childIn) {
+        this.statusCodeValue	= statusCodeValueIn;
+        this.child				= childIn;
+    }
+
+    /**
+     * Creates a new <code>StdStatusCode</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML StatusCode value
+     *
+     * @param statusCodeValueIn the <code>Identifier</code> representing the XACML StatusCode value
+     */
+    public StdStatusCode(Identifier majorStatusCodeValueIn) {
+        this(majorStatusCodeValueIn, null);
+    }
+
+    /**
+     * Creates a new <code>StdStatusCode</code> that is a copy of the given {@link com.att.research.xacml.api.StatusCode}.
+     *
+     * @param statusCode the <code>StatusCode</code> to copy
+     * @return a new <code>StdStatusCode</code> that is a copy of the given <code>StatusCode</code>.
+     */
+    public static StdStatusCode copy(StatusCode statusCode) {
+        return new StdStatusCode(statusCode.getStatusCodeValue(), statusCode.getChild());
+    }
+
+    @Override
+    public Identifier getStatusCodeValue() {
+        return this.statusCodeValue;
+    }
+
+    @Override
+    public StatusCode getChild() {
+        return this.child;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder	stringBuilder	= new StringBuilder("{");
+        boolean			needsComma		= false;
+        Object			objectToDump;
+
+        if ((objectToDump = this.getStatusCodeValue()) != null) {
+            stringBuilder.append("statusCodeValue=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
-        
-        /**
-         * Creates a new <code>StdStatusCode</code> with the given {@link com.att.research.xacml.api.Identifier} representing the XACML StatusCode value
-         * 
-         * @param statusCodeValueIn the <code>Identifier</code> representing the XACML StatusCode value
-         */
-        public StdStatusCode(Identifier majorStatusCodeValueIn) {
-                this(majorStatusCodeValueIn, null);
+        if ((objectToDump = this.getChild()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("child=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
-        
-        /**
-         * Creates a new <code>StdStatusCode</code> that is a copy of the given {@link com.att.research.xacml.api.StatusCode}.
-         * 
-         * @param statusCode the <code>StatusCode</code> to copy
-         * @return a new <code>StdStatusCode</code> that is a copy of the given <code>StatusCode</code>.
-         */
-        public static StdStatusCode copy(StatusCode statusCode) {
-                return new StdStatusCode(statusCode.getStatusCodeValue(), statusCode.getChild());
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public int hashCode() {
+        Identifier identifierStatusCodeValue	= this.getStatusCodeValue();
+        StatusCode statusCodeChild				= this.getChild();
+
+        int hc	= (identifierStatusCodeValue == null ? 0 : identifierStatusCodeValue.hashCode());
+        if (statusCodeChild != null) {
+            hc	+= statusCodeChild.hashCode();
+        }
+        return hc;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else if (!(obj instanceof StatusCode)) {
+            return false;
+        }
+        StatusCode	statusCodeObj	= (StatusCode)obj;
+        if (!(statusCodeObj.getStatusCodeValue().equals(this.getStatusCodeValue()))) {
+            return false;
         }
 
-        @Override
-        public Identifier getStatusCodeValue() {
-                return this.statusCodeValue;
+        StatusCode	statusCodeChildThis	= this.getChild();
+        StatusCode	statusCodeChildObj	= statusCodeObj.getChild();
+        if (statusCodeChildThis == null) {
+            return (statusCodeChildObj == null);
+        } else {
+            return (statusCodeChildThis.equals(statusCodeChildObj));
         }
-        
-        @Override
-        public StatusCode getChild() {
-                return this.child;
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder	stringBuilder	= new StringBuilder("{");
-                boolean			needsComma		= false;
-                Object			objectToDump;
-                
-                if ((objectToDump = this.getStatusCodeValue()) != null) {
-                        stringBuilder.append("statusCodeValue=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getChild()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("child=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
-        
-        @Override
-        public int hashCode() {
-                Identifier identifierStatusCodeValue	= this.getStatusCodeValue();
-                StatusCode statusCodeChild				= this.getChild();
-                
-                int hc	= (identifierStatusCodeValue == null ? 0 : identifierStatusCodeValue.hashCode());
-                if (statusCodeChild != null) {
-                        hc	+= statusCodeChild.hashCode();
-                }
-                return hc;
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
-                } else if (!(obj instanceof StatusCode)) {
-                        return false;
-                }
-                StatusCode	statusCodeObj	= (StatusCode)obj;
-                if (!(statusCodeObj.getStatusCodeValue().equals(this.getStatusCodeValue()))) {
-                        return false;
-                }
-                
-                StatusCode	statusCodeChildThis	= this.getChild();
-                StatusCode	statusCodeChildObj	= statusCodeObj.getChild();
-                if (statusCodeChildThis == null) {
-                        return (statusCodeChildObj == null);
-                } else {
-                        return (statusCodeChildThis.equals(statusCodeChildObj));
-                }
-        }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatusDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatusDetail.java
index 936ff12..cdfd9a8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatusDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdStatusDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,64 +38,64 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.StatusDetail} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdStatusDetail extends Wrapper<StatusDetail> implements StatusDetail {
-        /**
-         * Creates a new immutable <code>StdStatusDetail</code> that wraps the given {@link com.att.research.xacml.api.StatusDetail}.
-         * The caller agrees not to modify the given <code>StatusDetail</code> as long as the new <code>StdStatusDetail</code> refers to it.
-         * 
-         * @param statusDetail the <code>StatusDetail</code> to wrap
-         */
-        public StdStatusDetail(StatusDetail statusDetail) {
-                super(statusDetail);
-        }
-        
-        /**
-         * Creates a new immutable empty <code>StdStatusDetail</code>.
-         */
-        public StdStatusDetail() {
-                this(new StdMutableStatusDetail());
-        }
-        
-        /**
-         * Creates a new immutable <code>StdStatusDetail</code> with the given <code>Collection</code> of {@link com.att.research.xamcl.api.MissingAttributeDetail}s.
-         * 
-         * @param missingAttributeDetailsIn the <code>Collection</code> of <code>MissingAttributeDetail</code>s for the new <code>StdStatusDetail</code>.
-         */
-        public StdStatusDetail(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
-                this(new StdMutableStatusDetail(missingAttributeDetailsIn));
-        }
-        
-        /**
-         * Creates a new immutable <code>StdStatusDetail</code> with the given {@link com.att.research.xacml.api.MissingAttributeDetail}.
-         * 
-         * @param missingAttributeDetail the <code>MissingAttributeDetail</code> for the new <code>StdStatusDetail</code>
-         */
-        public StdStatusDetail(MissingAttributeDetail missingAttributeDetail) {
-                this(new StdMutableStatusDetail(missingAttributeDetail));
-        }
-        
-        /**
-         * Creates a new <code>StdStatusDetail that is a copy of the given {@link com.att.research.xacml.api.StatusDetail}.
-         * 
-         * @param statusDetail the <code>StatusDetail</code> to copy
-         * @return a new <code>StdStatusDetail</code> that is a copy of the given <code>StatusDetail</code>.
-         */
-        public static StdStatusDetail copy(StatusDetail statusDetail) {
-                return new StdStatusDetail(statusDetail.getMissingAttributeDetails());
-        }
+    /**
+     * Creates a new immutable <code>StdStatusDetail</code> that wraps the given {@link com.att.research.xacml.api.StatusDetail}.
+     * The caller agrees not to modify the given <code>StatusDetail</code> as long as the new <code>StdStatusDetail</code> refers to it.
+     *
+     * @param statusDetail the <code>StatusDetail</code> to wrap
+     */
+    public StdStatusDetail(StatusDetail statusDetail) {
+        super(statusDetail);
+    }
 
-        @Override
-        public Collection<MissingAttributeDetail> getMissingAttributeDetails() {
-                return this.getWrappedObject().getMissingAttributeDetails();
-        }
+    /**
+     * Creates a new immutable empty <code>StdStatusDetail</code>.
+     */
+    public StdStatusDetail() {
+        this(new StdMutableStatusDetail());
+    }
 
-        @Override
-        public StatusDetail merge(StatusDetail statusDetail) {
-                return new StdStatusDetail(this.getWrappedObject().merge(statusDetail));
-        }
+    /**
+     * Creates a new immutable <code>StdStatusDetail</code> with the given <code>Collection</code> of {@link com.att.research.xamcl.api.MissingAttributeDetail}s.
+     *
+     * @param missingAttributeDetailsIn the <code>Collection</code> of <code>MissingAttributeDetail</code>s for the new <code>StdStatusDetail</code>.
+     */
+    public StdStatusDetail(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
+        this(new StdMutableStatusDetail(missingAttributeDetailsIn));
+    }
+
+    /**
+     * Creates a new immutable <code>StdStatusDetail</code> with the given {@link com.att.research.xacml.api.MissingAttributeDetail}.
+     *
+     * @param missingAttributeDetail the <code>MissingAttributeDetail</code> for the new <code>StdStatusDetail</code>
+     */
+    public StdStatusDetail(MissingAttributeDetail missingAttributeDetail) {
+        this(new StdMutableStatusDetail(missingAttributeDetail));
+    }
+
+    /**
+     * Creates a new <code>StdStatusDetail that is a copy of the given {@link com.att.research.xacml.api.StatusDetail}.
+     *
+     * @param statusDetail the <code>StatusDetail</code> to copy
+     * @return a new <code>StdStatusDetail</code> that is a copy of the given <code>StatusDetail</code>.
+     */
+    public static StdStatusDetail copy(StatusDetail statusDetail) {
+        return new StdStatusDetail(statusDetail.getMissingAttributeDetails());
+    }
+
+    @Override
+    public Collection<MissingAttributeDetail> getMissingAttributeDetails() {
+        return this.getWrappedObject().getMissingAttributeDetails();
+    }
+
+    @Override
+    public StatusDetail merge(StatusDetail statusDetail) {
+        return new StdStatusDetail(this.getWrappedObject().merge(statusDetail));
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdVersion.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdVersion.java
index b5ec1e8..9524462 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdVersion.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdVersion.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,149 +37,149 @@
 
 /**
  * StdVersion implements the {@link com.att.research.xacml.api.Version} interface to represent XACML version identifiers.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class StdVersion implements Version {
-        private int[]	versionDigits;
-        private String	cachedVersionString;
-        
-        /**
-         * Creates a new <code>StdVersion</code> from the given array of integer digits.
-         * 
-         * @param versionDigitsIn the array of integer digits representing the version
-         */
-        public StdVersion(int[] versionDigitsIn) {
-                this.versionDigits	= versionDigitsIn;
-        }
-        
-        /**
-         * Creates a new <code>StdVersion</code> by parsing a <code>String</code> of the form Number"."Number"."Number"..."Number"
-         * 
-         * @param versionString the <code>String</code> representation of the version
-         * @return a new <code>StdVersion</code> parsed from the <code>String</code>
-         * @throws java.text.ParseException if the <code>String</code> is not a valid <code>Version</code>
-         */
-        public static StdVersion newInstance(String versionString) throws ParseException {
-                if (versionString == null) {
-                        throw new NullPointerException("Null version string");
-                }
-                String[] versionParts	= versionString.split("[.]", -1);
-                if (versionParts == null) {
-                        throw new ParseException("Invalid version string \"" + versionString + "\"", 0);
-                }
-                int[]	versionNumberParts	= new int[versionParts.length];
-                for (int i = 0 ; i < versionParts.length ; i++) {
-                        try {
-                                versionNumberParts[i]	= Integer.parseInt(versionParts[i]);
-                        } catch (NumberFormatException ex) {
-                                throw new ParseException("Invalid version number \"" + versionParts[i] + "\"", i);
-                        }
-                        if (versionNumberParts[i] < 0) {
-                                throw new ParseException("Invalid version number \"" + versionParts[i] + "\"", i);
-                        }
-                }
-                return new StdVersion(versionNumberParts);
-        }
-        
-        @Override
-        public String getVersion() {
-                if (this.cachedVersionString == null) {
-                        StringBuilder stringBuilder		= new StringBuilder();
-                        int[]		  versionDigitsHere	= this.getVersionDigits();
-                        if (versionDigitsHere != null && versionDigitsHere.length > 0) {
-                                stringBuilder.append(versionDigitsHere[0]);
-                                for (int i = 1 ; i < versionDigitsHere.length ; i++) {
-                                        stringBuilder.append('.');
-                                        stringBuilder.append(versionDigitsHere[i]);
-                                }
-                        }
-                        this.cachedVersionString	= stringBuilder.toString();
-                }
-                return this.cachedVersionString;
-        }
+    private int[]	versionDigits;
+    private String	cachedVersionString;
 
-        @Override
-        public int[] getVersionDigits() {
-                return this.versionDigits;
+    /**
+     * Creates a new <code>StdVersion</code> from the given array of integer digits.
+     *
+     * @param versionDigitsIn the array of integer digits representing the version
+     */
+    public StdVersion(int[] versionDigitsIn) {
+        this.versionDigits	= versionDigitsIn;
+    }
+
+    /**
+     * Creates a new <code>StdVersion</code> by parsing a <code>String</code> of the form Number"."Number"."Number"..."Number"
+     *
+     * @param versionString the <code>String</code> representation of the version
+     * @return a new <code>StdVersion</code> parsed from the <code>String</code>
+     * @throws java.text.ParseException if the <code>String</code> is not a valid <code>Version</code>
+     */
+    public static StdVersion newInstance(String versionString) throws ParseException {
+        if (versionString == null) {
+            throw new NullPointerException("Null version string");
         }
-        
-        @Override
-        public String toString() {
-                return this.getVersion();
+        String[] versionParts	= versionString.split("[.]", -1);
+        if (versionParts == null) {
+            throw new ParseException("Invalid version string \"" + versionString + "\"", 0);
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof Version)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
+        int[]	versionNumberParts	= new int[versionParts.length];
+        for (int i = 0 ; i < versionParts.length ; i++) {
+            try {
+                versionNumberParts[i]	= Integer.parseInt(versionParts[i]);
+            } catch (NumberFormatException ex) {
+                throw new ParseException("Invalid version number \"" + versionParts[i] + "\"", i);
+            }
+            if (versionNumberParts[i] < 0) {
+                throw new ParseException("Invalid version number \"" + versionParts[i] + "\"", i);
+            }
+        }
+        return new StdVersion(versionNumberParts);
+    }
+
+    @Override
+    public String getVersion() {
+        if (this.cachedVersionString == null) {
+            StringBuilder stringBuilder		= new StringBuilder();
+            int[]		  versionDigitsHere	= this.getVersionDigits();
+            if (versionDigitsHere != null && versionDigitsHere.length > 0) {
+                stringBuilder.append(versionDigitsHere[0]);
+                for (int i = 1 ; i < versionDigitsHere.length ; i++) {
+                    stringBuilder.append('.');
+                    stringBuilder.append(versionDigitsHere[i]);
+                }
+            }
+            this.cachedVersionString	= stringBuilder.toString();
+        }
+        return this.cachedVersionString;
+    }
+
+    @Override
+    public int[] getVersionDigits() {
+        return this.versionDigits;
+    }
+
+    @Override
+    public String toString() {
+        return this.getVersion();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof Version)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            int[] objDigits		= ((Version)obj).getVersionDigits();
+            int[] thisDigits	= this.getVersionDigits();
+            if (thisDigits == null || thisDigits.length == 0) {
+                if (objDigits == null || objDigits.length == 0) {
+                    return true;
                 } else {
-                        int[] objDigits		= ((Version)obj).getVersionDigits();
-                        int[] thisDigits	= this.getVersionDigits();
-                        if (thisDigits == null || thisDigits.length == 0) {
-                                if (objDigits == null || objDigits.length == 0) {
-                                        return true;
-                                } else {
-                                        return false;
-                                }
-                        } else {
-                                if (objDigits == null || objDigits.length == 0) {
-                                        return false;
-                                } else {
-                                        return Arrays.equals(thisDigits, objDigits);
-                                }
-                        }
+                    return false;
                 }
-        }
-
-        @Override
-        public int compareTo(Version o) {
-                /*
-                 * Comparing two equivalent objects should generate a compare value of 0
-                 */
-                if (o == this || this.equals(o)) {
-                        return 0;
+            } else {
+                if (objDigits == null || objDigits.length == 0) {
+                    return false;
                 } else {
-                        int[] thisDigits	= this.getVersionDigits();
-                        int[] oDigits		= o.getVersionDigits();
-                        if (thisDigits == null || thisDigits.length == 0) {
-                                if (oDigits == null || oDigits.length == 0) {
-                                        return 0;
-                                } else {
-                                        return -1;
-                                }
-                        } else {
-                                if (oDigits == null || oDigits.length == 0) {
-                                        return 1;
-                                } else {
-                                        int maxDigits	= (thisDigits.length > oDigits.length ? thisDigits.length : oDigits.length);
-                                        for (int i = 0 ; i < maxDigits ; i++) {
-                                                if (i < thisDigits.length) {
-                                                        if (i < oDigits.length) {
-                                                                int diff	= thisDigits[i] - oDigits[i];
-                                                                if (diff != 0) {
-                                                                        return diff;
-                                                                }
-                                                        } else if (thisDigits[i] > 0) {
-                                                                return 1;
-                                                        }
-                                                } else {
-                                                        if (oDigits[i] > 0) {
-                                                                return -1;
-                                                        }
-                                                }
-                                        }
-                                        return 0;
-                                }
-                        }
+                    return Arrays.equals(thisDigits, objDigits);
                 }
+            }
         }
+    }
 
-        @Override
-        public String stringValue() {
-                return this.getVersion();
+    @Override
+    public int compareTo(Version o) {
+        /*
+         * Comparing two equivalent objects should generate a compare value of 0
+         */
+        if (o == this || this.equals(o)) {
+            return 0;
+        } else {
+            int[] thisDigits	= this.getVersionDigits();
+            int[] oDigits		= o.getVersionDigits();
+            if (thisDigits == null || thisDigits.length == 0) {
+                if (oDigits == null || oDigits.length == 0) {
+                    return 0;
+                } else {
+                    return -1;
+                }
+            } else {
+                if (oDigits == null || oDigits.length == 0) {
+                    return 1;
+                } else {
+                    int maxDigits	= (thisDigits.length > oDigits.length ? thisDigits.length : oDigits.length);
+                    for (int i = 0 ; i < maxDigits ; i++) {
+                        if (i < thisDigits.length) {
+                            if (i < oDigits.length) {
+                                int diff	= thisDigits[i] - oDigits[i];
+                                if (diff != 0) {
+                                    return diff;
+                                }
+                            } else if (thisDigits[i] > 0) {
+                                return 1;
+                            }
+                        } else {
+                            if (oDigits[i] > 0) {
+                                return -1;
+                            }
+                        }
+                    }
+                    return 0;
+                }
+            }
         }
+    }
+
+    @Override
+    public String stringValue() {
+        return this.getVersion();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdVersionMatch.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdVersionMatch.java
index 3ddc380..214fd55 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/StdVersionMatch.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/StdVersionMatch.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,122 +38,122 @@
 
 /**
  * StdVersionMatch implements {@link com.att.research.xacml.api.VersionMatch} as an array of integers.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class StdVersionMatch implements VersionMatch {
-        private int[]	matchComponents;
-        private String	cachedStringRep;
-        
-        private static void addComponent(StringBuilder stringBuilder, int component) {
-                if (component == -2) {
-                        stringBuilder.append('+');
-                } else if (component == -1) {
-                        stringBuilder.append('*');
-                } else {
-                        stringBuilder.append(component);
-                }
-        }
-        
-        public StdVersionMatch(int[] matchComponentsIn) {
-                this.matchComponents	= matchComponentsIn;
-        }
-        
-        public static StdVersionMatch newInstance(String versionMatch) throws ParseException {
-                if (versionMatch == null) {
-                        throw new NullPointerException("Null version string");
-                }
-                String[] versionMatchParts	= versionMatch.split("[.]", -1);
-                if (versionMatchParts == null) {
-                        throw new ParseException("Invalid version string \"" + versionMatch + "\"", 0);
-                }
-                int[]	versionMatchNumberParts	= new int[versionMatchParts.length];
-                for (int i = 0 ; i < versionMatchParts.length ; i++) {
-                        if (versionMatchParts[i].equals("*")) {
-                                versionMatchNumberParts[i]	= -1;
-                        } else if (versionMatchParts[i].equals("+")) {
-                                versionMatchNumberParts[i]	= -2;
-                        } else {
-                                try {
-                                        versionMatchNumberParts[i]	= Integer.parseInt(versionMatchParts[i]);
-                                } catch (NumberFormatException ex) {
-                                        throw new ParseException("Invalid version number \"" + versionMatchParts[i] + "\"", i);
-                                }
-                        }
-                }
-                return new StdVersionMatch(versionMatchNumberParts);
-                
-        }
+    private int[]	matchComponents;
+    private String	cachedStringRep;
 
-        @Override
-        public String getVersionMatch() {
-                if (this.cachedStringRep == null) {
-                        StringBuilder stringBuilder	= new StringBuilder();
-                        int[] matchComponentsHere	= this.getMatchComponents();
-                        if (matchComponentsHere != null && matchComponentsHere.length > 0) {
-                                addComponent(stringBuilder, matchComponents[0]);
-                                for (int i = 1 ; i < matchComponents.length ; i++) {
-                                        stringBuilder.append('.');
-                                        addComponent(stringBuilder, matchComponents[i]);
-                                }
-                        }
-                        this.cachedStringRep	= stringBuilder.toString();
-                }
-                return this.cachedStringRep;
+    private static void addComponent(StringBuilder stringBuilder, int component) {
+        if (component == -2) {
+            stringBuilder.append('+');
+        } else if (component == -1) {
+            stringBuilder.append('*');
+        } else {
+            stringBuilder.append(component);
         }
-        
-        public int[] getMatchComponents() {
-                return this.matchComponents;
+    }
+
+    public StdVersionMatch(int[] matchComponentsIn) {
+        this.matchComponents	= matchComponentsIn;
+    }
+
+    public static StdVersionMatch newInstance(String versionMatch) throws ParseException {
+        if (versionMatch == null) {
+            throw new NullPointerException("Null version string");
         }
-        
-        @Override
-        public boolean match(Version version, int cmp) {
-                int[] matchComponentsHere	= this.getMatchComponents();
-                if (matchComponentsHere == null || matchComponentsHere.length == 0) {
-                        return false;
-                }
-                int[] versionComponents		= version.getVersionDigits();
-                if (versionComponents == null || versionComponents.length == 0) {
-                        return false;
-                }
-                int	iMatch	= 0, iVersion	= 0;
-                int matchValue;
-                while (iMatch < matchComponents.length && iVersion < versionComponents.length) {
-                        if ((matchValue = matchComponentsHere[iMatch]) == -2) {
-                                iVersion	= versionComponents.length;
-                        } else if (matchValue == -1) {
-                                iVersion++;
-                        } else {
-                                int versionValue	= versionComponents[iVersion];
-                                if (((cmp == 0) && (versionValue == matchValue)) ||
-                                        ((cmp < 0) && (versionValue <= matchValue)) ||
-                                        ((cmp > 0) && (versionValue >= matchValue))) {
-                                        iVersion++;
-                                } else {
-                                        return false;
-                                }
-                        }
-                        iMatch++;
-                }
-                return (iVersion == versionComponents.length && iMatch == matchComponents.length);
+        String[] versionMatchParts	= versionMatch.split("[.]", -1);
+        if (versionMatchParts == null) {
+            throw new ParseException("Invalid version string \"" + versionMatch + "\"", 0);
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof VersionMatch)) {
-                        return false;
+        int[]	versionMatchNumberParts	= new int[versionMatchParts.length];
+        for (int i = 0 ; i < versionMatchParts.length ; i++) {
+            if (versionMatchParts[i].equals("*")) {
+                versionMatchNumberParts[i]	= -1;
+            } else if (versionMatchParts[i].equals("+")) {
+                versionMatchNumberParts[i]	= -2;
+            } else {
+                try {
+                    versionMatchNumberParts[i]	= Integer.parseInt(versionMatchParts[i]);
+                } catch (NumberFormatException ex) {
+                    throw new ParseException("Invalid version number \"" + versionMatchParts[i] + "\"", i);
+                }
+            }
+        }
+        return new StdVersionMatch(versionMatchNumberParts);
+
+    }
+
+    @Override
+    public String getVersionMatch() {
+        if (this.cachedStringRep == null) {
+            StringBuilder stringBuilder	= new StringBuilder();
+            int[] matchComponentsHere	= this.getMatchComponents();
+            if (matchComponentsHere != null && matchComponentsHere.length > 0) {
+                addComponent(stringBuilder, matchComponents[0]);
+                for (int i = 1 ; i < matchComponents.length ; i++) {
+                    stringBuilder.append('.');
+                    addComponent(stringBuilder, matchComponents[i]);
+                }
+            }
+            this.cachedStringRep	= stringBuilder.toString();
+        }
+        return this.cachedStringRep;
+    }
+
+    public int[] getMatchComponents() {
+        return this.matchComponents;
+    }
+
+    @Override
+    public boolean match(Version version, int cmp) {
+        int[] matchComponentsHere	= this.getMatchComponents();
+        if (matchComponentsHere == null || matchComponentsHere.length == 0) {
+            return false;
+        }
+        int[] versionComponents		= version.getVersionDigits();
+        if (versionComponents == null || versionComponents.length == 0) {
+            return false;
+        }
+        int	iMatch	= 0, iVersion	= 0;
+        int matchValue;
+        while (iMatch < matchComponents.length && iVersion < versionComponents.length) {
+            if ((matchValue = matchComponentsHere[iMatch]) == -2) {
+                iVersion	= versionComponents.length;
+            } else if (matchValue == -1) {
+                iVersion++;
+            } else {
+                int versionValue	= versionComponents[iVersion];
+                if (((cmp == 0) && (versionValue == matchValue)) ||
+                        ((cmp < 0) && (versionValue <= matchValue)) ||
+                        ((cmp > 0) && (versionValue >= matchValue))) {
+                    iVersion++;
                 } else {
-                        VersionMatch objVersionMatch	= (VersionMatch)obj;
-                        return ObjUtil.equalsAllowNull(this.getVersionMatch(), objVersionMatch.getVersionMatch());
+                    return false;
                 }
+            }
+            iMatch++;
         }
-        
-        @Override
-        public String toString() {
-                return this.getVersionMatch();
+        return (iVersion == versionComponents.length && iMatch == matchComponents.length);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof VersionMatch)) {
+            return false;
+        } else {
+            VersionMatch objVersionMatch	= (VersionMatch)obj;
+            return ObjUtil.equalsAllowNull(this.getVersionMatch(), objVersionMatch.getVersionMatch());
         }
+    }
+
+    @Override
+    public String toString() {
+        return this.getVersionMatch();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/RequestParser.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/RequestParser.java
index d4bf3ab..0b7c7dc 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/RequestParser.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/RequestParser.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,322 +47,322 @@
 import java.util.*;
 
 public class RequestParser {
-        private static Log logger	= LogFactory.getLog(RequestParser.class);
-        
-        //
-        // Create our data type factory object. We could make this static
-        //
-        protected static DataTypeFactory dataTypeFactory		= null;
-        protected static synchronized DataTypeFactory getDataTypeFactory() {
-                try {
-                        if (dataTypeFactory != null) {
-                                return dataTypeFactory;
-                        }
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                        if (dataTypeFactory == null) {
-                                logger.error("Could not create data type factory");
-                        }
-                } catch (FactoryException e) {
-                        logger.error("Can't get Data type Factory: " + e.getLocalizedMessage());
-                }
+    private static Log logger	= LogFactory.getLog(RequestParser.class);
+
+    //
+    // Create our data type factory object. We could make this static
+    //
+    protected static DataTypeFactory dataTypeFactory		= null;
+    protected static synchronized DataTypeFactory getDataTypeFactory() {
+        try {
+            if (dataTypeFactory != null) {
                 return dataTypeFactory;
+            }
+            dataTypeFactory	= DataTypeFactory.newInstance();
+            if (dataTypeFactory == null) {
+                logger.error("Could not create data type factory");
+            }
+        } catch (FactoryException e) {
+            logger.error("Can't get Data type Factory: " + e.getLocalizedMessage());
         }
+        return dataTypeFactory;
+    }
 
-        public static Request	parseRequest(Object obj) throws IllegalArgumentException, IllegalAccessException, DataTypeException {
-                //
-                // Our returned object
-                //
-                StdMutableRequest stdMutableRequest	= new StdMutableRequest();
-                //
-                // Our collection of attribute values
-                //
-                List<StdMutableRequestAttributes> attributes = new ArrayList<StdMutableRequestAttributes>();
-                //
-                // Get overall XACML request annotation fields
-                //
-                XACMLRequest requestAnnotation = obj.getClass().getAnnotation(XACMLRequest.class);
-                //
-                // Add these annotations into the request
-                //
-                stdMutableRequest.setReturnPolicyIdList(requestAnnotation.ReturnPolicyIdList());
-                stdMutableRequest.setCombinedDecision(requestAnnotation.CombinedDecision());
-                if (requestAnnotation.Defaults().equals(XACMLRequest.nullString) == false) {
-                        stdMutableRequest.setRequestDefaults(new StdRequestDefaults(URI.create(requestAnnotation.Defaults())));
-                }
-                //
-                // Check for multi-request
-                //
-                XACMLMultiRequest multi = requestAnnotation.multiRequest();
-                if (multi != null) {
-                        for (XACMLRequestReference reference : multi.values()) {
-                                Collection<RequestAttributesReference> refs = new ArrayList<RequestAttributesReference>();
-                                for (String id : reference.values()) {
-                                        refs.add(new StdRequestAttributesReference(id));
-                                }
-                                if (refs.isEmpty() == false) {
-                                        stdMutableRequest.add(new StdRequestReference(refs));
-                                }
-                        }
-                }
-                //
-                // Iterate all the fields in the object
-                //
-                for (Field field : obj.getClass().getDeclaredFields()) {
-                        if (logger.isTraceEnabled()) {
-                                logger.trace("Field: " + field);
-                        }
-                        XACMLSubject subject = field.getAnnotation(XACMLSubject.class);
-                        if (subject != null) {
-                                RequestParser.addAttribute(attributes, 
-                                                new IdentifierImpl(subject.category()), 
-                                                new IdentifierImpl(subject.attributeId()), 
-                                                subject.includeInResults(), 
-                                                (subject.datatype().equals(XACMLRequest.nullString) ? null : subject.datatype()), 
-                                                (subject.issuer().equals(XACMLRequest.nullString) ? null : subject.issuer()),
-                                                (subject.id().equals(XACMLRequest.nullString) ? null : subject.id()),
-                                                field, 
-                                                obj);
-                        }
-                        XACMLAction action = field.getAnnotation(XACMLAction.class);
-                        if (action != null) {
-                                RequestParser.addAttribute(attributes, 
-                                                new IdentifierImpl(action.category()), 
-                                                new IdentifierImpl(action.attributeId()), 
-                                                action.includeInResults(), 
-                                                (action.datatype().equals(XACMLRequest.nullString) ? null : action.datatype()), 
-                                                (action.issuer().equals(XACMLRequest.nullString) ? null : action.issuer()),
-                                                (action.id().equals(XACMLRequest.nullString) ? null : action.id()),
-                                                field, 
-                                                obj);
-                        }
-                        XACMLResource resource = field.getAnnotation(XACMLResource.class);
-                        if (resource != null) {
-                                RequestParser.addAttribute(attributes, 
-                                                new IdentifierImpl(resource.category()), 
-                                                new IdentifierImpl(resource.attributeId()), 
-                                                resource.includeInResults(), 
-                                                (resource.datatype().equals(XACMLRequest.nullString) ? null : resource.datatype()),
-                                                (resource.issuer().equals(XACMLRequest.nullString) ? null : resource.issuer()), 
-                                                (resource.id().equals(XACMLRequest.nullString) ? null : resource.id()), 
-                                                field, 
-                                                obj);
-                        }
-                        XACMLEnvironment environment = field.getAnnotation(XACMLEnvironment.class);
-                        if (environment != null) {
-                                RequestParser.addAttribute(attributes,
-                                                new IdentifierImpl(environment.category()), 
-                                                new IdentifierImpl(environment.attributeId()), 
-                                                environment.includeInResults(),
-                                                (environment.datatype().equals(XACMLRequest.nullString) ? null : environment.datatype()), 
-                                                (environment.issuer().equals(XACMLRequest.nullString) ? null : environment.issuer()),
-                                                (environment.id().equals(XACMLRequest.nullString) ? null : environment.id()),
-                                                field, 
-                                                obj);
-                        }
-                        XACMLAttribute attribute = field.getAnnotation(XACMLAttribute.class);
-                        if (attribute != null) {
-                                RequestParser.addAttribute(attributes, 
-                                                new IdentifierImpl(attribute.category()), 
-                                                new IdentifierImpl(attribute.attributeId()), 
-                                                attribute.includeInResults(), 
-                                                (attribute.datatype().equals(XACMLRequest.nullString) ? null : attribute.datatype()), 
-                                                (attribute.issuer().equals(XACMLRequest.nullString) ? null : attribute.issuer()),
-                                                (attribute.id().equals(XACMLRequest.nullString) ? null : attribute.id()),
-                                                field, 
-                                                obj);
-                        }
-                }
-                //
-                // Add in all the attributes
-                //
-                for (StdMutableRequestAttributes a : attributes) {
-                        stdMutableRequest.add(a);
-                }
-                if (logger.isDebugEnabled()) {
-                        logger.debug(AttributeUtils.prettyPrint(stdMutableRequest));
-                }
-                return stdMutableRequest;
+    public static Request	parseRequest(Object obj) throws IllegalArgumentException, IllegalAccessException, DataTypeException {
+        //
+        // Our returned object
+        //
+        StdMutableRequest stdMutableRequest	= new StdMutableRequest();
+        //
+        // Our collection of attribute values
+        //
+        List<StdMutableRequestAttributes> attributes = new ArrayList<StdMutableRequestAttributes>();
+        //
+        // Get overall XACML request annotation fields
+        //
+        XACMLRequest requestAnnotation = obj.getClass().getAnnotation(XACMLRequest.class);
+        //
+        // Add these annotations into the request
+        //
+        stdMutableRequest.setReturnPolicyIdList(requestAnnotation.ReturnPolicyIdList());
+        stdMutableRequest.setCombinedDecision(requestAnnotation.CombinedDecision());
+        if (requestAnnotation.Defaults().equals(XACMLRequest.nullString) == false) {
+            stdMutableRequest.setRequestDefaults(new StdRequestDefaults(URI.create(requestAnnotation.Defaults())));
         }
-        
-        public static void addAttribute(List<StdMutableRequestAttributes> attributes, 
-                                                                        Identifier category, 
-                                                                        Identifier attributeId, 
-                                                                        boolean includeInResults, 
-                                                                        String datatype, 
-                                                                        String issuer,
-                                                                        String id,
-                                                                        Field field, 
-                                                                        Object object) throws IllegalArgumentException, IllegalAccessException, DataTypeException {
-                //
-                // Create our attribute
-                //
-                StdMutableAttribute mutableAttribute	= new StdMutableAttribute();
-                mutableAttribute.setCategory(category);
-                mutableAttribute.setAttributeId(attributeId);
-                mutableAttribute.setIncludeInResults(includeInResults);
-                if (issuer != null && issuer.isEmpty() == false) {
-                        mutableAttribute.setIssuer(issuer);
+        //
+        // Check for multi-request
+        //
+        XACMLMultiRequest multi = requestAnnotation.multiRequest();
+        if (multi != null) {
+            for (XACMLRequestReference reference : multi.values()) {
+                Collection<RequestAttributesReference> refs = new ArrayList<RequestAttributesReference>();
+                for (String id : reference.values()) {
+                    refs.add(new StdRequestAttributesReference(id));
                 }
-                //
-                // Pull the values from the field
-                //
-                field.setAccessible(true);
-                Collection<AttributeValue<?>> value = RequestParser.extractValues(datatype, field, object);
-                if (value != null) {
-                        mutableAttribute.addValues(value);
-                } else {
-                        throw new IllegalArgumentException("Unable to extract attribute value from object");
+                if (refs.isEmpty() == false) {
+                    stdMutableRequest.add(new StdRequestReference(refs));
                 }
-                //
-                // Does the category exist?
-                //
-                boolean added = false;
-                for (StdMutableRequestAttributes a : attributes) {
-                        if (a.getCategory().equals(mutableAttribute.getCategory()) &&
-                                (id != null ? a.getXmlId().equals(id) : (a.getXmlId() == null ? true : false))) {
-                                //
-                                // Category exists, add in the attribute values
-                                //
-                                a.add(mutableAttribute);
-                                added = true;
-                                break;
-                        }
-                }
-                //
-                // Was it added?
-                //
-                if (added == false) {
-                        //
-                        // No the category does not exist yet or this has a different xml:id
-                        //
-                        StdMutableRequestAttributes newAttributes = new StdMutableRequestAttributes();
-                        newAttributes.setCategory(mutableAttribute.getCategory());
-                        newAttributes.setXmlId(id);
-                        newAttributes.add(mutableAttribute);
-                        attributes.add(newAttributes);
-                }
+            }
         }
+        //
+        // Iterate all the fields in the object
+        //
+        for (Field field : obj.getClass().getDeclaredFields()) {
+            if (logger.isTraceEnabled()) {
+                logger.trace("Field: " + field);
+            }
+            XACMLSubject subject = field.getAnnotation(XACMLSubject.class);
+            if (subject != null) {
+                RequestParser.addAttribute(attributes,
+                                           new IdentifierImpl(subject.category()),
+                                           new IdentifierImpl(subject.attributeId()),
+                                           subject.includeInResults(),
+                                           (subject.datatype().equals(XACMLRequest.nullString) ? null : subject.datatype()),
+                                           (subject.issuer().equals(XACMLRequest.nullString) ? null : subject.issuer()),
+                                           (subject.id().equals(XACMLRequest.nullString) ? null : subject.id()),
+                                           field,
+                                           obj);
+            }
+            XACMLAction action = field.getAnnotation(XACMLAction.class);
+            if (action != null) {
+                RequestParser.addAttribute(attributes,
+                                           new IdentifierImpl(action.category()),
+                                           new IdentifierImpl(action.attributeId()),
+                                           action.includeInResults(),
+                                           (action.datatype().equals(XACMLRequest.nullString) ? null : action.datatype()),
+                                           (action.issuer().equals(XACMLRequest.nullString) ? null : action.issuer()),
+                                           (action.id().equals(XACMLRequest.nullString) ? null : action.id()),
+                                           field,
+                                           obj);
+            }
+            XACMLResource resource = field.getAnnotation(XACMLResource.class);
+            if (resource != null) {
+                RequestParser.addAttribute(attributes,
+                                           new IdentifierImpl(resource.category()),
+                                           new IdentifierImpl(resource.attributeId()),
+                                           resource.includeInResults(),
+                                           (resource.datatype().equals(XACMLRequest.nullString) ? null : resource.datatype()),
+                                           (resource.issuer().equals(XACMLRequest.nullString) ? null : resource.issuer()),
+                                           (resource.id().equals(XACMLRequest.nullString) ? null : resource.id()),
+                                           field,
+                                           obj);
+            }
+            XACMLEnvironment environment = field.getAnnotation(XACMLEnvironment.class);
+            if (environment != null) {
+                RequestParser.addAttribute(attributes,
+                                           new IdentifierImpl(environment.category()),
+                                           new IdentifierImpl(environment.attributeId()),
+                                           environment.includeInResults(),
+                                           (environment.datatype().equals(XACMLRequest.nullString) ? null : environment.datatype()),
+                                           (environment.issuer().equals(XACMLRequest.nullString) ? null : environment.issuer()),
+                                           (environment.id().equals(XACMLRequest.nullString) ? null : environment.id()),
+                                           field,
+                                           obj);
+            }
+            XACMLAttribute attribute = field.getAnnotation(XACMLAttribute.class);
+            if (attribute != null) {
+                RequestParser.addAttribute(attributes,
+                                           new IdentifierImpl(attribute.category()),
+                                           new IdentifierImpl(attribute.attributeId()),
+                                           attribute.includeInResults(),
+                                           (attribute.datatype().equals(XACMLRequest.nullString) ? null : attribute.datatype()),
+                                           (attribute.issuer().equals(XACMLRequest.nullString) ? null : attribute.issuer()),
+                                           (attribute.id().equals(XACMLRequest.nullString) ? null : attribute.id()),
+                                           field,
+                                           obj);
+            }
+        }
+        //
+        // Add in all the attributes
+        //
+        for (StdMutableRequestAttributes a : attributes) {
+            stdMutableRequest.add(a);
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug(AttributeUtils.prettyPrint(stdMutableRequest));
+        }
+        return stdMutableRequest;
+    }
 
-        public static Collection<AttributeValue<?>>	extractValues(String datatype, Field field, Object object) throws IllegalArgumentException, IllegalAccessException, DataTypeException {
+    public static void addAttribute(List<StdMutableRequestAttributes> attributes,
+                                    Identifier category,
+                                    Identifier attributeId,
+                                    boolean includeInResults,
+                                    String datatype,
+                                    String issuer,
+                                    String id,
+                                    Field field,
+                                    Object object) throws IllegalArgumentException, IllegalAccessException, DataTypeException {
+        //
+        // Create our attribute
+        //
+        StdMutableAttribute mutableAttribute	= new StdMutableAttribute();
+        mutableAttribute.setCategory(category);
+        mutableAttribute.setAttributeId(attributeId);
+        mutableAttribute.setIncludeInResults(includeInResults);
+        if (issuer != null && issuer.isEmpty() == false) {
+            mutableAttribute.setIssuer(issuer);
+        }
+        //
+        // Pull the values from the field
+        //
+        field.setAccessible(true);
+        Collection<AttributeValue<?>> value = RequestParser.extractValues(datatype, field, object);
+        if (value != null) {
+            mutableAttribute.addValues(value);
+        } else {
+            throw new IllegalArgumentException("Unable to extract attribute value from object");
+        }
+        //
+        // Does the category exist?
+        //
+        boolean added = false;
+        for (StdMutableRequestAttributes a : attributes) {
+            if (a.getCategory().equals(mutableAttribute.getCategory()) &&
+                    (id != null ? a.getXmlId().equals(id) : (a.getXmlId() == null ? true : false))) {
                 //
-                // Synchronize?
+                // Category exists, add in the attribute values
                 //
-                DataTypeFactory dtFactory = getDataTypeFactory();
-                if (dtFactory == null) {
-                        logger.error("Could not create data type factory");
-                        return null;
-                }
-                //
-                // This is what we will return
-                //
-                Collection<AttributeValue<?>> values = new ArrayList<AttributeValue<?>>();
-                //
-                // Sanity check the object
-                //
-                Object fieldObject = field.get(object);
-                if (logger.isDebugEnabled()) {
-                        logger.debug(fieldObject);
-                }
-                if (fieldObject == null) {
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("field's object is null.");
-                        }
-                        return values;
-                }
-                //
-                // Are we working with a collection or an array?
-                //
-                if (field.get(object) instanceof Collection || field.get(object) instanceof Map) {
-                        Collection<?> objects = (Collection<?>) field.get(object);
-                        if (objects == null || objects.isEmpty()) {
-                                if (logger.isTraceEnabled()) {
-                                        logger.trace("empty collection");
-                                }
-                                return values;
-                        }
-                        if (logger.isTraceEnabled()) {
-                                logger.trace("Object is a collection");
-                        }
-                        for (Object obj : objects) {
-                                values.add(extractValue(datatype, obj));
-                        }
-                } else if (fieldObject.getClass().isArray()) {
-                        if (logger.isTraceEnabled()) {
-                                logger.trace("Object is an array");
-                        }
-                        for (int i = 0; i < Array.getLength(fieldObject); i++) {
-                                values.add(extractValue(datatype, Array.get(fieldObject, i)));
-                        }
-                } else {
-                        values.add(extractValue(datatype, field.get(object)));
+                a.add(mutableAttribute);
+                added = true;
+                break;
+            }
+        }
+        //
+        // Was it added?
+        //
+        if (added == false) {
+            //
+            // No the category does not exist yet or this has a different xml:id
+            //
+            StdMutableRequestAttributes newAttributes = new StdMutableRequestAttributes();
+            newAttributes.setCategory(mutableAttribute.getCategory());
+            newAttributes.setXmlId(id);
+            newAttributes.add(mutableAttribute);
+            attributes.add(newAttributes);
+        }
+    }
+
+    public static Collection<AttributeValue<?>>	extractValues(String datatype, Field field, Object object) throws IllegalArgumentException, IllegalAccessException, DataTypeException {
+        //
+        // Synchronize?
+        //
+        DataTypeFactory dtFactory = getDataTypeFactory();
+        if (dtFactory == null) {
+            logger.error("Could not create data type factory");
+            return null;
+        }
+        //
+        // This is what we will return
+        //
+        Collection<AttributeValue<?>> values = new ArrayList<AttributeValue<?>>();
+        //
+        // Sanity check the object
+        //
+        Object fieldObject = field.get(object);
+        if (logger.isDebugEnabled()) {
+            logger.debug(fieldObject);
+        }
+        if (fieldObject == null) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("field's object is null.");
+            }
+            return values;
+        }
+        //
+        // Are we working with a collection or an array?
+        //
+        if (field.get(object) instanceof Collection || field.get(object) instanceof Map) {
+            Collection<?> objects = (Collection<?>) field.get(object);
+            if (objects == null || objects.isEmpty()) {
+                if (logger.isTraceEnabled()) {
+                    logger.trace("empty collection");
                 }
                 return values;
+            }
+            if (logger.isTraceEnabled()) {
+                logger.trace("Object is a collection");
+            }
+            for (Object obj : objects) {
+                values.add(extractValue(datatype, obj));
+            }
+        } else if (fieldObject.getClass().isArray()) {
+            if (logger.isTraceEnabled()) {
+                logger.trace("Object is an array");
+            }
+            for (int i = 0; i < Array.getLength(fieldObject); i++) {
+                values.add(extractValue(datatype, Array.get(fieldObject, i)));
+            }
+        } else {
+            values.add(extractValue(datatype, field.get(object)));
         }
-        
-        protected static AttributeValue<?> extractValue(String datatype, Object object) throws DataTypeException {
+        return values;
+    }
+
+    protected static AttributeValue<?> extractValue(String datatype, Object object) throws DataTypeException {
+        //
+        // Is there a data type?
+        //
+        Identifier datatypeId;
+        if (datatype == null) {
+            //
+            // The data type is not specified, we will decipher it based
+            // on its Java class.
+            //
+            if (object instanceof String) {
+                datatypeId = XACML3.ID_DATATYPE_STRING;
+            } else if (object instanceof Integer || object instanceof Long) {
+                datatypeId = XACML3.ID_DATATYPE_INTEGER;
+            } else if (object instanceof Boolean) {
+                datatypeId = XACML3.ID_DATATYPE_BOOLEAN;
+            } else if (object instanceof Double || object instanceof Float) {
+                datatypeId = XACML3.ID_DATATYPE_DOUBLE;
+            } else if (object instanceof Date ||
+                       object instanceof Calendar ||
+                       object instanceof ISO8601DateTime) {
+                datatypeId = XACML3.ID_DATATYPE_DATETIME;
+            } else if (object instanceof URI) {
+                datatypeId = XACML3.ID_DATATYPE_ANYURI;
+            } else if (object instanceof ISO8601Date) {
+                datatypeId = XACML3.ID_DATATYPE_DATE;
+            } else if (object instanceof ISO8601Time) {
+                datatypeId = XACML3.ID_DATATYPE_TIME;
+            } else if (object instanceof RFC2396DomainName) {
+                datatypeId = XACML3.ID_DATATYPE_DNSNAME;
+            } else if (object instanceof byte[] ||
+                       object instanceof HexBinary) {
+                datatypeId = XACML3.ID_DATATYPE_HEXBINARY;
+            } else if (object instanceof Base64Binary) {
+                datatypeId = XACML3.ID_DATATYPE_BASE64BINARY;
+            } else if (object instanceof XPathDayTimeDuration) {
+                datatypeId = XACML3.ID_DATATYPE_DAYTIMEDURATION;
+            } else if (object instanceof IPAddress) {
+                datatypeId = XACML3.ID_DATATYPE_IPADDRESS;
+            } else if (object instanceof RFC822Name) {
+                datatypeId = XACML3.ID_DATATYPE_RFC822NAME;
+            } else if (object instanceof X500Principal) {
+                datatypeId = XACML3.ID_DATATYPE_X500NAME;
+            } else if (object instanceof XPathExpression ||
+                       object instanceof Node) {
+                datatypeId = XACML3.ID_DATATYPE_XPATHEXPRESSION;
+            } else if (object instanceof XPathYearMonthDuration) {
+                datatypeId = XACML3.ID_DATATYPE_YEARMONTHDURATION;
+            } else {
+                logger.warn("Cannot decipher java object, defaulting to String datatype. If this is not correct, you must specify the datatype in the annotation.");
                 //
-                // Is there a data type?
+                // Default to a string
                 //
-                Identifier datatypeId;
-                if (datatype == null) {
-                        //
-                        // The data type is not specified, we will decipher it based
-                        // on its Java class.
-                        //
-                        if (object instanceof String) {
-                                datatypeId = XACML3.ID_DATATYPE_STRING;
-                        } else if (object instanceof Integer || object instanceof Long) {
-                                datatypeId = XACML3.ID_DATATYPE_INTEGER;
-                        } else if (object instanceof Boolean) {
-                                datatypeId = XACML3.ID_DATATYPE_BOOLEAN;
-                        } else if (object instanceof Double || object instanceof Float) {
-                                datatypeId = XACML3.ID_DATATYPE_DOUBLE;
-                        } else if (object instanceof Date || 
-                                        object instanceof Calendar || 
-                                        object instanceof ISO8601DateTime) {
-                                datatypeId = XACML3.ID_DATATYPE_DATETIME;
-                        } else if (object instanceof URI) {
-                                datatypeId = XACML3.ID_DATATYPE_ANYURI;
-                        } else if (object instanceof ISO8601Date) {
-                                datatypeId = XACML3.ID_DATATYPE_DATE;
-                        } else if (object instanceof ISO8601Time) {
-                                datatypeId = XACML3.ID_DATATYPE_TIME;
-                        } else if (object instanceof RFC2396DomainName) {
-                                datatypeId = XACML3.ID_DATATYPE_DNSNAME;
-                        } else if (object instanceof byte[] ||
-                                        object instanceof HexBinary) {
-                                datatypeId = XACML3.ID_DATATYPE_HEXBINARY;
-                        } else if (object instanceof Base64Binary) {
-                                datatypeId = XACML3.ID_DATATYPE_BASE64BINARY;
-                        } else if (object instanceof XPathDayTimeDuration) {
-                                datatypeId = XACML3.ID_DATATYPE_DAYTIMEDURATION;
-                        } else if (object instanceof IPAddress) {
-                                datatypeId = XACML3.ID_DATATYPE_IPADDRESS;
-                        } else if (object instanceof RFC822Name) {
-                                datatypeId = XACML3.ID_DATATYPE_RFC822NAME;
-                        } else if (object instanceof X500Principal) {
-                                datatypeId = XACML3.ID_DATATYPE_X500NAME;
-                        } else if (object instanceof XPathExpression ||
-                                        object instanceof Node) {
-                                datatypeId = XACML3.ID_DATATYPE_XPATHEXPRESSION;
-                        } else if (object instanceof XPathYearMonthDuration) {
-                                datatypeId = XACML3.ID_DATATYPE_YEARMONTHDURATION;
-                        } else {
-                                logger.warn("Cannot decipher java object, defaulting to String datatype. If this is not correct, you must specify the datatype in the annotation.");
-                                //
-                                // Default to a string
-                                //
-                                datatypeId = XACML3.ID_DATATYPE_STRING;
-                        }
-                } else {
-                        datatypeId = new IdentifierImpl(datatype);
-                }
-                DataType<?> dataTypeExtended	= getDataTypeFactory().getDataType(datatypeId);
-                if (dataTypeExtended == null) {
-                        logger.error("DataType factory does not know datatype: " + datatype);
-                        return null;
-                }
-                return dataTypeExtended.createAttributeValue(object);
+                datatypeId = XACML3.ID_DATATYPE_STRING;
+            }
+        } else {
+            datatypeId = new IdentifierImpl(datatype);
         }
+        DataType<?> dataTypeExtended	= getDataTypeFactory().getDataType(datatypeId);
+        if (dataTypeExtended == null) {
+            logger.error("DataType factory does not know datatype: " + datatype);
+            return null;
+        }
+        return dataTypeExtended.createAttributeValue(object);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLAction.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLAction.java
index bffbaa0..c7aafdc 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLAction.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLAction.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,10 +42,10 @@
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XACMLAction {
-        String	category() default "urn:oasis:names:tc:xacml:3.0:attribute-category:action";
-        String	attributeId() default "urn:oasis:names:tc:xacml:1.0:action:action-id";
-        String	datatype() default XACMLRequest.nullString;
-        String	issuer() default XACMLRequest.nullString;
-        String	id() default XACMLRequest.nullString;
-        boolean includeInResults() default false;
+String	category() default "urn:oasis:names:tc:xacml:3.0:attribute-category:action";
+String	attributeId() default "urn:oasis:names:tc:xacml:1.0:action:action-id";
+String	datatype() default XACMLRequest.nullString;
+String	issuer() default XACMLRequest.nullString;
+String	id() default XACMLRequest.nullString;
+boolean includeInResults() default false;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLAttribute.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLAttribute.java
index 1dff9ba..c59b8ed 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLAttribute.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLAttribute.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,10 +42,10 @@
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XACMLAttribute {
-        String	category() default "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject";
-        String	attributeId() default "urn:oasis:names:tc:xacml:1.0:subject:subject-id";
-        String	datatype() default XACMLRequest.nullString;
-        String	issuer() default XACMLRequest.nullString;
-        String	id() default XACMLRequest.nullString;
-        boolean includeInResults() default false;
+String	category() default "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject";
+String	attributeId() default "urn:oasis:names:tc:xacml:1.0:subject:subject-id";
+String	datatype() default XACMLRequest.nullString;
+String	issuer() default XACMLRequest.nullString;
+String	id() default XACMLRequest.nullString;
+boolean includeInResults() default false;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLEnvironment.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLEnvironment.java
index 961ec17..f5522ea 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLEnvironment.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLEnvironment.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,10 +42,10 @@
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XACMLEnvironment {
-        String	category() default "urn:oasis:names:tc:xacml:3.0:attribute-category:environment";
-        String	attributeId() default "urn:oasis:names:tc:xacml:1.0:environment:current-dateTime";
-        String	datatype() default XACMLRequest.nullString;
-        String	issuer() default XACMLRequest.nullString;
-        String	id() default XACMLRequest.nullString;
-        boolean includeInResults() default false;
+String	category() default "urn:oasis:names:tc:xacml:3.0:attribute-category:environment";
+String	attributeId() default "urn:oasis:names:tc:xacml:1.0:environment:current-dateTime";
+String	datatype() default XACMLRequest.nullString;
+String	issuer() default XACMLRequest.nullString;
+String	id() default XACMLRequest.nullString;
+boolean includeInResults() default false;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLMultiRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLMultiRequest.java
index 9fe80bf..a41e12b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLMultiRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLMultiRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,5 +42,5 @@
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XACMLMultiRequest {
-        XACMLRequestReference[] values() default @XACMLRequestReference();
+XACMLRequestReference[] values() default @XACMLRequestReference();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLRequest.java
index 659bbd8..789e990 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,10 +42,10 @@
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XACMLRequest {
-        boolean	ReturnPolicyIdList() default false;
-        boolean CombinedDecision() default false;
-        String Defaults() default XACMLRequest.nullString;
-        XACMLMultiRequest multiRequest() default @XACMLMultiRequest();
-        
-        public static String nullString = "NULL";
+boolean	ReturnPolicyIdList() default false;
+boolean CombinedDecision() default false;
+String Defaults() default XACMLRequest.nullString;
+XACMLMultiRequest multiRequest() default @XACMLMultiRequest();
+
+    public static String nullString = "NULL";
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLRequestReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLRequestReference.java
index 48ec004..cad1479 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLRequestReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLRequestReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,5 +42,5 @@
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XACMLRequestReference {
-        String[] values() default {};
+String[] values() default {};
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLResource.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLResource.java
index 77a15bd..22878ad 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLResource.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLResource.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,10 +42,10 @@
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XACMLResource {
-        String	category() default "urn:oasis:names:tc:xacml:3.0:attribute-category:resource";
-        String	attributeId() default "urn:oasis:names:tc:xacml:1.0:resource:resource-id";
-        String	datatype() default XACMLRequest.nullString;
-        String	issuer() default XACMLRequest.nullString;
-        String	id() default XACMLRequest.nullString;
-        boolean includeInResults() default false;
+String	category() default "urn:oasis:names:tc:xacml:3.0:attribute-category:resource";
+String	attributeId() default "urn:oasis:names:tc:xacml:1.0:resource:resource-id";
+String	datatype() default XACMLRequest.nullString;
+String	issuer() default XACMLRequest.nullString;
+String	id() default XACMLRequest.nullString;
+boolean includeInResults() default false;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLSubject.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLSubject.java
index 14bf306..90443af 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLSubject.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/annotations/XACMLSubject.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,10 +42,10 @@
 @Inherited
 @Retention(RetentionPolicy.RUNTIME)
 public @interface XACMLSubject {
-        String	category() default "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject";
-        String	attributeId() default "urn:oasis:names:tc:xacml:1.0:subject:subject-id";
-        String	datatype() default XACMLRequest.nullString;
-        String	issuer() default XACMLRequest.nullString;
-        String	id() default XACMLRequest.nullString;
-        boolean includeInResults() default false;
+String	category() default "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject";
+String	attributeId() default "urn:oasis:names:tc:xacml:1.0:subject:subject-id";
+String	datatype() default XACMLRequest.nullString;
+String	issuer() default XACMLRequest.nullString;
+String	id() default XACMLRequest.nullString;
+boolean includeInResults() default false;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/Base64Binary.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/Base64Binary.java
index 2f5ddd0..8cf8fe9 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/Base64Binary.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/Base64Binary.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,97 +40,97 @@
 
 /**
  * Base64Binary provides utilities for converting the XACML base64Binary data type to and from <code>String</code> values.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class Base64Binary implements SemanticString {
-        private byte[]	data;
-        
-        /**
-         * Creates a <code>Base64Binary</code> object from an array of <code>byte</code>s.
-         * 
-         * @param dataIn the array of <code>byte</code>s
-         */
-        public Base64Binary(byte[] dataIn) {
-                this.data	= dataIn;
-        }
-        
-        /**
-         * Creates a new <code>Base64Binary</code> by parsing the given <code>String</code> as hex binary data.
-         * 
-         * @param stringBase64Binary the <code>String</code> to convert
-         * @return a new <code>Base64Binary</code> from the converted <code>String</code>.
-         */
-        public static Base64Binary newInstance(String stringBase64Binary) throws DecoderException {
-                if (stringBase64Binary == null) {
-                        return null;
-                }
-                byte[]	base64Bytes	= (byte[])new Base64().decode(stringBase64Binary);
-                return new Base64Binary(base64Bytes);
-        }
+    private byte[]	data;
 
-        /**
-         * Gets the array of <code>byte</code>s for this <code>Base64Binary</code>.
-         * 
-         * @return the array of <code>byte</code>s for this <code>Base64Binary</code>.
-         */
-        public byte[] getData() {
-                return this.data;
+    /**
+     * Creates a <code>Base64Binary</code> object from an array of <code>byte</code>s.
+     *
+     * @param dataIn the array of <code>byte</code>s
+     */
+    public Base64Binary(byte[] dataIn) {
+        this.data	= dataIn;
+    }
+
+    /**
+     * Creates a new <code>Base64Binary</code> by parsing the given <code>String</code> as hex binary data.
+     *
+     * @param stringBase64Binary the <code>String</code> to convert
+     * @return a new <code>Base64Binary</code> from the converted <code>String</code>.
+     */
+    public static Base64Binary newInstance(String stringBase64Binary) throws DecoderException {
+        if (stringBase64Binary == null) {
+            return null;
         }
-        
-        @Override
-        public int hashCode() {
-                return (this.getData() == null ? 0 : this.getData().hashCode());
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof Base64Binary)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
+        byte[]	base64Bytes	= (byte[])new Base64().decode(stringBase64Binary);
+        return new Base64Binary(base64Bytes);
+    }
+
+    /**
+     * Gets the array of <code>byte</code>s for this <code>Base64Binary</code>.
+     *
+     * @return the array of <code>byte</code>s for this <code>Base64Binary</code>.
+     */
+    public byte[] getData() {
+        return this.data;
+    }
+
+    @Override
+    public int hashCode() {
+        return (this.getData() == null ? 0 : this.getData().hashCode());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof Base64Binary)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            Base64Binary	hexBinaryObj	= (Base64Binary)obj;
+            if (this.getData() == null) {
+                if (hexBinaryObj.getData() == null) {
+                    return true;
                 } else {
-                        Base64Binary	hexBinaryObj	= (Base64Binary)obj;
-                        if (this.getData() == null) {
-                                if (hexBinaryObj.getData() == null) {
-                                        return true;
-                                } else {
-                                        return false;
-                                }
-                        } else {
-                                if (hexBinaryObj.getData() == null) {
-                                        return false;
-                                } else {
-                                        return Arrays.equals(this.getData(), hexBinaryObj.getData());
-                                }
-                        }
+                    return false;
                 }
-        }
-        
-        /**
-         * Gets the <code>String</code> Base 64 binary representation of this <code>Base64Binary</code> object.
-         *  
-         * @return the <code>String</code> Base 64 binary representation of this <code>Base64Binary</code> object.
-         */
-        public String stringValue() {
-                if (this.getData() == null) {
-                        return null;
+            } else {
+                if (hexBinaryObj.getData() == null) {
+                    return false;
                 } else {
-                        return Base64.encodeBase64String(this.getData());
-                }		
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                byte[] thisData	= this.getData();
-                if (thisData != null) {
-                        stringBuilder.append("data=");
-                        stringBuilder.append(StringUtils.toString(thisData));
+                    return Arrays.equals(this.getData(), hexBinaryObj.getData());
                 }
-                stringBuilder.append("}");
-                return stringBuilder.toString();
+            }
         }
+    }
+
+    /**
+     * Gets the <code>String</code> Base 64 binary representation of this <code>Base64Binary</code> object.
+     *
+     * @return the <code>String</code> Base 64 binary representation of this <code>Base64Binary</code> object.
+     */
+    public String stringValue() {
+        if (this.getData() == null) {
+            return null;
+        } else {
+            return Base64.encodeBase64String(this.getData());
+        }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        byte[] thisData	= this.getData();
+        if (thisData != null) {
+            stringBuilder.append("data=");
+            stringBuilder.append(StringUtils.toString(thisData));
+        }
+        stringBuilder.append("}");
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeAnyURI.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeAnyURI.java
index db99b97..c9491fb 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeAnyURI.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeAnyURI.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,48 +39,48 @@
 
 /**
  * DataTypeAnyURI extends {@link DataTypeBase} for the XACML anyURI data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DataTypeAnyURI extends DataTypeBase<URI> {
-        private static final DataTypeAnyURI	singleInstance	= new DataTypeAnyURI();
-        
-        /**
-         * Creates a <code>DataTypeAnyURI</code> with the XACML anyURI id and the java <code>URI</code> class.
-         */
-        private DataTypeAnyURI() {
-                super(XACML.ID_DATATYPE_ANYURI, URI.class);
-        }
-        
-        public static DataTypeAnyURI newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeAnyURI	singleInstance	= new DataTypeAnyURI();
 
-        @Override
-        public URI convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof URI)) {
-                        return (URI)source;
-                } else if (source instanceof Identifier) {
-                        return ((Identifier)source).getUri();
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        }
-                        URI		uriValue	= null;
-                        try {
-                                //uriValue	= URI.create(stringValue);
-                                uriValue	= new URI(stringValue);
-                        } catch (URISyntaxException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to anyURI", ex);
-                        }
-                        return uriValue;
-                }
-        }
+    /**
+     * Creates a <code>DataTypeAnyURI</code> with the XACML anyURI id and the java <code>URI</code> class.
+     */
+    private DataTypeAnyURI() {
+        super(XACML.ID_DATATYPE_ANYURI, URI.class);
+    }
 
-        @Override
-        public String toStringValue(URI source) throws DataTypeException {
-                return (source == null ? null : source.toString());
+    public static DataTypeAnyURI newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public URI convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof URI)) {
+            return (URI)source;
+        } else if (source instanceof Identifier) {
+            return ((Identifier)source).getUri();
+        } else {
+            String stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            }
+            URI		uriValue	= null;
+            try {
+                //uriValue	= URI.create(stringValue);
+                uriValue	= new URI(stringValue);
+            } catch (URISyntaxException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to anyURI", ex);
+            }
+            return uriValue;
         }
+    }
+
+    @Override
+    public String toStringValue(URI source) throws DataTypeException {
+        return (source == null ? null : source.toString());
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBase.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBase.java
index 93dcc0f..24fe946 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBase.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBase.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,103 +47,103 @@
 /**
  * DataTypeBase provides common implementation components of the {@link com.att.research.xacml.api.DataType} interface
  * that is used by the specific instance implementations.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  *
  * @param <T> the value type for conversion
  */
 public abstract class DataTypeBase<T> implements DataType<T> {
-        private Identifier	id;
-        private Class<T>	classConvert;
-        
-        protected DataTypeBase(Identifier identifierIn, Class<T> classConvertIn) {
-                this.id				= identifierIn;
-                this.classConvert	= classConvertIn;
+    private Identifier	id;
+    private Class<T>	classConvert;
+
+    protected DataTypeBase(Identifier identifierIn, Class<T> classConvertIn) {
+        this.id				= identifierIn;
+        this.classConvert	= classConvertIn;
+    }
+
+    protected Class<T> getClassConvert() {
+        return this.classConvert;
+    }
+
+    private Object collapse(Collection<?> objects) throws DataTypeException {
+        if (objects == null || objects.size() == 0) {
+            return "";
+        } else if (objects.size() == 1) {
+            return objects.iterator().next();
+        } else {
+            Iterator<?>			iterObjects	= objects.iterator();
+            StringBuilder		stringBuilder	= new StringBuilder();
+            while (iterObjects.hasNext()) {
+                stringBuilder.append(this.convertToString(iterObjects.next()));
+            }
+            return stringBuilder.toString();
         }
-        
-        protected Class<T> getClassConvert() {
-                return this.classConvert;
+
+    }
+
+    /**
+     * This is a common utility method to handle <code>String</code> conversion that can be
+     * used by all derived <code>DataTypeBase</code> classes.
+     *
+     * @param obj the <code>Object</code> to convert to a <code>String</code>
+     * @return the <code>String</code> representation of the <code>Object</code>
+     */
+    protected String convertToString(Object obj) throws DataTypeException {
+        if (obj instanceof String) {
+            return (String)obj;
+        } else if (this.getClassConvert().isInstance(obj)) {
+            return this.toStringValue(this.getClassConvert().cast(obj));
+        } else if (obj instanceof Node) {
+            return ((Node)obj).getTextContent();
+        } else if (obj instanceof List) {
+            return this.convertToString(this.collapse((Collection<?>)obj));
+        } else {
+            return obj.toString();
         }
-        
-        private Object collapse(Collection<?> objects) throws DataTypeException {
-                if (objects == null || objects.size() == 0) {
-                        return "";
-                } else if (objects.size() == 1) {
-                        return objects.iterator().next();
-                } else {
-                        Iterator<?>			iterObjects	= objects.iterator();
-                        StringBuilder		stringBuilder	= new StringBuilder();
-                        while (iterObjects.hasNext()) {
-                                stringBuilder.append(this.convertToString(iterObjects.next()));
-                        }
-                        return stringBuilder.toString();
-                }
-                
-        }
-        
-        /**
-         * This is a common utility method to handle <code>String</code> conversion that can be
-         * used by all derived <code>DataTypeBase</code> classes.
-         * 
-         * @param obj the <code>Object</code> to convert to a <code>String</code>
-         * @return the <code>String</code> representation of the <code>Object</code>
+    }
+
+    @Override
+    public Identifier getId() {
+        return this.id;
+    }
+
+    @Override
+    public AttributeValue<T> createAttributeValue(Object source) throws DataTypeException {
+        /*
+         * If the given Object is a DOM Node, get the XPathCategory from it and use it to
+         * create the StdAttributeValue.
          */
-        protected String convertToString(Object obj) throws DataTypeException {
-                if (obj instanceof String) {
-                        return (String)obj;
-                } else if (this.getClassConvert().isInstance(obj)) {
-                        return this.toStringValue(this.getClassConvert().cast(obj));
-                } else if (obj instanceof Node) {
-                        return ((Node)obj).getTextContent();
-                } else if (obj instanceof List) {
-                        return this.convertToString(this.collapse((Collection<?>)obj));
-                } else {
-                        return obj.toString();
-                }
+        if (source != null && (source instanceof Node)) {
+            Identifier xpathCategory	= null;
+            try {
+                xpathCategory	= DOMUtil.getIdentifierAttribute((Node)source, XACML3.ATTRIBUTE_XPATHCATEGORY, false);
+            } catch (Exception ex) {
+                // TODO:
+            }
+            return new StdAttributeValue<T>(this.getId(), this.convert(source), xpathCategory);
+        } else {
+            return new StdAttributeValue<T>(this.getId(), this.convert(source));
         }
+    }
 
-        @Override
-        public Identifier getId() {
-                return this.id;
-        }
-        
-        @Override
-        public AttributeValue<T> createAttributeValue(Object source) throws DataTypeException {
-                /*
-                 * If the given Object is a DOM Node, get the XPathCategory from it and use it to
-                 * create the StdAttributeValue.
-                 */
-                if (source != null && (source instanceof Node)) {
-                        Identifier xpathCategory	= null;
-                        try {
-                                xpathCategory	= DOMUtil.getIdentifierAttribute((Node)source, XACML3.ATTRIBUTE_XPATHCATEGORY, false);
-                        } catch (Exception ex) {
-                                // TODO:
-                        }
-                        return new StdAttributeValue<T>(this.getId(), this.convert(source), xpathCategory);
-                } else {
-                        return new StdAttributeValue<T>(this.getId(), this.convert(source));
-                }
-        }
-        
-        @Override
-        public AttributeValue<T> createAttributeValue(Object source, Identifier xpathCategory) throws DataTypeException {
-                return new StdAttributeValue<T>(this.getId(), this.convert(source), xpathCategory);
-        }
+    @Override
+    public AttributeValue<T> createAttributeValue(Object source, Identifier xpathCategory) throws DataTypeException {
+        return new StdAttributeValue<T>(this.getId(), this.convert(source), xpathCategory);
+    }
 
-        @Override
-        public AttributeValue<T> convertAttributeValue(AttributeValue<?> attributeValue) throws DataTypeException {
-                if (attributeValue == null) {
-                        return null;
-                } else {
-                        return new StdAttributeValue<T>(this.getId(), this.convert(attributeValue.getValue()), attributeValue.getXPathCategory());
-                }
+    @Override
+    public AttributeValue<T> convertAttributeValue(AttributeValue<?> attributeValue) throws DataTypeException {
+        if (attributeValue == null) {
+            return null;
+        } else {
+            return new StdAttributeValue<T>(this.getId(), this.convert(attributeValue.getValue()), attributeValue.getXPathCategory());
         }
-        
-        @Override
-        public String toStringValue(T source) throws DataTypeException {
-                return (source == null ? null : source.toString());
-        }
+    }
+
+    @Override
+    public String toStringValue(T source) throws DataTypeException {
+        return (source == null ? null : source.toString());
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBase64Binary.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBase64Binary.java
index 5fcf987..5596924 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBase64Binary.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBase64Binary.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,45 +35,45 @@
 
 /**
  * DataTypeBase64Binary extends {@link DataTypeBase} for the XACML base64Binary data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeBase64Binary extends DataTypeBase<Base64Binary> {
-        private static final DataTypeBase64Binary	singleInstance	= new DataTypeBase64Binary();
-        
-        private DataTypeBase64Binary() {
-                super(XACML.ID_DATATYPE_BASE64BINARY, Base64Binary.class);
-        }
-        
-        public static DataTypeBase64Binary newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeBase64Binary	singleInstance	= new DataTypeBase64Binary();
 
-        @Override
-        public Base64Binary convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof Base64Binary)) {
-                        return (Base64Binary)source;
-                } else if (source instanceof byte[]) {
-                        return new Base64Binary((byte[])source);
-                } else {
-                        String	stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        }
-                        Base64Binary	base64Binary	= null;
-                        try {
-                                base64Binary	= Base64Binary.newInstance(stringValue);
-                        } catch (Exception ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to Base64Binary", ex);				
-                        }
-                        return base64Binary;
-                }
-        }
+    private DataTypeBase64Binary() {
+        super(XACML.ID_DATATYPE_BASE64BINARY, Base64Binary.class);
+    }
 
-        @Override
-        public String toStringValue(Base64Binary source) throws DataTypeException {
-                return (source == null ? null : source.stringValue());
+    public static DataTypeBase64Binary newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public Base64Binary convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof Base64Binary)) {
+            return (Base64Binary)source;
+        } else if (source instanceof byte[]) {
+            return new Base64Binary((byte[])source);
+        } else {
+            String	stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            }
+            Base64Binary	base64Binary	= null;
+            try {
+                base64Binary	= Base64Binary.newInstance(stringValue);
+            } catch (Exception ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to Base64Binary", ex);
+            }
+            return base64Binary;
         }
+    }
+
+    @Override
+    public String toStringValue(Base64Binary source) throws DataTypeException {
+        return (source == null ? null : source.stringValue());
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBoolean.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBoolean.java
index d26f472..70cf103 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBoolean.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeBoolean.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,48 +38,48 @@
 /**
  * DataTypeBoolean extends {@link DataTypeBase} with conversions to the
  * java <code>Boolean</code> type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeBoolean extends DataTypeBase<Boolean> {
-        private static final DataTypeBoolean	singleInstance	= new DataTypeBoolean();
-        
-        public static final AttributeValue<Boolean>	AV_TRUE	= new StdAttributeValue<Boolean>(XACML.ID_DATATYPE_BOOLEAN, Boolean.TRUE);
-        public static final AttributeValue<Boolean> AV_FALSE	= new StdAttributeValue<Boolean>(XACML.ID_DATATYPE_BOOLEAN, Boolean.FALSE);
-        
-        private DataTypeBoolean() {
-                super(XACML.ID_DATATYPE_BOOLEAN, Boolean.class);
-        }
-        
-        public static DataTypeBoolean newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeBoolean	singleInstance	= new DataTypeBoolean();
 
-        @Override
-        public Boolean convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof Boolean)) {
-                        return (Boolean)source;
-                } else if (source instanceof Integer) {
-                        int	iValue	= ((Integer)source).intValue();
-                        if (iValue == 0) {
-                                return Boolean.FALSE;
-                        } else if (iValue == 1) {
-                                return Boolean.TRUE;
-                        } else {
-                                throw new DataTypeException(this, "Cannot convert from integer " + iValue + " to boolean");
-                        }
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        } else if (stringValue.equals("0") || stringValue.equalsIgnoreCase("false")) {
-                                return Boolean.FALSE;
-                        } else if (stringValue.equals("1") || stringValue.equalsIgnoreCase("true")) {
-                                return Boolean.TRUE;
-                        } else {
-                                throw new DataTypeException(this, "Cannot convert from \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to boolean");
-                        }
-                }
+    public static final AttributeValue<Boolean>	AV_TRUE	= new StdAttributeValue<Boolean>(XACML.ID_DATATYPE_BOOLEAN, Boolean.TRUE);
+    public static final AttributeValue<Boolean> AV_FALSE	= new StdAttributeValue<Boolean>(XACML.ID_DATATYPE_BOOLEAN, Boolean.FALSE);
+
+    private DataTypeBoolean() {
+        super(XACML.ID_DATATYPE_BOOLEAN, Boolean.class);
+    }
+
+    public static DataTypeBoolean newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public Boolean convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof Boolean)) {
+            return (Boolean)source;
+        } else if (source instanceof Integer) {
+            int	iValue	= ((Integer)source).intValue();
+            if (iValue == 0) {
+                return Boolean.FALSE;
+            } else if (iValue == 1) {
+                return Boolean.TRUE;
+            } else {
+                throw new DataTypeException(this, "Cannot convert from integer " + iValue + " to boolean");
+            }
+        } else {
+            String stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            } else if (stringValue.equals("0") || stringValue.equalsIgnoreCase("false")) {
+                return Boolean.FALSE;
+            } else if (stringValue.equals("1") || stringValue.equalsIgnoreCase("true")) {
+                return Boolean.TRUE;
+            } else {
+                throw new DataTypeException(this, "Cannot convert from \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to boolean");
+            }
         }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDNSName.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDNSName.java
index a628663..e93cf81 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDNSName.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDNSName.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,38 +38,38 @@
 /**
  * DataTypeRFC2396DomainName extends {@link DataTypeBase} to implement the XACML
  * RFC2396 domainName data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeDNSName extends DataTypeSemanticStringBase<RFC2396DomainName> {
-        private static final DataTypeDNSName	singleInstance	= new DataTypeDNSName();
-        
-        private DataTypeDNSName() {
-                super(XACML2.ID_DATATYPE_DNSNAME, RFC2396DomainName.class);
-        }
-        
-        public static DataTypeDNSName newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeDNSName	singleInstance	= new DataTypeDNSName();
 
-        @Override
-        public RFC2396DomainName convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof RFC2396DomainName)) {
-                        return (RFC2396DomainName)source;
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        }
-                        RFC2396DomainName	rfc2396DomainName	= null;
-                        try {
-                                rfc2396DomainName	= RFC2396DomainName.newInstance(stringValue);
-                        } catch (ParseException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to DNSName", ex);
-                        }
-                        return rfc2396DomainName;
-                }
+    private DataTypeDNSName() {
+        super(XACML2.ID_DATATYPE_DNSNAME, RFC2396DomainName.class);
+    }
+
+    public static DataTypeDNSName newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public RFC2396DomainName convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof RFC2396DomainName)) {
+            return (RFC2396DomainName)source;
+        } else {
+            String stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            }
+            RFC2396DomainName	rfc2396DomainName	= null;
+            try {
+                rfc2396DomainName	= RFC2396DomainName.newInstance(stringValue);
+            } catch (ParseException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to DNSName", ex);
+            }
+            return rfc2396DomainName;
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDate.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDate.java
index 8e875bb..8ae62d4 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDate.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDate.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,38 +40,38 @@
 /**
  * DataTypeDate extends {@link DataTypeBase} to implement the XACML Date type with
  * a java <code>Date</code> representation.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeDate extends DataTypeSemanticStringBase<ISO8601Date> {
-        private static final DataTypeDate	singleInstance	= new DataTypeDate();
-        
-        private DataTypeDate() {
-                super(XACML.ID_DATATYPE_DATE, ISO8601Date.class);
-        }
-        
-        public static DataTypeDate newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeDate	singleInstance	= new DataTypeDate();
 
-        @Override
-        public ISO8601Date convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof ISO8601Date)) {
-                        return (ISO8601Date)source;
-                } else if (source instanceof Date) {
-                        return ISO8601Date.fromDate((Date)source);
-                } else if (source instanceof Calendar) {
-                        return ISO8601Date.fromCalendar((Calendar)source);
-                } else {
-                        String	stringValue	= this.convertToString(source);
-                        ISO8601Date	dateValue	= null;
-                        try {
-                                dateValue	= ISO8601Date.fromISO8601DateString(stringValue);
-                        } catch (ParseException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to Date", ex);
-                        }
-                        return dateValue;
-                }
+    private DataTypeDate() {
+        super(XACML.ID_DATATYPE_DATE, ISO8601Date.class);
+    }
+
+    public static DataTypeDate newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public ISO8601Date convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof ISO8601Date)) {
+            return (ISO8601Date)source;
+        } else if (source instanceof Date) {
+            return ISO8601Date.fromDate((Date)source);
+        } else if (source instanceof Calendar) {
+            return ISO8601Date.fromCalendar((Calendar)source);
+        } else {
+            String	stringValue	= this.convertToString(source);
+            ISO8601Date	dateValue	= null;
+            try {
+                dateValue	= ISO8601Date.fromISO8601DateString(stringValue);
+            } catch (ParseException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to Date", ex);
+            }
+            return dateValue;
         }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDateTime.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDateTime.java
index 0cee04d..39f044b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDateTime.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDateTime.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,39 +39,39 @@
 
 /**
  * DataTypeDateTime extends {@link DataTypeBase} for the XACML DateTime type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeDateTime extends DataTypeSemanticStringBase<ISO8601DateTime> {
-        private static final DataTypeDateTime	singleInstance	= new DataTypeDateTime();
-        
-        private DataTypeDateTime() {
-                super(XACML.ID_DATATYPE_DATETIME, ISO8601DateTime.class);
-        }
-        
-        public static DataTypeDateTime newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeDateTime	singleInstance	= new DataTypeDateTime();
 
-        @Override
-        public ISO8601DateTime convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof ISO8601DateTime)) {
-                        return (ISO8601DateTime)source;
-                } else if (source instanceof Calendar) {
-                        return ISO8601DateTime.fromCalendar((Calendar)source);
-                } else if (source instanceof Date) {
-                        return ISO8601DateTime.fromDate((Date)source);
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        ISO8601DateTime	dateTime	= null;
-                        try {
-                                dateTime	= ISO8601DateTime.fromISO8601DateTimeString(stringValue);
-                        } catch (ParseException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to DateTime", ex);
-                        }
-                        return dateTime;
-                }
+    private DataTypeDateTime() {
+        super(XACML.ID_DATATYPE_DATETIME, ISO8601DateTime.class);
+    }
+
+    public static DataTypeDateTime newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public ISO8601DateTime convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof ISO8601DateTime)) {
+            return (ISO8601DateTime)source;
+        } else if (source instanceof Calendar) {
+            return ISO8601DateTime.fromCalendar((Calendar)source);
+        } else if (source instanceof Date) {
+            return ISO8601DateTime.fromDate((Date)source);
+        } else {
+            String stringValue	= this.convertToString(source);
+            ISO8601DateTime	dateTime	= null;
+            try {
+                dateTime	= ISO8601DateTime.fromISO8601DateTimeString(stringValue);
+            } catch (ParseException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to DateTime", ex);
+            }
+            return dateTime;
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDayTimeDuration.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDayTimeDuration.java
index 1b8417b..489591b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDayTimeDuration.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDayTimeDuration.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,38 +38,38 @@
 /**
  * DataTypeDayTimeDuration extends {@link DataTypeBase} to implement the XACML dayTimeDuration
  * data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeDayTimeDuration extends DataTypeSemanticStringBase<XPathDayTimeDuration> {
-        private static final DataTypeDayTimeDuration	singleInstance	= new DataTypeDayTimeDuration();
-        
-        private DataTypeDayTimeDuration() {
-                super(XACML3.ID_DATATYPE_DAYTIMEDURATION, XPathDayTimeDuration.class);
-        }
-        
-        public static DataTypeDayTimeDuration newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeDayTimeDuration	singleInstance	= new DataTypeDayTimeDuration();
 
-        @Override
-        public XPathDayTimeDuration convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof XPathDayTimeDuration)) {
-                        return (XPathDayTimeDuration)source;
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        }
-                        XPathDayTimeDuration	xpathDayTimeDuration	= null;
-                        try {
-                                xpathDayTimeDuration	= XPathDayTimeDuration.newInstance(stringValue);
-                        } catch (ParseException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to DayTimeDuration", ex);
-                        }
-                        return xpathDayTimeDuration;
-                }
+    private DataTypeDayTimeDuration() {
+        super(XACML3.ID_DATATYPE_DAYTIMEDURATION, XPathDayTimeDuration.class);
+    }
+
+    public static DataTypeDayTimeDuration newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public XPathDayTimeDuration convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof XPathDayTimeDuration)) {
+            return (XPathDayTimeDuration)source;
+        } else {
+            String stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            }
+            XPathDayTimeDuration	xpathDayTimeDuration	= null;
+            try {
+                xpathDayTimeDuration	= XPathDayTimeDuration.newInstance(stringValue);
+            } catch (ParseException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to DayTimeDuration", ex);
+            }
+            return xpathDayTimeDuration;
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDouble.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDouble.java
index 9231f24..41d5f04 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDouble.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeDouble.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,41 +35,41 @@
 
 /**
  * DataTypeDouble implements conversion to the XACML Double data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeDouble extends DataTypeBase<Double> {
-        private static final DataTypeDouble	singleInstance	= new DataTypeDouble();
-        
-        private DataTypeDouble() {
-                super(XACML.ID_DATATYPE_DOUBLE, Double.class);
-        }
-        
-        public static DataTypeDouble newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeDouble	singleInstance	= new DataTypeDouble();
 
-        @Override
-        public Double convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof Double)) {
-                        return (Double)source;
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        Double	intValue	= null;
-                        try {
-                                // the XML representation of Infinity is "INF" and "-INF",
-                                // but the Java Double represenation is "Infinity" and "-Infinity"
-                                if (stringValue.equals("INF")) {
-                                                stringValue = "Infinity";
-                                } else if (stringValue.equals("-INF")) {
-                                                stringValue = "-Infinity";
-                                }
-                                intValue	= Double.parseDouble(stringValue);
-                        } catch (NumberFormatException ex) {
-                                throw new DataTypeException(this, "Failed to convert from \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to double", ex);
-                        }
-                        return intValue;
+    private DataTypeDouble() {
+        super(XACML.ID_DATATYPE_DOUBLE, Double.class);
+    }
+
+    public static DataTypeDouble newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public Double convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof Double)) {
+            return (Double)source;
+        } else {
+            String stringValue	= this.convertToString(source);
+            Double	intValue	= null;
+            try {
+                // the XML representation of Infinity is "INF" and "-INF",
+                // but the Java Double represenation is "Infinity" and "-Infinity"
+                if (stringValue.equals("INF")) {
+                    stringValue = "Infinity";
+                } else if (stringValue.equals("-INF")) {
+                    stringValue = "-Infinity";
                 }
+                intValue	= Double.parseDouble(stringValue);
+            } catch (NumberFormatException ex) {
+                throw new DataTypeException(this, "Failed to convert from \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to double", ex);
+            }
+            return intValue;
         }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeHexBinary.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeHexBinary.java
index 7b0f36f..a1822cb 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeHexBinary.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeHexBinary.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,40 +35,40 @@
 
 /**
  * DataTypeHexBinary extends {@link DataTypeBase} to implement the XACML hexBinary data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeHexBinary extends DataTypeSemanticStringBase<HexBinary> {
-        private static final DataTypeHexBinary	singleInstance	= new DataTypeHexBinary();
-        
-        private DataTypeHexBinary() {
-                super(XACML.ID_DATATYPE_HEXBINARY, HexBinary.class);
-        }
-        
-        public static DataTypeHexBinary newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeHexBinary	singleInstance	= new DataTypeHexBinary();
 
-        @Override
-        public HexBinary convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof HexBinary)) {
-                        return (HexBinary)source;
-                } else if (source instanceof byte[]) {
-                        return new HexBinary((byte[])source);
-                } else {
-                        String	stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        }
-                        HexBinary	hexBinary	= null;
-                        try {
-                                hexBinary	= HexBinary.newInstance(stringValue);
-                        } catch (Exception ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to HexBinary", ex);				
-                        }
-                        return hexBinary;
-                }
+    private DataTypeHexBinary() {
+        super(XACML.ID_DATATYPE_HEXBINARY, HexBinary.class);
+    }
+
+    public static DataTypeHexBinary newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public HexBinary convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof HexBinary)) {
+            return (HexBinary)source;
+        } else if (source instanceof byte[]) {
+            return new HexBinary((byte[])source);
+        } else {
+            String	stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            }
+            HexBinary	hexBinary	= null;
+            try {
+                hexBinary	= HexBinary.newInstance(stringValue);
+            } catch (Exception ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to HexBinary", ex);
+            }
+            return hexBinary;
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeInteger.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeInteger.java
index a3a6659..324dee5 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeInteger.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeInteger.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,36 +37,36 @@
 
 /**
  * DataTypeInteger extends {@link DataTypeBase} to implement the XACML integer type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeInteger extends DataTypeBase<BigInteger> {
-        private static final DataTypeInteger	singleInstance	= new DataTypeInteger();
-        
-        private DataTypeInteger() {
-                super(XACML.ID_DATATYPE_INTEGER, BigInteger.class);
-        }
-        
-        public static DataTypeInteger newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeInteger	singleInstance	= new DataTypeInteger();
 
-        @Override
-        public BigInteger convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof BigInteger)) {
-                        return (BigInteger)source;
-                } else if (source instanceof Integer) {
-                        return new BigInteger(source.toString());
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        BigInteger	intValue	= null;
-                        try {
-                                intValue	= new BigInteger(stringValue);
-                        } catch (NumberFormatException ex) {
-                                throw new DataTypeException(this, "Failed to convert from \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to integer", ex);
-                        }
-                        return intValue;
-                }
+    private DataTypeInteger() {
+        super(XACML.ID_DATATYPE_INTEGER, BigInteger.class);
+    }
+
+    public static DataTypeInteger newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public BigInteger convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof BigInteger)) {
+            return (BigInteger)source;
+        } else if (source instanceof Integer) {
+            return new BigInteger(source.toString());
+        } else {
+            String stringValue	= this.convertToString(source);
+            BigInteger	intValue	= null;
+            try {
+                intValue	= new BigInteger(stringValue);
+            } catch (NumberFormatException ex) {
+                throw new DataTypeException(this, "Failed to convert from \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to integer", ex);
+            }
+            return intValue;
         }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeIpAddress.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeIpAddress.java
index ccfc7db..a2b30a0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeIpAddress.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeIpAddress.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,38 +37,38 @@
 
 /**
  * DataTypeIpAddress extends {@link com.att.research.xacml.common.datatypes.DatatypeBase} to implement the XACML ipAddress data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeIpAddress extends DataTypeSemanticStringBase<IPAddress> {
-        private static final DataTypeIpAddress	singleInstance	= new DataTypeIpAddress();
-        
-        private DataTypeIpAddress() {
-                super(XACML2.ID_DATATYPE_IPADDRESS, IPAddress.class);
-        }
-        
-        public static DataTypeIpAddress newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeIpAddress	singleInstance	= new DataTypeIpAddress();
 
-        @Override
-        public IPAddress convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof IPAddress)) {
-                        return (IPAddress)source;
-                } else {
-                        String	stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        }
-                        IPAddress	ipAddress	= null;
-                        try {
-                                ipAddress	= IPAddress.newInstance(stringValue);
-                        } catch (ParseException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to IPAddress", ex);
-                        }
-                        return ipAddress;
-                }
+    private DataTypeIpAddress() {
+        super(XACML2.ID_DATATYPE_IPADDRESS, IPAddress.class);
+    }
+
+    public static DataTypeIpAddress newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public IPAddress convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof IPAddress)) {
+            return (IPAddress)source;
+        } else {
+            String	stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            }
+            IPAddress	ipAddress	= null;
+            try {
+                ipAddress	= IPAddress.newInstance(stringValue);
+            } catch (ParseException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to IPAddress", ex);
+            }
+            return ipAddress;
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeRFC822Name.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeRFC822Name.java
index 1a6fad6..6400042 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeRFC822Name.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeRFC822Name.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,38 +37,38 @@
 
 /**
  * DataTypeRFC822Name extends {@link com.att.research.xacml.common.datatypes.DataTypeBase> for the XACML rfc822Name data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeRFC822Name extends DataTypeSemanticStringBase<RFC822Name> {
-        private static final DataTypeRFC822Name	singleInstance	= new DataTypeRFC822Name();
-        
-        private DataTypeRFC822Name() {
-                super(XACML1.ID_DATATYPE_RFC822NAME, RFC822Name.class);
-        }
-        
-        public static DataTypeRFC822Name newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeRFC822Name	singleInstance	= new DataTypeRFC822Name();
 
-        @Override
-        public RFC822Name convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof RFC822Name)) {
-                        return (RFC822Name)source;
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        }
-                        RFC822Name	rfc822Name	= null;
-                        try {
-                                rfc822Name	= RFC822Name.newInstance(stringValue);
-                        } catch (ParseException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to RFC822Name", ex);
-                        }
-                        return rfc822Name;
-                }
+    private DataTypeRFC822Name() {
+        super(XACML1.ID_DATATYPE_RFC822NAME, RFC822Name.class);
+    }
+
+    public static DataTypeRFC822Name newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public RFC822Name convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof RFC822Name)) {
+            return (RFC822Name)source;
+        } else {
+            String stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            }
+            RFC822Name	rfc822Name	= null;
+            try {
+                rfc822Name	= RFC822Name.newInstance(stringValue);
+            } catch (ParseException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to RFC822Name", ex);
+            }
+            return rfc822Name;
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeSemanticStringBase.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeSemanticStringBase.java
index c2dfc23..6f8b8da 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeSemanticStringBase.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeSemanticStringBase.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,13 +35,13 @@
 
 public abstract class DataTypeSemanticStringBase<T extends com.att.research.xacml.api.SemanticString> extends DataTypeBase<T> {
 
-        public DataTypeSemanticStringBase(Identifier identifierIn, Class<T> classConvertIn) {
-                super(identifierIn, classConvertIn);
-        }
+    public DataTypeSemanticStringBase(Identifier identifierIn, Class<T> classConvertIn) {
+        super(identifierIn, classConvertIn);
+    }
 
-        @Override
-        public String toStringValue(T source) throws DataTypeException {
-                return (source == null ? null : source.stringValue());
-        }
+    @Override
+    public String toStringValue(T source) throws DataTypeException {
+        return (source == null ? null : source.stringValue());
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeString.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeString.java
index 8c101bd..4ed16ed 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeString.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeString.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,27 +35,27 @@
 
 /**
  * DataTypeString extends {@link DataTypeBase} to represent XACML 3.0 Strings as java <code>String</code>s.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeString extends DataTypeBase<String> {
-        private static final DataTypeString	singleInstance	= new DataTypeString();
-        
-        private DataTypeString() {
-                super(XACML.ID_DATATYPE_STRING, String.class);
-        }
-        
-        public static DataTypeString newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeString	singleInstance	= new DataTypeString();
 
-        @Override
-        public String convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof String)) {
-                        return (String)source;
-                } else {
-                        return this.convertToString(source);
-                }
+    private DataTypeString() {
+        super(XACML.ID_DATATYPE_STRING, String.class);
+    }
+
+    public static DataTypeString newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public String convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof String)) {
+            return (String)source;
+        } else {
+            return this.convertToString(source);
         }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeTime.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeTime.java
index 7f109f8..86289b5 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeTime.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeTime.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,38 +40,38 @@
 /**
  * DataTypeTime extends {@link DataTypeBase} to implement the XACML Time
  * data time mapping to a {@link ISO8601Time} java object.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeTime extends DataTypeSemanticStringBase<ISO8601Time> {
-        private static final DataTypeTime	singleInstance	= new DataTypeTime();
-        
-        private DataTypeTime() {
-                super(XACML.ID_DATATYPE_TIME, ISO8601Time.class);
-        }
-        
-        public static DataTypeTime newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeTime	singleInstance	= new DataTypeTime();
 
-        @Override
-        public ISO8601Time convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof ISO8601Time)) {
-                        return (ISO8601Time)source;
-                } else if (source instanceof Date) {
-                        return ISO8601Time.fromDate((Date)source);
-                } else if (source instanceof Calendar) {
-                        return ISO8601Time.fromCalendar((Calendar)source);
-                } else {
-                        String 	stringValue	= this.convertToString(source);
-                        ISO8601Time	timeValue	= null;
-                        try {
-                                timeValue	= ISO8601Time.fromISO8601TimeString(stringValue);
-                        } catch (ParseException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to Time", ex);
-                        }
-                        return timeValue;
-                }
+    private DataTypeTime() {
+        super(XACML.ID_DATATYPE_TIME, ISO8601Time.class);
+    }
+
+    public static DataTypeTime newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public ISO8601Time convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof ISO8601Time)) {
+            return (ISO8601Time)source;
+        } else if (source instanceof Date) {
+            return ISO8601Time.fromDate((Date)source);
+        } else if (source instanceof Calendar) {
+            return ISO8601Time.fromCalendar((Calendar)source);
+        } else {
+            String 	stringValue	= this.convertToString(source);
+            ISO8601Time	timeValue	= null;
+            try {
+                timeValue	= ISO8601Time.fromISO8601TimeString(stringValue);
+            } catch (ParseException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to Time", ex);
+            }
+            return timeValue;
         }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeX500Name.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeX500Name.java
index 38d5b94..bc9ec27 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeX500Name.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeX500Name.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,37 +37,37 @@
 
 /**
  * DataTypeX500Name extends {@link DataTypeBase} to implement the XACML x500Name data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeX500Name extends DataTypeBase<X500Principal> {
-        private static final DataTypeX500Name	singleInstance	= new DataTypeX500Name();
-        
-        /**
-         * Creates a new <code>DataTypeX500Name</code>>
-         */
-        private DataTypeX500Name() {
-                super(XACML1.ID_DATATYPE_X500NAME, X500Principal.class);
-        }
-        
-        public static DataTypeX500Name newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeX500Name	singleInstance	= new DataTypeX500Name();
 
-        @Override
-        public X500Principal convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof X500Principal)) {
-                        return (X500Principal)source;
-                } else {
-                        String 			stringValue		= this.convertToString(source);
-                        X500Principal	x500Principal	= null;
-                        try {
-                                x500Principal	= new X500Principal(stringValue);
-                        } catch (IllegalArgumentException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to X500Name", ex);
-                        }
-                        return x500Principal;
-                }
+    /**
+     * Creates a new <code>DataTypeX500Name</code>>
+     */
+    private DataTypeX500Name() {
+        super(XACML1.ID_DATATYPE_X500NAME, X500Principal.class);
+    }
+
+    public static DataTypeX500Name newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public X500Principal convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof X500Principal)) {
+            return (X500Principal)source;
+        } else {
+            String 			stringValue		= this.convertToString(source);
+            X500Principal	x500Principal	= null;
+            try {
+                x500Principal	= new X500Principal(stringValue);
+            } catch (IllegalArgumentException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to X500Name", ex);
+            }
+            return x500Principal;
         }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeXPathExpression.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeXPathExpression.java
index 297c182..b149c64 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeXPathExpression.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeXPathExpression.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,33 +40,33 @@
 /**
  * DataTypeXPathExpression extends {@link DataTypeBase} to implement the XACML
  * xpathExpression data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeXPathExpression extends DataTypeBase<XPathExpressionWrapper> {
-        private static final DataTypeXPathExpression	singleInstance	= new DataTypeXPathExpression();
-        
-        private DataTypeXPathExpression() {
-                super(XACML3.ID_DATATYPE_XPATHEXPRESSION, XPathExpressionWrapper.class);
-        }
-        
-        public static DataTypeXPathExpression newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeXPathExpression	singleInstance	= new DataTypeXPathExpression();
 
-        @Override
-        public XPathExpressionWrapper convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof XPathExpressionWrapper)) {
-                        return (XPathExpressionWrapper)source;
-                } else if (source instanceof XPathExpression) {
-                        return new XPathExpressionWrapper((XPathExpression)source);
-                } else if (source instanceof Node) {
-                        Node node			= (Node)source;
-                        return new XPathExpressionWrapper(node.getOwnerDocument(), node.getTextContent());
-                } else {
-                        return new XPathExpressionWrapper(this.convertToString(source));
-                }
+    private DataTypeXPathExpression() {
+        super(XACML3.ID_DATATYPE_XPATHEXPRESSION, XPathExpressionWrapper.class);
+    }
+
+    public static DataTypeXPathExpression newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public XPathExpressionWrapper convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof XPathExpressionWrapper)) {
+            return (XPathExpressionWrapper)source;
+        } else if (source instanceof XPathExpression) {
+            return new XPathExpressionWrapper((XPathExpression)source);
+        } else if (source instanceof Node) {
+            Node node			= (Node)source;
+            return new XPathExpressionWrapper(node.getOwnerDocument(), node.getTextContent());
+        } else {
+            return new XPathExpressionWrapper(this.convertToString(source));
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeYearMonthDuration.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeYearMonthDuration.java
index ca0f463..c36e4a6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeYearMonthDuration.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypeYearMonthDuration.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,37 +38,37 @@
 /**
  * DataTypeYearMonthDuration extends {@link DataTypeBase} to implement
  * the XACML yearMonthDuration data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypeYearMonthDuration extends DataTypeSemanticStringBase<XPathYearMonthDuration> {
-        private static final DataTypeYearMonthDuration	singleInstance	= new DataTypeYearMonthDuration();
-        
-        private DataTypeYearMonthDuration() {
-                super(XACML3.ID_DATATYPE_YEARMONTHDURATION, XPathYearMonthDuration.class);
-        }
-        
-        public static DataTypeYearMonthDuration newInstance() {
-                return singleInstance;
-        }
+    private static final DataTypeYearMonthDuration	singleInstance	= new DataTypeYearMonthDuration();
 
-        @Override
-        public XPathYearMonthDuration convert(Object source) throws DataTypeException {
-                if (source == null || (source instanceof XPathYearMonthDuration)) {
-                        return (XPathYearMonthDuration)source;
-                } else {
-                        String stringValue	= this.convertToString(source);
-                        if (stringValue == null) {
-                                return null;
-                        }
-                        XPathYearMonthDuration	xpathYearMonthDuration	= null;
-                        try {
-                                xpathYearMonthDuration	= XPathYearMonthDuration.newInstance(stringValue);
-                        } catch (ParseException ex) {
-                                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to YearMonthDuration", ex);				
-                        }
-                        return xpathYearMonthDuration;
-                }
+    private DataTypeYearMonthDuration() {
+        super(XACML3.ID_DATATYPE_YEARMONTHDURATION, XPathYearMonthDuration.class);
+    }
+
+    public static DataTypeYearMonthDuration newInstance() {
+        return singleInstance;
+    }
+
+    @Override
+    public XPathYearMonthDuration convert(Object source) throws DataTypeException {
+        if (source == null || (source instanceof XPathYearMonthDuration)) {
+            return (XPathYearMonthDuration)source;
+        } else {
+            String stringValue	= this.convertToString(source);
+            if (stringValue == null) {
+                return null;
+            }
+            XPathYearMonthDuration	xpathYearMonthDuration	= null;
+            try {
+                xpathYearMonthDuration	= XPathYearMonthDuration.newInstance(stringValue);
+            } catch (ParseException ex) {
+                throw new DataTypeException(this, "Failed to convert \"" + source.getClass().getCanonicalName() + "\" with value \"" + stringValue + "\" to YearMonthDuration", ex);
+            }
+            return xpathYearMonthDuration;
         }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypes.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypes.java
index b01cfa5..ed5009e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypes.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/DataTypes.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,29 +33,29 @@
 
 /**
  * DataTypes provides constant instances of the built-in {@link com.att.research.xacml.api.DataType} implementation classes.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DataTypes {
-        private DataTypes() {
-        }
-        
-        public static final DataTypeString				DT_STRING				= DataTypeString.newInstance();
-        public static final DataTypeBoolean				DT_BOOLEAN				= DataTypeBoolean.newInstance();
-        public static final DataTypeInteger				DT_INTEGER				= DataTypeInteger.newInstance();
-        public static final DataTypeDouble				DT_DOUBLE				= DataTypeDouble.newInstance();
-        public static final DataTypeTime				DT_TIME					= DataTypeTime.newInstance();
-        public static final DataTypeDate				DT_DATE					= DataTypeDate.newInstance();
-        public static final DataTypeDateTime			DT_DATETIME				= DataTypeDateTime.newInstance();
-        public static final DataTypeDayTimeDuration		DT_DAYTIMEDURATION		= DataTypeDayTimeDuration.newInstance();
-        public static final DataTypeYearMonthDuration	DT_YEARMONTHDURATION	= DataTypeYearMonthDuration.newInstance();
-        public static final DataTypeAnyURI				DT_ANYURI				= DataTypeAnyURI.newInstance();
-        public static final DataTypeHexBinary			DT_HEXBINARY			= DataTypeHexBinary.newInstance();
-        public static final DataTypeBase64Binary		DT_BASE64BINARY			= DataTypeBase64Binary.newInstance();
-        public static final DataTypeX500Name			DT_X500NAME				= DataTypeX500Name.newInstance();
-        public static final DataTypeRFC822Name			DT_RFC822NAME			= DataTypeRFC822Name.newInstance();
-        public static final DataTypeIpAddress			DT_IPADDRESS			= DataTypeIpAddress.newInstance();
-        public static final DataTypeDNSName				DT_DNSNAME				= DataTypeDNSName.newInstance();
-        public static final DataTypeXPathExpression		DT_XPATHEXPRESSION		= DataTypeXPathExpression.newInstance();
+    private DataTypes() {
+    }
+
+    public static final DataTypeString				DT_STRING				= DataTypeString.newInstance();
+    public static final DataTypeBoolean				DT_BOOLEAN				= DataTypeBoolean.newInstance();
+    public static final DataTypeInteger				DT_INTEGER				= DataTypeInteger.newInstance();
+    public static final DataTypeDouble				DT_DOUBLE				= DataTypeDouble.newInstance();
+    public static final DataTypeTime				DT_TIME					= DataTypeTime.newInstance();
+    public static final DataTypeDate				DT_DATE					= DataTypeDate.newInstance();
+    public static final DataTypeDateTime			DT_DATETIME				= DataTypeDateTime.newInstance();
+    public static final DataTypeDayTimeDuration		DT_DAYTIMEDURATION		= DataTypeDayTimeDuration.newInstance();
+    public static final DataTypeYearMonthDuration	DT_YEARMONTHDURATION	= DataTypeYearMonthDuration.newInstance();
+    public static final DataTypeAnyURI				DT_ANYURI				= DataTypeAnyURI.newInstance();
+    public static final DataTypeHexBinary			DT_HEXBINARY			= DataTypeHexBinary.newInstance();
+    public static final DataTypeBase64Binary		DT_BASE64BINARY			= DataTypeBase64Binary.newInstance();
+    public static final DataTypeX500Name			DT_X500NAME				= DataTypeX500Name.newInstance();
+    public static final DataTypeRFC822Name			DT_RFC822NAME			= DataTypeRFC822Name.newInstance();
+    public static final DataTypeIpAddress			DT_IPADDRESS			= DataTypeIpAddress.newInstance();
+    public static final DataTypeDNSName				DT_DNSNAME				= DataTypeDNSName.newInstance();
+    public static final DataTypeXPathExpression		DT_XPATHEXPRESSION		= DataTypeXPathExpression.newInstance();
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ExtendedNamespaceContext.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ExtendedNamespaceContext.java
index fdf591d..f92d098 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ExtendedNamespaceContext.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ExtendedNamespaceContext.java
@@ -1,23 +1,23 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you 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. 
- *  
- */
-
+/*

+ *  Licensed to the Apache Software Foundation (ASF) under one

+ *  or more contributor license agreements.  See the NOTICE file

+ *  distributed with this work for additional information

+ *  regarding copyright ownership.  The ASF licenses this file

+ *  to you 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.

+ *

+ */

+

 /*

  *                        AT&T - PROPRIETARY

  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF

@@ -42,41 +42,41 @@
  * including the default.

  * The Iterator returned by this contains the Prefixes used in the Namespace (including the Default if it is defined).

  * The caller can then use the Iterator values to call getNamespaceURI(prefix) defined in {@link javax.xml.namespace.NamespaceContext}.

- * 

+ *

  * @author glenngriffin

  * @version $Revision$

  */

 public abstract class ExtendedNamespaceContext implements NamespaceContext {

 

-        /**

-         * Get an Iterator that returns all prefixes in use in the Namespace, including the default if defined.

-         * The caller should use the returned values to call <code>getNamespaceURI(valueFromIterator)</code> to get the Namespace URIs associated with the prefix.

-         * 

-         * @return

-         */

-        public abstract Iterator<String> getAllPrefixes();

-        

-        

-        

-        

-        @Override

-        public String toString() {

-                Iterator<String> prefixIt = this.getAllPrefixes();

-                StringBuffer sb = new StringBuffer("{[");

-                while (prefixIt.hasNext()) {

-                        String prefix = prefixIt.next();

-                        String namespaceUri = this.getNamespaceURI(prefix);

-                        

-                        sb.append("{");

-                        if (prefix == XMLConstants.DEFAULT_NS_PREFIX) {

-                                sb.append(namespaceUri);

-                        } else {

-                                sb.append(prefix + "," + namespaceUri);

-                        }

-                        sb.append("}");

-                }

-                sb.append("]}");

-                return sb.toString();

+    /**

+     * Get an Iterator that returns all prefixes in use in the Namespace, including the default if defined.

+     * The caller should use the returned values to call <code>getNamespaceURI(valueFromIterator)</code> to get the Namespace URIs associated with the prefix.

+     *

+     * @return

+     */

+    public abstract Iterator<String> getAllPrefixes();

+

+

+

+

+    @Override

+    public String toString() {

+        Iterator<String> prefixIt = this.getAllPrefixes();

+        StringBuffer sb = new StringBuffer("{[");

+        while (prefixIt.hasNext()) {

+            String prefix = prefixIt.next();

+            String namespaceUri = this.getNamespaceURI(prefix);

+

+            sb.append("{");

+            if (prefix == XMLConstants.DEFAULT_NS_PREFIX) {

+                sb.append(namespaceUri);

+            } else {

+                sb.append(prefix + "," + namespaceUri);

+            }

+            sb.append("}");

         }

+        sb.append("]}");

+        return sb.toString();

+    }

 

 }

diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/HexBinary.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/HexBinary.java
index 361ac60..94634a0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/HexBinary.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/HexBinary.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,89 +40,89 @@
 
 /**
  * HexBinary provides utilities for converting the XACML hexBinary data type to and from <code>String</code> values.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class HexBinary implements SemanticString {
-        private byte[]	data;
-        
-        /**
-         * Creates a <code>HexBinary</code> object from an array of <code>byte</code>s.
-         * 
-         * @param dataIn the array of <code>byte</code>s
-         */
-        public HexBinary(byte[] dataIn) {
-                this.data	= dataIn;
-        }
-        
-        /**
-         * Creates a new <code>HexBinary</code> by parsing the given <code>String</code> as hex binary data.
-         * 
-         * @param stringHexBinary the <code>String</code> to convert
-         * @return a new <code>HexBinary</code> from the converted <code>String</code>.
-         */
-        public static HexBinary newInstance(String stringHexBinary) throws DecoderException {
-                if (stringHexBinary == null) {
-                        return null;
-                }
-                byte[]	hexBytes	= (byte[])new Hex().decode(stringHexBinary);
-                return new HexBinary(hexBytes);
-        }
+    private byte[]	data;
 
-        /**
-         * Gets the array of <code>byte</code>s for this <code>HexBinary</code>.
-         * 
-         * @return the array of <code>byte</code>s for this <code>HexBinary</code>.
-         */
-        public byte[] getData() {
-                return this.data;
+    /**
+     * Creates a <code>HexBinary</code> object from an array of <code>byte</code>s.
+     *
+     * @param dataIn the array of <code>byte</code>s
+     */
+    public HexBinary(byte[] dataIn) {
+        this.data	= dataIn;
+    }
+
+    /**
+     * Creates a new <code>HexBinary</code> by parsing the given <code>String</code> as hex binary data.
+     *
+     * @param stringHexBinary the <code>String</code> to convert
+     * @return a new <code>HexBinary</code> from the converted <code>String</code>.
+     */
+    public static HexBinary newInstance(String stringHexBinary) throws DecoderException {
+        if (stringHexBinary == null) {
+            return null;
         }
-        
-        @Override
-        public int hashCode() {
-                return (this.getData() == null ? 0 : this.getData().hashCode());
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof HexBinary)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
+        byte[]	hexBytes	= (byte[])new Hex().decode(stringHexBinary);
+        return new HexBinary(hexBytes);
+    }
+
+    /**
+     * Gets the array of <code>byte</code>s for this <code>HexBinary</code>.
+     *
+     * @return the array of <code>byte</code>s for this <code>HexBinary</code>.
+     */
+    public byte[] getData() {
+        return this.data;
+    }
+
+    @Override
+    public int hashCode() {
+        return (this.getData() == null ? 0 : this.getData().hashCode());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof HexBinary)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            HexBinary	hexBinaryObj	= (HexBinary)obj;
+            if (this.getData() == null) {
+                if (hexBinaryObj.getData() == null) {
+                    return true;
                 } else {
-                        HexBinary	hexBinaryObj	= (HexBinary)obj;
-                        if (this.getData() == null) {
-                                if (hexBinaryObj.getData() == null) {
-                                        return true;
-                                } else {
-                                        return false;
-                                }
-                        } else {
-                                if (hexBinaryObj.getData() == null) {
-                                        return false;
-                                } else {
-                                        return Arrays.equals(this.getData(), hexBinaryObj.getData());
-                                }
-                        }
+                    return false;
                 }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                byte[] thisData = this.getData();
-                if (thisData != null) {
-                        stringBuilder.append("data=");
-                        stringBuilder.append(StringUtils.toString(thisData));
+            } else {
+                if (hexBinaryObj.getData() == null) {
+                    return false;
+                } else {
+                    return Arrays.equals(this.getData(), hexBinaryObj.getData());
                 }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+            }
         }
+    }
 
-        @Override
-        public String stringValue() {
-                byte[] thisData	= this.getData();
-                return (thisData == null ? null : Hex.encodeHexString(thisData));
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        byte[] thisData = this.getData();
+        if (thisData != null) {
+            stringBuilder.append("data=");
+            stringBuilder.append(StringUtils.toString(thisData));
         }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public String stringValue() {
+        byte[] thisData	= this.getData();
+        return (thisData == null ? null : Hex.encodeHexString(thisData));
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IDateTime.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IDateTime.java
index fda0e88..eacf5f6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IDateTime.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IDateTime.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,26 +32,26 @@
 
 /**
  * IDateTime is the minimal interface an object needs to support in order to be used in XACML functions that expect a Date, DateTime, or Time.
- * 
+ *
  * @author car
  * @version $Revision$
- * 
+ *
  * @param T the data type of the object implementing the interface
  */
 public interface IDateTime<T> {
-        /**
-         * Adds the given <code>ISO8601Duration</code> to the <code>IDateTime</code> object.
-         * 
-         * @param iso8601Duration the <code>ISO8601Duration</code> to add
-         * @return a new <code>T</code> with the given <code>ISO8601Duration</code> added
-         */
-        public T add(ISO8601Duration iso8601Duration);
-        
-        /**
-         * Subtracts the given <code>ISO8601Duration</code> to the <code>IDateTime</code> object.
-         * 
-         * @param iso8601Duration the <code>ISO8601Duration</code> to subtract
-         * @return a new <code>T</code> with the given <code>ISO8601Duration</code> subtracted
-         */
-        public T sub(ISO8601Duration iso8601Duration);
+    /**
+     * Adds the given <code>ISO8601Duration</code> to the <code>IDateTime</code> object.
+     *
+     * @param iso8601Duration the <code>ISO8601Duration</code> to add
+     * @return a new <code>T</code> with the given <code>ISO8601Duration</code> added
+     */
+    public T add(ISO8601Duration iso8601Duration);
+
+    /**
+     * Subtracts the given <code>ISO8601Duration</code> to the <code>IDateTime</code> object.
+     *
+     * @param iso8601Duration the <code>ISO8601Duration</code> to subtract
+     * @return a new <code>T</code> with the given <code>ISO8601Duration</code> subtracted
+     */
+    public T sub(ISO8601Duration iso8601Duration);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPAddress.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPAddress.java
index 8dd4589..e4a9dca 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPAddress.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPAddress.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,40 +36,40 @@
 
 /**
  * IPAddress represents either an IPv4 or IPv6 network address with optional (IPv4)masks or (IPv6)prefixes and port range components.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
-public abstract class IPAddress implements SemanticString {	
-        
-        /**
-         * Given a string purporting to represent an <code>IPAddress</code>, try to convert it into an object.
-         * The string may represent either an <code>IPv4Address</code> or an <code>IPv6Address</code>,
-         * and may include a mask (for IPv4) or a prefix (for IPv6) and may also include a <code>PortRange</code>
-         * 
-         * @param addressString
-         * @return
-         */
-        public static IPAddress newInstance(String ipAddressString) throws ParseException {
-                if (ipAddressString == null || ipAddressString.length() == 0) {
-                        return null;
-                }
-                if (IPv4Address.isIPv4Address(ipAddressString)) {
-                        return IPv4Address.newIPv4Instance(ipAddressString);
-                } else if (IPv6Address.isIPv6Address(ipAddressString)) {
-                        return IPv6Address.newIPv6Instance(ipAddressString);
-                } else {
-                        throw new ParseException("Unknown IPAddress type for \"" + ipAddressString + "\"", 0);
-                }
+public abstract class IPAddress implements SemanticString {
+
+    /**
+     * Given a string purporting to represent an <code>IPAddress</code>, try to convert it into an object.
+     * The string may represent either an <code>IPv4Address</code> or an <code>IPv6Address</code>,
+     * and may include a mask (for IPv4) or a prefix (for IPv6) and may also include a <code>PortRange</code>
+     *
+     * @param addressString
+     * @return
+     */
+    public static IPAddress newInstance(String ipAddressString) throws ParseException {
+        if (ipAddressString == null || ipAddressString.length() == 0) {
+            return null;
         }
-        
-        // implementation (version) dependent
-        @Override
-        public abstract String stringValue();
-        
-        @Override
-        public abstract String toString();
-        
-        @Override
-        public abstract boolean equals(Object obj);
+        if (IPv4Address.isIPv4Address(ipAddressString)) {
+            return IPv4Address.newIPv4Instance(ipAddressString);
+        } else if (IPv6Address.isIPv6Address(ipAddressString)) {
+            return IPv6Address.newIPv6Instance(ipAddressString);
+        } else {
+            throw new ParseException("Unknown IPAddress type for \"" + ipAddressString + "\"", 0);
+        }
+    }
+
+    // implementation (version) dependent
+    @Override
+    public abstract String stringValue();
+
+    @Override
+    public abstract String toString();
+
+    @Override
+    public abstract boolean equals(Object obj);
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPv4Address.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPv4Address.java
index 6198564..c9ced99 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPv4Address.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPv4Address.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,204 +35,204 @@
 
 /**
  * IPV4Address extends {@link IPAddress} for IPv4 addresses.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class IPv4Address extends IPAddress {
-        
-        
-        // Future note:
-        // If we ever need to merge the IPv4 and IPv6 formats, the only issue is the v4 Mask vs the v6 Prefix.
-        // They are usually represented differently (4 octets vs. one number), but they are actually equivalent since they are both specifying which bits
-        // in the address are defining a set of subnets.  The trick is that IPv4 is expected to start with the top-most bit and fill in to the right,
-        // and the prefix says how many of those bits have been set to 1.  Typical examples:
-        //		255.0.0.0    = 8
-        //		255.255.0.0  = 16
-        //		255.255.255.0 = 24
-        // Thus it is possible to hold the addressMask for IPv4 internally as a single number and translate its representation to/from the octet version
-        // as input string is parsed and output string generated, which might allow for common processing between IPv4 and IPv6.
-        
-        private short[]		addressBytes;
-        private short[]		addressMask;
-        private PortRange	portRange;
-        
-        public IPv4Address(short[] addressBytesIn, short[] addressMaskIn, PortRange portRangeIn) {
-                addressBytes = addressBytesIn;
-                addressMask = addressMaskIn;
-                portRange = portRangeIn;
-                if (addressBytesIn.length != 4) {
-                        throw new IllegalArgumentException("Invalid byte count for IPv4 address: " + addressBytesIn.length);
-                }
+
+
+    // Future note:
+    // If we ever need to merge the IPv4 and IPv6 formats, the only issue is the v4 Mask vs the v6 Prefix.
+    // They are usually represented differently (4 octets vs. one number), but they are actually equivalent since they are both specifying which bits
+    // in the address are defining a set of subnets.  The trick is that IPv4 is expected to start with the top-most bit and fill in to the right,
+    // and the prefix says how many of those bits have been set to 1.  Typical examples:
+    //		255.0.0.0    = 8
+    //		255.255.0.0  = 16
+    //		255.255.255.0 = 24
+    // Thus it is possible to hold the addressMask for IPv4 internally as a single number and translate its representation to/from the octet version
+    // as input string is parsed and output string generated, which might allow for common processing between IPv4 and IPv6.
+
+    private short[]		addressBytes;
+    private short[]		addressMask;
+    private PortRange	portRange;
+
+    public IPv4Address(short[] addressBytesIn, short[] addressMaskIn, PortRange portRangeIn) {
+        addressBytes = addressBytesIn;
+        addressMask = addressMaskIn;
+        portRange = portRangeIn;
+        if (addressBytesIn.length != 4) {
+            throw new IllegalArgumentException("Invalid byte count for IPv4 address: " + addressBytesIn.length);
         }
-        
-        protected static short[] getAddress(String ipv4AddressString) throws ParseException {
-                String[]	addressParts	= ipv4AddressString.split("[.]",-1);
-                if (addressParts == null || addressParts.length != 4) {
-                        throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": invalid address", 0);
-                }
-                short[]		addressBytes	= new short[4];
-                for (int i = 0 ; i < 4 ; i++) {
-                        try {
-                                int	octet	= Integer.parseInt(addressParts[i]);
-                                if (octet < 0 || octet > 255) {
-                                        throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": invalid octet: \"" + addressParts[i], 0);
-                                } else {
-                                        addressBytes[i]	= (short)octet;
-                                }
-                        } catch (NumberFormatException ex) {
-                                throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": invalid octet: \"" + addressParts[i], 0);
-                        }
-                }
-                return addressBytes;
+    }
+
+    protected static short[] getAddress(String ipv4AddressString) throws ParseException {
+        String[]	addressParts	= ipv4AddressString.split("[.]",-1);
+        if (addressParts == null || addressParts.length != 4) {
+            throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": invalid address", 0);
         }
-        
-        public static String formatAddress(short[] addressBytes) {
-                if (addressBytes == null || addressBytes.length != 4) {
-                        return null;
-                }
-                return addressBytes[0] + "." + addressBytes[1] + "." + addressBytes[2] + "." + addressBytes[3];
-        }
-        
-        public static IPv4Address newIPv4Instance(String ipv4AddressString) throws ParseException {
-                if (ipv4AddressString == null || ipv4AddressString.length() == 0) {
-                        return null;
-                }
-                int	slashPos	= ipv4AddressString.indexOf('/');
-                int	colonPos	= ipv4AddressString.indexOf(':');
-                if ((colonPos >= 0) && (colonPos < slashPos)) {
-                        throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": out of order components", colonPos);
-                }
-                int endAddress	= (slashPos >= 0 ? slashPos : (colonPos >= 0 ? colonPos : ipv4AddressString.length() ));
-                if (endAddress < 7) {
-                        throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": address too short", 0);
-                }
-                
-                short[]		addressBytes	= getAddress(ipv4AddressString.substring(0, endAddress));
-                short[]		maskBytes		= null;
-                if (slashPos >= 0) {
-                        int	endMask	= (colonPos >= 0 ? colonPos : ipv4AddressString.length());
-                        maskBytes	= getAddress(ipv4AddressString.substring(slashPos+1, endMask));
-                }
-                
-                PortRange	portRange		= null;
-                if (colonPos >= 0) {
-                        if (ipv4AddressString.substring(colonPos+1).length() < 1) {
-                                throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": no portrange given after ':'", colonPos+1);
-                        }
-                        portRange	= PortRange.newInstance(ipv4AddressString.substring(colonPos+1));
-                }
-                return new IPv4Address(addressBytes, maskBytes, portRange);
-        }
-        
-        
-        
-        
-        
-        /**
-         * Guess whether or not the given string is intended to be an IPv4 address.
-         * Because there may be all kinds of errors in the representation, the only way to know that it is a legal IPv4 address is to fully parse it,
-         * and if the parse fails then we only know that is is not a legal IPv4 address (it might be a legal IPv6 or other address).
-         * 
-         * We could just have the IPAddress.newInstance method call the full parser and do some quick checks there.
-         * The disadvantage of that is that we would need to set up a try/catch (expensive) and in many cases there would be unneeded method calls involved.
-         * So we take a guess here.
-         * 
-         * @param ipv4AddressString
-         * @return
-         */
-        public static boolean isIPv4Address(String ipv4AddressString) {
-                if (ipv4AddressString == null || ipv4AddressString.length() == 0) {
-                        return false;
+        short[]		addressBytes	= new short[4];
+        for (int i = 0 ; i < 4 ; i++) {
+            try {
+                int	octet	= Integer.parseInt(addressParts[i]);
+                if (octet < 0 || octet > 255) {
+                    throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": invalid octet: \"" + addressParts[i], 0);
                 } else {
-                        // V4 addresses contain dots between multiple groups and at most one colon (may be none)
-                        if (ipv4AddressString.indexOf('.') < ipv4AddressString.lastIndexOf('.') && 
-                                        ipv4AddressString.indexOf(':') == ipv4AddressString.lastIndexOf(':') ) {
-                                return true;
-                        } else {
-                                return false;
-                        }
+                    addressBytes[i]	= (short)octet;
                 }
+            } catch (NumberFormatException ex) {
+                throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": invalid octet: \"" + addressParts[i], 0);
+            }
+        }
+        return addressBytes;
+    }
+
+    public static String formatAddress(short[] addressBytes) {
+        if (addressBytes == null || addressBytes.length != 4) {
+            return null;
+        }
+        return addressBytes[0] + "." + addressBytes[1] + "." + addressBytes[2] + "." + addressBytes[3];
+    }
+
+    public static IPv4Address newIPv4Instance(String ipv4AddressString) throws ParseException {
+        if (ipv4AddressString == null || ipv4AddressString.length() == 0) {
+            return null;
+        }
+        int	slashPos	= ipv4AddressString.indexOf('/');
+        int	colonPos	= ipv4AddressString.indexOf(':');
+        if ((colonPos >= 0) && (colonPos < slashPos)) {
+            throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": out of order components", colonPos);
+        }
+        int endAddress	= (slashPos >= 0 ? slashPos : (colonPos >= 0 ? colonPos : ipv4AddressString.length() ));
+        if (endAddress < 7) {
+            throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": address too short", 0);
         }
 
-        
-        @Override
-        public String stringValue() {
-                StringBuilder stringBuilder	= new StringBuilder();
-                
-                if (addressBytes != null && addressBytes.length > 0) {
-                        stringBuilder.append(formatAddress(addressBytes));
-                }
+        short[]		addressBytes	= getAddress(ipv4AddressString.substring(0, endAddress));
+        short[]		maskBytes		= null;
+        if (slashPos >= 0) {
+            int	endMask	= (colonPos >= 0 ? colonPos : ipv4AddressString.length());
+            maskBytes	= getAddress(ipv4AddressString.substring(slashPos+1, endMask));
+        }
 
-                if (addressMask != null && addressMask.length > 0) {
-                        stringBuilder.append('/');
-                        stringBuilder.append(formatAddress(addressMask));
-                }
+        PortRange	portRange		= null;
+        if (colonPos >= 0) {
+            if (ipv4AddressString.substring(colonPos+1).length() < 1) {
+                throw new ParseException("Invalid IPv4 address string \"" + ipv4AddressString + "\": no portrange given after ':'", colonPos+1);
+            }
+            portRange	= PortRange.newInstance(ipv4AddressString.substring(colonPos+1));
+        }
+        return new IPv4Address(addressBytes, maskBytes, portRange);
+    }
 
-                if (portRange != null) {
-                        stringBuilder.append(':');
-                        stringBuilder.append(portRange.stringValue());
+
+
+
+
+    /**
+     * Guess whether or not the given string is intended to be an IPv4 address.
+     * Because there may be all kinds of errors in the representation, the only way to know that it is a legal IPv4 address is to fully parse it,
+     * and if the parse fails then we only know that is is not a legal IPv4 address (it might be a legal IPv6 or other address).
+     *
+     * We could just have the IPAddress.newInstance method call the full parser and do some quick checks there.
+     * The disadvantage of that is that we would need to set up a try/catch (expensive) and in many cases there would be unneeded method calls involved.
+     * So we take a guess here.
+     *
+     * @param ipv4AddressString
+     * @return
+     */
+    public static boolean isIPv4Address(String ipv4AddressString) {
+        if (ipv4AddressString == null || ipv4AddressString.length() == 0) {
+            return false;
+        } else {
+            // V4 addresses contain dots between multiple groups and at most one colon (may be none)
+            if (ipv4AddressString.indexOf('.') < ipv4AddressString.lastIndexOf('.') &&
+                    ipv4AddressString.indexOf(':') == ipv4AddressString.lastIndexOf(':') ) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+    }
+
+
+    @Override
+    public String stringValue() {
+        StringBuilder stringBuilder	= new StringBuilder();
+
+        if (addressBytes != null && addressBytes.length > 0) {
+            stringBuilder.append(formatAddress(addressBytes));
+        }
+
+        if (addressMask != null && addressMask.length > 0) {
+            stringBuilder.append('/');
+            stringBuilder.append(formatAddress(addressMask));
+        }
+
+        if (portRange != null) {
+            stringBuilder.append(':');
+            stringBuilder.append(portRange.stringValue());
+        }
+
+        return stringBuilder.toString();
+    }
+
+
+    @Override
+    public String toString() {
+        return stringValue();
+    }
+
+
+    @Override
+    public boolean equals(Object obj) {
+        // for the moment assume that different IP formats can never be equal
+        if (obj == null || !(obj instanceof IPv4Address)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            IPv4Address ipAddress	= (IPv4Address)obj;
+
+            short[]	bytesThis	= this.addressBytes;
+            short[]	bytesThat	= ipAddress.addressBytes;
+            if (bytesThis == null) {
+                if (bytesThat != null) {
+                    return false;
                 }
-                
-                return stringBuilder.toString();
-        }
-        
-        
-        @Override
-        public String toString() {
-                return stringValue();
-        }
-        
-        
-        @Override
-        public boolean equals(Object obj) {
-                // for the moment assume that different IP formats can never be equal
-                if (obj == null || !(obj instanceof IPv4Address)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
-                } else {
-                        IPv4Address ipAddress	= (IPv4Address)obj;
-                        
-                        short[]	bytesThis	= this.addressBytes;
-                        short[]	bytesThat	= ipAddress.addressBytes;
-                        if (bytesThis == null) {
-                                if (bytesThat != null) {
-                                        return false;
-                                }
-                        } else {
-                                if (bytesThat == null || !Arrays.equals(bytesThis, bytesThat)) {
-                                        return false;
-                                }
-                        }
-                        
-                        bytesThis	= this.addressMask;
-                        bytesThat	= ipAddress.addressMask;
-                        if (bytesThis == null) {
-                                if (bytesThat != null) {
-                                        return false;
-                                }
-                        } else {
-                                if (bytesThat == null || !Arrays.equals(bytesThis, bytesThat)) {
-                                        return false;
-                                }
-                        }
-                        
-                        /*
-                         * Check the port range
-                         */
-                        if (this.portRange == null) {
-                                if (ipAddress.portRange != null) {
-                                        return false;
-                                }
-                        } else {
-                                if (ipAddress.portRange == null || !ipAddress.portRange.equals(this.portRange)) {
-                                        return false;
-                                }
-                        }
-                        
-                        return true;
+            } else {
+                if (bytesThat == null || !Arrays.equals(bytesThis, bytesThat)) {
+                    return false;
                 }
+            }
+
+            bytesThis	= this.addressMask;
+            bytesThat	= ipAddress.addressMask;
+            if (bytesThis == null) {
+                if (bytesThat != null) {
+                    return false;
+                }
+            } else {
+                if (bytesThat == null || !Arrays.equals(bytesThis, bytesThat)) {
+                    return false;
+                }
+            }
+
+            /*
+             * Check the port range
+             */
+            if (this.portRange == null) {
+                if (ipAddress.portRange != null) {
+                    return false;
+                }
+            } else {
+                if (ipAddress.portRange == null || !ipAddress.portRange.equals(this.portRange)) {
+                    return false;
+                }
+            }
+
+            return true;
         }
-        
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPv6Address.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPv6Address.java
index 7bacd38..f7cd161 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPv6Address.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/IPv6Address.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,451 +35,451 @@
 
 /**
  * IPV4Address extends {@link IPAddress} for IPv4 addresses.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class IPv6Address extends IPAddress {
-        
-        private static final short[] NULL_ADDRESS	= { 0, 0, 0, 0, 0, 0, 0, 0 };
 
-        
-        
-        // Future note:
-        // If we ever need to merge the IPv4 and IPv6 formats, the only issue is the v4 Mask vs the v6 Prefix.
-        // They are usually represented differently (4 octets vs. one number), but they are actually equivalent since they are both specifying which bits
-        // in the address are defining a set of subnets.  The trick is that IPv4 is expected to start with the top-most bit and fill in to the right,
-        // and the prefix says how many of those bits have been set to 1.  Typical examples:
-        //		255.0.0.0    = 8
-        //		255.255.0.0  = 16
-        //		255.255.255.0 = 24
-        // Thus it is possible to hold the addressMask for IPv4 internally as a single number (as IPv6 does) and translate its representation to/from the octet version
-        // as input string is parsed and output string generated, which might allow for common processing between IPv4 and IPv6.
-        
-        private short[]		addressBytes;
-        private Short		prefix;
-        private PortRange	portRange;
-        
-        public IPv6Address(short[] addressBytesIn, Short prefixIn, PortRange portRangeIn) {
-                addressBytes = addressBytesIn;
-                prefix = prefixIn;
-                portRange = portRangeIn;
-                if (addressBytesIn.length != 8) {
-                        throw new IllegalArgumentException("Invalid byte count for IPv6 address: " + addressBytesIn.length);
-                }
+    private static final short[] NULL_ADDRESS	= { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+
+
+    // Future note:
+    // If we ever need to merge the IPv4 and IPv6 formats, the only issue is the v4 Mask vs the v6 Prefix.
+    // They are usually represented differently (4 octets vs. one number), but they are actually equivalent since they are both specifying which bits
+    // in the address are defining a set of subnets.  The trick is that IPv4 is expected to start with the top-most bit and fill in to the right,
+    // and the prefix says how many of those bits have been set to 1.  Typical examples:
+    //		255.0.0.0    = 8
+    //		255.255.0.0  = 16
+    //		255.255.255.0 = 24
+    // Thus it is possible to hold the addressMask for IPv4 internally as a single number (as IPv6 does) and translate its representation to/from the octet version
+    // as input string is parsed and output string generated, which might allow for common processing between IPv4 and IPv6.
+
+    private short[]		addressBytes;
+    private Short		prefix;
+    private PortRange	portRange;
+
+    public IPv6Address(short[] addressBytesIn, Short prefixIn, PortRange portRangeIn) {
+        addressBytes = addressBytesIn;
+        prefix = prefixIn;
+        portRange = portRangeIn;
+        if (addressBytesIn.length != 8) {
+            throw new IllegalArgumentException("Invalid byte count for IPv6 address: " + addressBytesIn.length);
         }
-        
-        
-        /**
-         * Is this address really an IPv4 address in IPv6 format?
-         * 
-         * @param addressBytes
-         * @return
-         */
-        public static boolean isIPv4Address(short[] addressBytes) {
-                if (addressBytes == null || addressBytes.length < 8) {
-                        return false;
-                }
-                for (int i = 0 ; i < 5 ; i++) {
-                        if (addressBytes[i] != 0) {
-                                return false;
-                        }
-                }
-                return (addressBytes[5] == (short)0xFFFF);	
+    }
+
+
+    /**
+     * Is this address really an IPv4 address in IPv6 format?
+     *
+     * @param addressBytes
+     * @return
+     */
+    public static boolean isIPv4Address(short[] addressBytes) {
+        if (addressBytes == null || addressBytes.length < 8) {
+            return false;
         }
-        
-        
-        /**
-         * Generate a string representing just the address part without the [], prefix or portrange.
-         * This accounts for the case of an IPv4-form address being represented in IPv6 format.
-         * 
-         * @param addressParts
-         * @return
-         */
-        public static String formatAddress(short[] addressParts) {
-                StringBuilder	stringBuilder	= new StringBuilder();
-                
-                if (isIPv4Address(addressParts)) {
-                        stringBuilder.append("::FFFF:");
-                        short[]	ipv4Octets	= new short[4];
-                        ipv4Octets[0]	= (short)((addressParts[6] >> 8) & 0xFF);
-                        ipv4Octets[1]	= (short)(addressParts[6] & 0xFF);
-                        ipv4Octets[2]	= (short)((addressParts[7] >> 8) & 0xFF);
-                        ipv4Octets[3]	= (short)(addressParts[7] & 0xFF);
-                        stringBuilder.append(IPv4Address.formatAddress(ipv4Octets));
+        for (int i = 0 ; i < 5 ; i++) {
+            if (addressBytes[i] != 0) {
+                return false;
+            }
+        }
+        return (addressBytes[5] == (short)0xFFFF);
+    }
+
+
+    /**
+     * Generate a string representing just the address part without the [], prefix or portrange.
+     * This accounts for the case of an IPv4-form address being represented in IPv6 format.
+     *
+     * @param addressParts
+     * @return
+     */
+    public static String formatAddress(short[] addressParts) {
+        StringBuilder	stringBuilder	= new StringBuilder();
+
+        if (isIPv4Address(addressParts)) {
+            stringBuilder.append("::FFFF:");
+            short[]	ipv4Octets	= new short[4];
+            ipv4Octets[0]	= (short)((addressParts[6] >> 8) & 0xFF);
+            ipv4Octets[1]	= (short)(addressParts[6] & 0xFF);
+            ipv4Octets[2]	= (short)((addressParts[7] >> 8) & 0xFF);
+            ipv4Octets[3]	= (short)(addressParts[7] & 0xFF);
+            stringBuilder.append(IPv4Address.formatAddress(ipv4Octets));
+        } else {
+            /*
+             * Find the longest string of consecutive zeros
+             */
+            int zeroPos	= -1;
+            int	zeroLen	= 0;
+            for (int i = 0 ; i < addressParts.length ; ) {
+                if (addressParts[i] == 0) {
+                    int zeroCount	= 1;
+                    for (int j = i+1 ; j < addressParts.length && addressParts[j] == 0 ; j++, zeroCount++);
+                    if (zeroCount > zeroLen) {
+                        zeroPos	= i;
+                        zeroLen	= zeroCount;
+                    }
+                    i	+= zeroCount;
                 } else {
-                        /*
-                         * Find the longest string of consecutive zeros
-                         */
-                        int zeroPos	= -1;
-                        int	zeroLen	= 0;
-                        for (int i = 0 ; i < addressParts.length ; ) {
-                                if (addressParts[i] == 0) {
-                                        int zeroCount	= 1;
-                                        for (int j = i+1 ; j < addressParts.length && addressParts[j] == 0 ; j++, zeroCount++);
-                                        if (zeroCount > zeroLen) {
-                                                zeroPos	= i;
-                                                zeroLen	= zeroCount;
-                                        }
-                                        i	+= zeroCount;
-                                } else {
-                                        i++;
-                                }
+                    i++;
+                }
+            }
+
+            /*
+             * Start formatting the output
+             */
+            for (int i = 0 ; i < addressParts.length ; ) {
+                if (addressParts[i] == 0) {
+                    if (i == zeroPos) {
+                        if (i == 0) {
+                            stringBuilder.append(':');
                         }
-                        
-                        /*
-                         * Start formatting the output
-                         */
-                        for (int i = 0 ; i < addressParts.length ; ) {
-                                if (addressParts[i] == 0) {
-                                        if (i == zeroPos) {
-                                                if (i == 0) {
-                                                        stringBuilder.append(':');
-                                                }
-                                                stringBuilder.append(':');
-                                                i	+= zeroLen;
-                                        } else {
-                                                stringBuilder.append('0');
-                                                i++;
-                                                if (i < addressParts.length) {
-                                                        stringBuilder.append(':');
-                                                }
-                                        }
-                                } else {
-                                        stringBuilder.append(String.format("%x", addressParts[i]));
-                                        i++;
-                                        if (i < addressParts.length) {
-                                                stringBuilder.append(':');
-                                        }
-                                }
-                        }
-                }
-
-                return stringBuilder.toString();
-        }
-        
-        
-        
-        
-        /**
-         * Parses a string that can represent an IPv6 address into an array of 8 shorts representing
-         * the 8 16-bit components of the address.  Allows for the IPv4 equivalence address: ::FFFF:w.x.y.z
-         * where the 32 bits of the IPv4 address are encoded into the lower two shorts of the IPv6 address
-         * 
-         * @param ipv6Address
-         * @return
-         * @throws java.text.ParseException
-         */
-        protected static short[] getAddress(String ipv6Address) throws ParseException {
-                if (ipv6Address.equals("::")) {
-                        return NULL_ADDRESS;
-                }
-
-                String	parseString	= ipv6Address;
-                if (ipv6Address.startsWith("::")) {
-                        /*
-                         * Skip over the first ':' of the '::' to avoid getting two null fields in a row at the beginning
-                         */
-                        parseString	= ipv6Address.substring(1);
-                } else if (ipv6Address.endsWith("::")) {
-                        /*
-                         * Skip over the last ':' of the '::' to avoid getting two null fields in a row at the end
-                         */
-                        parseString	= ipv6Address.substring(0, ipv6Address.length()-1);
-                }
-                String[]	addressFields	= parseString.split("[:]",-1);
-                if (addressFields == null || addressFields.length == 0 || addressFields.length > 8) {
-                        throw new ParseException("Invalid IPv6Address string \"" + ipv6Address + "\"", 0);
-                }
-                
-                boolean		isIPv4				= false;
-                if (addressFields.length == 3 && addressFields[0].length() == 0 && addressFields[1].equalsIgnoreCase("FFFF") && addressFields[2].contains(".")) {
-                        isIPv4	= true;
-                }
-                
-                short[]		addressShorts		= new short[8];
-                int			nAddressShorts		= 0;
-                int			missingFields		= (isIPv4 ? 4 : 8 - addressFields.length);
-                boolean 	sawMissingField		= false;
-                
-                for (int i = 0 ; i < addressFields.length ; i++) {
-                        if (addressFields[i].length() == 0) {
-                                /*
-                                 * An empty field indicates a consecutive string of zero values.
-                                 */
-                                if (sawMissingField) {
-                                        throw new ParseException("Invalid IPv6Address string \"" + ipv6Address + "\": multiple zero runs", i);
-                                }
-                                
-                                sawMissingField	= true;
-                                addressShorts[nAddressShorts++]	= 0;
-                                for (int j = 0 ; j < missingFields ; j++) {
-                                        addressShorts[nAddressShorts++]	= 0;
-                                }
-                        } else if (addressFields[i].indexOf('.') >= 0) {
-                                if (nAddressShorts != 6) {
-                                        throw new ParseException("Invalid IPv6Address string \"" + ipv6Address + "\": misplaced IPv4 address", i);
-                                }
-                                
-                                /*
-                                 * IPv4 address
-                                 */
-                                short[] ipv4Octets	= null;
-                                try {
-                                        ipv4Octets	= IPv4Address.getAddress(addressFields[i]);
-                                } catch (ParseException ex) {
-                                        throw new ParseException("Invalid IPv4Address in Ipv6Address \"" + addressFields[i] + "\"", i);
-                                }
-                                if (ipv4Octets == null) {
-                                        throw new ParseException("Invalid Ipv4Address in IPv6Address \"" + addressFields[i] + "\"", i);
-                                }
-                                assert(ipv4Octets.length == 4);
-                                
-                                addressShorts[nAddressShorts++]	= (short)(ipv4Octets[0] * 256 + ipv4Octets[1]);
-                                addressShorts[nAddressShorts++]	= (short)(ipv4Octets[2] * 256 + ipv4Octets[3]);
-                        } else {
-                                try {
-                                        addressShorts[nAddressShorts++]	= (short)(Integer.parseInt(addressFields[i], 16));
-                                } catch (NumberFormatException ex) {
-                                        throw new ParseException("Invalid IPv6Address component \"" + addressFields[i] + "\": invalid hex", i);
-                                }
-                        }
-                }
-                if (nAddressShorts < 8) {
-                        throw new ParseException("Invalid IPv6Address string \"" + ipv6Address + "\": not enough address fields", 0);
-                }
-                
-                return addressShorts;
-        }
-        
-        
-        
-        
-        /**
-         * Specs not clear on format of a "prefix".  It could be either
-         * 		"[" <address> [ "/" <prefix> ] "]" [ ":" portrange ]
-         * or
-         * 		"[" <address> "]" [ "/" <prefix> ] [ ":" portrange ]
-         * but we cannot tell which the specs are saying.
-         * To avoid problems in the future it seems safest to implement both of these formats.
-         * 
-         * @param ipv6AddressString
-         * @return
-         * @throws java.text.ParseException
-         */
-        public static IPv6Address newIPv6Instance(String ipv6AddressString) throws ParseException {
-
-                if (ipv6AddressString == null || ipv6AddressString.length() == 0) {
-                        return null;
-                } else if (!ipv6AddressString.startsWith("[")) {
-                        throw new ParseException("Invalid IPv6Address string \"" + ipv6AddressString + "\": missing opening bracket", 0);
-                }
-
-                /*
-                 * Start with the address
-                 */
-                int	addressStart	= 1;
-                int	addressEnd		= ipv6AddressString.indexOf(']', addressStart);
-                if (addressEnd < 0) {
-                        throw new ParseException("Invalid IPv6Address string \"" + ipv6AddressString + "\": missing closing bracket", 0);
-                } else if ((addressEnd - addressStart) < 2) {
-                        throw new ParseException("Invalid IPv6Address string \"" + ipv6AddressString + "\": empty address", 0);
-                }
-                // If address has prefix inside the brackets, adjust the end
-                int slashIndex = ipv6AddressString.indexOf("/");
-                if (slashIndex > -1 && slashIndex < ipv6AddressString.indexOf("]")) {
-                        // do not include the prefix in the address
-                        addressEnd = slashIndex ;
-                }
-
-                short[]	addressShorts	= getAddress(ipv6AddressString.substring(addressStart, addressEnd));
-                int		nextPos			= addressEnd;
-                
-                /*
-                 * See if there is a slash for the prefix
-                 * The four cases we are looking at are:
-                 * 		]
-                 * 		]/<prefix>
-                 * 		/<prefix>]
-                 * all of which may be followed by ":<portrange>"
-                 */
-                // adjust starting point for case of ]/<prefix>
-                Short prefix = null;
-                if (nextPos < ipv6AddressString.length() - 1 && ipv6AddressString.charAt(nextPos) == ']' && ipv6AddressString.charAt(nextPos + 1) == '/') {
-                        nextPos++;
-                }
-                if (nextPos < ipv6AddressString.length() && ipv6AddressString.charAt(nextPos) == '/') {
-                        nextPos++;
-                        if (nextPos >= ipv6AddressString.length() || ipv6AddressString.charAt(nextPos) == ']' || ipv6AddressString.charAt(nextPos) == ':') {
-                                throw new ParseException("Invalid Ipv6Address string \"" + ipv6AddressString + "\": prefix designation without value", nextPos);
-                        }
-                        addressStart	= nextPos;
-                        addressEnd		= ipv6AddressString.indexOf(']', addressStart);
-
-                        if (addressEnd < 0) {
-                                // looking at ]/<prefix> or ]/<prefix>:<portRange>
-                                addressEnd = ipv6AddressString.indexOf(':', addressStart);
-                                if (addressEnd < 0) {
-                                        // no portrange following this
-                                        addressEnd = ipv6AddressString.length();
-                                }
-                        }
-
-                        prefix = Short.parseShort(ipv6AddressString.substring(addressStart, addressEnd));
-                        
-                        // prefix cannot be larger than 128 (and really should not be 128!)
-                        if (prefix > 128) {
-                                throw new ParseException("Invalid Ipv6Address string \"" + ipv6AddressString + "\": prefix is larger than 128", nextPos);
-                        }
-                        nextPos		= addressEnd;
-                }
-                // adjust for case of
-                //		/<prefix>]
-                if (nextPos < ipv6AddressString.length() && ipv6AddressString.charAt(nextPos) == ']') {
-                        nextPos++;
-                }
-
-                /*
-                 * See if there is a ':' for the port range
-                 */
-                PortRange	portRange		= null;
-                if (nextPos < ipv6AddressString.length() && ipv6AddressString.charAt(nextPos) == ':') {
-                        if (ipv6AddressString.substring(nextPos+1).length() < 1) {
-                                throw new ParseException("Invalid IPv6 address string \"" + ipv6AddressString + "\": no portrange given after ':'", nextPos+1);
-                        }
-
-                        portRange	= PortRange.newInstance(ipv6AddressString.substring(nextPos+1));
-                        nextPos		= ipv6AddressString.length();
-                }
-                
-                if (nextPos < ipv6AddressString.length()) {
-                        throw new ParseException("Invalid Ipv6Address string \"" + ipv6AddressString + "\": unknown content at end", nextPos);
-                }
-                
-                return new IPv6Address(addressShorts, prefix, portRange);
-        }
-        
-        
-        
-        
-        /**
-         * Guess whether or not the given string is intended to be an IPv6 address.
-         * Because there may be all kinds of errors in the representation, the only way to know that it is a legal IPv6 address is to fully parse it,
-         * and if the parse fails then we only know that is is not a legal IPv6 address (it might be a legal IPv4 or other address).
-         * 
-         * We could just have the IPAddress.newInstance method call the full parser and do some quick checks there.
-         * The disadvantage of that is that we would need to set up a try/catch (expensive) and in many cases there would be unneeded method calls involved.
-         * So we take a guess here.
-         * 
-         * @param ipv4AddressString
-         * @return
-         */
-        public static boolean isIPv6Address(String ipv4AddressString) {
-                if (ipv4AddressString == null || ipv4AddressString.length() == 0) {
-                        return false;
-                } else {
-                        // V6 addresses should contain no dots and multiple colons
-                        if (ipv4AddressString.indexOf(':') < ipv4AddressString.lastIndexOf(':') && 
-                                        ipv4AddressString.indexOf('.') == ipv4AddressString.lastIndexOf('.') ) {
-                                return true;
-                        } else {
-                                return false;
-                        }
-                }
-        }
-
-        
-        /**
-         * The specifications are ambiguous on how to handle /prefix in IPv6.
-         * There are two possibilities and the documents are silent on how to handle it, and no examples are readily apparent on the internet.
-         * The two possible representations are:
-         * 		[<address>/prefix]
-         * and
-         * 		[<address>]/prefix
-         * The prefix is optional as is the ":&lt;portrange&gt;" that can follow it.
-         * 
-         * We have chosen to use the first representation because the prefix seems to be part of the address itself, which is supposed to be inside the brackets.
-         */
-        @Override
-        public String stringValue() {
-                StringBuilder	stringBuilder	= new StringBuilder("[");
-
-                if (addressBytes != null) {
-                        stringBuilder.append(formatAddress(addressBytes));
-                }
-                if (prefix != null) {
-                        stringBuilder.append('/');
-                        stringBuilder.append(prefix);
-                }
-
-                stringBuilder.append("]");
-                
-                if (portRange != null) {
                         stringBuilder.append(':');
-                        stringBuilder.append(portRange.stringValue());
-                }
-                
-                return stringBuilder.toString();
-        }
-
-        
-        @Override
-        public String toString() {
-                return stringValue();
-        }
-        
-        
-        
-        @Override
-        public boolean equals(Object obj) {
-                // for the moment assume that different IP formats can never be equal
-                if (obj == null || !(obj instanceof IPv6Address)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
+                        i	+= zeroLen;
+                    } else {
+                        stringBuilder.append('0');
+                        i++;
+                        if (i < addressParts.length) {
+                            stringBuilder.append(':');
+                        }
+                    }
                 } else {
-                        IPv6Address ipAddress	= (IPv6Address)obj;
-                        
-                        short[]	bytesThis	= this.addressBytes;
-                        short[]	bytesThat	= ipAddress.addressBytes;
-                        if (bytesThis == null) {
-                                if (bytesThat != null) {
-                                        return false;
-                                }
-                        } else {
-                                if (bytesThat == null || !Arrays.equals(bytesThis, bytesThat)) {
-                                        return false;
-                                }
-                        }
-
-                        Short prefixThis	= this.prefix;
-                        Short prefixThat	= ipAddress.prefix;
-                        if (prefixThis == null) {
-                                if (prefixThat != null) {
-                                        return false;
-                                }
-                        } else {
-                                if (prefixThis == prefixThat) {
-                                        return false;
-                                }
-                        }
-
-                        /*
-                         * Check the port range
-                         */
-                        if (this.portRange == null) {
-                                if (ipAddress.portRange != null) {
-                                        return false;
-                                }
-                        } else {
-                                if (ipAddress.portRange == null || !ipAddress.portRange.equals(this.portRange)) {
-                                        return false;
-                                }
-                        }
-
-                        return true;
+                    stringBuilder.append(String.format("%x", addressParts[i]));
+                    i++;
+                    if (i < addressParts.length) {
+                        stringBuilder.append(':');
+                    }
                 }
+            }
         }
-        
-        
+
+        return stringBuilder.toString();
+    }
+
+
+
+
+    /**
+     * Parses a string that can represent an IPv6 address into an array of 8 shorts representing
+     * the 8 16-bit components of the address.  Allows for the IPv4 equivalence address: ::FFFF:w.x.y.z
+     * where the 32 bits of the IPv4 address are encoded into the lower two shorts of the IPv6 address
+     *
+     * @param ipv6Address
+     * @return
+     * @throws java.text.ParseException
+     */
+    protected static short[] getAddress(String ipv6Address) throws ParseException {
+        if (ipv6Address.equals("::")) {
+            return NULL_ADDRESS;
+        }
+
+        String	parseString	= ipv6Address;
+        if (ipv6Address.startsWith("::")) {
+            /*
+             * Skip over the first ':' of the '::' to avoid getting two null fields in a row at the beginning
+             */
+            parseString	= ipv6Address.substring(1);
+        } else if (ipv6Address.endsWith("::")) {
+            /*
+             * Skip over the last ':' of the '::' to avoid getting two null fields in a row at the end
+             */
+            parseString	= ipv6Address.substring(0, ipv6Address.length()-1);
+        }
+        String[]	addressFields	= parseString.split("[:]",-1);
+        if (addressFields == null || addressFields.length == 0 || addressFields.length > 8) {
+            throw new ParseException("Invalid IPv6Address string \"" + ipv6Address + "\"", 0);
+        }
+
+        boolean		isIPv4				= false;
+        if (addressFields.length == 3 && addressFields[0].length() == 0 && addressFields[1].equalsIgnoreCase("FFFF") && addressFields[2].contains(".")) {
+            isIPv4	= true;
+        }
+
+        short[]		addressShorts		= new short[8];
+        int			nAddressShorts		= 0;
+        int			missingFields		= (isIPv4 ? 4 : 8 - addressFields.length);
+        boolean 	sawMissingField		= false;
+
+        for (int i = 0 ; i < addressFields.length ; i++) {
+            if (addressFields[i].length() == 0) {
+                /*
+                 * An empty field indicates a consecutive string of zero values.
+                 */
+                if (sawMissingField) {
+                    throw new ParseException("Invalid IPv6Address string \"" + ipv6Address + "\": multiple zero runs", i);
+                }
+
+                sawMissingField	= true;
+                addressShorts[nAddressShorts++]	= 0;
+                for (int j = 0 ; j < missingFields ; j++) {
+                    addressShorts[nAddressShorts++]	= 0;
+                }
+            } else if (addressFields[i].indexOf('.') >= 0) {
+                if (nAddressShorts != 6) {
+                    throw new ParseException("Invalid IPv6Address string \"" + ipv6Address + "\": misplaced IPv4 address", i);
+                }
+
+                /*
+                 * IPv4 address
+                 */
+                short[] ipv4Octets	= null;
+                try {
+                    ipv4Octets	= IPv4Address.getAddress(addressFields[i]);
+                } catch (ParseException ex) {
+                    throw new ParseException("Invalid IPv4Address in Ipv6Address \"" + addressFields[i] + "\"", i);
+                }
+                if (ipv4Octets == null) {
+                    throw new ParseException("Invalid Ipv4Address in IPv6Address \"" + addressFields[i] + "\"", i);
+                }
+                assert(ipv4Octets.length == 4);
+
+                addressShorts[nAddressShorts++]	= (short)(ipv4Octets[0] * 256 + ipv4Octets[1]);
+                addressShorts[nAddressShorts++]	= (short)(ipv4Octets[2] * 256 + ipv4Octets[3]);
+            } else {
+                try {
+                    addressShorts[nAddressShorts++]	= (short)(Integer.parseInt(addressFields[i], 16));
+                } catch (NumberFormatException ex) {
+                    throw new ParseException("Invalid IPv6Address component \"" + addressFields[i] + "\": invalid hex", i);
+                }
+            }
+        }
+        if (nAddressShorts < 8) {
+            throw new ParseException("Invalid IPv6Address string \"" + ipv6Address + "\": not enough address fields", 0);
+        }
+
+        return addressShorts;
+    }
+
+
+
+
+    /**
+     * Specs not clear on format of a "prefix".  It could be either
+     * 		"[" <address> [ "/" <prefix> ] "]" [ ":" portrange ]
+     * or
+     * 		"[" <address> "]" [ "/" <prefix> ] [ ":" portrange ]
+     * but we cannot tell which the specs are saying.
+     * To avoid problems in the future it seems safest to implement both of these formats.
+     *
+     * @param ipv6AddressString
+     * @return
+     * @throws java.text.ParseException
+     */
+    public static IPv6Address newIPv6Instance(String ipv6AddressString) throws ParseException {
+
+        if (ipv6AddressString == null || ipv6AddressString.length() == 0) {
+            return null;
+        } else if (!ipv6AddressString.startsWith("[")) {
+            throw new ParseException("Invalid IPv6Address string \"" + ipv6AddressString + "\": missing opening bracket", 0);
+        }
+
+        /*
+         * Start with the address
+         */
+        int	addressStart	= 1;
+        int	addressEnd		= ipv6AddressString.indexOf(']', addressStart);
+        if (addressEnd < 0) {
+            throw new ParseException("Invalid IPv6Address string \"" + ipv6AddressString + "\": missing closing bracket", 0);
+        } else if ((addressEnd - addressStart) < 2) {
+            throw new ParseException("Invalid IPv6Address string \"" + ipv6AddressString + "\": empty address", 0);
+        }
+        // If address has prefix inside the brackets, adjust the end
+        int slashIndex = ipv6AddressString.indexOf("/");
+        if (slashIndex > -1 && slashIndex < ipv6AddressString.indexOf("]")) {
+            // do not include the prefix in the address
+            addressEnd = slashIndex ;
+        }
+
+        short[]	addressShorts	= getAddress(ipv6AddressString.substring(addressStart, addressEnd));
+        int		nextPos			= addressEnd;
+
+        /*
+         * See if there is a slash for the prefix
+         * The four cases we are looking at are:
+         * 		]
+         * 		]/<prefix>
+         * 		/<prefix>]
+         * all of which may be followed by ":<portrange>"
+         */
+        // adjust starting point for case of ]/<prefix>
+        Short prefix = null;
+        if (nextPos < ipv6AddressString.length() - 1 && ipv6AddressString.charAt(nextPos) == ']' && ipv6AddressString.charAt(nextPos + 1) == '/') {
+            nextPos++;
+        }
+        if (nextPos < ipv6AddressString.length() && ipv6AddressString.charAt(nextPos) == '/') {
+            nextPos++;
+            if (nextPos >= ipv6AddressString.length() || ipv6AddressString.charAt(nextPos) == ']' || ipv6AddressString.charAt(nextPos) == ':') {
+                throw new ParseException("Invalid Ipv6Address string \"" + ipv6AddressString + "\": prefix designation without value", nextPos);
+            }
+            addressStart	= nextPos;
+            addressEnd		= ipv6AddressString.indexOf(']', addressStart);
+
+            if (addressEnd < 0) {
+                // looking at ]/<prefix> or ]/<prefix>:<portRange>
+                addressEnd = ipv6AddressString.indexOf(':', addressStart);
+                if (addressEnd < 0) {
+                    // no portrange following this
+                    addressEnd = ipv6AddressString.length();
+                }
+            }
+
+            prefix = Short.parseShort(ipv6AddressString.substring(addressStart, addressEnd));
+
+            // prefix cannot be larger than 128 (and really should not be 128!)
+            if (prefix > 128) {
+                throw new ParseException("Invalid Ipv6Address string \"" + ipv6AddressString + "\": prefix is larger than 128", nextPos);
+            }
+            nextPos		= addressEnd;
+        }
+        // adjust for case of
+        //		/<prefix>]
+        if (nextPos < ipv6AddressString.length() && ipv6AddressString.charAt(nextPos) == ']') {
+            nextPos++;
+        }
+
+        /*
+         * See if there is a ':' for the port range
+         */
+        PortRange	portRange		= null;
+        if (nextPos < ipv6AddressString.length() && ipv6AddressString.charAt(nextPos) == ':') {
+            if (ipv6AddressString.substring(nextPos+1).length() < 1) {
+                throw new ParseException("Invalid IPv6 address string \"" + ipv6AddressString + "\": no portrange given after ':'", nextPos+1);
+            }
+
+            portRange	= PortRange.newInstance(ipv6AddressString.substring(nextPos+1));
+            nextPos		= ipv6AddressString.length();
+        }
+
+        if (nextPos < ipv6AddressString.length()) {
+            throw new ParseException("Invalid Ipv6Address string \"" + ipv6AddressString + "\": unknown content at end", nextPos);
+        }
+
+        return new IPv6Address(addressShorts, prefix, portRange);
+    }
+
+
+
+
+    /**
+     * Guess whether or not the given string is intended to be an IPv6 address.
+     * Because there may be all kinds of errors in the representation, the only way to know that it is a legal IPv6 address is to fully parse it,
+     * and if the parse fails then we only know that is is not a legal IPv6 address (it might be a legal IPv4 or other address).
+     *
+     * We could just have the IPAddress.newInstance method call the full parser and do some quick checks there.
+     * The disadvantage of that is that we would need to set up a try/catch (expensive) and in many cases there would be unneeded method calls involved.
+     * So we take a guess here.
+     *
+     * @param ipv4AddressString
+     * @return
+     */
+    public static boolean isIPv6Address(String ipv4AddressString) {
+        if (ipv4AddressString == null || ipv4AddressString.length() == 0) {
+            return false;
+        } else {
+            // V6 addresses should contain no dots and multiple colons
+            if (ipv4AddressString.indexOf(':') < ipv4AddressString.lastIndexOf(':') &&
+                    ipv4AddressString.indexOf('.') == ipv4AddressString.lastIndexOf('.') ) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+    }
+
+
+    /**
+     * The specifications are ambiguous on how to handle /prefix in IPv6.
+     * There are two possibilities and the documents are silent on how to handle it, and no examples are readily apparent on the internet.
+     * The two possible representations are:
+     * 		[<address>/prefix]
+     * and
+     * 		[<address>]/prefix
+     * The prefix is optional as is the ":&lt;portrange&gt;" that can follow it.
+     *
+     * We have chosen to use the first representation because the prefix seems to be part of the address itself, which is supposed to be inside the brackets.
+     */
+    @Override
+    public String stringValue() {
+        StringBuilder	stringBuilder	= new StringBuilder("[");
+
+        if (addressBytes != null) {
+            stringBuilder.append(formatAddress(addressBytes));
+        }
+        if (prefix != null) {
+            stringBuilder.append('/');
+            stringBuilder.append(prefix);
+        }
+
+        stringBuilder.append("]");
+
+        if (portRange != null) {
+            stringBuilder.append(':');
+            stringBuilder.append(portRange.stringValue());
+        }
+
+        return stringBuilder.toString();
+    }
+
+
+    @Override
+    public String toString() {
+        return stringValue();
+    }
+
+
+
+    @Override
+    public boolean equals(Object obj) {
+        // for the moment assume that different IP formats can never be equal
+        if (obj == null || !(obj instanceof IPv6Address)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            IPv6Address ipAddress	= (IPv6Address)obj;
+
+            short[]	bytesThis	= this.addressBytes;
+            short[]	bytesThat	= ipAddress.addressBytes;
+            if (bytesThis == null) {
+                if (bytesThat != null) {
+                    return false;
+                }
+            } else {
+                if (bytesThat == null || !Arrays.equals(bytesThis, bytesThat)) {
+                    return false;
+                }
+            }
+
+            Short prefixThis	= this.prefix;
+            Short prefixThat	= ipAddress.prefix;
+            if (prefixThis == null) {
+                if (prefixThat != null) {
+                    return false;
+                }
+            } else {
+                if (prefixThis == prefixThat) {
+                    return false;
+                }
+            }
+
+            /*
+             * Check the port range
+             */
+            if (this.portRange == null) {
+                if (ipAddress.portRange != null) {
+                    return false;
+                }
+            } else {
+                if (ipAddress.portRange == null || !ipAddress.portRange.equals(this.portRange)) {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+    }
+
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Date.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Date.java
index e5af9cc..329e135 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Date.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Date.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,181 +41,181 @@
 /**
  * ISO8601Date is a representation of an ISO8601 format date without a time component.
  * NOTE: This is actually the extended specification for XACML3.0, not a strict ISO8601 date
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class ISO8601Date implements IDateTime<ISO8601Date>, Comparable<ISO8601Date>, SemanticString {
-        private ISO8601DateTime	dateTime;
-        
-        protected ISO8601Date(ISO8601DateTime iso8601DateTime) {
-                this.dateTime	= iso8601DateTime;
-        }
-        
-        public ISO8601Date(String timeZone, int yearIn, int monthIn, int dayIn) {
-                this.dateTime	= new ISO8601DateTime(timeZone, yearIn, monthIn, dayIn, 0, 0, 0, 0);
-        }
-        
-        public ISO8601Date(TimeZone timeZone, int yearIn, int monthIn, int dayIn) {
-                this.dateTime	= new ISO8601DateTime(timeZone, yearIn, monthIn, dayIn, 0, 0, 0, 0);
-        }
-        
-        public ISO8601Date(ISO8601TimeZone timeZone, int yearIn, int monthIn, int dayIn) {
-                this((timeZone == null ? null : timeZone.getTimeZoneString()), yearIn, monthIn, dayIn);
-        }
-        
-        public ISO8601Date(int yearIn, int monthIn, int dayIn) {
-                this((String)null, yearIn, monthIn, dayIn);
-        }
-        
-        public boolean getHasTimeZone() {
-                return this.dateTime.getHasTimeZone();
-        }
-        public Calendar getCalendar() {
-                return this.dateTime.getCalendar();
-        }
-        public String getTimeZone() {
-                return this.dateTime.getTimeZone();
-        }
-        public int getYear() {
-                return this.dateTime.getYear();
-        }
-        public int getMonth() {
-                return this.dateTime.getMonth();
-        }
-        public int getDay() {
-                return this.dateTime.getDay();
-        }
-        
-        public ISO8601Date add(ISO8601Duration iso8601Duration) {
-                return new ISO8601Date(this.dateTime.add(iso8601Duration));
-        }
-        
-        public ISO8601Date sub(ISO8601Duration iso8601Duration) {
-                return new ISO8601Date(this.dateTime.sub(iso8601Duration));
-        }
-        
-        @Override
-        public int hashCode() {
-                return this.dateTime.hashCode();
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof ISO8601Date)) {
-                        return false;
-                } else {
-                        ISO8601Date iso8601Date	= (ISO8601Date)obj;
-                        return this.dateTime.equals(iso8601Date.dateTime);
-                }
-        }
+    private ISO8601DateTime	dateTime;
 
-        /**
-         * Gets the <code>String</code> representation of the ISO8601 date represented by this <code>ISO8601Date</code> object.
-         * 
-         * @param includeTimeZone <code>boolean</code> indicating whether the time zone information should be included
-         * @return the <code>String</code> representation of the ISO8601 date represented by this <code>ISO8601Date</code> object.
+    protected ISO8601Date(ISO8601DateTime iso8601DateTime) {
+        this.dateTime	= iso8601DateTime;
+    }
+
+    public ISO8601Date(String timeZone, int yearIn, int monthIn, int dayIn) {
+        this.dateTime	= new ISO8601DateTime(timeZone, yearIn, monthIn, dayIn, 0, 0, 0, 0);
+    }
+
+    public ISO8601Date(TimeZone timeZone, int yearIn, int monthIn, int dayIn) {
+        this.dateTime	= new ISO8601DateTime(timeZone, yearIn, monthIn, dayIn, 0, 0, 0, 0);
+    }
+
+    public ISO8601Date(ISO8601TimeZone timeZone, int yearIn, int monthIn, int dayIn) {
+        this((timeZone == null ? null : timeZone.getTimeZoneString()), yearIn, monthIn, dayIn);
+    }
+
+    public ISO8601Date(int yearIn, int monthIn, int dayIn) {
+        this((String)null, yearIn, monthIn, dayIn);
+    }
+
+    public boolean getHasTimeZone() {
+        return this.dateTime.getHasTimeZone();
+    }
+    public Calendar getCalendar() {
+        return this.dateTime.getCalendar();
+    }
+    public String getTimeZone() {
+        return this.dateTime.getTimeZone();
+    }
+    public int getYear() {
+        return this.dateTime.getYear();
+    }
+    public int getMonth() {
+        return this.dateTime.getMonth();
+    }
+    public int getDay() {
+        return this.dateTime.getDay();
+    }
+
+    public ISO8601Date add(ISO8601Duration iso8601Duration) {
+        return new ISO8601Date(this.dateTime.add(iso8601Duration));
+    }
+
+    public ISO8601Date sub(ISO8601Duration iso8601Duration) {
+        return new ISO8601Date(this.dateTime.sub(iso8601Duration));
+    }
+
+    @Override
+    public int hashCode() {
+        return this.dateTime.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof ISO8601Date)) {
+            return false;
+        } else {
+            ISO8601Date iso8601Date	= (ISO8601Date)obj;
+            return this.dateTime.equals(iso8601Date.dateTime);
+        }
+    }
+
+    /**
+     * Gets the <code>String</code> representation of the ISO8601 date represented by this <code>ISO8601Date</code> object.
+     *
+     * @param includeTimeZone <code>boolean</code> indicating whether the time zone information should be included
+     * @return the <code>String</code> representation of the ISO8601 date represented by this <code>ISO8601Date</code> object.
+     */
+    public String stringValue(boolean includeTimeZone) {
+        StringBuilder	stringBuilder	= new StringBuilder();
+        stringBuilder.append(String.format("%d-%02d-%02d", this.dateTime.getYear(), this.dateTime.getMonth(), this.dateTime.getDay()));
+        if (includeTimeZone && this.dateTime.getHasTimeZone()) {
+            stringBuilder.append(this.dateTime.getTimeZone());
+        }
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public String stringValue() {
+        return this.stringValue(true);
+    }
+
+    @Override
+    public String toString() {
+        return this.stringValue(true);
+    }
+
+    @Override
+    public int compareTo(ISO8601Date o) {
+        return this.dateTime.compareTo(o.dateTime);
+    }
+
+    public static ISO8601Date fromCalendar(Calendar calendar) {
+        int year;
+        if (calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
+            year	= 1 - calendar.get(Calendar.YEAR);
+        } else {
+            year	= calendar.get(Calendar.YEAR);
+        }
+        return new ISO8601Date(calendar.getTimeZone(), year, calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH));
+    }
+
+    public static ISO8601Date fromDate(Date date) {
+        Calendar cal	= Calendar.getInstance();
+        cal.setTime(date);
+        return ISO8601Date.fromCalendar(cal);
+    }
+
+    public static ISO8601Date fromISO8601DateString(String strDate) throws ParseException {
+        int	startPos	= ParseUtils.nextNonWhite(strDate, 0);
+
+        ParseUtils.ParseValue<Integer> parseValue	= ParseUtils.getSignedValue(strDate, startPos);
+        if (parseValue == null) {
+            throw new ParseException("Invalid year", startPos);
+        }
+        int year		= parseValue.getValue();
+        if (parseValue.getNextPos() < 4) {
+            throw new ParseException("Invalid year (must be at least 4 digits)", startPos);
+        }
+        startPos		+= parseValue.getNextPos();
+        if (startPos >= strDate.length() || strDate.charAt(startPos) != '-') {
+            throw new ParseException("Invalid date", startPos);
+        }
+        startPos++;
+
+        int month		= ParseUtils.getTwoDigitValue(strDate,  startPos);
+        if (month < 0 || month > 12) {
+            throw new ParseException("Invalid month", startPos);
+        }
+        startPos		+= 2;
+        if (startPos >= strDate.length() || strDate.charAt(startPos) != '-') {
+            throw new ParseException("Invalid date", startPos);
+        }
+        startPos++;
+
+        int day			= ParseUtils.getTwoDigitValue(strDate, startPos);
+        if (day < 1 || day > 31) {
+            throw new ParseException("Invalid day", startPos);
+        }
+        startPos		+= 2;
+
+        /*
+         * Now determine if there is a timezone
          */
-        public String stringValue(boolean includeTimeZone) {
-                StringBuilder	stringBuilder	= new StringBuilder();
-                stringBuilder.append(String.format("%d-%02d-%02d", this.dateTime.getYear(), this.dateTime.getMonth(), this.dateTime.getDay()));
-                if (includeTimeZone && this.dateTime.getHasTimeZone()) {
-                        stringBuilder.append(this.dateTime.getTimeZone());
-                }
-                return stringBuilder.toString();
-        }
-        
-        @Override
-        public String stringValue() {
-                return this.stringValue(true);
-        }
-        
-        @Override
-        public String toString() {
-                return this.stringValue(true);
-        }
+        String timezone		= null;
 
-        @Override
-        public int compareTo(ISO8601Date o) {
-                return this.dateTime.compareTo(o.dateTime);
-        }
-        
-        public static ISO8601Date fromCalendar(Calendar calendar) {
-                int year;
-                if (calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
-                        year	= 1 - calendar.get(Calendar.YEAR);
+        if (startPos < strDate.length()) {
+            switch(strDate.charAt(startPos)) {
+            case 'Z':
+                timezone	= "GMT";
+                startPos++;
+                break;
+            case '-':
+            case '+':
+                if (startPos+5 < strDate.length()) {
+                    timezone	= "GMT" + strDate.substring(startPos, startPos+6);
                 } else {
-                        year	= calendar.get(Calendar.YEAR);
+                    throw new ParseException("Invalid timezone", startPos);
                 }
-                return new ISO8601Date(calendar.getTimeZone(), year, calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_MONTH));
+                break;
+            default:
+                throw new ParseException("Invalid timezone", startPos);
+            }
         }
-        
-        public static ISO8601Date fromDate(Date date) {
-                Calendar cal	= Calendar.getInstance();
-                cal.setTime(date);
-                return ISO8601Date.fromCalendar(cal);
-        }
-        
-        public static ISO8601Date fromISO8601DateString(String strDate) throws ParseException {
-                int	startPos	= ParseUtils.nextNonWhite(strDate, 0);
-                
-                ParseUtils.ParseValue<Integer> parseValue	= ParseUtils.getSignedValue(strDate, startPos);
-                if (parseValue == null) {
-                        throw new ParseException("Invalid year", startPos);
-                }
-                int year		= parseValue.getValue();
-                if (parseValue.getNextPos() < 4) {
-                        throw new ParseException("Invalid year (must be at least 4 digits)", startPos);
-                }
-                startPos		+= parseValue.getNextPos();
-                if (startPos >= strDate.length() || strDate.charAt(startPos) != '-') {
-                        throw new ParseException("Invalid date", startPos);
-                }
-                startPos++;
-                
-                int month		= ParseUtils.getTwoDigitValue(strDate,  startPos);
-                if (month < 0 || month > 12) {
-                        throw new ParseException("Invalid month", startPos);
-                }
-                startPos		+= 2;
-                if (startPos >= strDate.length() || strDate.charAt(startPos) != '-') {
-                        throw new ParseException("Invalid date", startPos);
-                }
-                startPos++;
-                
-                int day			= ParseUtils.getTwoDigitValue(strDate, startPos);
-                if (day < 1 || day > 31) {
-                        throw new ParseException("Invalid day", startPos);
-                }
-                startPos		+= 2;
-                
-                /*
-                 * Now determine if there is a timezone
-                 */
-                String timezone		= null;
 
-                if (startPos < strDate.length()) {
-                        switch(strDate.charAt(startPos)) {
-                        case 'Z':
-                                timezone	= "GMT";
-                                startPos++;
-                                break;
-                        case '-':
-                        case '+':
-                                if (startPos+5 < strDate.length()) {
-                                        timezone	= "GMT" + strDate.substring(startPos, startPos+6);
-                                } else {
-                                        throw new ParseException("Invalid timezone", startPos);
-                                }
-                                break;
-                        default:
-                                throw new ParseException("Invalid timezone", startPos);
-                        }
-                }
-                
-                return new ISO8601Date(timezone, year, month, day);
-        }
-        
+        return new ISO8601Date(timezone, year, month, day);
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601DateTime.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601DateTime.java
index 41b24ff..22ebca3 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601DateTime.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601DateTime.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,476 +41,476 @@
 /**
  * ISO8601Datetime is a combination of an {@link ISO8601Date} and a {@link ISO8601Time}
  * with a common {@link com.att.research.xacml.std.datatypes.ISO8601TimeZone}.
- * 
+ *
  * Note: This is a temporary implementation.  It appears Java 8 will have better classes for dealing with ISO8601 dates and times.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ISO8601DateTime implements IDateTime<ISO8601DateTime>, Comparable<ISO8601DateTime>, SemanticString {
-        private static final long		TZOFFSET_14_HOURS_MILLIS	= 14*60*60*1000;
-        private boolean hasTimeZone;
-        private Calendar calendar;
-        
-        private void validateDate() {
-                this.calendar.getTime();
-                int year	= this.calendar.get(Calendar.YEAR);
-                if (this.calendar.isSet(Calendar.ERA) && this.calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
-                        year	= 0 - year + 1;
-                }
+    private static final long		TZOFFSET_14_HOURS_MILLIS	= 14*60*60*1000;
+    private boolean hasTimeZone;
+    private Calendar calendar;
 
-        }
-        
-        /**
-         * Creates a new <code>ISO8601DateTime</code> using the supplied field values.
-         * 
-         * @param timeZone the <code>String</code> name of the time zone.  Use null for non-time-zoned instances
-         * @param yearIn the integer year (-9999 to 9999)
-         * @param monthIn the integer month (1-12)
-         * @param dayIn the integer day of the month (1-31)
-         * @param hourIn the integer hour of the day (0-23)
-         * @param minuteIn the integer minute of the hour (0-59)
-         * @param secondIn the integer second of the minute (0-59)
-         * @param millisecondIn the integer milliseconds (0-999)
-         */
-        public ISO8601DateTime(TimeZone timeZone, int yearIn, int monthIn, int dayIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
-                this.calendar	= Calendar.getInstance();
-                this.calendar.setLenient(false);
-                if (timeZone != null) {
-                        this.hasTimeZone	= true;
-                        this.calendar.setTimeZone(timeZone);
-                }
-                if (yearIn <= 0) {
-                        this.calendar.set(Calendar.ERA, GregorianCalendar.BC);
-                        this.calendar.set(Calendar.YEAR, Math.abs(yearIn)+1);
-                } else {
-                        this.calendar.set(Calendar.YEAR, yearIn);
-                }
-                this.calendar.set(Calendar.MONTH, monthIn-1);
-                this.calendar.set(Calendar.DAY_OF_MONTH, dayIn);
-                this.calendar.set(Calendar.HOUR_OF_DAY, hourIn);
-                this.calendar.set(Calendar.MINUTE, minuteIn);
-                this.calendar.set(Calendar.SECOND, secondIn);
-                this.calendar.set(Calendar.MILLISECOND, millisecondIn);
-                
-                /*
-                 * Now do the tests to throw illegal argument exceptions if the request was invalid
-                 */
-                this.validateDate();
-        }
-        
-        public ISO8601DateTime(String timeZone, int yearIn, int monthIn, int dayIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
-                this((timeZone == null ? null : TimeZone.getTimeZone(timeZone)), yearIn, monthIn, dayIn, hourIn, minuteIn, secondIn, millisecondIn);
-        }
-        
-        public ISO8601DateTime(ISO8601TimeZone timeZone, ISO8601Date iso8601Date, ISO8601Time iso8601Time) {
-                this((timeZone == null ? null : timeZone.getTimeZoneString()), iso8601Date.getYear(), iso8601Date.getMonth(), iso8601Date.getDay(), iso8601Time.getHour(), iso8601Time.getMinute(), iso8601Time.getSecond(), iso8601Time.getMillisecond());
-        }
-        
-        public ISO8601DateTime(int yearIn, int monthIn, int dayIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
-                this((TimeZone)null, yearIn, monthIn, dayIn, hourIn, minuteIn, secondIn, millisecondIn);
-        }
-        
-        /**
-         * Creates a new <code>ISO8601DateTime</code> using the given <code>Calendar</code>.  If <code>hasTimeZoneIn</code>
-         * is true, then the time zone of the given <code>Calendar</code> is used, otherwise this is a non-time-zoned <code>ISO8601DateTime</code>
-         * 
-         * @param calendarIn the <code>Calendar</code> for the new <code>ISO8601DateTime</code>
-         * @param hasTimeZoneIn if true, create a time-zoned <code>ISO8601DateTime</code> else create a non-time-zoned <code>ISO8601DateTime</code>
-         */
-        private ISO8601DateTime(Calendar calendarIn, boolean hasTimeZoneIn) {
-                /*
-                this.calendar		= Calendar.getInstance();
-                this.calendar.setLenient(false);
-                this.calendar.setTimeZone(calendarIn.getTimeZone());
-                this.calendar.setTimeInMillis(calendarIn.getTimeInMillis());
-                */
-                this.calendar		= calendarIn;
-                this.hasTimeZone	= hasTimeZoneIn;
-        }
-        
-        /**
-         * Gets the value indicating whether this <code>ISO8601DateTime</code> is time-zoned or non-time-zoned.
-         * 
-         * @return true if this <code>ISO8601DateTime</code> is time-zoned, else false
-         */
-        public boolean getHasTimeZone() {
-                return this.hasTimeZone;
-        }
-        
-        public String getTimeZone() {
-                if (this.getHasTimeZone()) {
-                        int tzOffsetMillis	= this.calendar.get(Calendar.ZONE_OFFSET);
-                        if (tzOffsetMillis == 0) {
-                                return "Z";
-                        } else {
-                                int tzOffsetHours	= Math.abs(tzOffsetMillis) / (60 * 60 * 1000);
-                                int tzOffsetMinutes	= (Math.abs(tzOffsetMillis) - (tzOffsetHours * 60 * 60 * 1000)) / (60 * 1000);
-                                StringBuilder stringBuilder	= new StringBuilder();
-                                stringBuilder.append((tzOffsetMillis < 0 ? '-' : '+'));
-                                stringBuilder.append(String.format("%02d", tzOffsetHours));
-                                stringBuilder.append(':');
-                                stringBuilder.append(String.format("%02d", tzOffsetMinutes));
-                                return stringBuilder.toString();
-                        }
-                        
-                } else {
-                        return null;
-                }
-        }
-        
-        public int getYear() {
-                int year	= this.calendar.get(Calendar.YEAR);
-                if (this.calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
-                        return -(year - 1);
-                } else {
-                        return year;
-                }
-        }
-        public int getMonth() {
-                return this.calendar.get(Calendar.MONTH) + 1;
-        }
-        public int getDay() {
-                return this.calendar.get(Calendar.DAY_OF_MONTH);
-        }
-        public int getHour() {
-                return this.calendar.get(Calendar.HOUR_OF_DAY);
-        }
-        public int getMinute() {
-                return this.calendar.get(Calendar.MINUTE);
-        }
-        public int getSecond() {
-                return this.calendar.get(Calendar.SECOND);
-        }
-        public int getMillisecond() {
-                return this.calendar.get(Calendar.MILLISECOND);
-        }
-        
-        /**
-         * Gets a copy of the <code>Calendar</code> backing this <code>ISO8601DateTime</code>.
-         * 
-         * @return a copy of the <code>Calendar</code> backing this <code>ISO8601DateTime</code>.
-         */
-        public Calendar getCalendar() {
-                Calendar calendarCopy	= Calendar.getInstance();
-                calendarCopy.setLenient(false);
-                if (this.getHasTimeZone()) {
-                        calendarCopy.setTimeZone(this.calendar.getTimeZone());
-                }
-                calendarCopy.setTimeInMillis(this.calendar.getTimeInMillis());
-                return calendarCopy;
-        }
-        
-        /**
-         * Gets a <code>ISO8601DateTime</code> equivalent to this <code>ISO8601DateTime</code> converted to
-         * the GMT time zone.  If this <code>ISO8601DateTime</code> is non-time-zoned, this method will throw
-         * an illegal state exception.
-         * 
-         * @return a <code>ISO8601DateTime</code> equivalent to this <code>ISO8601DateTime</code> in the GMT time zone.
-         * @throws IllegalStateException if this <code>ISO8601DateTime</code> is non-time-zoned.
-         */
-        public ISO8601DateTime getGMTDateTime() {
-                if (!this.getHasTimeZone()) {
-                        throw new IllegalStateException("Cannot convert non-time-zoned ISO8601DateTime to GMT");
-                }
-                if (this.calendar.get(Calendar.ZONE_OFFSET) == 0) {
-                        return this;
-                } else {
-                        Calendar calendarGMT	= Calendar.getInstance();
-                        calendarGMT.setLenient(false);
-                        calendarGMT.setTimeZone(TimeZone.getTimeZone("GMT"));
-                        calendarGMT.setTimeInMillis(this.calendar.getTimeInMillis());
-                        return new ISO8601DateTime(calendarGMT, true);
-                }
-        }
-        
-        private ISO8601DateTime add(ISO8601Duration iso8601Duration, int sign) {
-                Calendar calendarCopy	= this.getCalendar();
-                
-                int value;
-                if ((value = iso8601Duration.getYears()) != 0) {
-                        calendarCopy.add(Calendar.YEAR, sign*value);
-                }
-                if ((value = iso8601Duration.getMonths()) != 0) {
-                        calendarCopy.add(Calendar.MONTH, sign*value);
-                }
-                if ((value = iso8601Duration.getDays()) != 0) {
-                        calendarCopy.add(Calendar.DAY_OF_YEAR, sign*value);
-                }
-                if ((value = iso8601Duration.getHours()) != 0) {
-                        calendarCopy.add(Calendar.HOUR_OF_DAY, sign*value);
-                }
-                if ((value = iso8601Duration.getMinutes()) != 0) {
-                        calendarCopy.add(Calendar.MINUTE, sign*value);
-                }
-                int seconds	= iso8601Duration.getSeconds();
-                if (seconds >= 1) {
-                        calendarCopy.add(Calendar.SECOND, sign*seconds);
-                }
-                int millis	= iso8601Duration.getMillis();
-                if (millis != 0) {
-                        calendarCopy.add(Calendar.MILLISECOND, sign*millis);
-                }
-
-                return new ISO8601DateTime(calendarCopy, this.getHasTimeZone());		
-        }
-        
-        /**
-         * Adds the given <code>ISO8601Duration</code> to this <code>ISO8601DateTime</code> and returns
-         * a new <code>ISO8601DateTime</code> with the result.
-         * 
-         * @param iso8601Duration the <code>ISO8601Duration</code> to add
-         * @return a new <code>ISO8601DateTime</code> with the result of the addition
-         */
-        public ISO8601DateTime add(ISO8601Duration iso8601Duration) {
-                return this.add(iso8601Duration, iso8601Duration.getDurationSign());
-        }
-        
-        public ISO8601DateTime sub(ISO8601Duration iso8601Duration) {
-                return this.add(iso8601Duration, -iso8601Duration.getDurationSign());
-        }
-        
-        @Override
-        public int hashCode() {
-                return (this.getHasTimeZone() ? 999 : 0) + this.calendar.hashCode();
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof ISO8601DateTime)) {
-                        return false;
-                } else {
-                        ISO8601DateTime iso8601DateTime	= (ISO8601DateTime)obj;
-                        return (this.getHasTimeZone() == iso8601DateTime.getHasTimeZone()) && (this.calendar.equals(iso8601DateTime.calendar));
-                }
-        }
-        
-        public static ISO8601DateTime fromCalendar(Calendar calendar) {
-                Calendar calendarNew	= Calendar.getInstance();
-                calendarNew.setTime(calendar.getTime());
-                calendarNew.setLenient(false);
-                return new ISO8601DateTime(calendarNew, true);
-        }
-        
-        public static ISO8601DateTime fromDate(Date date) {
-                Calendar calendar	= Calendar.getInstance();
-                calendar.setTime(date);
-                calendar.setLenient(false);
-                return new ISO8601DateTime(calendar, true);
+    private void validateDate() {
+        this.calendar.getTime();
+        int year	= this.calendar.get(Calendar.YEAR);
+        if (this.calendar.isSet(Calendar.ERA) && this.calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
+            year	= 0 - year + 1;
         }
 
-        /**
-         * Creates a new <code>ISO8601DateTime</code> by parsing the given <code>String</code> in the extended ISO8601 
-         * format defined for XML.
-         * 
-         * @param strDateTime the <code>String</code> in ISO8601 date-time format.
-         * @return a new <code>ISO8601DateTime</code>.
-         * @throws java.text.ParseException if there is an error parsing the <code>String</code>
-         */
-        public static ISO8601DateTime fromISO8601DateTimeString(String strDateTime) throws ParseException {
-                /*
-                 * Trim whitespace
-                 */
-                int startPos	= ParseUtils.nextNonWhite(strDateTime, 0);
-                
-                ParseUtils.ParseValue<Integer> parseValue	= ParseUtils.getSignedValue(strDateTime, startPos);
-                if (parseValue == null) {
-                        throw new ParseException("Invalid year", startPos);
-                }
-                int year		= parseValue.getValue();
-                if (parseValue.getNextPos() < 4) {
-                        throw new ParseException("Invalid year (must be at least 4 digits)", startPos);
-                }
-                startPos		+= parseValue.getNextPos();
-                if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != '-') {
-                        throw new ParseException("Invalid date", startPos);
-                }
-                startPos++;
-                
-                int month		= ParseUtils.getTwoDigitValue(strDateTime,  startPos);
-                if (month <= 0 || month > 12) {
-                        throw new ParseException("Invalid month", startPos);
-                }
-                startPos		+= 2;
-                if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != '-') {
-                        throw new ParseException("Invalid date", startPos);
-                }
-                startPos++;
-                
-                int day			= ParseUtils.getTwoDigitValue(strDateTime, startPos);
-                if (day < 1 || day > 31) {
-                        throw new ParseException("Invalid day", startPos);
-                }
-                startPos		+= 2;
-                
-                /*
-                 * There should now be a 'T'
-                 */
-                if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != 'T') {
-                        throw new ParseException("Missing time separator 'T'", startPos);
-                }
-                startPos++;
-                
-                /*
-                 * Get the hours
-                 */
-                int hours		= ParseUtils.getTwoDigitValue(strDateTime, startPos);
-                if (hours < 0 || hours > 23) {
-                        throw new ParseException("Invalid hours", startPos);
-                }
-                startPos		+= 2;
-                if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != ':') {
-                        throw new ParseException("Invalid date", startPos);
-                }
-                startPos++;
-                
-                /*
-                 * Get the minutes
-                 */
-                int minutes		= ParseUtils.getTwoDigitValue(strDateTime, startPos);
-                if (minutes < 0 || minutes > 59) {
-                        throw new ParseException("Invalid minutes", startPos);
-                }
-                startPos		+= 2;
-                if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != ':') {
-                        throw new ParseException("Invalid date", startPos);
-                }
-                startPos++;
-                
-                /*
-                 * Get the two-digit second of minute
-                 */
-                int	ss			= ParseUtils.getTwoDigitValue(strDateTime, startPos);
-                if (ss < 0 || ss >= 60) {
-                        throw new ParseException("Invalid second of minute", startPos);
-                }
-                startPos				+= 2;
-                
-                /*
-                 * Now determine if we have a milliseconds portion
-                 */
-                int	ms			= 0;
-                if (startPos < strDateTime.length()) {
-                        if (strDateTime.charAt(startPos) == '.') {
-                                startPos++;
-                                if ((ms = ParseUtils.getThreeDigitValue(strDateTime, startPos)) < 0 || ms >= 1000) {
-                                        throw new ParseException("Invalid milliseconds", startPos);
-                                }
-                                startPos	+= 3;
-                        }
-                }
+    }
 
-                /*
-                 * Now determine if there is a timezone
-                 */
-                String timezone		= null;
-
-                if (startPos < strDateTime.length()) {
-                        switch(strDateTime.charAt(startPos)) {
-                        case 'Z':
-                                timezone	= "GMT";
-                                startPos++;
-                                break;
-                        case '-':
-                        case '+':
-                                if (startPos+5 < strDateTime.length()) {
-                                        timezone	= "GMT" + strDateTime.substring(startPos, startPos+6);
-                                } else {
-                                        throw new ParseException("Invalid timezone", startPos);
-                                }
-                                break;
-                        default:
-                                throw new ParseException("Invalid timezone", startPos);
-                        }
-                }
-                
-                return new ISO8601DateTime(timezone, year, month, day, hours, minutes, ss, ms);
+    /**
+     * Creates a new <code>ISO8601DateTime</code> using the supplied field values.
+     *
+     * @param timeZone the <code>String</code> name of the time zone.  Use null for non-time-zoned instances
+     * @param yearIn the integer year (-9999 to 9999)
+     * @param monthIn the integer month (1-12)
+     * @param dayIn the integer day of the month (1-31)
+     * @param hourIn the integer hour of the day (0-23)
+     * @param minuteIn the integer minute of the hour (0-59)
+     * @param secondIn the integer second of the minute (0-59)
+     * @param millisecondIn the integer milliseconds (0-999)
+     */
+    public ISO8601DateTime(TimeZone timeZone, int yearIn, int monthIn, int dayIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
+        this.calendar	= Calendar.getInstance();
+        this.calendar.setLenient(false);
+        if (timeZone != null) {
+            this.hasTimeZone	= true;
+            this.calendar.setTimeZone(timeZone);
         }
-        
-        @Override
-        public String stringValue() {
+        if (yearIn <= 0) {
+            this.calendar.set(Calendar.ERA, GregorianCalendar.BC);
+            this.calendar.set(Calendar.YEAR, Math.abs(yearIn)+1);
+        } else {
+            this.calendar.set(Calendar.YEAR, yearIn);
+        }
+        this.calendar.set(Calendar.MONTH, monthIn-1);
+        this.calendar.set(Calendar.DAY_OF_MONTH, dayIn);
+        this.calendar.set(Calendar.HOUR_OF_DAY, hourIn);
+        this.calendar.set(Calendar.MINUTE, minuteIn);
+        this.calendar.set(Calendar.SECOND, secondIn);
+        this.calendar.set(Calendar.MILLISECOND, millisecondIn);
+
+        /*
+         * Now do the tests to throw illegal argument exceptions if the request was invalid
+         */
+        this.validateDate();
+    }
+
+    public ISO8601DateTime(String timeZone, int yearIn, int monthIn, int dayIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
+        this((timeZone == null ? null : TimeZone.getTimeZone(timeZone)), yearIn, monthIn, dayIn, hourIn, minuteIn, secondIn, millisecondIn);
+    }
+
+    public ISO8601DateTime(ISO8601TimeZone timeZone, ISO8601Date iso8601Date, ISO8601Time iso8601Time) {
+        this((timeZone == null ? null : timeZone.getTimeZoneString()), iso8601Date.getYear(), iso8601Date.getMonth(), iso8601Date.getDay(), iso8601Time.getHour(), iso8601Time.getMinute(), iso8601Time.getSecond(), iso8601Time.getMillisecond());
+    }
+
+    public ISO8601DateTime(int yearIn, int monthIn, int dayIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
+        this((TimeZone)null, yearIn, monthIn, dayIn, hourIn, minuteIn, secondIn, millisecondIn);
+    }
+
+    /**
+     * Creates a new <code>ISO8601DateTime</code> using the given <code>Calendar</code>.  If <code>hasTimeZoneIn</code>
+     * is true, then the time zone of the given <code>Calendar</code> is used, otherwise this is a non-time-zoned <code>ISO8601DateTime</code>
+     *
+     * @param calendarIn the <code>Calendar</code> for the new <code>ISO8601DateTime</code>
+     * @param hasTimeZoneIn if true, create a time-zoned <code>ISO8601DateTime</code> else create a non-time-zoned <code>ISO8601DateTime</code>
+     */
+    private ISO8601DateTime(Calendar calendarIn, boolean hasTimeZoneIn) {
+        /*
+        this.calendar		= Calendar.getInstance();
+        this.calendar.setLenient(false);
+        this.calendar.setTimeZone(calendarIn.getTimeZone());
+        this.calendar.setTimeInMillis(calendarIn.getTimeInMillis());
+        */
+        this.calendar		= calendarIn;
+        this.hasTimeZone	= hasTimeZoneIn;
+    }
+
+    /**
+     * Gets the value indicating whether this <code>ISO8601DateTime</code> is time-zoned or non-time-zoned.
+     *
+     * @return true if this <code>ISO8601DateTime</code> is time-zoned, else false
+     */
+    public boolean getHasTimeZone() {
+        return this.hasTimeZone;
+    }
+
+    public String getTimeZone() {
+        if (this.getHasTimeZone()) {
+            int tzOffsetMillis	= this.calendar.get(Calendar.ZONE_OFFSET);
+            if (tzOffsetMillis == 0) {
+                return "Z";
+            } else {
+                int tzOffsetHours	= Math.abs(tzOffsetMillis) / (60 * 60 * 1000);
+                int tzOffsetMinutes	= (Math.abs(tzOffsetMillis) - (tzOffsetHours * 60 * 60 * 1000)) / (60 * 1000);
                 StringBuilder stringBuilder	= new StringBuilder();
-                if (this.calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
-                        int yearBC	= this.calendar.get(Calendar.YEAR) - 1;
-                        stringBuilder.append('-');
-                        stringBuilder.append(String.format("%d", yearBC));
-                } else {
-                        stringBuilder.append(String.format("%d", this.calendar.get(Calendar.YEAR)));
-                }
-                stringBuilder.append('-');
-                stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.MONTH) + 1));
-                stringBuilder.append('-');
-                stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.DAY_OF_MONTH)));
-                stringBuilder.append('T');
-                stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.HOUR_OF_DAY)));
+                stringBuilder.append((tzOffsetMillis < 0 ? '-' : '+'));
+                stringBuilder.append(String.format("%02d", tzOffsetHours));
                 stringBuilder.append(':');
-                stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.MINUTE)));
-                stringBuilder.append(':');
-                stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.SECOND)));
-                int ms	= this.calendar.get(Calendar.MILLISECOND);
-                if (ms != 0) {
-                        stringBuilder.append('.');
-                        stringBuilder.append(String.format("%03d",  ms));
-                }
-                if (this.getHasTimeZone()) {
-                        stringBuilder.append(this.getTimeZone());
-                }
+                stringBuilder.append(String.format("%02d", tzOffsetMinutes));
                 return stringBuilder.toString();
+            }
+
+        } else {
+            return null;
         }
-        
-        @Override
-        public String toString() {
-                return this.stringValue();
+    }
+
+    public int getYear() {
+        int year	= this.calendar.get(Calendar.YEAR);
+        if (this.calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
+            return -(year - 1);
+        } else {
+            return year;
         }
-        
-        private static int compareCalendars(Calendar cal1, Calendar cal2) {
-                long cal1Time	= cal1.getTimeInMillis();
-                long cal2Time	= cal2.getTimeInMillis();
-                if (cal1Time < cal2Time) {
-                        return -1;
-                } else if (cal1Time > cal2Time) {
-                        return 1;
-                } else {
-                        return 0;
-                }
+    }
+    public int getMonth() {
+        return this.calendar.get(Calendar.MONTH) + 1;
+    }
+    public int getDay() {
+        return this.calendar.get(Calendar.DAY_OF_MONTH);
+    }
+    public int getHour() {
+        return this.calendar.get(Calendar.HOUR_OF_DAY);
+    }
+    public int getMinute() {
+        return this.calendar.get(Calendar.MINUTE);
+    }
+    public int getSecond() {
+        return this.calendar.get(Calendar.SECOND);
+    }
+    public int getMillisecond() {
+        return this.calendar.get(Calendar.MILLISECOND);
+    }
+
+    /**
+     * Gets a copy of the <code>Calendar</code> backing this <code>ISO8601DateTime</code>.
+     *
+     * @return a copy of the <code>Calendar</code> backing this <code>ISO8601DateTime</code>.
+     */
+    public Calendar getCalendar() {
+        Calendar calendarCopy	= Calendar.getInstance();
+        calendarCopy.setLenient(false);
+        if (this.getHasTimeZone()) {
+            calendarCopy.setTimeZone(this.calendar.getTimeZone());
+        }
+        calendarCopy.setTimeInMillis(this.calendar.getTimeInMillis());
+        return calendarCopy;
+    }
+
+    /**
+     * Gets a <code>ISO8601DateTime</code> equivalent to this <code>ISO8601DateTime</code> converted to
+     * the GMT time zone.  If this <code>ISO8601DateTime</code> is non-time-zoned, this method will throw
+     * an illegal state exception.
+     *
+     * @return a <code>ISO8601DateTime</code> equivalent to this <code>ISO8601DateTime</code> in the GMT time zone.
+     * @throws IllegalStateException if this <code>ISO8601DateTime</code> is non-time-zoned.
+     */
+    public ISO8601DateTime getGMTDateTime() {
+        if (!this.getHasTimeZone()) {
+            throw new IllegalStateException("Cannot convert non-time-zoned ISO8601DateTime to GMT");
+        }
+        if (this.calendar.get(Calendar.ZONE_OFFSET) == 0) {
+            return this;
+        } else {
+            Calendar calendarGMT	= Calendar.getInstance();
+            calendarGMT.setLenient(false);
+            calendarGMT.setTimeZone(TimeZone.getTimeZone("GMT"));
+            calendarGMT.setTimeInMillis(this.calendar.getTimeInMillis());
+            return new ISO8601DateTime(calendarGMT, true);
+        }
+    }
+
+    private ISO8601DateTime add(ISO8601Duration iso8601Duration, int sign) {
+        Calendar calendarCopy	= this.getCalendar();
+
+        int value;
+        if ((value = iso8601Duration.getYears()) != 0) {
+            calendarCopy.add(Calendar.YEAR, sign*value);
+        }
+        if ((value = iso8601Duration.getMonths()) != 0) {
+            calendarCopy.add(Calendar.MONTH, sign*value);
+        }
+        if ((value = iso8601Duration.getDays()) != 0) {
+            calendarCopy.add(Calendar.DAY_OF_YEAR, sign*value);
+        }
+        if ((value = iso8601Duration.getHours()) != 0) {
+            calendarCopy.add(Calendar.HOUR_OF_DAY, sign*value);
+        }
+        if ((value = iso8601Duration.getMinutes()) != 0) {
+            calendarCopy.add(Calendar.MINUTE, sign*value);
+        }
+        int seconds	= iso8601Duration.getSeconds();
+        if (seconds >= 1) {
+            calendarCopy.add(Calendar.SECOND, sign*seconds);
+        }
+        int millis	= iso8601Duration.getMillis();
+        if (millis != 0) {
+            calendarCopy.add(Calendar.MILLISECOND, sign*millis);
         }
 
-        @Override
-        public int compareTo(ISO8601DateTime o) {
-                if (this.getHasTimeZone()) {
-                        if (o.getHasTimeZone()) {
-                                return compareCalendars(this.calendar, o.calendar);
-                        } else {
-                                long thisMilliseconds	= this.calendar.getTimeInMillis();
-                                long oMilliseconds		= o.calendar.getTimeInMillis();
-                                if (thisMilliseconds < (oMilliseconds - TZOFFSET_14_HOURS_MILLIS)) {
-                                        return -1;
-                                } else if (thisMilliseconds > (oMilliseconds + TZOFFSET_14_HOURS_MILLIS)) {
-                                        return 1;
-                                } else {
-                                        throw new IllegalArgumentException("Cannot compare this ISO8601DateTime with non-time-zoned ISO8601DateTime");
-                                }
-                        }
-                } else {
-                        if (o.getHasTimeZone()) {
-                                long thisMilliseconds	= this.calendar.getTimeInMillis();
-                                long oMilliseconds		= o.calendar.getTimeInMillis();
-                                if ((thisMilliseconds + TZOFFSET_14_HOURS_MILLIS) < oMilliseconds) {
-                                        return -1;
-                                } else if ((thisMilliseconds - TZOFFSET_14_HOURS_MILLIS) > oMilliseconds) {
-                                        return 1;
-                                } else {
-                                        throw new IllegalArgumentException("Cannot compare this ISO8601DateTime with time-zoned ISO8601DateTime");
-                                }				
-                        } else {
-                                /*
-                                 * Neither has a timezone, so we can just compare the time in milliseconds
-                                 */
-                                return compareCalendars(this.calendar, o.calendar);
-                        }
-                }
+        return new ISO8601DateTime(calendarCopy, this.getHasTimeZone());
+    }
+
+    /**
+     * Adds the given <code>ISO8601Duration</code> to this <code>ISO8601DateTime</code> and returns
+     * a new <code>ISO8601DateTime</code> with the result.
+     *
+     * @param iso8601Duration the <code>ISO8601Duration</code> to add
+     * @return a new <code>ISO8601DateTime</code> with the result of the addition
+     */
+    public ISO8601DateTime add(ISO8601Duration iso8601Duration) {
+        return this.add(iso8601Duration, iso8601Duration.getDurationSign());
+    }
+
+    public ISO8601DateTime sub(ISO8601Duration iso8601Duration) {
+        return this.add(iso8601Duration, -iso8601Duration.getDurationSign());
+    }
+
+    @Override
+    public int hashCode() {
+        return (this.getHasTimeZone() ? 999 : 0) + this.calendar.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof ISO8601DateTime)) {
+            return false;
+        } else {
+            ISO8601DateTime iso8601DateTime	= (ISO8601DateTime)obj;
+            return (this.getHasTimeZone() == iso8601DateTime.getHasTimeZone()) && (this.calendar.equals(iso8601DateTime.calendar));
         }
-        
+    }
+
+    public static ISO8601DateTime fromCalendar(Calendar calendar) {
+        Calendar calendarNew	= Calendar.getInstance();
+        calendarNew.setTime(calendar.getTime());
+        calendarNew.setLenient(false);
+        return new ISO8601DateTime(calendarNew, true);
+    }
+
+    public static ISO8601DateTime fromDate(Date date) {
+        Calendar calendar	= Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.setLenient(false);
+        return new ISO8601DateTime(calendar, true);
+    }
+
+    /**
+     * Creates a new <code>ISO8601DateTime</code> by parsing the given <code>String</code> in the extended ISO8601
+     * format defined for XML.
+     *
+     * @param strDateTime the <code>String</code> in ISO8601 date-time format.
+     * @return a new <code>ISO8601DateTime</code>.
+     * @throws java.text.ParseException if there is an error parsing the <code>String</code>
+     */
+    public static ISO8601DateTime fromISO8601DateTimeString(String strDateTime) throws ParseException {
+        /*
+         * Trim whitespace
+         */
+        int startPos	= ParseUtils.nextNonWhite(strDateTime, 0);
+
+        ParseUtils.ParseValue<Integer> parseValue	= ParseUtils.getSignedValue(strDateTime, startPos);
+        if (parseValue == null) {
+            throw new ParseException("Invalid year", startPos);
+        }
+        int year		= parseValue.getValue();
+        if (parseValue.getNextPos() < 4) {
+            throw new ParseException("Invalid year (must be at least 4 digits)", startPos);
+        }
+        startPos		+= parseValue.getNextPos();
+        if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != '-') {
+            throw new ParseException("Invalid date", startPos);
+        }
+        startPos++;
+
+        int month		= ParseUtils.getTwoDigitValue(strDateTime,  startPos);
+        if (month <= 0 || month > 12) {
+            throw new ParseException("Invalid month", startPos);
+        }
+        startPos		+= 2;
+        if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != '-') {
+            throw new ParseException("Invalid date", startPos);
+        }
+        startPos++;
+
+        int day			= ParseUtils.getTwoDigitValue(strDateTime, startPos);
+        if (day < 1 || day > 31) {
+            throw new ParseException("Invalid day", startPos);
+        }
+        startPos		+= 2;
+
+        /*
+         * There should now be a 'T'
+         */
+        if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != 'T') {
+            throw new ParseException("Missing time separator 'T'", startPos);
+        }
+        startPos++;
+
+        /*
+         * Get the hours
+         */
+        int hours		= ParseUtils.getTwoDigitValue(strDateTime, startPos);
+        if (hours < 0 || hours > 23) {
+            throw new ParseException("Invalid hours", startPos);
+        }
+        startPos		+= 2;
+        if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != ':') {
+            throw new ParseException("Invalid date", startPos);
+        }
+        startPos++;
+
+        /*
+         * Get the minutes
+         */
+        int minutes		= ParseUtils.getTwoDigitValue(strDateTime, startPos);
+        if (minutes < 0 || minutes > 59) {
+            throw new ParseException("Invalid minutes", startPos);
+        }
+        startPos		+= 2;
+        if (startPos >= strDateTime.length() || strDateTime.charAt(startPos) != ':') {
+            throw new ParseException("Invalid date", startPos);
+        }
+        startPos++;
+
+        /*
+         * Get the two-digit second of minute
+         */
+        int	ss			= ParseUtils.getTwoDigitValue(strDateTime, startPos);
+        if (ss < 0 || ss >= 60) {
+            throw new ParseException("Invalid second of minute", startPos);
+        }
+        startPos				+= 2;
+
+        /*
+         * Now determine if we have a milliseconds portion
+         */
+        int	ms			= 0;
+        if (startPos < strDateTime.length()) {
+            if (strDateTime.charAt(startPos) == '.') {
+                startPos++;
+                if ((ms = ParseUtils.getThreeDigitValue(strDateTime, startPos)) < 0 || ms >= 1000) {
+                    throw new ParseException("Invalid milliseconds", startPos);
+                }
+                startPos	+= 3;
+            }
+        }
+
+        /*
+         * Now determine if there is a timezone
+         */
+        String timezone		= null;
+
+        if (startPos < strDateTime.length()) {
+            switch(strDateTime.charAt(startPos)) {
+            case 'Z':
+                timezone	= "GMT";
+                startPos++;
+                break;
+            case '-':
+            case '+':
+                if (startPos+5 < strDateTime.length()) {
+                    timezone	= "GMT" + strDateTime.substring(startPos, startPos+6);
+                } else {
+                    throw new ParseException("Invalid timezone", startPos);
+                }
+                break;
+            default:
+                throw new ParseException("Invalid timezone", startPos);
+            }
+        }
+
+        return new ISO8601DateTime(timezone, year, month, day, hours, minutes, ss, ms);
+    }
+
+    @Override
+    public String stringValue() {
+        StringBuilder stringBuilder	= new StringBuilder();
+        if (this.calendar.get(Calendar.ERA) == GregorianCalendar.BC) {
+            int yearBC	= this.calendar.get(Calendar.YEAR) - 1;
+            stringBuilder.append('-');
+            stringBuilder.append(String.format("%d", yearBC));
+        } else {
+            stringBuilder.append(String.format("%d", this.calendar.get(Calendar.YEAR)));
+        }
+        stringBuilder.append('-');
+        stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.MONTH) + 1));
+        stringBuilder.append('-');
+        stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.DAY_OF_MONTH)));
+        stringBuilder.append('T');
+        stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.HOUR_OF_DAY)));
+        stringBuilder.append(':');
+        stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.MINUTE)));
+        stringBuilder.append(':');
+        stringBuilder.append(String.format("%02d", this.calendar.get(Calendar.SECOND)));
+        int ms	= this.calendar.get(Calendar.MILLISECOND);
+        if (ms != 0) {
+            stringBuilder.append('.');
+            stringBuilder.append(String.format("%03d",  ms));
+        }
+        if (this.getHasTimeZone()) {
+            stringBuilder.append(this.getTimeZone());
+        }
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public String toString() {
+        return this.stringValue();
+    }
+
+    private static int compareCalendars(Calendar cal1, Calendar cal2) {
+        long cal1Time	= cal1.getTimeInMillis();
+        long cal2Time	= cal2.getTimeInMillis();
+        if (cal1Time < cal2Time) {
+            return -1;
+        } else if (cal1Time > cal2Time) {
+            return 1;
+        } else {
+            return 0;
+        }
+    }
+
+    @Override
+    public int compareTo(ISO8601DateTime o) {
+        if (this.getHasTimeZone()) {
+            if (o.getHasTimeZone()) {
+                return compareCalendars(this.calendar, o.calendar);
+            } else {
+                long thisMilliseconds	= this.calendar.getTimeInMillis();
+                long oMilliseconds		= o.calendar.getTimeInMillis();
+                if (thisMilliseconds < (oMilliseconds - TZOFFSET_14_HOURS_MILLIS)) {
+                    return -1;
+                } else if (thisMilliseconds > (oMilliseconds + TZOFFSET_14_HOURS_MILLIS)) {
+                    return 1;
+                } else {
+                    throw new IllegalArgumentException("Cannot compare this ISO8601DateTime with non-time-zoned ISO8601DateTime");
+                }
+            }
+        } else {
+            if (o.getHasTimeZone()) {
+                long thisMilliseconds	= this.calendar.getTimeInMillis();
+                long oMilliseconds		= o.calendar.getTimeInMillis();
+                if ((thisMilliseconds + TZOFFSET_14_HOURS_MILLIS) < oMilliseconds) {
+                    return -1;
+                } else if ((thisMilliseconds - TZOFFSET_14_HOURS_MILLIS) > oMilliseconds) {
+                    return 1;
+                } else {
+                    throw new IllegalArgumentException("Cannot compare this ISO8601DateTime with time-zoned ISO8601DateTime");
+                }
+            } else {
+                /*
+                 * Neither has a timezone, so we can just compare the time in milliseconds
+                 */
+                return compareCalendars(this.calendar, o.calendar);
+            }
+        }
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Duration.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Duration.java
index f25d753..750b592 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Duration.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Duration.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,338 +36,338 @@
 
 /**
  * ISO8601Duration implements the ISO8601 duration data type with parsers from strings and to strings.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class ISO8601Duration implements SemanticString {
-        private static int getChunkOrder(boolean sawT, char chunkName) {
-                switch(chunkName) {
-                case 'Y':
-                        return 1;
-                case 'M':
-                        return (!sawT ? 2 : 5);
-                case 'D':
-                        return 3;
-                case 'H':
-                        return 4;
-                case 'S':
-                        return 6;
-                default:
-                        return -1;
-                }
+    private static int getChunkOrder(boolean sawT, char chunkName) {
+        switch(chunkName) {
+        case 'Y':
+            return 1;
+        case 'M':
+            return (!sawT ? 2 : 5);
+        case 'D':
+            return 3;
+        case 'H':
+            return 4;
+        case 'S':
+            return 6;
+        default:
+            return -1;
         }
-        
-        private static class DurationChunk {
-                private char	chunkName;
-                private double	chunkValue;
-                private int		length;
-                
-                public DurationChunk(char name, double value, int lengthIn) {
-                        this.chunkName	= name;
-                        this.chunkValue	= value;
-                        this.length		= lengthIn;
-                }
-                
-                public char getChunkName() {
-                        return this.chunkName;
-                }
-                public double getChunkValue() {
-                        return this.chunkValue;
-                }
-                public int getLength() {
-                        return this.length;
-                }
-                public boolean isIntValue() {
-                        return Math.floor(this.getChunkValue()) == this.getChunkValue();
-                }
-                public int getIntValue() {
-                        return (int)Math.floor(this.getChunkValue());
-                }
-                
-                public static DurationChunk nextChunk(String duration, int startPos) throws ParseException {
-                        if (duration == null || startPos >= duration.length()) {
-                                return null;
-                        }
-                        int		curPos		= startPos;
-                        int		endPos		= duration.length();
-                        int		dotCount	= 0;
-                        char	charAt;
-                        while (curPos < endPos && ((charAt = duration.charAt(curPos)) == '.' || Character.isDigit(charAt))) {
-                                if (charAt == '.') {
-                                        dotCount++;
-                                }
-                                curPos++;
-                        }
-                        if (curPos < endPos && dotCount <= 1) {
-                                char	chunkName	= duration.charAt(curPos);
-                                Double	dvalue		= null;
-                                try {
-                                        dvalue	= Double.parseDouble(duration.substring(startPos, curPos));
-                                } catch (NumberFormatException ex) {
-                                        throw new ParseException("Invalid chunk \"" + duration + "\" at position " + startPos, startPos);
-                                }
-                                curPos++;
-                                return new DurationChunk(chunkName, dvalue, (curPos - startPos));
-                        } else {
-                                throw new ParseException("Invalid chunk \"" + duration + "\" at position " + startPos, curPos);
-                        }			
-                }
-        }
-        
-        private int		durationSign	= 1;
-        private int		years;
-        private int 	months;
-        private int 	days;
-        private int 	hours;
-        private int 	minutes;
-        private int		seconds;
-        private int 	millis;
-        
-        /**
-         * Creates a duration with the given values.
-         * 
-         * @param durationSignIn the sign of the duration
-         * @param yearsIn the number of years
-         * @param monthsIn the number of months
-         * @param daysIn the number of days
-         * @param hoursIn the number of hours
-         * @param minutesIn the number of minutes
-         * @param secondsIn the number of fractional seconds
-         */
-        public ISO8601Duration(int durationSignIn, int yearsIn, int monthsIn, int daysIn, int hoursIn, int minutesIn, double secondsIn) {
-                this.durationSign	= durationSignIn;
-                this.years			= yearsIn;
-                this.months			= monthsIn;
-                this.days			= daysIn;
-                this.hours			= hoursIn;
-                this.minutes		= minutesIn;
-                this.seconds		= (int) Math.floor(secondsIn);
-                this.millis			= (int) Math.floor(((secondsIn * 1000) - (this.seconds * 1000)));
-        }
-        
-        /**
-         * Creates a new <code>ISO8601Duration</code> by parsing the given <code>String</code>.
-         * 
-         * @param iso8601DurationString the ISO8601 duration <code>String</code>
-         * @return a new <code>ISO8601Duration</code> parsed from the given <code>String</code>
-         */
-        public static ISO8601Duration newInstance(String iso8601DurationString) throws ParseException {
-                if (iso8601DurationString == null || iso8601DurationString.length() == 0) {
-                        return null;
-                }
-                int	curPos			= 0;
-                int endPos			= iso8601DurationString.length();
-                
-                int	durationSign	= 1;
-                int years			= 0;
-                int	months			= 0;
-                int days			= 0;
-                int hours			= 0;
-                int minutes			= 0;
-                double fractionalSeconds		= 0.0;
+    }
 
-                
-                if (iso8601DurationString.charAt(curPos) == '-') {
-                        durationSign	= -1;
-                        curPos++;
-                }
-                if (iso8601DurationString.charAt(curPos) != 'P') {
-                        throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos, curPos);
+    private static class DurationChunk {
+        private char	chunkName;
+        private double	chunkValue;
+        private int		length;
+
+        public DurationChunk(char name, double value, int lengthIn) {
+            this.chunkName	= name;
+            this.chunkValue	= value;
+            this.length		= lengthIn;
+        }
+
+        public char getChunkName() {
+            return this.chunkName;
+        }
+        public double getChunkValue() {
+            return this.chunkValue;
+        }
+        public int getLength() {
+            return this.length;
+        }
+        public boolean isIntValue() {
+            return Math.floor(this.getChunkValue()) == this.getChunkValue();
+        }
+        public int getIntValue() {
+            return (int)Math.floor(this.getChunkValue());
+        }
+
+        public static DurationChunk nextChunk(String duration, int startPos) throws ParseException {
+            if (duration == null || startPos >= duration.length()) {
+                return null;
+            }
+            int		curPos		= startPos;
+            int		endPos		= duration.length();
+            int		dotCount	= 0;
+            char	charAt;
+            while (curPos < endPos && ((charAt = duration.charAt(curPos)) == '.' || Character.isDigit(charAt))) {
+                if (charAt == '.') {
+                    dotCount++;
                 }
                 curPos++;
-                
-                if (curPos >= endPos) {
-                        throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\": No duration components following P", curPos);
+            }
+            if (curPos < endPos && dotCount <= 1) {
+                char	chunkName	= duration.charAt(curPos);
+                Double	dvalue		= null;
+                try {
+                    dvalue	= Double.parseDouble(duration.substring(startPos, curPos));
+                } catch (NumberFormatException ex) {
+                    throw new ParseException("Invalid chunk \"" + duration + "\" at position " + startPos, startPos);
                 }
-                
-                int lastChunkOrder	= 0;
-                boolean sawT		= false;
-                while (curPos < endPos) {
-                        /*
-                         * Look for the Time divider character
-                         */
-                        if (iso8601DurationString.charAt(curPos) == 'T') {
-                                if (sawT) {
-                                        throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos + ": saw multiple T separators", curPos);
-                                } else {
-                                        sawT	= true;
-                                }
-                                curPos++;
-                        } else {
-                                DurationChunk	durationChunk	= DurationChunk.nextChunk(iso8601DurationString, curPos);
-                                
-                                /*
-                                 * Check for unknown chunks or out of order chunks
-                                 */
-                                int			chunkOrder		= getChunkOrder(sawT, durationChunk.getChunkName());
-                                if (chunkOrder <= 0) {
-                                        throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos + ": invalid component", curPos);
-                                } else if (chunkOrder <= lastChunkOrder) {
-                                        throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos + ": out of order component", curPos);
-                                }
-                                lastChunkOrder	= chunkOrder;
-                                
-                                /*
-                                 * Check for correct value type
-                                 */
-                                if (durationChunk.getChunkName() != 'S' && !durationChunk.isIntValue()) {
-                                        throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos + ": expected int value", curPos);
-                                }
-                                
-                                /*
-                                 * Assign the value to the right component
-                                 */
-                                switch(durationChunk.getChunkName()) {
-                                case 'Y':
-                                        years	= durationChunk.getIntValue();
-                                        break;
-                                case 'M':
-                                        if (!sawT) {
-                                                months	= durationChunk.getIntValue();
-                                        } else {
-                                                minutes	= durationChunk.getIntValue();
-                                        }
-                                        break;
-                                case 'D':
-                                        days	= durationChunk.getIntValue();
-                                        break;
-                                case 'H':
-                                        hours	= durationChunk.getIntValue();
-                                        break;
-                                case 'S':
-                                        fractionalSeconds	= durationChunk.getChunkValue();
-                                        break;
-                                default:
-                                        assert(false);
-                                        break;
-                                }
-                                
-                                /*
-                                 * Advance the current position
-                                 */
-                                curPos	+= durationChunk.getLength();
-                        }
+                curPos++;
+                return new DurationChunk(chunkName, dvalue, (curPos - startPos));
+            } else {
+                throw new ParseException("Invalid chunk \"" + duration + "\" at position " + startPos, curPos);
+            }
+        }
+    }
+
+    private int		durationSign	= 1;
+    private int		years;
+    private int 	months;
+    private int 	days;
+    private int 	hours;
+    private int 	minutes;
+    private int		seconds;
+    private int 	millis;
+
+    /**
+     * Creates a duration with the given values.
+     *
+     * @param durationSignIn the sign of the duration
+     * @param yearsIn the number of years
+     * @param monthsIn the number of months
+     * @param daysIn the number of days
+     * @param hoursIn the number of hours
+     * @param minutesIn the number of minutes
+     * @param secondsIn the number of fractional seconds
+     */
+    public ISO8601Duration(int durationSignIn, int yearsIn, int monthsIn, int daysIn, int hoursIn, int minutesIn, double secondsIn) {
+        this.durationSign	= durationSignIn;
+        this.years			= yearsIn;
+        this.months			= monthsIn;
+        this.days			= daysIn;
+        this.hours			= hoursIn;
+        this.minutes		= minutesIn;
+        this.seconds		= (int) Math.floor(secondsIn);
+        this.millis			= (int) Math.floor(((secondsIn * 1000) - (this.seconds * 1000)));
+    }
+
+    /**
+     * Creates a new <code>ISO8601Duration</code> by parsing the given <code>String</code>.
+     *
+     * @param iso8601DurationString the ISO8601 duration <code>String</code>
+     * @return a new <code>ISO8601Duration</code> parsed from the given <code>String</code>
+     */
+    public static ISO8601Duration newInstance(String iso8601DurationString) throws ParseException {
+        if (iso8601DurationString == null || iso8601DurationString.length() == 0) {
+            return null;
+        }
+        int	curPos			= 0;
+        int endPos			= iso8601DurationString.length();
+
+        int	durationSign	= 1;
+        int years			= 0;
+        int	months			= 0;
+        int days			= 0;
+        int hours			= 0;
+        int minutes			= 0;
+        double fractionalSeconds		= 0.0;
+
+
+        if (iso8601DurationString.charAt(curPos) == '-') {
+            durationSign	= -1;
+            curPos++;
+        }
+        if (iso8601DurationString.charAt(curPos) != 'P') {
+            throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos, curPos);
+        }
+        curPos++;
+
+        if (curPos >= endPos) {
+            throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\": No duration components following P", curPos);
+        }
+
+        int lastChunkOrder	= 0;
+        boolean sawT		= false;
+        while (curPos < endPos) {
+            /*
+             * Look for the Time divider character
+             */
+            if (iso8601DurationString.charAt(curPos) == 'T') {
+                if (sawT) {
+                    throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos + ": saw multiple T separators", curPos);
+                } else {
+                    sawT	= true;
+                }
+                curPos++;
+            } else {
+                DurationChunk	durationChunk	= DurationChunk.nextChunk(iso8601DurationString, curPos);
+
+                /*
+                 * Check for unknown chunks or out of order chunks
+                 */
+                int			chunkOrder		= getChunkOrder(sawT, durationChunk.getChunkName());
+                if (chunkOrder <= 0) {
+                    throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos + ": invalid component", curPos);
+                } else if (chunkOrder <= lastChunkOrder) {
+                    throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos + ": out of order component", curPos);
+                }
+                lastChunkOrder	= chunkOrder;
+
+                /*
+                 * Check for correct value type
+                 */
+                if (durationChunk.getChunkName() != 'S' && !durationChunk.isIntValue()) {
+                    throw new ParseException("Invalid ISO8601 duration string \"" + iso8601DurationString + "\" at position " + curPos + ": expected int value", curPos);
                 }
 
-                return new ISO8601Duration(durationSign, years, months, days, hours, minutes, fractionalSeconds);
+                /*
+                 * Assign the value to the right component
+                 */
+                switch(durationChunk.getChunkName()) {
+                case 'Y':
+                    years	= durationChunk.getIntValue();
+                    break;
+                case 'M':
+                    if (!sawT) {
+                        months	= durationChunk.getIntValue();
+                    } else {
+                        minutes	= durationChunk.getIntValue();
+                    }
+                    break;
+                case 'D':
+                    days	= durationChunk.getIntValue();
+                    break;
+                case 'H':
+                    hours	= durationChunk.getIntValue();
+                    break;
+                case 'S':
+                    fractionalSeconds	= durationChunk.getChunkValue();
+                    break;
+                default:
+                    assert(false);
+                    break;
+                }
+
+                /*
+                 * Advance the current position
+                 */
+                curPos	+= durationChunk.getLength();
+            }
         }
-        
-        public int getDurationSign() {
-                return this.durationSign;
+
+        return new ISO8601Duration(durationSign, years, months, days, hours, minutes, fractionalSeconds);
+    }
+
+    public int getDurationSign() {
+        return this.durationSign;
+    }
+    public int getYears() {
+        return this.years;
+    }
+    public int getMonths() {
+        return this.months;
+    }
+    public int getDays() {
+        return this.days;
+    }
+    public int getHours() {
+        return this.hours;
+    }
+    public int getMinutes() {
+        return this.minutes;
+    }
+    public int getSeconds() {
+        return this.seconds;
+    }
+    public int getMillis() {
+        return this.millis;
+    }
+    public double getFractionalSecs() {
+        double dSec = (double)(this.seconds) + (( (double)this.millis) / 1000);
+        return dSec;
+    }
+
+    @Override
+    public int hashCode() {
+        return this.getDurationSign() + this.getYears() + this.getMonths() + this.getDays() + this.getHours() + this.getMinutes() + this.getSeconds() + this.getMillis();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof ISO8601Duration)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            ISO8601Duration	iso8601Duration	= (ISO8601Duration)obj;
+            return (this.getDurationSign() == iso8601Duration.getDurationSign() &&
+                    this.getYears() == iso8601Duration.getYears() &&
+                    this.getMonths() == iso8601Duration.getMonths() &&
+                    this.getDays() == iso8601Duration.getDays() &&
+                    this.getHours() == iso8601Duration.getHours() &&
+                    this.getMinutes() == iso8601Duration.getMinutes() &&
+                    this.getSeconds() == iso8601Duration.getSeconds() &&
+                    this.getMillis() == iso8601Duration.getMillis()
+                   );
+
         }
-        public int getYears() {
-                return this.years;
+    }
+
+    @Override
+    public String stringValue() {
+        StringBuilder stringBuilder	= new StringBuilder();
+        if (this.getDurationSign() < 0) {
+            stringBuilder.append("-P");
+        } else {
+            stringBuilder.append("P");
         }
-        public int getMonths() {
-                return this.months;
+        boolean		sawOne	= false;
+        if (this.getYears() > 0) {
+            stringBuilder.append(this.getYears());
+            stringBuilder.append('Y');
+            sawOne	= true;
         }
-        public int getDays() {
-                return this.days;
+        if (this.getMonths() > 0) {
+            stringBuilder.append(this.getMonths());
+            stringBuilder.append('M');
+            sawOne	= true;
         }
-        public int getHours() {
-                return this.hours;
+        if (this.getDays() > 0) {
+            stringBuilder.append(this.getDays());
+            stringBuilder.append('D');
+            sawOne	= true;
         }
-        public int getMinutes() {
-                return this.minutes;
-        }
-        public int getSeconds() {
-                return this.seconds;
-        }
-        public int getMillis() {
-                return this.millis;
-        }
-        public double getFractionalSecs() {
-                double dSec = (double)(this.seconds) + (( (double)this.millis) / 1000);
-                return dSec;
-        }
-        
-        @Override
-        public int hashCode() {
-                return this.getDurationSign() + this.getYears() + this.getMonths() + this.getDays() + this.getHours() + this.getMinutes() + this.getSeconds() + this.getMillis();
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof ISO8601Duration)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
+        if (this.getHours() > 0 || this.getMinutes() > 0 || this.getSeconds() > 0 || this.getMillis() > 0) {
+            stringBuilder.append('T');
+            if (this.getHours() > 0) {
+                stringBuilder.append(this.getHours());
+                stringBuilder.append('H');
+            }
+            if (this.getMinutes() > 0) {
+                stringBuilder.append(this.getMinutes());
+                stringBuilder.append('M');
+            }
+            double	dSeconds	= this.getFractionalSecs();
+            if (dSeconds > 0) {
+                if (dSeconds == Math.floor(dSeconds)) {
+                    stringBuilder.append((int)dSeconds);
                 } else {
-                        ISO8601Duration	iso8601Duration	= (ISO8601Duration)obj;
-                        return (this.getDurationSign() == iso8601Duration.getDurationSign() &&
-                                        this.getYears() == iso8601Duration.getYears() &&
-                                        this.getMonths() == iso8601Duration.getMonths() &&
-                                        this.getDays() == iso8601Duration.getDays() &&
-                                        this.getHours() == iso8601Duration.getHours() &&
-                                        this.getMinutes() == iso8601Duration.getMinutes() &&
-                                        this.getSeconds() == iso8601Duration.getSeconds() &&
-                                        this.getMillis() == iso8601Duration.getMillis()
-                                        );
-                                
+                    stringBuilder.append(dSeconds);
                 }
+                stringBuilder.append('S');
+            }
+        } else if (!sawOne) {
+            stringBuilder.append("T0S");
         }
-        
-        @Override
-        public String stringValue() {
-                StringBuilder stringBuilder	= new StringBuilder();
-                if (this.getDurationSign() < 0) {
-                        stringBuilder.append("-P");
-                } else {
-                        stringBuilder.append("P");
-                }
-                boolean		sawOne	= false;
-                if (this.getYears() > 0) {
-                        stringBuilder.append(this.getYears());
-                        stringBuilder.append('Y');
-                        sawOne	= true;
-                }
-                if (this.getMonths() > 0) {
-                        stringBuilder.append(this.getMonths());
-                        stringBuilder.append('M');
-                        sawOne	= true;
-                }
-                if (this.getDays() > 0) {
-                        stringBuilder.append(this.getDays());
-                        stringBuilder.append('D');
-                        sawOne	= true;
-                }
-                if (this.getHours() > 0 || this.getMinutes() > 0 || this.getSeconds() > 0 || this.getMillis() > 0) {
-                        stringBuilder.append('T');
-                        if (this.getHours() > 0) {
-                                stringBuilder.append(this.getHours());
-                                stringBuilder.append('H');
-                        }
-                        if (this.getMinutes() > 0) {
-                                stringBuilder.append(this.getMinutes());
-                                stringBuilder.append('M');
-                        }
-                        double	dSeconds	= this.getFractionalSecs();
-                        if (dSeconds > 0) {
-                                if (dSeconds == Math.floor(dSeconds)) {
-                                        stringBuilder.append((int)dSeconds);
-                                } else {
-                                        stringBuilder.append(dSeconds);
-                                }
-                                stringBuilder.append('S');
-                        }
-                } else if (!sawOne) {
-                        stringBuilder.append("T0S");
-                }
-                return stringBuilder.toString();		
-        }
-        
-        @Override
-        public String toString() {
-                return "{" +
-                                "durationSign=" + this.getDurationSign() +
-                                "years=" + this.getYears() +
-                                "months=" + this.getMonths() +
-                                "days=" + this.getDays() + 
-                                "hours=" + this.getHours() +
-                                "minutes=" + this.getMinutes() +
-                                "seconds=" + this.getSeconds() +
-                                "millis=" + this.getMillis() +
-                                "}";
-        }
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public String toString() {
+        return "{" +
+               "durationSign=" + this.getDurationSign() +
+               "years=" + this.getYears() +
+               "months=" + this.getMonths() +
+               "days=" + this.getDays() +
+               "hours=" + this.getHours() +
+               "minutes=" + this.getMinutes() +
+               "seconds=" + this.getSeconds() +
+               "millis=" + this.getMillis() +
+               "}";
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Time.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Time.java
index 73ccf12..13f1397 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Time.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601Time.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,235 +40,235 @@
 /**
  * ISO8601Time represents a time of day with an optional timezone indication using ISO8601 standard representations
  * for time, ordering, and operations.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ISO8601Time implements IDateTime<ISO8601Time>, Comparable<ISO8601Time>, SemanticString {
-        private static final int ARBITRARY_YEAR		= 1970;
-        private static final int ARBITRARY_MONTH	= 11;
-        private static final int ARBITRARY_DAY		= 15;
-        
-        private ISO8601DateTime dateTime;
-        
-        protected ISO8601Time(ISO8601DateTime iso8601DateTime) {
-                this.dateTime	= iso8601DateTime;
-        }
-        
-        /**
-         * Creates a <code>ISO8601Time</code> object for the given instant of time in the given <code>ISO8601TimeZone</code>.
-         * 
-         * @param tzOffsetHours the signed offset in hours for the timezone of this time
-         * @param tzOffsetMinutes the unsigned offset in minutes for the timezone of this time
-         * @param hourIn the hour
-         * @param minuteIn the minute
-         * @param secondIn the second
-         * @param millisecondIn the millisecond
-         */
-        public ISO8601Time(String timeZoneIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
-                this.dateTime	= new ISO8601DateTime(timeZoneIn, ARBITRARY_YEAR, ARBITRARY_MONTH, ARBITRARY_DAY, hourIn, minuteIn, secondIn, millisecondIn);
-        }
-        
-        public ISO8601Time(int hourIn, int minuteIn, int secondIn, int millisecondIn) {
-                this((String)null, hourIn, minuteIn, secondIn, millisecondIn);
-        }
-        
-        public ISO8601Time(ISO8601TimeZone timeZoneIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
-                this((timeZoneIn == null ? null : timeZoneIn.getTimeZoneString()), hourIn, minuteIn, secondIn, millisecondIn);
-        }
-        
-        public ISO8601Time(TimeZone timeZoneIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
-                this((timeZoneIn == null ? null : timeZoneIn.getID()), hourIn, minuteIn, secondIn, millisecondIn);
-        }
-        
-        public boolean getHasTimeZone() {
-                return this.dateTime.getHasTimeZone();
-        }
-        public String getTimeZone() {
-                return this.dateTime.getTimeZone();
-        }
-        public int getHour() {
-                return this.dateTime.getHour();
-        }
-        public int getMinute() {
-                return this.dateTime.getMinute();
-        }
-        public int getSecond() {
-                return this.dateTime.getSecond();
-        }
-        public int getMillisecond() {
-                return this.dateTime.getMillisecond();
-        }
-        
-        public ISO8601Time add(ISO8601Duration iso8601Duration) {
-                return new ISO8601Time(this.dateTime.add(iso8601Duration));
-        }
-        
-        public ISO8601Time sub(ISO8601Duration iso8601Duration) {
-                return new ISO8601Time(this.dateTime.sub(iso8601Duration));
-        }
-        
-        /**
-         * Gets the <code>String</code> ISO8601 time representation of this <code>ISO8601Time</code>.
-         * 
-         * @param includeTimeZone <code>boolean</code> indicating whether the time zone information should be included
-         * @return the <code>String</code> ISO8601 time representation of this <code>ISO8601Time</code>.
-         */
-        public String stringValue(boolean includeTimeZone) {
-                StringBuilder stringBuilder	= new StringBuilder();
-                stringBuilder.append(String.format("%02d", this.getHour()));
-                stringBuilder.append(':');
-                stringBuilder.append(String.format("%02d", this.getMinute()));
-                stringBuilder.append(':');
-                stringBuilder.append(String.format("%02d", this.getSecond()));
-                int ms	= this.getMillisecond();
-                if (ms > 0) {
-                        stringBuilder.append('.');
-                        stringBuilder.append(String.format("%03d", ms));
-                }
-                if (this.getHasTimeZone() && includeTimeZone) {
-                        stringBuilder.append(this.getTimeZone());
-                }
-                return stringBuilder.toString();		
-        }
-        
-        @Override
-        public String stringValue() {
-                return this.stringValue(true);
-        }
-        
-        @Override
-        public String toString() {
-                return this.stringValue(true);
-        }
-        
-        @Override
-        public int hashCode() {
-                return this.dateTime.hashCode();
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof ISO8601Time)) {
-                        return false;
-                } else {
-                        return this.dateTime.equals(((ISO8601Time)obj).dateTime);
-                }
-        }
-        
-        @Override
-        public int compareTo(ISO8601Time o) {
-                return this.dateTime.compareTo(o.dateTime);
-        }
-        
-        public static ISO8601Time fromCalendar(Calendar calendar) {
-                return new ISO8601Time(calendar.getTimeZone(), calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND), calendar.get(Calendar.MILLISECOND));
-        }
-        
-        public static ISO8601Time fromDate(Date date) {
-                Calendar cal	= Calendar.getInstance();
-                cal.setTime(date);
-                return ISO8601Time.fromCalendar(cal);
-        }
-        
-        /**
-         * Creates a new <code>Time</code> object by parsing the <code>String</code> supplied which must conform to the
-         * ISO8601 standard for time formats {@link http://www.w3.org/TR/NOTE-datetime}
-         * 
-         * @param timeString the timeString to parse
-         * @return a new <code>Time</code> representing the given <code>String</code>
-         * @throws java.text.ParseException if the string cannot be interpreted as an ISO8601 time string
-         */
-        public static ISO8601Time fromISO8601TimeString(String timeString) throws ParseException {
-                if (timeString == null) {
-                        throw new NullPointerException("Null time string");
-                } else if (timeString.length() < 8) {
-                        throw new ParseException("Time string too short", 0);
-                }
-                
-                /*
-                 * Find the starting position by searching past any whitespace
-                 */
-                int			startPos	= ParseUtils.nextNonWhite(timeString, 0);
-                
-                /*
-                 * Get the two digit hour of day
-                 */
-                int			hh			= ParseUtils.getTwoDigitValue(timeString, startPos);
-                if (hh < 0 || hh >= 24) {
-                        throw new ParseException("Invalid hour of day", startPos);
-                }
-                startPos				+= 2;
-                if (startPos >= timeString.length()) {
-                        throw new ParseException("Invalid time string", startPos);
-                } else if (timeString.charAt(startPos) != ':') {
-                        throw new ParseException("Missing hour-minute separator", startPos);
-                }
-                startPos++;
-                
-                /*
-                 * Get the two-digit minute of hour
-                 */
-                int			mm			= ParseUtils.getTwoDigitValue(timeString, startPos);
-                if (mm < 0 || mm >= 60) {
-                        throw new ParseException("Invalid minute of hour", startPos);
-                }
-                startPos				+= 2;
-                if (startPos >= timeString.length()) {
-                        throw new ParseException("Invalid time string", startPos);
-                } else if (timeString.charAt(startPos) != ':') {
-                        throw new ParseException("Missing minute-second separator", startPos);
-                }
-                startPos++;
-                
-                /*
-                 * Get the two-digit second of minute
-                 */
-                int			ss			= ParseUtils.getTwoDigitValue(timeString, startPos);
-                if (ss < 0 || ss >= 60) {
-                        throw new ParseException("Invalid second of minute", startPos);
-                }
-                startPos				+= 2;
-                
-                /*
-                 * Now determine if we have a milliseconds portion
-                 */
-                int			ms			= 0;
-                if (startPos < timeString.length()) {
-                        if (timeString.charAt(startPos) == '.') {
-                                startPos++;
-                                if ((ms = ParseUtils.getThreeDigitValue(timeString, startPos)) < 0 || ms >= 1000) {
-                                        throw new ParseException("Invalid milliseconds", startPos);
-                                }
-                                startPos	+= 3;
-                        }
-                }
-                
-                /*
-                 * Now determine if there is a timezone
-                 */
-                String timezone		= null;
+    private static final int ARBITRARY_YEAR		= 1970;
+    private static final int ARBITRARY_MONTH	= 11;
+    private static final int ARBITRARY_DAY		= 15;
 
-                if (startPos < timeString.length()) {
-                        switch(timeString.charAt(startPos)) {
-                        case 'Z':
-                                timezone	= "GMT";
-                                startPos++;
-                                break;
-                        case '-':
-                        case '+':
-                                if (startPos+5 < timeString.length()) {
-                                        timezone	= "GMT" + timeString.substring(startPos, startPos+6);
-                                } else {
-                                        throw new ParseException("Invalid timezone", startPos);
-                                }
-                                break;
-                        default:
-                                throw new ParseException("Invalid timezone", startPos);
-                        }
+    private ISO8601DateTime dateTime;
+
+    protected ISO8601Time(ISO8601DateTime iso8601DateTime) {
+        this.dateTime	= iso8601DateTime;
+    }
+
+    /**
+     * Creates a <code>ISO8601Time</code> object for the given instant of time in the given <code>ISO8601TimeZone</code>.
+     *
+     * @param tzOffsetHours the signed offset in hours for the timezone of this time
+     * @param tzOffsetMinutes the unsigned offset in minutes for the timezone of this time
+     * @param hourIn the hour
+     * @param minuteIn the minute
+     * @param secondIn the second
+     * @param millisecondIn the millisecond
+     */
+    public ISO8601Time(String timeZoneIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
+        this.dateTime	= new ISO8601DateTime(timeZoneIn, ARBITRARY_YEAR, ARBITRARY_MONTH, ARBITRARY_DAY, hourIn, minuteIn, secondIn, millisecondIn);
+    }
+
+    public ISO8601Time(int hourIn, int minuteIn, int secondIn, int millisecondIn) {
+        this((String)null, hourIn, minuteIn, secondIn, millisecondIn);
+    }
+
+    public ISO8601Time(ISO8601TimeZone timeZoneIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
+        this((timeZoneIn == null ? null : timeZoneIn.getTimeZoneString()), hourIn, minuteIn, secondIn, millisecondIn);
+    }
+
+    public ISO8601Time(TimeZone timeZoneIn, int hourIn, int minuteIn, int secondIn, int millisecondIn) {
+        this((timeZoneIn == null ? null : timeZoneIn.getID()), hourIn, minuteIn, secondIn, millisecondIn);
+    }
+
+    public boolean getHasTimeZone() {
+        return this.dateTime.getHasTimeZone();
+    }
+    public String getTimeZone() {
+        return this.dateTime.getTimeZone();
+    }
+    public int getHour() {
+        return this.dateTime.getHour();
+    }
+    public int getMinute() {
+        return this.dateTime.getMinute();
+    }
+    public int getSecond() {
+        return this.dateTime.getSecond();
+    }
+    public int getMillisecond() {
+        return this.dateTime.getMillisecond();
+    }
+
+    public ISO8601Time add(ISO8601Duration iso8601Duration) {
+        return new ISO8601Time(this.dateTime.add(iso8601Duration));
+    }
+
+    public ISO8601Time sub(ISO8601Duration iso8601Duration) {
+        return new ISO8601Time(this.dateTime.sub(iso8601Duration));
+    }
+
+    /**
+     * Gets the <code>String</code> ISO8601 time representation of this <code>ISO8601Time</code>.
+     *
+     * @param includeTimeZone <code>boolean</code> indicating whether the time zone information should be included
+     * @return the <code>String</code> ISO8601 time representation of this <code>ISO8601Time</code>.
+     */
+    public String stringValue(boolean includeTimeZone) {
+        StringBuilder stringBuilder	= new StringBuilder();
+        stringBuilder.append(String.format("%02d", this.getHour()));
+        stringBuilder.append(':');
+        stringBuilder.append(String.format("%02d", this.getMinute()));
+        stringBuilder.append(':');
+        stringBuilder.append(String.format("%02d", this.getSecond()));
+        int ms	= this.getMillisecond();
+        if (ms > 0) {
+            stringBuilder.append('.');
+            stringBuilder.append(String.format("%03d", ms));
+        }
+        if (this.getHasTimeZone() && includeTimeZone) {
+            stringBuilder.append(this.getTimeZone());
+        }
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public String stringValue() {
+        return this.stringValue(true);
+    }
+
+    @Override
+    public String toString() {
+        return this.stringValue(true);
+    }
+
+    @Override
+    public int hashCode() {
+        return this.dateTime.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof ISO8601Time)) {
+            return false;
+        } else {
+            return this.dateTime.equals(((ISO8601Time)obj).dateTime);
+        }
+    }
+
+    @Override
+    public int compareTo(ISO8601Time o) {
+        return this.dateTime.compareTo(o.dateTime);
+    }
+
+    public static ISO8601Time fromCalendar(Calendar calendar) {
+        return new ISO8601Time(calendar.getTimeZone(), calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND), calendar.get(Calendar.MILLISECOND));
+    }
+
+    public static ISO8601Time fromDate(Date date) {
+        Calendar cal	= Calendar.getInstance();
+        cal.setTime(date);
+        return ISO8601Time.fromCalendar(cal);
+    }
+
+    /**
+     * Creates a new <code>Time</code> object by parsing the <code>String</code> supplied which must conform to the
+     * ISO8601 standard for time formats {@link http://www.w3.org/TR/NOTE-datetime}
+     *
+     * @param timeString the timeString to parse
+     * @return a new <code>Time</code> representing the given <code>String</code>
+     * @throws java.text.ParseException if the string cannot be interpreted as an ISO8601 time string
+     */
+    public static ISO8601Time fromISO8601TimeString(String timeString) throws ParseException {
+        if (timeString == null) {
+            throw new NullPointerException("Null time string");
+        } else if (timeString.length() < 8) {
+            throw new ParseException("Time string too short", 0);
+        }
+
+        /*
+         * Find the starting position by searching past any whitespace
+         */
+        int			startPos	= ParseUtils.nextNonWhite(timeString, 0);
+
+        /*
+         * Get the two digit hour of day
+         */
+        int			hh			= ParseUtils.getTwoDigitValue(timeString, startPos);
+        if (hh < 0 || hh >= 24) {
+            throw new ParseException("Invalid hour of day", startPos);
+        }
+        startPos				+= 2;
+        if (startPos >= timeString.length()) {
+            throw new ParseException("Invalid time string", startPos);
+        } else if (timeString.charAt(startPos) != ':') {
+            throw new ParseException("Missing hour-minute separator", startPos);
+        }
+        startPos++;
+
+        /*
+         * Get the two-digit minute of hour
+         */
+        int			mm			= ParseUtils.getTwoDigitValue(timeString, startPos);
+        if (mm < 0 || mm >= 60) {
+            throw new ParseException("Invalid minute of hour", startPos);
+        }
+        startPos				+= 2;
+        if (startPos >= timeString.length()) {
+            throw new ParseException("Invalid time string", startPos);
+        } else if (timeString.charAt(startPos) != ':') {
+            throw new ParseException("Missing minute-second separator", startPos);
+        }
+        startPos++;
+
+        /*
+         * Get the two-digit second of minute
+         */
+        int			ss			= ParseUtils.getTwoDigitValue(timeString, startPos);
+        if (ss < 0 || ss >= 60) {
+            throw new ParseException("Invalid second of minute", startPos);
+        }
+        startPos				+= 2;
+
+        /*
+         * Now determine if we have a milliseconds portion
+         */
+        int			ms			= 0;
+        if (startPos < timeString.length()) {
+            if (timeString.charAt(startPos) == '.') {
+                startPos++;
+                if ((ms = ParseUtils.getThreeDigitValue(timeString, startPos)) < 0 || ms >= 1000) {
+                    throw new ParseException("Invalid milliseconds", startPos);
                 }
-                return new ISO8601Time(timezone, hh, mm, ss, ms);
-        }	
+                startPos	+= 3;
+            }
+        }
+
+        /*
+         * Now determine if there is a timezone
+         */
+        String timezone		= null;
+
+        if (startPos < timeString.length()) {
+            switch(timeString.charAt(startPos)) {
+            case 'Z':
+                timezone	= "GMT";
+                startPos++;
+                break;
+            case '-':
+            case '+':
+                if (startPos+5 < timeString.length()) {
+                    timezone	= "GMT" + timeString.substring(startPos, startPos+6);
+                } else {
+                    throw new ParseException("Invalid timezone", startPos);
+                }
+                break;
+            default:
+                throw new ParseException("Invalid timezone", startPos);
+            }
+        }
+        return new ISO8601Time(timezone, hh, mm, ss, ms);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601TimeZone.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601TimeZone.java
index 4ab50a4..3904620 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601TimeZone.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ISO8601TimeZone.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,150 +36,150 @@
 
 /**
  * ISO8601TimeZone represents an ISO8601 TimeZone specification.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ISO8601TimeZone implements Comparable<ISO8601TimeZone>, SemanticString {
-        private static int MAX_TZOFFSET_MINUTES				= 60*24;
-        private static int MAX_NORMALIZED_TZOFFSET_MINUTES	= 60*12;
-        
-        private int	tzOffsetMinutes;
-        
-        public static final ISO8601TimeZone TIMEZONE_GMT	= new ISO8601TimeZone(0);
-        
-        /**
-         * Creates a new <code>ISO8601TimeZone</code> with the given time zone offset in minutes.
-         * 
-         * @param tzOffsetMinutesIn the time zone offset in minutes
-         */
-        public ISO8601TimeZone(int tzOffsetMinutesIn) {
-                int	absOffsetMinutes	= Math.abs(tzOffsetMinutesIn);
-                if (absOffsetMinutes > MAX_TZOFFSET_MINUTES) {
-                        throw new IllegalArgumentException("Invalid ISO8601 timezone offset " + tzOffsetMinutesIn);
-                }
-                if (absOffsetMinutes <= MAX_NORMALIZED_TZOFFSET_MINUTES) {
-                        this.tzOffsetMinutes	= tzOffsetMinutesIn;
-                } else {
-                        if (tzOffsetMinutesIn < 0) {
-                                this.tzOffsetMinutes	= MAX_TZOFFSET_MINUTES - absOffsetMinutes;
-                        } else {
-                                this.tzOffsetMinutes	= -(MAX_TZOFFSET_MINUTES - absOffsetMinutes);
-                        }
-                }
-        }
-        
-        public static ISO8601TimeZone fromString(String timezoneString) throws ParseException {
-                /*
-                 * Look for timezone information
-                 */
-                int startPos		= ParseUtils.nextNonWhite(timezoneString, 0);
-                int	offsetMinutes	= 0;
-                int	signPart		= 1;
+    private static int MAX_TZOFFSET_MINUTES				= 60*24;
+    private static int MAX_NORMALIZED_TZOFFSET_MINUTES	= 60*12;
 
-                switch(timezoneString.charAt(startPos)) {
-                case 'Z':
-                        offsetMinutes	= 0;
-                        startPos++;
-                        break;
-                case '-':
-                        signPart	= -1;
-                        /*
-                         * Note: Purposefully not breaking here so the remainder of timezone parsing takes place following the '+' label
-                         */
-                case '+':
-                        startPos++;
-                        int	hourPart	= ParseUtils.getTwoDigitValue(timezoneString, startPos);
-                        if (hourPart < 0 || hourPart > 24) {
-                                throw new ParseException("Invalid timezone", startPos);
-                        }
-                        startPos	+= 2;
-                        if (startPos >= timezoneString.length() || timezoneString.charAt(startPos) != ':') {
-                                throw new ParseException("Invalid time string", startPos);
-                        }
-                        startPos++;
-                        int minutePart	= ParseUtils.getTwoDigitValue(timezoneString, startPos);
-                        if (minutePart < 0 || minutePart >= 60) {
-                                throw new ParseException("Invalid timezone", startPos);
-                        }
-                        startPos	+= 2;
-                        
-                        offsetMinutes	= signPart*(hourPart*60 + minutePart);
-                        break;
-                        
-                default:
-                        throw new ParseException("Invalid timezone", startPos);
-                }
-                return new ISO8601TimeZone(offsetMinutes);		
+    private int	tzOffsetMinutes;
+
+    public static final ISO8601TimeZone TIMEZONE_GMT	= new ISO8601TimeZone(0);
+
+    /**
+     * Creates a new <code>ISO8601TimeZone</code> with the given time zone offset in minutes.
+     *
+     * @param tzOffsetMinutesIn the time zone offset in minutes
+     */
+    public ISO8601TimeZone(int tzOffsetMinutesIn) {
+        int	absOffsetMinutes	= Math.abs(tzOffsetMinutesIn);
+        if (absOffsetMinutes > MAX_TZOFFSET_MINUTES) {
+            throw new IllegalArgumentException("Invalid ISO8601 timezone offset " + tzOffsetMinutesIn);
         }
-        
-        /**
-         * Gets the offset in minutes from GMT for this <code>TimeZone</code>.
-         * 
-         * @return the offset in minutes from GMT for this <code>TimeZone</code>>
+        if (absOffsetMinutes <= MAX_NORMALIZED_TZOFFSET_MINUTES) {
+            this.tzOffsetMinutes	= tzOffsetMinutesIn;
+        } else {
+            if (tzOffsetMinutesIn < 0) {
+                this.tzOffsetMinutes	= MAX_TZOFFSET_MINUTES - absOffsetMinutes;
+            } else {
+                this.tzOffsetMinutes	= -(MAX_TZOFFSET_MINUTES - absOffsetMinutes);
+            }
+        }
+    }
+
+    public static ISO8601TimeZone fromString(String timezoneString) throws ParseException {
+        /*
+         * Look for timezone information
          */
-        public int getTzOffsetMinutes() {
-                return this.tzOffsetMinutes;
+        int startPos		= ParseUtils.nextNonWhite(timezoneString, 0);
+        int	offsetMinutes	= 0;
+        int	signPart		= 1;
+
+        switch(timezoneString.charAt(startPos)) {
+        case 'Z':
+            offsetMinutes	= 0;
+            startPos++;
+            break;
+        case '-':
+            signPart	= -1;
+        /*
+         * Note: Purposefully not breaking here so the remainder of timezone parsing takes place following the '+' label
+         */
+        case '+':
+            startPos++;
+            int	hourPart	= ParseUtils.getTwoDigitValue(timezoneString, startPos);
+            if (hourPart < 0 || hourPart > 24) {
+                throw new ParseException("Invalid timezone", startPos);
+            }
+            startPos	+= 2;
+            if (startPos >= timezoneString.length() || timezoneString.charAt(startPos) != ':') {
+                throw new ParseException("Invalid time string", startPos);
+            }
+            startPos++;
+            int minutePart	= ParseUtils.getTwoDigitValue(timezoneString, startPos);
+            if (minutePart < 0 || minutePart >= 60) {
+                throw new ParseException("Invalid timezone", startPos);
+            }
+            startPos	+= 2;
+
+            offsetMinutes	= signPart*(hourPart*60 + minutePart);
+            break;
+
+        default:
+            throw new ParseException("Invalid timezone", startPos);
         }
-        
-        public String getTimeZoneString() {
-                if (this.tzOffsetMinutes == 0) {
-                        return "GMT";
-                } else {
-                        int	offsetAbs	= Math.abs(this.tzOffsetMinutes);
-                        String sign		= (this.tzOffsetMinutes < 0 ? "-" : "+");
-                        int hours		= offsetAbs / 60;
-                        int minutes		= offsetAbs - (60 * hours);
-                        return "GMT" + sign + String.format("%02d", hours) + ":" + String.format("%02d",  minutes);
-                }
+        return new ISO8601TimeZone(offsetMinutes);
+    }
+
+    /**
+     * Gets the offset in minutes from GMT for this <code>TimeZone</code>.
+     *
+     * @return the offset in minutes from GMT for this <code>TimeZone</code>>
+     */
+    public int getTzOffsetMinutes() {
+        return this.tzOffsetMinutes;
+    }
+
+    public String getTimeZoneString() {
+        if (this.tzOffsetMinutes == 0) {
+            return "GMT";
+        } else {
+            int	offsetAbs	= Math.abs(this.tzOffsetMinutes);
+            String sign		= (this.tzOffsetMinutes < 0 ? "-" : "+");
+            int hours		= offsetAbs / 60;
+            int minutes		= offsetAbs - (60 * hours);
+            return "GMT" + sign + String.format("%02d", hours) + ":" + String.format("%02d",  minutes);
         }
-        
-        @Override
-        public String stringValue() {
-                int				offset			= this.getTzOffsetMinutes();
-                if (offset == 0) {
-                        return "Z";
-                }
-                
-                StringBuilder 	stringBuilder	= new StringBuilder();
-                if (offset < 0) {
-                        stringBuilder.append('-');
-                } else {
-                        stringBuilder.append('+');
-                }
-                int	hourPart	= offset / 60;
-                int minutePart	= offset - (hourPart * 60);
-                stringBuilder.append(String.format("%02d", hourPart));
-                stringBuilder.append(':');
-                stringBuilder.append(String.format("%02d", minutePart));
-                
-                return stringBuilder.toString();		
-        }
-        
-        @Override
-        public int hashCode() {
-                return this.getTzOffsetMinutes();
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof ISO8601TimeZone)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
-                } else {
-                        return this.getTzOffsetMinutes() == ((ISO8601TimeZone)obj).getTzOffsetMinutes();
-                }
-        }
-        
-        @Override
-        public String toString() {
-                return "{tzOffsetMinutes=" + this.getTzOffsetMinutes() + "}";
+    }
+
+    @Override
+    public String stringValue() {
+        int				offset			= this.getTzOffsetMinutes();
+        if (offset == 0) {
+            return "Z";
         }
 
-        @Override
-        public int compareTo(ISO8601TimeZone o) {
-                return this.getTzOffsetMinutes() - o.getTzOffsetMinutes();
+        StringBuilder 	stringBuilder	= new StringBuilder();
+        if (offset < 0) {
+            stringBuilder.append('-');
+        } else {
+            stringBuilder.append('+');
         }
+        int	hourPart	= offset / 60;
+        int minutePart	= offset - (hourPart * 60);
+        stringBuilder.append(String.format("%02d", hourPart));
+        stringBuilder.append(':');
+        stringBuilder.append(String.format("%02d", minutePart));
+
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public int hashCode() {
+        return this.getTzOffsetMinutes();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof ISO8601TimeZone)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            return this.getTzOffsetMinutes() == ((ISO8601TimeZone)obj).getTzOffsetMinutes();
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "{tzOffsetMinutes=" + this.getTzOffsetMinutes() + "}";
+    }
+
+    @Override
+    public int compareTo(ISO8601TimeZone o) {
+        return this.getTzOffsetMinutes() - o.getTzOffsetMinutes();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/NodeNamespaceContext.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/NodeNamespaceContext.java
index 8f92f0f..a2af353 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/NodeNamespaceContext.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/NodeNamespaceContext.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,61 +43,61 @@
 /**
  * NodeNamespaceContext extends {@link javax.xml.namespace.NamespaceContext} by delegating to the owning
  * {@link org.w3c.dom.Document}.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class NodeNamespaceContext extends ExtendedNamespaceContext {
-        private Document document;
-        
-        public NodeNamespaceContext(Document documentIn) {
-                this.document	= documentIn;
-        }
+    private Document document;
 
-        @Override
-        public String getNamespaceURI(String prefix) {
-                if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
-                        return this.document.lookupNamespaceURI(null);
+    public NodeNamespaceContext(Document documentIn) {
+        this.document	= documentIn;
+    }
+
+    @Override
+    public String getNamespaceURI(String prefix) {
+        if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+            return this.document.lookupNamespaceURI(null);
+        } else {
+            return this.document.lookupNamespaceURI(prefix);
+        }
+    }
+
+    @Override
+    public String getPrefix(String namespaceURI) {
+        return this.document.lookupPrefix(namespaceURI);
+    }
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    public Iterator getPrefixes(String namespaceURI) {
+        return null;
+    }
+
+
+
+    @Override
+    public Iterator<String> getAllPrefixes() {
+        NamedNodeMap attributes = document.getDocumentElement().getAttributes();
+        List<String> prefixList = new ArrayList<String>();
+        for (int i = 0; i < attributes.getLength(); i++) {
+            Node node = attributes.item(i);
+            if (node.getNodeName().startsWith("xmlns")) {
+                // this is a namespace definition
+                int index = node.getNodeName().indexOf(":");
+                if (node.getNodeName().length() < index + 1) {
+                    index = -1;
+                }
+                if (index < 0) {
+                    // default namespace
+                    prefixList.add(XMLConstants.DEFAULT_NS_PREFIX);
                 } else {
-                        return this.document.lookupNamespaceURI(prefix);
+                    String prefix = node.getNodeName().substring(index + 1);
+                    prefixList.add(prefix);
                 }
+            }
         }
-
-        @Override
-        public String getPrefix(String namespaceURI) {
-                return this.document.lookupPrefix(namespaceURI);
-        }
-
-        @SuppressWarnings("rawtypes")
-        @Override
-        public Iterator getPrefixes(String namespaceURI) {
-                return null;
-        }
-
-        
-        
-        @Override
-        public Iterator<String> getAllPrefixes() {
-                NamedNodeMap attributes = document.getDocumentElement().getAttributes();
-                List<String> prefixList = new ArrayList<String>();
-                for (int i = 0; i < attributes.getLength(); i++) {
-                        Node node = attributes.item(i);
-                        if (node.getNodeName().startsWith("xmlns")) {
-                                // this is a namespace definition
-                                int index = node.getNodeName().indexOf(":");
-                                if (node.getNodeName().length() < index + 1) {
-                                        index = -1;
-                                }
-                                if (index < 0) {
-                                        // default namespace
-                                        prefixList.add(XMLConstants.DEFAULT_NS_PREFIX);
-                                } else {
-                                        String prefix = node.getNodeName().substring(index + 1);
-                                        prefixList.add(prefix);
-                                }
-                        }
-                }
-                return prefixList.iterator();
-        }
+        return prefixList.iterator();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ParseUtils.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ParseUtils.java
index 23baea5..dfad57c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ParseUtils.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/ParseUtils.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,99 +33,99 @@
 /**
  * ParseUtils provides a number of static methods that are useful in parsing <code>String</code> objects into
  * other java data types.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ParseUtils {
-        protected ParseUtils() {
-        }
-        
-        public static class ParseValue<T> {
-                private T value;
-                private int nextPos;
-                
-                public ParseValue(T v, int n) {
-                        this.value		= v;
-                        this.nextPos	= n;
-                }
-                
-                public T getValue() {
-                        return this.value;
-                }
-                public int getNextPos() {
-                        return this.nextPos;
-                }
+    protected ParseUtils() {
+    }
+
+    public static class ParseValue<T> {
+        private T value;
+        private int nextPos;
+
+        public ParseValue(T v, int n) {
+            this.value		= v;
+            this.nextPos	= n;
         }
 
-        static int getTwoDigitValue(String fromString, int startPos) {
-                if (fromString.length() <= (startPos+1)) {
-                        return -1;
-                } else if (!Character.isDigit(fromString.charAt(startPos)) || !Character.isDigit(fromString.charAt(startPos+1))) {
-                        return -1;
-                } else {
-                        return 10*Character.digit(fromString.charAt(startPos), 10) + Character.digit(fromString.charAt(startPos+1), 10);
-                }
+        public T getValue() {
+            return this.value;
         }
+        public int getNextPos() {
+            return this.nextPos;
+        }
+    }
 
-        static int getThreeDigitValue(String fromString, int startPos) {
-                if (fromString.length() <= (startPos+2)) {
-                        return -1;
-                } else if (!Character.isDigit(fromString.charAt(startPos)) || !Character.isDigit(fromString.charAt(startPos+1)) || !Character.isDigit(fromString.charAt(startPos+2))) {
-                        return -1;
-                } else {
-                        return 100*Character.digit(fromString.charAt(startPos), 10) + 10*Character.digit(fromString.charAt(startPos+1), 10) + Character.digit(fromString.charAt(startPos+2), 10);
-                }
+    static int getTwoDigitValue(String fromString, int startPos) {
+        if (fromString.length() <= (startPos+1)) {
+            return -1;
+        } else if (!Character.isDigit(fromString.charAt(startPos)) || !Character.isDigit(fromString.charAt(startPos+1))) {
+            return -1;
+        } else {
+            return 10*Character.digit(fromString.charAt(startPos), 10) + Character.digit(fromString.charAt(startPos+1), 10);
         }
-        
-        static int getFourDigitValue(String fromString, int startPos) {
-                if (fromString.length() <= (startPos + 3)) {
-                        return -1;
-                } else if (!Character.isDigit(fromString.charAt(startPos)) ||
-                                   !Character.isDigit(fromString.charAt(startPos+1)) ||
-                                   !Character.isDigit(fromString.charAt(startPos+2)) ||
-                                   !Character.isDigit(fromString.charAt(startPos+3))
-                                ) {
-                        return -1;
-                } else {
-                        return 1000*Character.digit(fromString.charAt(startPos), 10) +
-                                        100*Character.digit(fromString.charAt(startPos+1), 10) +
-                                         10*Character.digit(fromString.charAt(startPos+2), 10) +
-                                            Character.digit(fromString.charAt(startPos+3), 10);
-                }
-        }
-        
-        static ParseValue<Integer> getSignedValue(String fromString, int startPos) {
-                int sign	= 1;
-                int value	= 0;
-                int i		= startPos;
-                if (i >= fromString.length()) {
-                        return null;
-                }
-                if (fromString.charAt(i) == '-') {
-                        sign	= -1;
-                        i++;
-                }
-                if (i >= fromString.length() || !Character.isDigit(fromString.charAt(i))) {
-                        return null;
-                }
-                char charAt;
-                while (i < fromString.length() && Character.isDigit((charAt = fromString.charAt(i)))) {
-                        value	= value*10 + Character.digit(charAt, 10);
-                        i++;
-                }
-                return new ParseValue<Integer>(sign * value, i);
-        }
+    }
 
-        static int nextNonWhite(String fromString, int startPos) {
-                while (startPos < fromString.length()) {
-                        if (!Character.isWhitespace(fromString.charAt(startPos))) {
-                                return startPos;
-                        } else {
-                                startPos++;
-                        }
-                }
-                return -1;
+    static int getThreeDigitValue(String fromString, int startPos) {
+        if (fromString.length() <= (startPos+2)) {
+            return -1;
+        } else if (!Character.isDigit(fromString.charAt(startPos)) || !Character.isDigit(fromString.charAt(startPos+1)) || !Character.isDigit(fromString.charAt(startPos+2))) {
+            return -1;
+        } else {
+            return 100*Character.digit(fromString.charAt(startPos), 10) + 10*Character.digit(fromString.charAt(startPos+1), 10) + Character.digit(fromString.charAt(startPos+2), 10);
         }
+    }
+
+    static int getFourDigitValue(String fromString, int startPos) {
+        if (fromString.length() <= (startPos + 3)) {
+            return -1;
+        } else if (!Character.isDigit(fromString.charAt(startPos)) ||
+                   !Character.isDigit(fromString.charAt(startPos+1)) ||
+                   !Character.isDigit(fromString.charAt(startPos+2)) ||
+                   !Character.isDigit(fromString.charAt(startPos+3))
+                  ) {
+            return -1;
+        } else {
+            return 1000*Character.digit(fromString.charAt(startPos), 10) +
+                   100*Character.digit(fromString.charAt(startPos+1), 10) +
+                   10*Character.digit(fromString.charAt(startPos+2), 10) +
+                   Character.digit(fromString.charAt(startPos+3), 10);
+        }
+    }
+
+    static ParseValue<Integer> getSignedValue(String fromString, int startPos) {
+        int sign	= 1;
+        int value	= 0;
+        int i		= startPos;
+        if (i >= fromString.length()) {
+            return null;
+        }
+        if (fromString.charAt(i) == '-') {
+            sign	= -1;
+            i++;
+        }
+        if (i >= fromString.length() || !Character.isDigit(fromString.charAt(i))) {
+            return null;
+        }
+        char charAt;
+        while (i < fromString.length() && Character.isDigit((charAt = fromString.charAt(i)))) {
+            value	= value*10 + Character.digit(charAt, 10);
+            i++;
+        }
+        return new ParseValue<Integer>(sign * value, i);
+    }
+
+    static int nextNonWhite(String fromString, int startPos) {
+        while (startPos < fromString.length()) {
+            if (!Character.isWhitespace(fromString.charAt(startPos))) {
+                return startPos;
+            } else {
+                startPos++;
+            }
+        }
+        return -1;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/PortRange.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/PortRange.java
index e100a4e..317eb98 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/PortRange.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/PortRange.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package com.att.research.xacml.std.datatypes;
@@ -27,120 +27,120 @@
 /**
  * PortRange represents the optional range of port values for an <code>IPAddress</code>.  A value of -1
  * for either port represents the limit for port numbers (min or max) in the given addressing scheme.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public final class PortRange implements SemanticString {
-        private int	portMin;
-        private int	portMax;
-        
-        /**
-         * Creates a new <code>PortRange</code> with the given range of ports.
-         * 
-         * @param portMinIn the minimum port number of the range
-         * @param portMaxIn the maximum port number of the range
-         */
-        public PortRange(int portMinIn, int portMaxIn) {
-                this.portMin	= portMinIn;
-                this.portMax	= portMaxIn;
+    private int	portMin;
+    private int	portMax;
+
+    /**
+     * Creates a new <code>PortRange</code> with the given range of ports.
+     *
+     * @param portMinIn the minimum port number of the range
+     * @param portMaxIn the maximum port number of the range
+     */
+    public PortRange(int portMinIn, int portMaxIn) {
+        this.portMin	= portMinIn;
+        this.portMax	= portMaxIn;
+    }
+
+    /**
+     * Parses a port range string of the form [portNumber[-[portNumber]]] into a <code>PortRange</code>.
+     *
+     * @param stringPortRange the <code>String</code> port range
+     * @return a new <code>PortRange</code> parsed from the <code>String</code>
+     * @throws java.text.ParseException if there is an error parsing the <code>String</code>
+     */
+    public static PortRange newInstance(String stringPortRange) throws ParseException {
+        if (stringPortRange == null) {
+            return null;
         }
-        
-        /**
-         * Parses a port range string of the form [portNumber[-[portNumber]]] into a <code>PortRange</code>.
-         * 
-         * @param stringPortRange the <code>String</code> port range
-         * @return a new <code>PortRange</code> parsed from the <code>String</code>
-         * @throws java.text.ParseException if there is an error parsing the <code>String</code>
-         */
-        public static PortRange newInstance(String stringPortRange) throws ParseException {
-                if (stringPortRange == null) {
-                        return null;
-                }
-                String[]	portParts	= stringPortRange.split("[-]", -1);
-                if (portParts == null || portParts.length == 0) {
-                        return null;
-                } else if (portParts.length > 2) {
-                        throw new ParseException("Invalid PortRange \"" + stringPortRange + "\": too many ranges", 0);
-                }
-                int[]		rangeParts	= new int[portParts.length];
-                try {
-                        for (int i = 0 ; i < portParts.length ; i++) {
-                                if (portParts[i].length() == 0) {
-                                        rangeParts[i]	= -1;
-                                } else {
-                                        rangeParts[i]	= Integer.parseInt(portParts[i]);
-                                }
-                        }
-                } catch (NumberFormatException ex) {
-                        throw new ParseException("Invalid PortRange \"" + stringPortRange + "\": invalid port number", 0);
-                }
-                if (rangeParts.length == 1) {
-                        return new PortRange(rangeParts[0], rangeParts[0]);
+        String[]	portParts	= stringPortRange.split("[-]", -1);
+        if (portParts == null || portParts.length == 0) {
+            return null;
+        } else if (portParts.length > 2) {
+            throw new ParseException("Invalid PortRange \"" + stringPortRange + "\": too many ranges", 0);
+        }
+        int[]		rangeParts	= new int[portParts.length];
+        try {
+            for (int i = 0 ; i < portParts.length ; i++) {
+                if (portParts[i].length() == 0) {
+                    rangeParts[i]	= -1;
                 } else {
-                        return new PortRange(rangeParts[0], rangeParts[1]);
+                    rangeParts[i]	= Integer.parseInt(portParts[i]);
                 }
+            }
+        } catch (NumberFormatException ex) {
+            throw new ParseException("Invalid PortRange \"" + stringPortRange + "\": invalid port number", 0);
         }
-        
-        public int getPortMin() {
-                return this.portMin;
+        if (rangeParts.length == 1) {
+            return new PortRange(rangeParts[0], rangeParts[0]);
+        } else {
+            return new PortRange(rangeParts[0], rangeParts[1]);
         }
-        public int getPortMax() {
-                return this.portMax;
+    }
+
+    public int getPortMin() {
+        return this.portMin;
+    }
+    public int getPortMax() {
+        return this.portMax;
+    }
+
+    public boolean contains(int port) {
+        if (port < 0) {
+            return false;
+        } else {
+            return ((port >= this.getPortMin()) && (this.getPortMax() < 0 || port <= this.getPortMax()));
         }
-        
-        public boolean contains(int port) {
-                if (port < 0) {
-                        return false;
-                } else {
-                        return ((port >= this.getPortMin()) && (this.getPortMax() < 0 || port <= this.getPortMax()));
-                }
+    }
+
+    @Override
+    public String stringValue() {
+        StringBuilder	stringBuilder	= new StringBuilder();
+        int	pMin	= this.getPortMin();
+        int pMax	= this.getPortMax();
+        if (pMin >= 0) {
+            stringBuilder.append(pMin);
         }
-        
-        @Override
-        public String stringValue() {
-                StringBuilder	stringBuilder	= new StringBuilder();
-                int	pMin	= this.getPortMin();
-                int pMax	= this.getPortMax();
-                if (pMin >= 0) {
-                        stringBuilder.append(pMin);
-                }
-                stringBuilder.append('-');
-                if (pMax >= 0) {
-                        stringBuilder.append(pMax);
-                }
-                return stringBuilder.toString();		
+        stringBuilder.append('-');
+        if (pMax >= 0) {
+            stringBuilder.append(pMax);
         }
-        
-        @Override
-        public int hashCode() {
-                int	hc	= 0;
-                if (this.getPortMax() > 0) {
-                        hc	+= this.getPortMax();
-                }
-                if (this.getPortMin() > 0) {
-                        hc	+= this.getPortMax();
-                }
-                return hc;
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public int hashCode() {
+        int	hc	= 0;
+        if (this.getPortMax() > 0) {
+            hc	+= this.getPortMax();
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof PortRange)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
-                } else {
-                        PortRange	portRange	= (PortRange)obj;
-                        return (this.getPortMax() == portRange.getPortMax() && this.getPortMin() == portRange.getPortMin());
-                }
+        if (this.getPortMin() > 0) {
+            hc	+= this.getPortMax();
         }
-        
-        @Override
-        public String toString() {
-                return "{" +
-                                "portMin=" + this.getPortMin() +
-                                "portMax=" + this.getPortMax() +
-                                "}";
+        return hc;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof PortRange)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            PortRange	portRange	= (PortRange)obj;
+            return (this.getPortMax() == portRange.getPortMax() && this.getPortMin() == portRange.getPortMin());
         }
+    }
+
+    @Override
+    public String toString() {
+        return "{" +
+               "portMin=" + this.getPortMin() +
+               "portMax=" + this.getPortMax() +
+               "}";
+    }
 }
\ No newline at end of file
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/RFC2396DomainName.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/RFC2396DomainName.java
index 0baa930..e8a2098 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/RFC2396DomainName.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/RFC2396DomainName.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,201 +36,201 @@
 
 /**
  * RFC2396DomainName represents a host name from the RFC2396 specification.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class RFC2396DomainName implements SemanticString {
-        private String		domainName;
-        private PortRange	portRange;
-        
-        public static boolean isValidTopLabel(String topLabel) {
-                if (topLabel == null || topLabel.length() == 0) {
-                        return false;
-                }
-                
-                if (!Character.isLetter(topLabel.charAt(0))) {
-                        return false;
-                }
-                if (topLabel.length() > 1) {
-                        for (int i = 1 ; i < topLabel.length() - 1 ; i++) {
-                                char	c	= topLabel.charAt(i);
-                                if (!(Character.isLetterOrDigit(c) || c == '-')) {
-                                        return false;
-                                }
-                        }
-                        if (!Character.isLetterOrDigit(topLabel.charAt(topLabel.length() - 1))) {
-                                return false;
-                        }
-                }
-                return true;
+    private String		domainName;
+    private PortRange	portRange;
+
+    public static boolean isValidTopLabel(String topLabel) {
+        if (topLabel == null || topLabel.length() == 0) {
+            return false;
         }
-        
-        public static boolean isValidDomainLabel(String domainLabel) {
-                if (domainLabel == null || domainLabel.length() == 0) {
-                        return false;
-                }
-                
-                if (!Character.isLetterOrDigit(domainLabel.charAt(0))) {
-                        return false;
-                }
-                if (domainLabel.length() > 1) {
-                        for (int i = 1 ; i < domainLabel.length() - 1 ; i++) {
-                                char	c	= domainLabel.charAt(i);
-                                if (!(Character.isLetterOrDigit(c) || c == '-')) {
-                                        return false;
-                                }
-                        }
-                        if (!Character.isLetterOrDigit(domainLabel.charAt(domainLabel.length() - 1))) {
-                                return false;
-                        }
-                }
-                return true;
+
+        if (!Character.isLetter(topLabel.charAt(0))) {
+            return false;
         }
-        
-        public static boolean isValidHostName(String hostName) {
-                if (hostName == null || hostName.length() == 0) {
-                        return false;
+        if (topLabel.length() > 1) {
+            for (int i = 1 ; i < topLabel.length() - 1 ; i++) {
+                char	c	= topLabel.charAt(i);
+                if (!(Character.isLetterOrDigit(c) || c == '-')) {
+                    return false;
                 }
-                String[]	labels	= hostName.split("[.]",-1);
-                if (labels == null || labels.length == 0) {
-                        return false;
-                }
-                
-                /*
-                 * Validate the domain label parts
-                 */
-                for (int i = 0 ; i < labels.length-1 ; i++) {
-                        if (!isValidDomainLabel(labels[i])) {
-                                return false;
-                        }
-                }
-                
-                /*
-                 * Validate the top label
-                 */
-                if (!isValidTopLabel(labels[labels.length-1])) {
-                        return false;
-                }
-                return true;
+            }
+            if (!Character.isLetterOrDigit(topLabel.charAt(topLabel.length() - 1))) {
+                return false;
+            }
         }
-        
-        public RFC2396DomainName(String domainNameIn, PortRange portRangeIn) {
-                if (!isValidHostName(domainNameIn)) {
-                        throw new IllegalArgumentException("Invalid RFC2396 domain name");
-                }
-                this.domainName	= domainNameIn;
-                this.portRange	= portRangeIn;
+        return true;
+    }
+
+    public static boolean isValidDomainLabel(String domainLabel) {
+        if (domainLabel == null || domainLabel.length() == 0) {
+            return false;
         }
-        
-        /**
-         * Parses an RFC2396 domain name of the form [domain.[domain.[...]].name[:port-range] to create a new <code>RFC2396DomainName</code>.
-         * 
-         * @param rfc2396DomainNameString the <code>String</code> name to parse
-         * @return a new <code>RFC2396DomainName</code> generated from the given <code>String</code>
-         * @throws java.text.ParseException if there is an error parsing the name.
+
+        if (!Character.isLetterOrDigit(domainLabel.charAt(0))) {
+            return false;
+        }
+        if (domainLabel.length() > 1) {
+            for (int i = 1 ; i < domainLabel.length() - 1 ; i++) {
+                char	c	= domainLabel.charAt(i);
+                if (!(Character.isLetterOrDigit(c) || c == '-')) {
+                    return false;
+                }
+            }
+            if (!Character.isLetterOrDigit(domainLabel.charAt(domainLabel.length() - 1))) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static boolean isValidHostName(String hostName) {
+        if (hostName == null || hostName.length() == 0) {
+            return false;
+        }
+        String[]	labels	= hostName.split("[.]",-1);
+        if (labels == null || labels.length == 0) {
+            return false;
+        }
+
+        /*
+         * Validate the domain label parts
          */
-        public static RFC2396DomainName newInstance(String rfc2396DomainNameString) throws ParseException {
-                if (rfc2396DomainNameString == null || rfc2396DomainNameString.length() == 0) {
-                        return null;
-                }
-                
-                /*
-                 * Break the string up into its name and port range parts
-                 */
-                int	colonPos	= rfc2396DomainNameString.indexOf(':');
-                String hostName	= (colonPos < 0 ? rfc2396DomainNameString : rfc2396DomainNameString.substring(0, colonPos));
-                if (!isValidHostName(hostName)) {
-                        throw new ParseException("Invalid RFC 2396 host name \"" + hostName + "\"", 0);
-                }
-                
-                PortRange	portRange	= null;
-                if (colonPos >= 0) {
-                        if (colonPos + 1 >= rfc2396DomainNameString.length()) {
-                                throw new ParseException("Invalid RFC 2396 port range \"" + rfc2396DomainNameString + "\": no port numbers", colonPos);
-                        }
-                        String	stringPortRange	= rfc2396DomainNameString.substring(colonPos+1);
-                        try {
-                                portRange	= PortRange.newInstance(stringPortRange);
-                        } catch (ParseException ex) {
-                                throw new ParseException("Invalid RFC 2396 port range \"" + stringPortRange + "\"", colonPos);
-                        }
-                }
-                
-                return new RFC2396DomainName(hostName, portRange);
+        for (int i = 0 ; i < labels.length-1 ; i++) {
+            if (!isValidDomainLabel(labels[i])) {
+                return false;
+            }
         }
-        
-        public String getDomainName() {
-                return this.domainName;
+
+        /*
+         * Validate the top label
+         */
+        if (!isValidTopLabel(labels[labels.length-1])) {
+            return false;
         }
-        
-        public PortRange getPortRange() {
-                return this.portRange;
+        return true;
+    }
+
+    public RFC2396DomainName(String domainNameIn, PortRange portRangeIn) {
+        if (!isValidHostName(domainNameIn)) {
+            throw new IllegalArgumentException("Invalid RFC2396 domain name");
         }
-        
-        @Override
-        public String stringValue() {
-                StringBuilder	stringBuilder	= new StringBuilder();
-                if (this.getDomainName() != null) {
-                        stringBuilder.append(this.getDomainName());
+        this.domainName	= domainNameIn;
+        this.portRange	= portRangeIn;
+    }
+
+    /**
+     * Parses an RFC2396 domain name of the form [domain.[domain.[...]].name[:port-range] to create a new <code>RFC2396DomainName</code>.
+     *
+     * @param rfc2396DomainNameString the <code>String</code> name to parse
+     * @return a new <code>RFC2396DomainName</code> generated from the given <code>String</code>
+     * @throws java.text.ParseException if there is an error parsing the name.
+     */
+    public static RFC2396DomainName newInstance(String rfc2396DomainNameString) throws ParseException {
+        if (rfc2396DomainNameString == null || rfc2396DomainNameString.length() == 0) {
+            return null;
+        }
+
+        /*
+         * Break the string up into its name and port range parts
+         */
+        int	colonPos	= rfc2396DomainNameString.indexOf(':');
+        String hostName	= (colonPos < 0 ? rfc2396DomainNameString : rfc2396DomainNameString.substring(0, colonPos));
+        if (!isValidHostName(hostName)) {
+            throw new ParseException("Invalid RFC 2396 host name \"" + hostName + "\"", 0);
+        }
+
+        PortRange	portRange	= null;
+        if (colonPos >= 0) {
+            if (colonPos + 1 >= rfc2396DomainNameString.length()) {
+                throw new ParseException("Invalid RFC 2396 port range \"" + rfc2396DomainNameString + "\": no port numbers", colonPos);
+            }
+            String	stringPortRange	= rfc2396DomainNameString.substring(colonPos+1);
+            try {
+                portRange	= PortRange.newInstance(stringPortRange);
+            } catch (ParseException ex) {
+                throw new ParseException("Invalid RFC 2396 port range \"" + stringPortRange + "\"", colonPos);
+            }
+        }
+
+        return new RFC2396DomainName(hostName, portRange);
+    }
+
+    public String getDomainName() {
+        return this.domainName;
+    }
+
+    public PortRange getPortRange() {
+        return this.portRange;
+    }
+
+    @Override
+    public String stringValue() {
+        StringBuilder	stringBuilder	= new StringBuilder();
+        if (this.getDomainName() != null) {
+            stringBuilder.append(this.getDomainName());
+        }
+        if (this.getPortRange() != null) {
+            stringBuilder.append(':');
+            stringBuilder.append(this.getPortRange().stringValue());
+        }
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public int hashCode() {
+        int hc	= (this.getDomainName() == null ? 0 : this.getDomainName().hashCode());
+        return hc + (this.getPortRange() == null ? 0 : this.getPortRange().hashCode());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof RFC2396DomainName)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            RFC2396DomainName	rfc2396DomainName	= (RFC2396DomainName)obj;
+            if (this.getDomainName() == null) {
+                if (rfc2396DomainName.getDomainName() != null) {
+                    return false;
                 }
-                if (this.getPortRange() != null) {
-                        stringBuilder.append(':');
-                        stringBuilder.append(this.getPortRange().stringValue());
+            } else {
+                if (!this.getDomainName().equals(rfc2396DomainName.getDomainName())) {
+                    return false;
                 }
-                return stringBuilder.toString();		
+            }
+            if (this.getPortRange() == null) {
+                return (rfc2396DomainName.getPortRange() == null);
+            } else {
+                return this.getPortRange().equals(rfc2396DomainName.getPortRange());
+            }
         }
-        
-        @Override
-        public int hashCode() {
-                int hc	= (this.getDomainName() == null ? 0 : this.getDomainName().hashCode());
-                return hc + (this.getPortRange() == null ? 0 : this.getPortRange().hashCode());
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        boolean needComma			= false;
+
+        if (this.getDomainName() != null) {
+            stringBuilder.append("domainName=");
+            stringBuilder.append(this.getDomainName());
+            needComma	= true;
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof RFC2396DomainName)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
-                } else {
-                        RFC2396DomainName	rfc2396DomainName	= (RFC2396DomainName)obj;
-                        if (this.getDomainName() == null) {
-                                if (rfc2396DomainName.getDomainName() != null) {
-                                        return false;
-                                }
-                        } else {
-                                if (!this.getDomainName().equals(rfc2396DomainName.getDomainName())) {
-                                        return false;
-                                }
-                        }
-                        if (this.getPortRange() == null) {
-                                return (rfc2396DomainName.getPortRange() == null);
-                        } else {
-                                return this.getPortRange().equals(rfc2396DomainName.getPortRange());
-                        }
-                }
+        if (this.getPortRange() != null) {
+            if (needComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("portRange=");
+            stringBuilder.append(this.getPortRange().toString());
+            needComma	= true;
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                boolean needComma			= false;
-                
-                if (this.getDomainName() != null) {
-                        stringBuilder.append("domainName=");
-                        stringBuilder.append(this.getDomainName());
-                        needComma	= true;
-                }
-                if (this.getPortRange() != null) {
-                        if (needComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("portRange=");
-                        stringBuilder.append(this.getPortRange().toString());
-                        needComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/RFC822Name.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/RFC822Name.java
index caaa86c..cc58847 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/RFC822Name.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/RFC822Name.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -36,151 +36,151 @@
 
 /**
  * RFC822Name represents an RFC 822 name consisting of a local part and a domain part.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class RFC822Name implements Comparable<RFC822Name>, SemanticString {
-        private String	localName;
-        private String	domainName;
-        
-        public RFC822Name(String localNameIn, String domainNameIn) {
-                if (localNameIn == null || localNameIn.length() == 0 || domainNameIn == null || domainNameIn.length() == 0) {
-                        throw new IllegalArgumentException("Invalid RFC822Name");
+    private String	localName;
+    private String	domainName;
+
+    public RFC822Name(String localNameIn, String domainNameIn) {
+        if (localNameIn == null || localNameIn.length() == 0 || domainNameIn == null || domainNameIn.length() == 0) {
+            throw new IllegalArgumentException("Invalid RFC822Name");
+        }
+        this.localName	= localNameIn;
+        this.domainName	= domainNameIn;
+    }
+
+    public static RFC822Name newInstance(String rfc822NameString) throws ParseException {
+        if (rfc822NameString == null) {
+            return null;
+        } else {
+            String[] parts	= rfc822NameString.split("[@]",-1);
+            if (parts == null || parts.length == 0) {
+                return null;
+            } else if (parts.length == 1) {
+                throw new ParseException("Invalid RFC822Name \"" + rfc822NameString + "\": missing local part", 0);
+            } else if (parts.length == 2) {
+                if (parts[0].length() == 0 || parts[1].length() == 0) {
+                    throw new ParseException("Invalid RFC822Name \"" + rfc822NameString + "\": empty parts", 0);
                 }
-                this.localName	= localNameIn;
-                this.domainName	= domainNameIn;
+                return new RFC822Name(parts[0], parts[1]);
+            } else {
+                throw new ParseException("Invalid RFC822Name \"" + rfc822NameString + "\": too many @ delimiters", 0);
+            }
         }
-        
-        public static RFC822Name newInstance(String rfc822NameString) throws ParseException {
-                if (rfc822NameString == null) {
-                        return null;
-                } else {
-                        String[] parts	= rfc822NameString.split("[@]",-1);
-                        if (parts == null || parts.length == 0) {
-                                return null;
-                        } else if (parts.length == 1) {
-                                throw new ParseException("Invalid RFC822Name \"" + rfc822NameString + "\": missing local part", 0);
-                        } else if (parts.length == 2) {
-                                if (parts[0].length() == 0 || parts[1].length() == 0) {
-                                        throw new ParseException("Invalid RFC822Name \"" + rfc822NameString + "\": empty parts", 0);
-                                }
-                                return new RFC822Name(parts[0], parts[1]);
-                        } else {
-                                throw new ParseException("Invalid RFC822Name \"" + rfc822NameString + "\": too many @ delimiters", 0);
-                        }
-                }
+    }
+
+    public String getLocalName() {
+        return this.localName;
+    }
+
+    public String getDomainName() {
+        return this.domainName;
+    }
+
+    public String getCanonicalDomainName() {
+        return this.getDomainName().toLowerCase();
+    }
+
+    public String getName() {
+        return this.getLocalName() + "@" + this.getDomainName();
+    }
+
+    public String getCanonicalName() {
+        return this.getLocalName() + "@" + this.getCanonicalDomainName();
+    }
+
+    @Override
+    public String stringValue() {
+        return this.getCanonicalName();
+    }
+
+    /**
+     * Determines if the given <code>RFC822Name</code> matches this <code>RFC822Name</code>, which may
+     * either be a full name or a pattern, using the XACML rules for matching RFC822 names.
+     *
+     * @param pattern the <code>String</code> pattern to match against
+     * @return true if this <code>RFC822Name</code> matches the given <code>RFC822Name</code>
+     */
+    public boolean match(String pattern) {
+        if (pattern == null) {
+            return false;
         }
-        
-        public String getLocalName() {
-                return this.localName;
+
+        String[] patternParts	= pattern.split("[@]",-1);
+        if (patternParts == null || patternParts.length == 0 || patternParts.length > 1) {
+            return false;
         }
-        
-        public String getDomainName() {
-                return this.domainName;
-        }
-        
-        public String getCanonicalDomainName() {
-                return this.getDomainName().toLowerCase();
-        }
-        
-        public String getName() {
-                return this.getLocalName() + "@" + this.getDomainName();
-        }
-        
-        public String getCanonicalName() {
-                return this.getLocalName() + "@" + this.getCanonicalDomainName();
-        }
-        
-        @Override
-        public String stringValue() {
-                return this.getCanonicalName();
-        }
-        
-        /**
-         * Determines if the given <code>RFC822Name</code> matches this <code>RFC822Name</code>, which may
-         * either be a full name or a pattern, using the XACML rules for matching RFC822 names.
-         * 
-         * @param pattern the <code>String</code> pattern to match against
-         * @return true if this <code>RFC822Name</code> matches the given <code>RFC822Name</code>
+
+        /*
+         * Try and match the local part
          */
-        public boolean match(String pattern) {
-                if (pattern == null) {
-                        return false;
-                }
-                
-                String[] patternParts	= pattern.split("[@]",-1);
-                if (patternParts == null || patternParts.length == 0 || patternParts.length > 1) {
-                        return false;
-                }
-
-                /*
-                 * Try and match the local part
-                 */
-                if (patternParts.length == 2) {
-                        if (!patternParts[0].equals(this.getLocalName())) {
-                                return false;
-                        }
-                }
-                
-                String thisDomainName	= this.getCanonicalDomainName();
-                String thatDomainName	= (patternParts.length == 0 ? patternParts[0] : patternParts[1]);
-                if (thatDomainName == null) {
-                        return false;
-                }
-                if (thatDomainName.startsWith(".")) {
-                        return thisDomainName.endsWith(thatDomainName);
-                } else {
-                        return thisDomainName.equals(thatDomainName);
-                }
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                boolean needComma			= false;
-                
-                String stringToDump;
-                if ((stringToDump = this.getLocalName()) != null) {
-                        stringBuilder.append("localName=");
-                        stringBuilder.append(stringToDump);
-                        needComma	= true;
-                }
-                if ((stringToDump = this.getDomainName()) != null) {
-                        if (needComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("domainName=");
-                        stringBuilder.append(stringToDump);
-                        needComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        if (patternParts.length == 2) {
+            if (!patternParts[0].equals(this.getLocalName())) {
+                return false;
+            }
         }
 
-        @Override
-        public int hashCode() {
-                return ( this.getLocalName().hashCode() + this.getCanonicalDomainName().hashCode());
+        String thisDomainName	= this.getCanonicalDomainName();
+        String thatDomainName	= (patternParts.length == 0 ? patternParts[0] : patternParts[1]);
+        if (thatDomainName == null) {
+            return false;
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof RFC822Name)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
-                } else {
-                        return (this.compareTo((RFC822Name)obj) == 0);
-                }
+        if (thatDomainName.startsWith(".")) {
+            return thisDomainName.endsWith(thatDomainName);
+        } else {
+            return thisDomainName.equals(thatDomainName);
         }
-        
-        @Override
-        public int compareTo(RFC822Name o) {
-                if (o == null) {
-                        return 1;
-                } else {
-                        return this.getCanonicalName().compareTo(o.getCanonicalName());
-                }
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+        boolean needComma			= false;
+
+        String stringToDump;
+        if ((stringToDump = this.getLocalName()) != null) {
+            stringBuilder.append("localName=");
+            stringBuilder.append(stringToDump);
+            needComma	= true;
         }
+        if ((stringToDump = this.getDomainName()) != null) {
+            if (needComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("domainName=");
+            stringBuilder.append(stringToDump);
+            needComma	= true;
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public int hashCode() {
+        return ( this.getLocalName().hashCode() + this.getCanonicalDomainName().hashCode());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof RFC822Name)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            return (this.compareTo((RFC822Name)obj) == 0);
+        }
+    }
+
+    @Override
+    public int compareTo(RFC822Name o) {
+        if (o == null) {
+            return 1;
+        } else {
+            return this.getCanonicalName().compareTo(o.getCanonicalName());
+        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/StringNamespaceContext.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/StringNamespaceContext.java
index 9bfd416..a30f352 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/StringNamespaceContext.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/StringNamespaceContext.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,217 +41,221 @@
 
 
 /**
- * StringNamespaceContext extends {@link javax.xml.namespace.NamespaceContext} by 
+ * StringNamespaceContext extends {@link javax.xml.namespace.NamespaceContext} by
  * keeping the Namespace definitions as Strings.
  * This NamespaceContext applies to only a single scope and therefore can have at most one default unbound (i.e. with no Prefix) Namespace.
  * All other Namespaces in this context must have a prefix.
- * 
+ *
  * @author glenngriffin
  * @version $Revision$
  */
 public class StringNamespaceContext extends ExtendedNamespaceContext {
 
-        // structure to hold the namespace info, which may or may not include a prefix
-        private class Namespace {
-                private String prefix;
-                private String namespace;
-                
+    // structure to hold the namespace info, which may or may not include a prefix
+    private class Namespace {
+        private String prefix;
+        private String namespace;
+
 // if we make this a first-class object, do not let people create it without args
 //		private Namespace(){}
-                
-                /**
-                 * Create a new Namespace with only a namespaceURI
-                 * @param namespace
-                 */
-                public Namespace(String namespace) {
-                        this.prefix = null;
-                        this.namespace = namespace;
-                }
-                
-                /**
-                 * Create a new Namespace with both prefix and namespace URI
-                 * @param prefix
-                 * @param namespace
-                 */
-                public Namespace(String prefix, String namespace) {
-                        this.prefix = prefix;
-                        this.namespace = namespace;
-                }
-                
-                public String getPrefix() { return this.prefix;}
-                public String getNamespace() { return this.namespace;}
-                
-                @Override
-                public String toString() {
-                        return "{" + prefix + "," + namespace + "}";
-                }
-        }
-        
-        
-        /*
-         * The access methods make it simpler to store Namespaces that have prefixes (which is all of them except the default, if any) in a Map
-         */
-        private Map<String,Namespace> namespaceMap = new HashMap<String,Namespace>();
-        
-        private Namespace defaultNamespace = null;
-        
-        
+
         /**
-         * Basic constructor
+         * Create a new Namespace with only a namespaceURI
+         * @param namespace
          */
-        public StringNamespaceContext() {}
-        
-        /**
-         * Constructor with a single entry consisting of only a Namespace URI without a Prefix (ie. the default namespace)
-         * @param namespaceURI
-         * @throws Exception 
-         */
-        public StringNamespaceContext(String namespaceURI) throws Exception {
-                this.add(namespaceURI);
-        }
-        
-        /**
-         * Constructor with a single entry consisting of both a prefix and a namespace URI.
-         * 
-         * @param prefix
-         * @param namespaceURI
-         * @throws Exception 
-         */
-        public StringNamespaceContext(String prefix, String namespaceURI) throws Exception {
-                this.add(prefix, namespaceURI);
-        }
-        
-        
-        /**
-         * Add a default Namespace to the list using just the Namespace URI (without a prefix).
-         * 
-         * @param namespaceURI
-         * @throws Exception 
-         */
-        public void add(String namespaceURI) throws Exception {
-                if (defaultNamespace != null) {
-                        // caller is trying to replace the default namespace in this scope.
-                        // This probably indicates a mistake, so we do not allow it.
-                        // If we find that this is allowed, just delete this if block.
-                        throw new Exception("Default name already set");
-                }
-                // This allows multiple instances of the same URI with different (or no) prefixes
-                defaultNamespace = new Namespace(namespaceURI);
+        public Namespace(String namespace) {
+            this.prefix = null;
+            this.namespace = namespace;
         }
 
         /**
-         * Add a Namespace to the list with both a Prefix and the Namespace URI.
-         * 
+         * Create a new Namespace with both prefix and namespace URI
          * @param prefix
          * @param namespace
-         * @throws Exception 
          */
-        public void add(String prefix, String namespace) throws Exception {
-                // if prefix is missing or "", this is really the default namespace, so add it using the other method
-                if (prefix == null || prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
-                        this.add(namespace);
-                        return;
-                }
-                // prefix is non-null
-                if (namespaceMap.get(prefix) != null) {
-                        throw new Exception("Namespace prefix '" + prefix + "' already in use (value='" + namespaceMap.get(prefix) + "'");
-                }
-                namespaceMap.put(prefix, new Namespace(prefix, namespace));
+        public Namespace(String prefix, String namespace) {
+            this.prefix = prefix;
+            this.namespace = namespace;
         }
-        
-        
-        
-        //
-        // Methods implementing NamespaceContext interface
-        //
-        
-        
-        @Override
-        public String getNamespaceURI(String prefix) {
-                if (prefix == null) {
-                        throw new IllegalArgumentException();
-                } else if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
-                        if (defaultNamespace == null) {
-                                return XMLConstants.NULL_NS_URI;
-                        } else {
-                                return defaultNamespace.getNamespace();
-                        }
-                } else if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {
-                        return XMLConstants.XML_NS_URI;
-                } else if (prefix.equals(XMLConstants.XML_NS_PREFIX)) {
-                        return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
-                } else if (namespaceMap.get(prefix) == null) {
-                        return XMLConstants.NULL_NS_URI;
-                } else {
-                        return namespaceMap.get(prefix).getNamespace();
-                }
+
+        public String getPrefix() {
+            return this.prefix;
+        }
+        public String getNamespace() {
+            return this.namespace;
         }
 
         @Override
-        public String getPrefix(String namespaceURI) {
-                if (namespaceURI == null) {
-                        throw new IllegalArgumentException();
+        public String toString() {
+            return "{" + prefix + "," + namespace + "}";
+        }
+    }
+
+
+    /*
+     * The access methods make it simpler to store Namespaces that have prefixes (which is all of them except the default, if any) in a Map
+     */
+    private Map<String,Namespace> namespaceMap = new HashMap<String,Namespace>();
+
+    private Namespace defaultNamespace = null;
+
+
+    /**
+     * Basic constructor
+     */
+    public StringNamespaceContext() {}
+
+    /**
+     * Constructor with a single entry consisting of only a Namespace URI without a Prefix (ie. the default namespace)
+     * @param namespaceURI
+     * @throws Exception
+     */
+    public StringNamespaceContext(String namespaceURI) throws Exception {
+        this.add(namespaceURI);
+    }
+
+    /**
+     * Constructor with a single entry consisting of both a prefix and a namespace URI.
+     *
+     * @param prefix
+     * @param namespaceURI
+     * @throws Exception
+     */
+    public StringNamespaceContext(String prefix, String namespaceURI) throws Exception {
+        this.add(prefix, namespaceURI);
+    }
+
+
+    /**
+     * Add a default Namespace to the list using just the Namespace URI (without a prefix).
+     *
+     * @param namespaceURI
+     * @throws Exception
+     */
+    public void add(String namespaceURI) throws Exception {
+        if (defaultNamespace != null) {
+            // caller is trying to replace the default namespace in this scope.
+            // This probably indicates a mistake, so we do not allow it.
+            // If we find that this is allowed, just delete this if block.
+            throw new Exception("Default name already set");
+        }
+        // This allows multiple instances of the same URI with different (or no) prefixes
+        defaultNamespace = new Namespace(namespaceURI);
+    }
+
+    /**
+     * Add a Namespace to the list with both a Prefix and the Namespace URI.
+     *
+     * @param prefix
+     * @param namespace
+     * @throws Exception
+     */
+    public void add(String prefix, String namespace) throws Exception {
+        // if prefix is missing or "", this is really the default namespace, so add it using the other method
+        if (prefix == null || prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+            this.add(namespace);
+            return;
+        }
+        // prefix is non-null
+        if (namespaceMap.get(prefix) != null) {
+            throw new Exception("Namespace prefix '" + prefix + "' already in use (value='" + namespaceMap.get(prefix) + "'");
+        }
+        namespaceMap.put(prefix, new Namespace(prefix, namespace));
+    }
+
+
+
+    //
+    // Methods implementing NamespaceContext interface
+    //
+
+
+    @Override
+    public String getNamespaceURI(String prefix) {
+        if (prefix == null) {
+            throw new IllegalArgumentException();
+        } else if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+            if (defaultNamespace == null) {
+                return XMLConstants.NULL_NS_URI;
+            } else {
+                return defaultNamespace.getNamespace();
+            }
+        } else if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {
+            return XMLConstants.XML_NS_URI;
+        } else if (prefix.equals(XMLConstants.XML_NS_PREFIX)) {
+            return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
+        } else if (namespaceMap.get(prefix) == null) {
+            return XMLConstants.NULL_NS_URI;
+        } else {
+            return namespaceMap.get(prefix).getNamespace();
+        }
+    }
+
+    @Override
+    public String getPrefix(String namespaceURI) {
+        if (namespaceURI == null) {
+            throw new IllegalArgumentException();
+        }
+        if (defaultNamespace != null && namespaceURI.equals(defaultNamespace.getNamespace())) {
+            return XMLConstants.DEFAULT_NS_PREFIX;
+        }
+        if (namespaceURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
+            return XMLConstants.XMLNS_ATTRIBUTE;
+        } else if (namespaceURI.equals(XMLConstants.XML_NS_URI)) {
+            return XMLConstants.XML_NS_PREFIX;
+        }
+        //  search the map looking for an entry that matches
+        for (String key : namespaceMap.keySet()) {
+            Namespace namespace = namespaceMap.get(key);
+            if (namespace.getNamespace().equals(namespaceURI)) {
+                return namespace.getPrefix();
+            }
+        }
+        // if we get here then the URI was not in the map
+        return null;
+    }
+
+
+    @SuppressWarnings("rawtypes")
+    @Override
+    public Iterator getPrefixes(String namespaceURI) {
+        List<String> prefixList = new ArrayList<String>();
+        if (namespaceURI == null) {
+            throw new IllegalArgumentException();
+        } else if (namespaceURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
+            prefixList.add(XMLConstants.XMLNS_ATTRIBUTE);
+        } else if (namespaceURI.equals(XMLConstants.XML_NS_URI)) {
+            prefixList.add(XMLConstants.XML_NS_PREFIX);
+        } else {
+            if (defaultNamespace != null && defaultNamespace.getNamespace().equals(namespaceURI)) {
+                prefixList.add(XMLConstants.DEFAULT_NS_PREFIX);
+            }
+            for (String key : namespaceMap.keySet()) {
+                Namespace ns = namespaceMap.get(key);
+                if (ns.getNamespace().equals(namespaceURI)) {
+                    prefixList.add(ns.prefix);
                 }
-                if (defaultNamespace != null && namespaceURI.equals(defaultNamespace.getNamespace())) {
-                        return XMLConstants.DEFAULT_NS_PREFIX;
-                }
-                if (namespaceURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
-                        return XMLConstants.XMLNS_ATTRIBUTE;
-                } else if (namespaceURI.equals(XMLConstants.XML_NS_URI)) {
-                        return XMLConstants.XML_NS_PREFIX;
-                }
-                //  search the map looking for an entry that matches
-                for (String key : namespaceMap.keySet()) {
-                        Namespace namespace = namespaceMap.get(key);
-                        if (namespace.getNamespace().equals(namespaceURI)) {
-                                return namespace.getPrefix();
-                        }
-                }
-                // if we get here then the URI was not in the map
-                return null;
+            }
         }
 
-        
-        @SuppressWarnings("rawtypes")
-        @Override
-        public Iterator getPrefixes(String namespaceURI) {
-                List<String> prefixList = new ArrayList<String>();
-                if (namespaceURI == null) {
-                        throw new IllegalArgumentException();
-                } else if (namespaceURI.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
-                        prefixList.add(XMLConstants.XMLNS_ATTRIBUTE);
-                } else if (namespaceURI.equals(XMLConstants.XML_NS_URI)) {
-                        prefixList.add(XMLConstants.XML_NS_PREFIX);
-                } else {
-                        if (defaultNamespace != null && defaultNamespace.getNamespace().equals(namespaceURI)) {
-                                prefixList.add(XMLConstants.DEFAULT_NS_PREFIX);
-                        }
-                        for (String key : namespaceMap.keySet()) {
-                                Namespace ns = namespaceMap.get(key);
-                                if (ns.getNamespace().equals(namespaceURI)) {
-                                        prefixList.add(ns.prefix);
-                                }
-                        }
-                }
+        return prefixList.iterator();
+    }
 
-                return prefixList.iterator();
-        }
-        
-        
 
-        
-        
-        @Override
-        public Iterator<String> getAllPrefixes() {
-                // if the default namespace is not in use, just return the iterator for the prefixes in the map
-                if (defaultNamespace == null) {
-                        return namespaceMap.keySet().iterator();
-                }
-                // we need to include the default namespace prefix in the iterator
-                List<String> keyList = new ArrayList<String>();
-                keyList.addAll(namespaceMap.keySet());
-                keyList.add(XMLConstants.DEFAULT_NS_PREFIX);
-                return keyList.iterator();
+
+
+
+    @Override
+    public Iterator<String> getAllPrefixes() {
+        // if the default namespace is not in use, just return the iterator for the prefixes in the map
+        if (defaultNamespace == null) {
+            return namespaceMap.keySet().iterator();
         }
+        // we need to include the default namespace prefix in the iterator
+        List<String> keyList = new ArrayList<String>();
+        keyList.addAll(namespaceMap.keySet());
+        keyList.add(XMLConstants.DEFAULT_NS_PREFIX);
+        return keyList.iterator();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathDayTimeDuration.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathDayTimeDuration.java
index 523676a..4c9ff0e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathDayTimeDuration.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathDayTimeDuration.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,109 +35,109 @@
 /**
  * XPathDayTimeDuration extends {@link ISO8601Duration} to restrict values
  * to day and time components only, and then provides for ordering based on canonical duration in fractional seconds.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class XPathDayTimeDuration extends ISO8601Duration implements Comparable<XPathDayTimeDuration> {
-        private double	fractionalSeconds;
-        
-        /**
-         * Creates a new XPathDayTimeDuration with the given sign, days, hours, minutes, and seconds.
-         * 
-         * @param durationSignIn
-         * @param daysIn
-         * @param hoursIn
-         * @param minutesIn
-         * @param secondsIn
-         */
-        public XPathDayTimeDuration(int durationSignIn, int daysIn, int hoursIn, int minutesIn, double secondsIn) {
-                super(durationSignIn, 0, 0, daysIn, hoursIn, minutesIn, secondsIn);
-                fractionalSeconds	= this.getDurationSign() * (
-                                this.getDays() * 24 * 60 * 60 +
-                                this.getHours() * 60 * 60 +
-                                this.getMinutes() * 60 +
-                                this.getFractionalSecs()
-                                );
-        }
-        
-        public double getFractionalSeconds() {
-                return this.fractionalSeconds;
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof XPathDayTimeDuration)) {
-                        return false;
-                } else if (this == obj) {
-                        return true;
-                } else {
-                        return this.getFractionalSeconds() == ((XPathDayTimeDuration)obj).getFractionalSeconds();
-                }
-        }
-        
-        /**
-         * Creates a new <code>XPathDayTimeDuration</code> by parsing the given ISO8601 duration string and validating that
-         * it only contains days, hours, minutes, and seconds components.
-         * 
-         * @param iso8601DurationString
-         * @return
-         * @throws java.text.ParseException
-         */
-        public static XPathDayTimeDuration newInstance(String iso8601DurationString) throws ParseException {
-                return newInstance(ISO8601Duration.newInstance(iso8601DurationString));
-        }
-        
-        /**
-         * Creates a new <code>XPathDayTimeDuration</code> from an existing <code>ISO8601Duration</code> by validating
-         * that it only contains the day and time components.
-         * 
-         * @param iso8601Duration
-         * @return
-         * @throws java.text.ParseException
-         */
-        public static XPathDayTimeDuration newInstance(ISO8601Duration iso8601Duration) throws ParseException {
-                if (iso8601Duration == null) {
-                        return null;
-                }
-                if (iso8601Duration.getYears() > 0 || iso8601Duration.getMonths() > 0) {
-                        throw new ParseException("Invalid XPath dayTimeDuration \"" + iso8601Duration.toString() + "\": includes years or months component", 0);
-                }
-                return new XPathDayTimeDuration(iso8601Duration.getDurationSign(), iso8601Duration.getDays(), iso8601Duration.getHours(), iso8601Duration.getMinutes(), iso8601Duration.getFractionalSecs());		
-        }
-        
-        /**
-         * Computes the canonical <code>XPathDayTimeDuration</code> by converting the fractional seconds to canonical
-         * days, hours, minutes, and seconds.
-         * 
-         * @return the canonical <code>XPathDayTimeDuration</code> for this <code>XPathDayTimeDuration</code>
-         */
-        public XPathDayTimeDuration getCanonicalDuration() {
-                double	fractionalSecondsLeft	= Math.abs(this.getFractionalSeconds());
-                int		days					= (int)(fractionalSecondsLeft/(24*60*60));
-                fractionalSecondsLeft			-= (days*24*60*60);
-                int		hours					= (int)(fractionalSecondsLeft/(60*60));
-                fractionalSecondsLeft			-= (hours*60*60);
-                int		minutes					= (int)(fractionalSecondsLeft/60);
-                fractionalSecondsLeft			-= (minutes*60);
-                return new XPathDayTimeDuration(this.getDurationSign(), days, hours, minutes, fractionalSecondsLeft);
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{super=");
-                stringBuilder.append(super.toString());
-                stringBuilder.append(",factionalSeconds=");
-                stringBuilder.append(this.getFractionalSecs());
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    private double	fractionalSeconds;
 
-        @Override
-        public int compareTo(XPathDayTimeDuration o) {
-                if (o == null) {
-                        return 1;
-                }
-                return Double.compare(this.getFractionalSeconds(), o.getFractionalSeconds());
+    /**
+     * Creates a new XPathDayTimeDuration with the given sign, days, hours, minutes, and seconds.
+     *
+     * @param durationSignIn
+     * @param daysIn
+     * @param hoursIn
+     * @param minutesIn
+     * @param secondsIn
+     */
+    public XPathDayTimeDuration(int durationSignIn, int daysIn, int hoursIn, int minutesIn, double secondsIn) {
+        super(durationSignIn, 0, 0, daysIn, hoursIn, minutesIn, secondsIn);
+        fractionalSeconds	= this.getDurationSign() * (
+                                  this.getDays() * 24 * 60 * 60 +
+                                  this.getHours() * 60 * 60 +
+                                  this.getMinutes() * 60 +
+                                  this.getFractionalSecs()
+                              );
+    }
+
+    public double getFractionalSeconds() {
+        return this.fractionalSeconds;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof XPathDayTimeDuration)) {
+            return false;
+        } else if (this == obj) {
+            return true;
+        } else {
+            return this.getFractionalSeconds() == ((XPathDayTimeDuration)obj).getFractionalSeconds();
         }
+    }
+
+    /**
+     * Creates a new <code>XPathDayTimeDuration</code> by parsing the given ISO8601 duration string and validating that
+     * it only contains days, hours, minutes, and seconds components.
+     *
+     * @param iso8601DurationString
+     * @return
+     * @throws java.text.ParseException
+     */
+    public static XPathDayTimeDuration newInstance(String iso8601DurationString) throws ParseException {
+        return newInstance(ISO8601Duration.newInstance(iso8601DurationString));
+    }
+
+    /**
+     * Creates a new <code>XPathDayTimeDuration</code> from an existing <code>ISO8601Duration</code> by validating
+     * that it only contains the day and time components.
+     *
+     * @param iso8601Duration
+     * @return
+     * @throws java.text.ParseException
+     */
+    public static XPathDayTimeDuration newInstance(ISO8601Duration iso8601Duration) throws ParseException {
+        if (iso8601Duration == null) {
+            return null;
+        }
+        if (iso8601Duration.getYears() > 0 || iso8601Duration.getMonths() > 0) {
+            throw new ParseException("Invalid XPath dayTimeDuration \"" + iso8601Duration.toString() + "\": includes years or months component", 0);
+        }
+        return new XPathDayTimeDuration(iso8601Duration.getDurationSign(), iso8601Duration.getDays(), iso8601Duration.getHours(), iso8601Duration.getMinutes(), iso8601Duration.getFractionalSecs());
+    }
+
+    /**
+     * Computes the canonical <code>XPathDayTimeDuration</code> by converting the fractional seconds to canonical
+     * days, hours, minutes, and seconds.
+     *
+     * @return the canonical <code>XPathDayTimeDuration</code> for this <code>XPathDayTimeDuration</code>
+     */
+    public XPathDayTimeDuration getCanonicalDuration() {
+        double	fractionalSecondsLeft	= Math.abs(this.getFractionalSeconds());
+        int		days					= (int)(fractionalSecondsLeft/(24*60*60));
+        fractionalSecondsLeft			-= (days*24*60*60);
+        int		hours					= (int)(fractionalSecondsLeft/(60*60));
+        fractionalSecondsLeft			-= (hours*60*60);
+        int		minutes					= (int)(fractionalSecondsLeft/60);
+        fractionalSecondsLeft			-= (minutes*60);
+        return new XPathDayTimeDuration(this.getDurationSign(), days, hours, minutes, fractionalSecondsLeft);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{super=");
+        stringBuilder.append(super.toString());
+        stringBuilder.append(",factionalSeconds=");
+        stringBuilder.append(this.getFractionalSecs());
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public int compareTo(XPathDayTimeDuration o) {
+        if (o == null) {
+            return 1;
+        }
+        return Double.compare(this.getFractionalSeconds(), o.getFractionalSeconds());
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathExpressionWrapper.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathExpressionWrapper.java
index 67be282..411a3a8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathExpressionWrapper.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathExpressionWrapper.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,115 +48,115 @@
 /**
  * XPathExpressionWrapper implements the {@link javax.xml.xpath.XPathExpression} interface to wrap another <code>XPathExpression</code> and
  * keep the path expression that was used to create it.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class XPathExpressionWrapper implements XPathExpression {
-        private XPathExpression	xpathExpressionWrapped;
-        private String path;
-        private ExtendedNamespaceContext namespaceContext;
-        private Status status;
-        
-        public XPathExpressionWrapper(ExtendedNamespaceContext namespaceContextIn, String pathIn) {
-                this.namespaceContext	= namespaceContextIn;
-                this.path				= pathIn;
+    private XPathExpression	xpathExpressionWrapped;
+    private String path;
+    private ExtendedNamespaceContext namespaceContext;
+    private Status status;
+
+    public XPathExpressionWrapper(ExtendedNamespaceContext namespaceContextIn, String pathIn) {
+        this.namespaceContext	= namespaceContextIn;
+        this.path				= pathIn;
+    }
+
+    public XPathExpressionWrapper(Document documentIn, String pathIn) {
+        this(new NodeNamespaceContext(documentIn), pathIn);
+        if (pathIn == null || pathIn.length() == 0) {
+            throw new IllegalArgumentException("XPathExpression must have XPath value");
         }
-        
-        public XPathExpressionWrapper(Document documentIn, String pathIn) {
-                this(new NodeNamespaceContext(documentIn), pathIn);
-                if (pathIn == null || pathIn.length() == 0) {
-                        throw new IllegalArgumentException("XPathExpression must have XPath value");
+    }
+
+    public XPathExpressionWrapper(String pathIn) {
+        this((ExtendedNamespaceContext)null, pathIn);
+    }
+
+    public XPathExpressionWrapper(Node node) {
+        this(node.getOwnerDocument(), node.getTextContent());
+    }
+
+    public XPathExpressionWrapper(XPathExpression xpathExpression) {
+        this.xpathExpressionWrapped	= xpathExpression;
+    }
+
+    public synchronized XPathExpression getXpathExpressionWrapped() {
+        if (this.xpathExpressionWrapped == null && (this.getStatus() == null || this.getStatus().isOk())) {
+            String thisPath	= this.getPath();
+            if (thisPath != null) {
+                XPath xPath	= XPathFactory.newInstance().newXPath();
+                NamespaceContext namespaceContextThis	= this.getNamespaceContext();
+                if (namespaceContextThis != null) {
+                    xPath.setNamespaceContext(namespaceContextThis);
                 }
-        }
-        
-        public XPathExpressionWrapper(String pathIn) {
-                this((ExtendedNamespaceContext)null, pathIn);
-        }
-        
-        public XPathExpressionWrapper(Node node) {
-                this(node.getOwnerDocument(), node.getTextContent());
-        }
-        
-        public XPathExpressionWrapper(XPathExpression xpathExpression) {
-                this.xpathExpressionWrapped	= xpathExpression;
-        }
-        
-        public synchronized XPathExpression getXpathExpressionWrapped() {
-                if (this.xpathExpressionWrapped == null && (this.getStatus() == null || this.getStatus().isOk())) {
-                        String thisPath	= this.getPath();
-                        if (thisPath != null) {
-                                XPath xPath	= XPathFactory.newInstance().newXPath();
-                                NamespaceContext namespaceContextThis	= this.getNamespaceContext();
-                                if (namespaceContextThis != null) {
-                                        xPath.setNamespaceContext(namespaceContextThis);
-                                }
-                                try {
-                                        this.xpathExpressionWrapped	= xPath.compile(thisPath);
-                                } catch (XPathExpressionException ex) {
-                                        this.status	= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Error compiling XPath " + thisPath + ": " + ex.getMessage());
-                                }
-                        }
+                try {
+                    this.xpathExpressionWrapped	= xPath.compile(thisPath);
+                } catch (XPathExpressionException ex) {
+                    this.status	= new StdStatus(StdStatusCode.STATUS_CODE_SYNTAX_ERROR, "Error compiling XPath " + thisPath + ": " + ex.getMessage());
                 }
-                return this.xpathExpressionWrapped;
+            }
         }
-        
-        public String getPath() {
-                return this.path;
-        }
-        
-        public ExtendedNamespaceContext getNamespaceContext() {
-                return this.namespaceContext;
-        }
-        
-        public Status getStatus() {
-                return this.status;
-        }
+        return this.xpathExpressionWrapped;
+    }
 
-        @Override
-        public Object evaluate(Object item, QName returnType) throws XPathExpressionException {
-                XPathExpression thisXPathExpression	= this.getXpathExpressionWrapped();
-                return (thisXPathExpression == null ? null : thisXPathExpression.evaluate(item, returnType));
-        }
+    public String getPath() {
+        return this.path;
+    }
 
-        @Override
-        public String evaluate(Object item) throws XPathExpressionException {
-                XPathExpression thisXPathExpression	= this.getXpathExpressionWrapped();
-                return (thisXPathExpression == null ? null : thisXPathExpression.evaluate(item));
-        }
+    public ExtendedNamespaceContext getNamespaceContext() {
+        return this.namespaceContext;
+    }
 
-        @Override
-        public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException {
-                XPathExpression thisXPathExpression	= this.getXpathExpressionWrapped();
-                return (thisXPathExpression == null ? null : thisXPathExpression.evaluate(source, returnType));
-        }
+    public Status getStatus() {
+        return this.status;
+    }
 
-        @Override
-        public String evaluate(InputSource source) throws XPathExpressionException {
-                XPathExpression thisXPathExpression	= this.getXpathExpressionWrapped();
-                return (thisXPathExpression == null ? null : thisXPathExpression.evaluate(source));
-        }
+    @Override
+    public Object evaluate(Object item, QName returnType) throws XPathExpressionException {
+        XPathExpression thisXPathExpression	= this.getXpathExpressionWrapped();
+        return (thisXPathExpression == null ? null : thisXPathExpression.evaluate(item, returnType));
+    }
 
-        
-        @Override
-        public boolean equals(Object o) {
-                if (o == null ||  ! (o instanceof XPathExpressionWrapper)) {
-                        return false;
-                }
-                XPathExpressionWrapper other = (XPathExpressionWrapper) o;
-                return this.path.equals(other.path);
+    @Override
+    public String evaluate(Object item) throws XPathExpressionException {
+        XPathExpression thisXPathExpression	= this.getXpathExpressionWrapped();
+        return (thisXPathExpression == null ? null : thisXPathExpression.evaluate(item));
+    }
+
+    @Override
+    public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException {
+        XPathExpression thisXPathExpression	= this.getXpathExpressionWrapped();
+        return (thisXPathExpression == null ? null : thisXPathExpression.evaluate(source, returnType));
+    }
+
+    @Override
+    public String evaluate(InputSource source) throws XPathExpressionException {
+        XPathExpression thisXPathExpression	= this.getXpathExpressionWrapped();
+        return (thisXPathExpression == null ? null : thisXPathExpression.evaluate(source));
+    }
+
+
+    @Override
+    public boolean equals(Object o) {
+        if (o == null ||  ! (o instanceof XPathExpressionWrapper)) {
+            return false;
         }
-        
-        
-        @Override
-        public String toString() {
-                StringBuilder sb = new StringBuilder("{");
-                sb.append("path="+this.path);
-                // the document is not printed by toString, but what we really want from it is the Namespace attributes
-                sb.append(",Namespace=" + this.namespaceContext);
-                sb.append(",status="+this.status);
-                sb.append(",xpathExpressionWrapped=" + ((this.xpathExpressionWrapped == null) ? "null" : "(XpathExpression object)"));
-                sb.append("}");
-                return sb.toString();
-        }
+        XPathExpressionWrapper other = (XPathExpressionWrapper) o;
+        return this.path.equals(other.path);
+    }
+
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder("{");
+        sb.append("path="+this.path);
+        // the document is not printed by toString, but what we really want from it is the Namespace attributes
+        sb.append(",Namespace=" + this.namespaceContext);
+        sb.append(",status="+this.status);
+        sb.append(",xpathExpressionWrapped=" + ((this.xpathExpressionWrapped == null) ? "null" : "(XpathExpression object)"));
+        sb.append("}");
+        return sb.toString();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathYearMonthDuration.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathYearMonthDuration.java
index e7c2933..dc8a4e1 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathYearMonthDuration.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/XPathYearMonthDuration.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,81 +35,81 @@
 /**
  * XPathYearMonthDuration extends {@link ISO8601Duration} to implement the XPath yearMonthDuration
  * data type.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class XPathYearMonthDuration extends ISO8601Duration implements Comparable<XPathYearMonthDuration> {
-        private int monthsDuration;
-        
-        public XPathYearMonthDuration(int durationSignIn, int yearsIn, int monthsIn) {
-                super(durationSignIn, yearsIn, monthsIn, 0, 0, 0, 0);
-                this.monthsDuration	= this.getDurationSign() * (this.getYears()*12 + this.getMonths());
-        }
-        
-        /**
-         * Computes the duration as a number of months.
-         * 
-         * @return the duration in months
-         */
-        public int getMonthsDuration() {
-                return this.monthsDuration;
-        }
-        
-        /**
-         * Gets a canonical <code>XPathYearMonthDuration</code> from this <code>XPathYearMonthDuration</code> by ensuring
-         * the number of months never exceeds 11, converting excess months to additional years.
-         * 
-         * @return a new <code>XPathYearMonthDuration</code> in canonical format
-         */
-        public XPathYearMonthDuration getCanonical() {
-                int	monthsLeft	= Math.abs(this.getMonthsDuration());
-                int years		= monthsLeft / 12;
-                monthsLeft		-= years * 12;
-                return new XPathYearMonthDuration(this.getDurationSign(), years, monthsLeft);
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == null || !(obj instanceof XPathYearMonthDuration)) {
-                        return false;
-                } else if (obj == this) {
-                        return true;
-                } else {
-                        return (this.getMonthsDuration() == ((XPathYearMonthDuration)obj).getMonthsDuration());
-                }
-        }
-        
-        public static XPathYearMonthDuration newInstance(ISO8601Duration iso8601Duration) throws ParseException {
-                if (iso8601Duration == null) {
-                        return null;
-                }
-                if (iso8601Duration.getDays() > 0 || iso8601Duration.getHours() > 0 || iso8601Duration.getMinutes() > 0 || iso8601Duration.getFractionalSecs() > 0) {
-                        throw new ParseException("Invalid XPath yearMonthDuraiton \"" + iso8601Duration.toString() + "\": includes days, hours, minutes, or seconds", 0);
-                }
-                return new XPathYearMonthDuration(iso8601Duration.getDurationSign(), iso8601Duration.getYears(), iso8601Duration.getMonths());
-        }
-        
-        public static XPathYearMonthDuration newInstance(String iso8601DurationString) throws ParseException {
-                return newInstance(ISO8601Duration.newInstance(iso8601DurationString));
-        }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{super=");
-                stringBuilder.append(super.toString());
-                stringBuilder.append(",monthsDuration=");
-                stringBuilder.append(this.getMonthsDuration());
-                stringBuilder.append('}');
-                return stringBuilder.toString();
-        }
+    private int monthsDuration;
 
-        @Override
-        public int compareTo(XPathYearMonthDuration o) {
-                if (o == null) {
-                        return 1;
-                }
-                return Integer.compare(this.getMonthsDuration(), o.getMonthsDuration());
+    public XPathYearMonthDuration(int durationSignIn, int yearsIn, int monthsIn) {
+        super(durationSignIn, yearsIn, monthsIn, 0, 0, 0, 0);
+        this.monthsDuration	= this.getDurationSign() * (this.getYears()*12 + this.getMonths());
+    }
+
+    /**
+     * Computes the duration as a number of months.
+     *
+     * @return the duration in months
+     */
+    public int getMonthsDuration() {
+        return this.monthsDuration;
+    }
+
+    /**
+     * Gets a canonical <code>XPathYearMonthDuration</code> from this <code>XPathYearMonthDuration</code> by ensuring
+     * the number of months never exceeds 11, converting excess months to additional years.
+     *
+     * @return a new <code>XPathYearMonthDuration</code> in canonical format
+     */
+    public XPathYearMonthDuration getCanonical() {
+        int	monthsLeft	= Math.abs(this.getMonthsDuration());
+        int years		= monthsLeft / 12;
+        monthsLeft		-= years * 12;
+        return new XPathYearMonthDuration(this.getDurationSign(), years, monthsLeft);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null || !(obj instanceof XPathYearMonthDuration)) {
+            return false;
+        } else if (obj == this) {
+            return true;
+        } else {
+            return (this.getMonthsDuration() == ((XPathYearMonthDuration)obj).getMonthsDuration());
         }
+    }
+
+    public static XPathYearMonthDuration newInstance(ISO8601Duration iso8601Duration) throws ParseException {
+        if (iso8601Duration == null) {
+            return null;
+        }
+        if (iso8601Duration.getDays() > 0 || iso8601Duration.getHours() > 0 || iso8601Duration.getMinutes() > 0 || iso8601Duration.getFractionalSecs() > 0) {
+            throw new ParseException("Invalid XPath yearMonthDuraiton \"" + iso8601Duration.toString() + "\": includes days, hours, minutes, or seconds", 0);
+        }
+        return new XPathYearMonthDuration(iso8601Duration.getDurationSign(), iso8601Duration.getYears(), iso8601Duration.getMonths());
+    }
+
+    public static XPathYearMonthDuration newInstance(String iso8601DurationString) throws ParseException {
+        return newInstance(ISO8601Duration.newInstance(iso8601DurationString));
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{super=");
+        stringBuilder.append(super.toString());
+        stringBuilder.append(",monthsDuration=");
+        stringBuilder.append(this.getMonthsDuration());
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
+
+    @Override
+    public int compareTo(XPathYearMonthDuration o) {
+        if (o == null) {
+            return 1;
+        }
+        return Integer.compare(this.getMonthsDuration(), o.getMonthsDuration());
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/package-info.java
index f453f7b..e8c3a90 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/datatypes/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacml.std.datatypes contains implementations of the {@link com.att.research.xacml.api.DataType} interface
  * for standard XACML 3.0 data types.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAdvice.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAdvice.java
index 91a7fab..279df69 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAdvice.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAdvice.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,159 +48,159 @@
  * DOMAdvice provides a static method for creating an instance of the {@link com.att.research.xacml.Advice} interface from
  * a {@link org.w3c.dom.Node} representing a XACML 3.0 Advice element, and for creating a <code>List</code> of <code>Advice</code>
  * objects from a <code>Node</code> representing a XACML 3.0 AssociatedAdvice element.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public class DOMAdvice {
-        private static Log logger	= LogFactory.getLog(StdMutableAdvice.class);
-        
-        protected DOMAdvice() {
-        }
-        
-        /**
-         * Creates a new <code>Advice</code> by parsing the given <code>Node</code> representing a XACML Advice element.
-         * 
-         * @param nodeAdvice the <code>Node</code> representing a XACML Advice element
-         * @return a new <code>Advice</code> parsed from the given <code>Node</code>.
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static Advice newInstance(Node nodeAdvice) throws DOMStructureException {
-                Element	elementAdvice								= DOMUtil.getElement(nodeAdvice);
-                StdMutableAdvice mutableAdvice						= new StdMutableAdvice();
-                boolean bLenient									= DOMProperties.isLenient();
-                
-                mutableAdvice.setId(DOMUtil.getIdentifierAttribute(elementAdvice, XACML3.ATTRIBUTE_ADVICEID, !bLenient));
-                
-                NodeList children	= elementAdvice.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTEASSIGNMENT.equals(child.getLocalName())) {
-                                                        mutableAdvice.addAttributeAssignment(DOMAttributeAssignment.newInstance(child));
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeAdvice);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeAdvice);
-                                                }
-                                        }
-                                }
+    private static Log logger	= LogFactory.getLog(StdMutableAdvice.class);
+
+    protected DOMAdvice() {
+    }
+
+    /**
+     * Creates a new <code>Advice</code> by parsing the given <code>Node</code> representing a XACML Advice element.
+     *
+     * @param nodeAdvice the <code>Node</code> representing a XACML Advice element
+     * @return a new <code>Advice</code> parsed from the given <code>Node</code>.
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static Advice newInstance(Node nodeAdvice) throws DOMStructureException {
+        Element	elementAdvice								= DOMUtil.getElement(nodeAdvice);
+        StdMutableAdvice mutableAdvice						= new StdMutableAdvice();
+        boolean bLenient									= DOMProperties.isLenient();
+
+        mutableAdvice.setId(DOMUtil.getIdentifierAttribute(elementAdvice, XACML3.ATTRIBUTE_ADVICEID, !bLenient));
+
+        NodeList children	= elementAdvice.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTEASSIGNMENT.equals(child.getLocalName())) {
+                            mutableAdvice.addAttributeAssignment(DOMAttributeAssignment.newInstance(child));
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeAdvice);
+                            }
                         }
-                }
-                
-                return new StdAdvice(mutableAdvice);
-        }
-        
-        /**
-         * Repairs the given <code>Node</code> representing a XACML Advice element if possible.
-         * 
-         * @param nodeAdvice the <code>Node</code> to repair
-         * @return true if the node was altered, else false
-         * @throws DOMStructureException if an error occurred while repairing the <code>Node</code>
-         */
-        public static boolean repair(Node nodeAdvice) throws DOMStructureException {
-                Element elementAdvice	= DOMUtil.getElement(nodeAdvice);
-                boolean result			= false;
-                
-                result					= result || DOMUtil.repairIdentifierAttribute(elementAdvice, XACML3.ATTRIBUTE_ADVICEID, logger);
-                
-                NodeList children	= elementAdvice.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTEASSIGNMENT.equals(child.getLocalName())) {
-                                                        result	=  DOMAttributeAssignment.repair(child) || result;
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementAdvice.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementAdvice.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeAdvice);
                         }
+                    }
                 }
-                return result;
+            }
         }
-        
-        /**
-         * Creates a <code>List</code> of <code>Advice</code> by parsing the given <code>Node</code> representing a
-         * XACML AssociatedAdvice element.
-         * 
-         * @param nodeAssociatedAdvice the <code>Node</code> representing the XACML AssociatedAdvice element
-         * @return a <code>List</code> of <code>Advice</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static List<Advice> newList(Node nodeAssociatedAdvice) throws DOMStructureException {
-                Element elementAssociatedAdvice	= DOMUtil.getElement(nodeAssociatedAdvice);
-                List<Advice> listAdvice			= new ArrayList<Advice>();
-                boolean bLenient				= DOMProperties.isLenient();
-                
-                NodeList children				= elementAssociatedAdvice.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ADVICE.equals(child.getLocalName())) {
-                                                        listAdvice.add(DOMAdvice.newInstance(child));
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeAssociatedAdvice);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeAssociatedAdvice);
-                                                }
-                                        }
-                                }
+
+        return new StdAdvice(mutableAdvice);
+    }
+
+    /**
+     * Repairs the given <code>Node</code> representing a XACML Advice element if possible.
+     *
+     * @param nodeAdvice the <code>Node</code> to repair
+     * @return true if the node was altered, else false
+     * @throws DOMStructureException if an error occurred while repairing the <code>Node</code>
+     */
+    public static boolean repair(Node nodeAdvice) throws DOMStructureException {
+        Element elementAdvice	= DOMUtil.getElement(nodeAdvice);
+        boolean result			= false;
+
+        result					= result || DOMUtil.repairIdentifierAttribute(elementAdvice, XACML3.ATTRIBUTE_ADVICEID, logger);
+
+        NodeList children	= elementAdvice.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTEASSIGNMENT.equals(child.getLocalName())) {
+                            result	=  DOMAttributeAssignment.repair(child) || result;
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementAdvice.removeChild(child);
+                            result	= true;
                         }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementAdvice.removeChild(child);
+                        result	= true;
+                    }
                 }
-                return listAdvice;
+            }
         }
-        
-        public static boolean repairList(Node nodeAssociatedAdvice) throws DOMStructureException {
-                Element elementAssociatedAdvice	= DOMUtil.getElement(nodeAssociatedAdvice);
-                boolean result	= false;
-                NodeList children				= elementAssociatedAdvice.getChildNodes();
-                int numChildren;
-                
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ADVICE.equals(child.getLocalName())) {
-                                                        result	= repair(child) || result;
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementAssociatedAdvice.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementAssociatedAdvice.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+        return result;
+    }
+
+    /**
+     * Creates a <code>List</code> of <code>Advice</code> by parsing the given <code>Node</code> representing a
+     * XACML AssociatedAdvice element.
+     *
+     * @param nodeAssociatedAdvice the <code>Node</code> representing the XACML AssociatedAdvice element
+     * @return a <code>List</code> of <code>Advice</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static List<Advice> newList(Node nodeAssociatedAdvice) throws DOMStructureException {
+        Element elementAssociatedAdvice	= DOMUtil.getElement(nodeAssociatedAdvice);
+        List<Advice> listAdvice			= new ArrayList<Advice>();
+        boolean bLenient				= DOMProperties.isLenient();
+
+        NodeList children				= elementAssociatedAdvice.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ADVICE.equals(child.getLocalName())) {
+                            listAdvice.add(DOMAdvice.newInstance(child));
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeAssociatedAdvice);
+                            }
                         }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeAssociatedAdvice);
+                        }
+                    }
                 }
-                
-                return result;
+            }
         }
+        return listAdvice;
+    }
+
+    public static boolean repairList(Node nodeAssociatedAdvice) throws DOMStructureException {
+        Element elementAssociatedAdvice	= DOMUtil.getElement(nodeAssociatedAdvice);
+        boolean result	= false;
+        NodeList children				= elementAssociatedAdvice.getChildNodes();
+        int numChildren;
+
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ADVICE.equals(child.getLocalName())) {
+                            result	= repair(child) || result;
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementAssociatedAdvice.removeChild(child);
+                            result	= true;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementAssociatedAdvice.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttribute.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttribute.java
index 03b1cfa..2d2548c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttribute.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttribute.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,105 +44,105 @@
 
 /**
  * DOMAttribute extends {@link com.att.research.xacml.std.StdMutableAttribute} with methods for creation from DOM <code>Node</code>s.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMAttribute {
-        private static Log logger	= LogFactory.getLog(DOMAttribute.class);
-        
-        protected DOMAttribute() {
-                
-        }
-        
-        /**
-         * Creates a new <code>DOMAttribute</code> by parsing the given {@link org.w3c.dom.Node}.
-         * 
-         * @param category the {@link com.att.research.xacml.common.Identfier} for the category of the new <code>DOMAttribute</code>.
-         * @param nodeAttribute the <code>Node</code> for the <code>DOMAttribute</code>
-         * @return a new <code>DOMAttribute</code> parsed from the given <code>Node</code>.
-         * @throws IllegalArgumentException if there is an error converting the <code>Node</code> to a <code>DOMAttribute</code>
-         */
-        public static Attribute newInstance(Identifier category, Node nodeAttribute) throws DOMStructureException {
-                Element	elementAttribute				= DOMUtil.getElement(nodeAttribute);
-                boolean bLenient						= DOMProperties.isLenient();
-                StdMutableAttribute mutableAttribute	= new StdMutableAttribute();
-                
-                mutableAttribute.setCategory(category);
-                mutableAttribute.setAttributeId(DOMUtil.getIdentifierAttribute(nodeAttribute, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));
-                
-                NodeList children					= elementAttribute.getChildNodes();
-                int numChildren;
-                boolean sawAttributeValue			= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                        mutableAttribute.addValue(DOMAttributeValue.newInstance(child, category));
-                                                        sawAttributeValue	= true;
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeAttribute);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeAttribute);
-                                                }
-                                        }
-                                }
+    private static Log logger	= LogFactory.getLog(DOMAttribute.class);
+
+    protected DOMAttribute() {
+
+    }
+
+    /**
+     * Creates a new <code>DOMAttribute</code> by parsing the given {@link org.w3c.dom.Node}.
+     *
+     * @param category the {@link com.att.research.xacml.common.Identfier} for the category of the new <code>DOMAttribute</code>.
+     * @param nodeAttribute the <code>Node</code> for the <code>DOMAttribute</code>
+     * @return a new <code>DOMAttribute</code> parsed from the given <code>Node</code>.
+     * @throws IllegalArgumentException if there is an error converting the <code>Node</code> to a <code>DOMAttribute</code>
+     */
+    public static Attribute newInstance(Identifier category, Node nodeAttribute) throws DOMStructureException {
+        Element	elementAttribute				= DOMUtil.getElement(nodeAttribute);
+        boolean bLenient						= DOMProperties.isLenient();
+        StdMutableAttribute mutableAttribute	= new StdMutableAttribute();
+
+        mutableAttribute.setCategory(category);
+        mutableAttribute.setAttributeId(DOMUtil.getIdentifierAttribute(nodeAttribute, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));
+
+        NodeList children					= elementAttribute.getChildNodes();
+        int numChildren;
+        boolean sawAttributeValue			= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                            mutableAttribute.addValue(DOMAttributeValue.newInstance(child, category));
+                            sawAttributeValue	= true;
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeAttribute);
+                            }
                         }
-                }
-                
-                if (!sawAttributeValue && !bLenient) {
-                        throw DOMUtil.newMissingElementException(nodeAttribute, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
-                }
-                
-                mutableAttribute.setIssuer(DOMUtil.getStringAttribute(nodeAttribute, XACML3.ATTRIBUTE_ISSUER));
-                mutableAttribute.setIncludeInResults(DOMUtil.getBooleanAttribute(elementAttribute, XACML3.ATTRIBUTE_INCLUDEINRESULT, !bLenient));
-                
-                return new StdAttribute(mutableAttribute);
-        }
-        
-        public static boolean repair(Node nodeAttribute) throws DOMStructureException {
-                Element	elementAttribute	= DOMUtil.getElement(nodeAttribute);
-                boolean result				= false;
-                
-                result						= DOMUtil.repairIdentifierAttribute(elementAttribute, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
-                result						= DOMUtil.repairBooleanAttribute(elementAttribute, XACML3.ATTRIBUTE_INCLUDEINRESULT, false, logger) || result;
-                
-                NodeList children					= elementAttribute.getChildNodes();
-                int numChildren;
-                boolean sawAttributeValue			= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                        result	= DOMAttributeValue.repair(child) || result;
-                                                        sawAttributeValue	= true;
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementAttribute.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementAttribute.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeAttribute);
                         }
+                    }
                 }
-                
-                if (!sawAttributeValue) {
-                        throw new DOMStructureException(DOMUtil.newMissingAttributeException(elementAttribute, XACML3.ELEMENT_ATTRIBUTEVALUE));
-                }
-                
-                return result;
+            }
         }
 
+        if (!sawAttributeValue && !bLenient) {
+            throw DOMUtil.newMissingElementException(nodeAttribute, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTEVALUE);
+        }
+
+        mutableAttribute.setIssuer(DOMUtil.getStringAttribute(nodeAttribute, XACML3.ATTRIBUTE_ISSUER));
+        mutableAttribute.setIncludeInResults(DOMUtil.getBooleanAttribute(elementAttribute, XACML3.ATTRIBUTE_INCLUDEINRESULT, !bLenient));
+
+        return new StdAttribute(mutableAttribute);
+    }
+
+    public static boolean repair(Node nodeAttribute) throws DOMStructureException {
+        Element	elementAttribute	= DOMUtil.getElement(nodeAttribute);
+        boolean result				= false;
+
+        result						= DOMUtil.repairIdentifierAttribute(elementAttribute, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
+        result						= DOMUtil.repairBooleanAttribute(elementAttribute, XACML3.ATTRIBUTE_INCLUDEINRESULT, false, logger) || result;
+
+        NodeList children					= elementAttribute.getChildNodes();
+        int numChildren;
+        boolean sawAttributeValue			= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                            result	= DOMAttributeValue.repair(child) || result;
+                            sawAttributeValue	= true;
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementAttribute.removeChild(child);
+                            result	= true;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementAttribute.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+
+        if (!sawAttributeValue) {
+            throw new DOMStructureException(DOMUtil.newMissingAttributeException(elementAttribute, XACML3.ELEMENT_ATTRIBUTEVALUE));
+        }
+
+        return result;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeAssignment.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeAssignment.java
index 2689686..88b201f 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeAssignment.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeAssignment.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,83 +47,83 @@
 import com.att.research.xacml.util.FactoryException;
 
 public class DOMAttributeAssignment {
-        private static final Log logger	= LogFactory.getLog(DOMAttributeAssignment.class);
-        
-        protected DOMAttributeAssignment() {
+    private static final Log logger	= LogFactory.getLog(DOMAttributeAssignment.class);
+
+    protected DOMAttributeAssignment() {
+    }
+
+    /**
+     * Creates a new <code>DOMAttributeAssignment</code> from the given <code>Node</code> by parsing it as a XACML 3.0 AttributeAssignment element.
+     *
+     * @param nodeAttributeAssignment the root <code>Node</code> of the AttributeAssignment element
+     * @return a new <code>DOMAttributeAssignment</code> parsed from the given AttributeAssignment <code>Node</code>
+     * @throws IllegalArgumentException
+     */
+    public static AttributeAssignment newInstance(Node nodeAttributeAssignment) throws DOMStructureException {
+        Element	elementAttributeAssignment							= DOMUtil.getElement(nodeAttributeAssignment);
+        boolean bLenient											= DOMProperties.isLenient();
+        StdMutableAttributeAssignment mutableAttributeAssignment	= new StdMutableAttributeAssignment();
+
+        mutableAttributeAssignment.setAttributeId(DOMUtil.getIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));
+        Identifier	identifierDataTypeId	= DOMUtil.getIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_DATATYPE, !bLenient);
+        DataTypeFactory dataTypeFactory		= null;
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+            if (dataTypeFactory == null) {
+                throw new DOMStructureException("Failed to get DataTypeFactory");
+            }
+        } catch (FactoryException ex) {
+            throw new DOMStructureException("FactoryException loading DataTypeFactory: " + ex.getMessage(), ex);
         }
-        
-        /**
-         * Creates a new <code>DOMAttributeAssignment</code> from the given <code>Node</code> by parsing it as a XACML 3.0 AttributeAssignment element.
-         * 
-         * @param nodeAttributeAssignment the root <code>Node</code> of the AttributeAssignment element
-         * @return a new <code>DOMAttributeAssignment</code> parsed from the given AttributeAssignment <code>Node</code>
-         * @throws IllegalArgumentException
-         */
-        public static AttributeAssignment newInstance(Node nodeAttributeAssignment) throws DOMStructureException {
-                Element	elementAttributeAssignment							= DOMUtil.getElement(nodeAttributeAssignment);
-                boolean bLenient											= DOMProperties.isLenient();
-                StdMutableAttributeAssignment mutableAttributeAssignment	= new StdMutableAttributeAssignment();
-                
-                mutableAttributeAssignment.setAttributeId(DOMUtil.getIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));		
-                Identifier	identifierDataTypeId	= DOMUtil.getIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_DATATYPE, !bLenient);
-                DataTypeFactory dataTypeFactory		= null;
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                        if (dataTypeFactory == null) {
-                                throw new DOMStructureException("Failed to get DataTypeFactory");
-                        }
-                } catch (FactoryException ex) {
-                        throw new DOMStructureException("FactoryException loading DataTypeFactory: " + ex.getMessage(), ex);
-                }
-                DataType<?> dataType				= dataTypeFactory.getDataType(identifierDataTypeId);
-                if (dataType == null) {
-                        throw new DOMStructureException(elementAttributeAssignment, "Unknown dataType \"" + identifierDataTypeId.toString() + "\" in \"" + DOMUtil.getNodeLabel(elementAttributeAssignment));
-                }
-                
-                AttributeValue<?> attributeValue	= null;
-                try {
-                        attributeValue	= dataType.createAttributeValue(elementAttributeAssignment);
-                } catch (DataTypeException ex) {
-                        if (!bLenient) {
-                                throw new DOMStructureException("DataTypeException creating AttributeValue from \"" + DOMUtil.getNodeLabel(elementAttributeAssignment) + "\" contents", ex);
-                        }
-                }
-                if (attributeValue == null && !bLenient) {
-                        throw new DOMStructureException(elementAttributeAssignment, "Failed to create AttributeValue from \"" + DOMUtil.getNodeLabel(elementAttributeAssignment) + "\" contents");
-                }
-                mutableAttributeAssignment.setAttributeValue(attributeValue);
-                
-                mutableAttributeAssignment.setCategory(DOMUtil.getIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_CATEGORY));
-                mutableAttributeAssignment.setIssuer(DOMUtil.getStringAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_ISSUER));
-                
-                return new StdAttributeAssignment(mutableAttributeAssignment);		
+        DataType<?> dataType				= dataTypeFactory.getDataType(identifierDataTypeId);
+        if (dataType == null) {
+            throw new DOMStructureException(elementAttributeAssignment, "Unknown dataType \"" + identifierDataTypeId.toString() + "\" in \"" + DOMUtil.getNodeLabel(elementAttributeAssignment));
         }
-        
-        public static boolean repair(Node nodeAttributeAssignment) throws DOMStructureException {
-                Element	elementAttributeAssignment	= DOMUtil.getElement(nodeAttributeAssignment);
-                boolean result						= false;
-                
-                result								= DOMUtil.repairIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
-                result								= DOMUtil.repairIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
-                
-                DataTypeFactory dataTypeFactory		= null;
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                        if (dataTypeFactory == null) {
-                                throw new DOMStructureException("Failed to get DataTypeFactory");
-                        }
-                } catch (FactoryException ex) {
-                        throw new DOMStructureException("FactoryException loading DataTypeFactory: " + ex.getMessage(), ex);
-                }
-                Identifier identifierDataType	= DOMUtil.getIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_DATATYPE);
-                DataType<?> dataType	= dataTypeFactory.getDataType(identifierDataType);
-                if (dataType == null) {
-                        logger.warn("Changing unknown DataType " + identifierDataType.stringValue() + " to " + XACML3.ID_DATATYPE_STRING.stringValue());
-                        elementAttributeAssignment.setAttribute(XACML3.ATTRIBUTE_DATATYPE, XACML3.ID_DATATYPE_STRING.stringValue());
-                        result	= true;
-                }
-                
-                return result;
+
+        AttributeValue<?> attributeValue	= null;
+        try {
+            attributeValue	= dataType.createAttributeValue(elementAttributeAssignment);
+        } catch (DataTypeException ex) {
+            if (!bLenient) {
+                throw new DOMStructureException("DataTypeException creating AttributeValue from \"" + DOMUtil.getNodeLabel(elementAttributeAssignment) + "\" contents", ex);
+            }
         }
+        if (attributeValue == null && !bLenient) {
+            throw new DOMStructureException(elementAttributeAssignment, "Failed to create AttributeValue from \"" + DOMUtil.getNodeLabel(elementAttributeAssignment) + "\" contents");
+        }
+        mutableAttributeAssignment.setAttributeValue(attributeValue);
+
+        mutableAttributeAssignment.setCategory(DOMUtil.getIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_CATEGORY));
+        mutableAttributeAssignment.setIssuer(DOMUtil.getStringAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_ISSUER));
+
+        return new StdAttributeAssignment(mutableAttributeAssignment);
+    }
+
+    public static boolean repair(Node nodeAttributeAssignment) throws DOMStructureException {
+        Element	elementAttributeAssignment	= DOMUtil.getElement(nodeAttributeAssignment);
+        boolean result						= false;
+
+        result								= DOMUtil.repairIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
+        result								= DOMUtil.repairIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
+
+        DataTypeFactory dataTypeFactory		= null;
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+            if (dataTypeFactory == null) {
+                throw new DOMStructureException("Failed to get DataTypeFactory");
+            }
+        } catch (FactoryException ex) {
+            throw new DOMStructureException("FactoryException loading DataTypeFactory: " + ex.getMessage(), ex);
+        }
+        Identifier identifierDataType	= DOMUtil.getIdentifierAttribute(elementAttributeAssignment, XACML3.ATTRIBUTE_DATATYPE);
+        DataType<?> dataType	= dataTypeFactory.getDataType(identifierDataType);
+        if (dataType == null) {
+            logger.warn("Changing unknown DataType " + identifierDataType.stringValue() + " to " + XACML3.ID_DATATYPE_STRING.stringValue());
+            elementAttributeAssignment.setAttribute(XACML3.ATTRIBUTE_DATATYPE, XACML3.ID_DATATYPE_STRING.stringValue());
+            result	= true;
+        }
+
+        return result;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeCategory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeCategory.java
index c1df9ea..3cea0d8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeCategory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeCategory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,86 +48,86 @@
 /**
  * DOMAttributeCategory extends {@link com.att.research.xacml.std.StdAttributeCategory} with methods for creation
  * from DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMAttributeCategory {
-        private static final Log logger	= LogFactory.getLog(DOMAttributeCategory.class);
-        
-        protected DOMAttributeCategory() {
-        }
-        
-        /**
-         * Creates a new <code>DOMAttributeCategory</code> by parsing the given <code>Node</code> as a XACML Attributes element.
-         * 
-         * @param nodeAttributeCategory the root <code>Node</code>
-         * @return a new <code>DOMAttributeCategory</code> parsed from the given <code>Node</code>.
-         * @throws DOMStructureException if the <code>Node</code> cannot be converted to a <code>DOMAttributeCategory</code>>
-         */
-        public static AttributeCategory newInstance(Node nodeAttributeCategory) throws DOMStructureException {
-                Element	elementAttributeCategory			= DOMUtil.getElement(nodeAttributeCategory);
-                boolean bLenient							= DOMProperties.isLenient();
-                
-                Identifier identifierCategory	= DOMUtil.getIdentifierAttribute(nodeAttributeCategory, XACML3.ATTRIBUTE_CATEGORY, !bLenient);
-                List<Attribute> listAttributes	= new ArrayList<Attribute>();
-                
-                NodeList children							= elementAttributeCategory.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTE.equals(child.getLocalName())) {
-                                                        listAttributes.add(DOMAttribute.newInstance(identifierCategory, child));
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeAttributeCategory);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeAttributeCategory);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMAttributeCategory.class);
+
+    protected DOMAttributeCategory() {
+    }
+
+    /**
+     * Creates a new <code>DOMAttributeCategory</code> by parsing the given <code>Node</code> as a XACML Attributes element.
+     *
+     * @param nodeAttributeCategory the root <code>Node</code>
+     * @return a new <code>DOMAttributeCategory</code> parsed from the given <code>Node</code>.
+     * @throws DOMStructureException if the <code>Node</code> cannot be converted to a <code>DOMAttributeCategory</code>>
+     */
+    public static AttributeCategory newInstance(Node nodeAttributeCategory) throws DOMStructureException {
+        Element	elementAttributeCategory			= DOMUtil.getElement(nodeAttributeCategory);
+        boolean bLenient							= DOMProperties.isLenient();
+
+        Identifier identifierCategory	= DOMUtil.getIdentifierAttribute(nodeAttributeCategory, XACML3.ATTRIBUTE_CATEGORY, !bLenient);
+        List<Attribute> listAttributes	= new ArrayList<Attribute>();
+
+        NodeList children							= elementAttributeCategory.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTE.equals(child.getLocalName())) {
+                            listAttributes.add(DOMAttribute.newInstance(identifierCategory, child));
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeAttributeCategory);
+                            }
                         }
-                }
-                
-                return new StdAttributeCategory(identifierCategory, listAttributes);
-        }
-        
-        public static boolean repair(Node nodeAttributeCategory) throws DOMStructureException {
-                Element	elementAttributeCategory	= DOMUtil.getElement(nodeAttributeCategory);
-                boolean result						= false;
-                
-                result								= DOMUtil.repairIdentifierAttribute(elementAttributeCategory, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
-                
-                NodeList children							= elementAttributeCategory.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTE.equals(child.getLocalName())) {
-                                                        result	= DOMAttribute.repair(child) || result;
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementAttributeCategory.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementAttributeCategory.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeAttributeCategory);
                         }
+                    }
                 }
-        
-                return result;
+            }
         }
 
+        return new StdAttributeCategory(identifierCategory, listAttributes);
+    }
+
+    public static boolean repair(Node nodeAttributeCategory) throws DOMStructureException {
+        Element	elementAttributeCategory	= DOMUtil.getElement(nodeAttributeCategory);
+        boolean result						= false;
+
+        result								= DOMUtil.repairIdentifierAttribute(elementAttributeCategory, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
+
+        NodeList children							= elementAttributeCategory.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTE.equals(child.getLocalName())) {
+                            result	= DOMAttribute.repair(child) || result;
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementAttributeCategory.removeChild(child);
+                            result	= true;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementAttributeCategory.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+
+        return result;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeValue.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeValue.java
index 94b4031..6ba6df9 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeValue.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMAttributeValue.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,85 +48,85 @@
 
 /**
  * DOMAttributeValue extends {@link com.att.research.xacml.std.StdAttributeValue} with methods for creation from DOM elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
- * 
+ *
  * @param <T> the Java type implementing the value for the Attribute
  */
 public class DOMAttributeValue<T> extends StdAttributeValue<T> {
-        private static Log logger	= LogFactory.getLog(DOMAttributeValue.class);
-        
-        protected DOMAttributeValue(Identifier dataTypeIdIn, T valueIn) {
-                super(dataTypeIdIn, valueIn);
-        }
-        
-        public static AttributeValue<?> newInstance(Node nodeAttributeValue, Identifier category) throws DOMStructureException {
-                repair(nodeAttributeValue);
-                
-                Element	elementAttributeValue	= DOMUtil.getElement(nodeAttributeValue);
-                boolean bLenient				= DOMProperties.isLenient();
-                
-                Identifier	identifierDataTypeId	= DOMUtil.getIdentifierAttribute(elementAttributeValue, XACML3.ATTRIBUTE_DATATYPE, !bLenient);
-                
-                DataTypeFactory dataTypeFactory		= null;
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                        if (dataTypeFactory == null) {
-                                throw new DOMStructureException("Failed to get DataTypeFactory");
-                        }
-                } catch (FactoryException ex) {
-                        throw new DOMStructureException("FactoryException loading DataTypeFactory: " + ex.getMessage(), ex);
-                }
-                DataType<?> dataTypeExtended	= dataTypeFactory.getDataType(identifierDataTypeId);
-                if (dataTypeExtended == null) {
-                        throw new DOMStructureException(elementAttributeValue, "Unknown dataTypeId \"" + identifierDataTypeId.toString() + "\" in \"" + DOMUtil.getNodeLabel(nodeAttributeValue));
-                }
-                AttributeValue<?> attributeValue	= null;
-                try {
-                        attributeValue	= dataTypeExtended.createAttributeValue(elementAttributeValue);
-                        if (!bLenient && attributeValue != null && attributeValue.getXPathCategory() != null && category != null && !category.equals(attributeValue.getXPathCategory())) {
-                                throw new DOMStructureException(elementAttributeValue, "AttributeValue XPathCategory does not match " + category.stringValue());
-                        }
-                } catch (DataTypeException ex) {
-                        throw new DOMStructureException("Unable to convert \"" + DOMUtil.getNodeLabel(nodeAttributeValue) + "\" to \"" + identifierDataTypeId.toString() + "\"");
-                }
-                return attributeValue;
-        }
-        
-        public static boolean repair(Node nodeAttributeValue) throws DOMStructureException {
-                Element	elementAttributeValue	= DOMUtil.getElement(nodeAttributeValue);
-                boolean result					= false;
-                
-                result							= DOMUtil.repairIdentifierAttribute(elementAttributeValue, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
-                Identifier identifierDataTypeId	= DOMUtil.getIdentifierAttribute(elementAttributeValue, XACML3.ATTRIBUTE_DATATYPE);
-                try {
-                        DataTypeFactory dataTypeFactory	= DataTypeFactory.newInstance();
-                        DataType<?> dataTypeExtended	= dataTypeFactory.getDataType(identifierDataTypeId);
+    private static Log logger	= LogFactory.getLog(DOMAttributeValue.class);
 
-                        if (dataTypeExtended == null) {
-                                if (identifierDataTypeId.equals(XACML.ID_DATATYPE_WD_DAYTIMEDURATION)) {
-                                        dataTypeExtended	= DataTypes.DT_DAYTIMEDURATION;
-                                } else if (identifierDataTypeId.equals(XACML.ID_DATATYPE_WD_YEARMONTHDURATION)) {
-                                        dataTypeExtended	= DataTypes.DT_YEARMONTHDURATION;
-                                } else {
-                                        dataTypeExtended	= DataTypes.DT_STRING;
-                                }
-                                logger.warn("Changing unknown DataType " + identifierDataTypeId.stringValue() + " to " + dataTypeExtended.getId().stringValue());
-                                elementAttributeValue.setAttribute(XACML3.ATTRIBUTE_DATATYPE, dataTypeExtended.getId().stringValue());
-                                result				= true;
-                        }
-                        dataTypeExtended.createAttributeValue(nodeAttributeValue);
-                        
-                        if (result == true) {
-                                // reset the DataType attribute of the node
-                                nodeAttributeValue.getAttributes().getNamedItem("DataType").setNodeValue(dataTypeExtended.getId().stringValue());
-                        }
+    protected DOMAttributeValue(Identifier dataTypeIdIn, T valueIn) {
+        super(dataTypeIdIn, valueIn);
+    }
 
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Unable to convert \"" + DOMUtil.getNodeLabel(nodeAttributeValue) + "\" to \"" + identifierDataTypeId.toString() + "\"");
-                }
-                return result;
+    public static AttributeValue<?> newInstance(Node nodeAttributeValue, Identifier category) throws DOMStructureException {
+        repair(nodeAttributeValue);
+
+        Element	elementAttributeValue	= DOMUtil.getElement(nodeAttributeValue);
+        boolean bLenient				= DOMProperties.isLenient();
+
+        Identifier	identifierDataTypeId	= DOMUtil.getIdentifierAttribute(elementAttributeValue, XACML3.ATTRIBUTE_DATATYPE, !bLenient);
+
+        DataTypeFactory dataTypeFactory		= null;
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+            if (dataTypeFactory == null) {
+                throw new DOMStructureException("Failed to get DataTypeFactory");
+            }
+        } catch (FactoryException ex) {
+            throw new DOMStructureException("FactoryException loading DataTypeFactory: " + ex.getMessage(), ex);
         }
+        DataType<?> dataTypeExtended	= dataTypeFactory.getDataType(identifierDataTypeId);
+        if (dataTypeExtended == null) {
+            throw new DOMStructureException(elementAttributeValue, "Unknown dataTypeId \"" + identifierDataTypeId.toString() + "\" in \"" + DOMUtil.getNodeLabel(nodeAttributeValue));
+        }
+        AttributeValue<?> attributeValue	= null;
+        try {
+            attributeValue	= dataTypeExtended.createAttributeValue(elementAttributeValue);
+            if (!bLenient && attributeValue != null && attributeValue.getXPathCategory() != null && category != null && !category.equals(attributeValue.getXPathCategory())) {
+                throw new DOMStructureException(elementAttributeValue, "AttributeValue XPathCategory does not match " + category.stringValue());
+            }
+        } catch (DataTypeException ex) {
+            throw new DOMStructureException("Unable to convert \"" + DOMUtil.getNodeLabel(nodeAttributeValue) + "\" to \"" + identifierDataTypeId.toString() + "\"");
+        }
+        return attributeValue;
+    }
+
+    public static boolean repair(Node nodeAttributeValue) throws DOMStructureException {
+        Element	elementAttributeValue	= DOMUtil.getElement(nodeAttributeValue);
+        boolean result					= false;
+
+        result							= DOMUtil.repairIdentifierAttribute(elementAttributeValue, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
+        Identifier identifierDataTypeId	= DOMUtil.getIdentifierAttribute(elementAttributeValue, XACML3.ATTRIBUTE_DATATYPE);
+        try {
+            DataTypeFactory dataTypeFactory	= DataTypeFactory.newInstance();
+            DataType<?> dataTypeExtended	= dataTypeFactory.getDataType(identifierDataTypeId);
+
+            if (dataTypeExtended == null) {
+                if (identifierDataTypeId.equals(XACML.ID_DATATYPE_WD_DAYTIMEDURATION)) {
+                    dataTypeExtended	= DataTypes.DT_DAYTIMEDURATION;
+                } else if (identifierDataTypeId.equals(XACML.ID_DATATYPE_WD_YEARMONTHDURATION)) {
+                    dataTypeExtended	= DataTypes.DT_YEARMONTHDURATION;
+                } else {
+                    dataTypeExtended	= DataTypes.DT_STRING;
+                }
+                logger.warn("Changing unknown DataType " + identifierDataTypeId.stringValue() + " to " + dataTypeExtended.getId().stringValue());
+                elementAttributeValue.setAttribute(XACML3.ATTRIBUTE_DATATYPE, dataTypeExtended.getId().stringValue());
+                result				= true;
+            }
+            dataTypeExtended.createAttributeValue(nodeAttributeValue);
+
+            if (result == true) {
+                // reset the DataType attribute of the node
+                nodeAttributeValue.getAttributes().getNamedItem("DataType").setNodeValue(dataTypeExtended.getId().stringValue());
+            }
+
+        } catch (Exception ex) {
+            throw new DOMStructureException("Unable to convert \"" + DOMUtil.getNodeLabel(nodeAttributeValue) + "\" to \"" + identifierDataTypeId.toString() + "\"");
+        }
+        return result;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMDocumentRepair.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMDocumentRepair.java
index b0badc3..c5048a8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMDocumentRepair.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMDocumentRepair.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,59 +38,59 @@
 /**
  * DOMDocumentRepair provides methods for examining a DOM {@link org.w3c.dom.Document} for XACML document types and doing repair on them.
  * This class supports XACML Request and Response documents.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DOMDocumentRepair {
-        public static class UnsupportedDocumentTypeException extends Exception {
-                private static final long serialVersionUID = -1845303652188504199L;
-                
-                public UnsupportedDocumentTypeException(String message) {
-                        super(message);
-                }
-                
-                public UnsupportedDocumentTypeException(String message, Throwable cause) {
-                        super(message, cause);
-                }
+    public static class UnsupportedDocumentTypeException extends Exception {
+        private static final long serialVersionUID = -1845303652188504199L;
+
+        public UnsupportedDocumentTypeException(String message) {
+            super(message);
         }
-        
-        public DOMDocumentRepair() {
+
+        public UnsupportedDocumentTypeException(String message, Throwable cause) {
+            super(message, cause);
         }
-        
-        protected boolean repairRequest(Node nodeRequest) throws DOMStructureException {
-                return DOMRequest.repair(nodeRequest);
+    }
+
+    public DOMDocumentRepair() {
+    }
+
+    protected boolean repairRequest(Node nodeRequest) throws DOMStructureException {
+        return DOMRequest.repair(nodeRequest);
+    }
+
+    protected boolean repairResponse(Node nodeResponse) throws DOMStructureException {
+        return DOMResponse.repair(nodeResponse);
+    }
+
+    /**
+     * Determines what kind of XACML document is represented by the given <code>Document</code> and
+     * attempts to repair it.
+     *
+     * @param document the <code>Document</code> to check
+     * @return true if any repairs were made in the <code>Document</code>, else false
+     * @throws DOMStructureException if there were unrecoverable errors found
+     * @throws com.att.research.xacml.std.dom.DOMDocumentRepair.UnsupportedDocumentTypeException if the root element is not a XACML Request or Response.
+     */
+    public boolean repair(Document document) throws DOMStructureException, UnsupportedDocumentTypeException {
+        Node firstChild	= DOMUtil.getFirstChildElement(document);
+        if (firstChild == null || !DOMUtil.isElement(firstChild)) {
+            return false;
         }
-        
-        protected boolean repairResponse(Node nodeResponse) throws DOMStructureException {
-                return DOMResponse.repair(nodeResponse);
+
+        if (!DOMUtil.isInNamespace(firstChild, XACML3.XMLNS)) {
+            throw new UnsupportedDocumentTypeException("Not a XACML document: " + DOMUtil.getNodeLabel(firstChild));
         }
-        
-        /**
-         * Determines what kind of XACML document is represented by the given <code>Document</code> and
-         * attempts to repair it.
-         * 
-         * @param document the <code>Document</code> to check
-         * @return true if any repairs were made in the <code>Document</code>, else false
-         * @throws DOMStructureException if there were unrecoverable errors found
-         * @throws com.att.research.xacml.std.dom.DOMDocumentRepair.UnsupportedDocumentTypeException if the root element is not a XACML Request or Response.
-         */
-        public boolean repair(Document document) throws DOMStructureException, UnsupportedDocumentTypeException {
-                Node firstChild	= DOMUtil.getFirstChildElement(document);
-                if (firstChild == null || !DOMUtil.isElement(firstChild)) {
-                        return false;
-                }
-                
-                if (!DOMUtil.isInNamespace(firstChild, XACML3.XMLNS)) {
-                        throw new UnsupportedDocumentTypeException("Not a XACML document: " + DOMUtil.getNodeLabel(firstChild));
-                }
-                if (XACML3.ELEMENT_REQUEST.equals(firstChild.getLocalName())) {
-                        return this.repairRequest(firstChild);
-                } else if (XACML3.ELEMENT_RESPONSE.equals(firstChild.getLocalName())) {
-                        return this.repairResponse(firstChild);
-                } else {
-                        throw new UnsupportedDocumentTypeException("Not a XACML Request or Response: " + DOMUtil.getNodeLabel(firstChild));
-                }
+        if (XACML3.ELEMENT_REQUEST.equals(firstChild.getLocalName())) {
+            return this.repairRequest(firstChild);
+        } else if (XACML3.ELEMENT_RESPONSE.equals(firstChild.getLocalName())) {
+            return this.repairResponse(firstChild);
+        } else {
+            throw new UnsupportedDocumentTypeException("Not a XACML Request or Response: " + DOMUtil.getNodeLabel(firstChild));
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMIdReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMIdReference.java
index bd34aa8..bb7784c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMIdReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMIdReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,61 +47,61 @@
 /**
  * DOMIdReference extends {@link com.att.research.xacml.std.StdIdReference} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMIdReference extends StdIdReference {
-        private static Log logger	= LogFactory.getLog(DOMIdReference.class);
-        protected DOMIdReference(Identifier idReferenceIn, Version versionIn) {
-                super(idReferenceIn, versionIn);
-        }
-        
-        /**
-         * Creates a new <code>IdReference</code> by parsing the given <code>Node</code> as a XACML "IdReferenceType" element.
-         * 
-         * @param nodeIdReference the <code>Node</code> to parse
-         * @return a new <code>IDReference</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static IdReference newInstance(Node nodeIdReference) throws DOMStructureException {
-                Element	elementIdReference	= DOMUtil.getElement(nodeIdReference);
-                boolean bLenient			= DOMProperties.isLenient();
-                
-                Identifier idReference		= DOMUtil.getIdentifierContent(elementIdReference, !bLenient);
-                
-                String versionString			= DOMUtil.getStringAttribute(elementIdReference, XACML3.ATTRIBUTE_VERSION);
-                Version version					= null;
-                if (versionString != null) {
-                        try {
-                                version	= StdVersion.newInstance(versionString);
-                        } catch (ParseException ex) {
-                                if (!bLenient) {
-                                        throw new DOMStructureException(nodeIdReference, "Invalid version \"" + versionString + "\" in \"" + DOMUtil.getNodeLabel(nodeIdReference) + "\"");
-                                }
-                        }
+    private static Log logger	= LogFactory.getLog(DOMIdReference.class);
+    protected DOMIdReference(Identifier idReferenceIn, Version versionIn) {
+        super(idReferenceIn, versionIn);
+    }
+
+    /**
+     * Creates a new <code>IdReference</code> by parsing the given <code>Node</code> as a XACML "IdReferenceType" element.
+     *
+     * @param nodeIdReference the <code>Node</code> to parse
+     * @return a new <code>IDReference</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static IdReference newInstance(Node nodeIdReference) throws DOMStructureException {
+        Element	elementIdReference	= DOMUtil.getElement(nodeIdReference);
+        boolean bLenient			= DOMProperties.isLenient();
+
+        Identifier idReference		= DOMUtil.getIdentifierContent(elementIdReference, !bLenient);
+
+        String versionString			= DOMUtil.getStringAttribute(elementIdReference, XACML3.ATTRIBUTE_VERSION);
+        Version version					= null;
+        if (versionString != null) {
+            try {
+                version	= StdVersion.newInstance(versionString);
+            } catch (ParseException ex) {
+                if (!bLenient) {
+                    throw new DOMStructureException(nodeIdReference, "Invalid version \"" + versionString + "\" in \"" + DOMUtil.getNodeLabel(nodeIdReference) + "\"");
                 }
-                
-                return new DOMIdReference(idReference, version);
-        }	
-        
-        public static boolean repair(Node nodeIdReference) throws DOMStructureException {
-                Element	elementIdReference	= DOMUtil.getElement(nodeIdReference);
-                boolean result				= false;
-                
-                result						= DOMUtil.repairIdentifierContent(elementIdReference, logger) || result;
-                
-                String versionString			= DOMUtil.getStringAttribute(elementIdReference, XACML3.ATTRIBUTE_VERSION);
-                if (versionString != null) {
-                        try {
-                                StdVersion.newInstance(versionString);
-                        } catch (ParseException ex) {
-                                logger.warn("Deleting invalid Version string " + versionString , ex);
-                                elementIdReference.removeAttribute(XACML3.ATTRIBUTE_VERSION);
-                                result	= true;
-                        }
-                }
-                
-                return result;
+            }
         }
+
+        return new DOMIdReference(idReference, version);
+    }
+
+    public static boolean repair(Node nodeIdReference) throws DOMStructureException {
+        Element	elementIdReference	= DOMUtil.getElement(nodeIdReference);
+        boolean result				= false;
+
+        result						= DOMUtil.repairIdentifierContent(elementIdReference, logger) || result;
+
+        String versionString			= DOMUtil.getStringAttribute(elementIdReference, XACML3.ATTRIBUTE_VERSION);
+        if (versionString != null) {
+            try {
+                StdVersion.newInstance(versionString);
+            } catch (ParseException ex) {
+                logger.warn("Deleting invalid Version string " + versionString , ex);
+                elementIdReference.removeAttribute(XACML3.ATTRIBUTE_VERSION);
+                result	= true;
+            }
+        }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMIdReferenceMatch.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMIdReferenceMatch.java
index d5921c5..77d7a56 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMIdReferenceMatch.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMIdReferenceMatch.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,71 +47,71 @@
 /**
  * DOMIdReferenceMatch extends {@link com.att.research.xacml.std.StdIdReferenceMatch} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMIdReferenceMatch extends StdIdReferenceMatch {
-        private static final Log logger	= LogFactory.getLog(DOMIdReferenceMatch.class);
-        
-        protected DOMIdReferenceMatch(Identifier idIn, VersionMatch versionIn, VersionMatch earliestVersionIn, VersionMatch latestVersionIn) {
-                super(idIn, versionIn, earliestVersionIn, latestVersionIn);
+    private static final Log logger	= LogFactory.getLog(DOMIdReferenceMatch.class);
+
+    protected DOMIdReferenceMatch(Identifier idIn, VersionMatch versionIn, VersionMatch earliestVersionIn, VersionMatch latestVersionIn) {
+        super(idIn, versionIn, earliestVersionIn, latestVersionIn);
+    }
+
+    public static IdReferenceMatch newInstance(Node nodeIdReferenceMatch) throws DOMStructureException {
+        Element	elementIdReferenceMatch		= DOMUtil.getElement(nodeIdReferenceMatch);
+        boolean bLenient					= DOMProperties.isLenient();
+
+        Identifier	idReferenceMatch		= DOMUtil.getIdentifierContent(elementIdReferenceMatch, !bLenient);
+
+        String versionString			= DOMUtil.getStringAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_VERSION);
+        String versionEarliestString	= DOMUtil.getStringAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_EARLIESTVERSION);
+        String versionLatestString		= DOMUtil.getStringAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_LATESTVERSION);
+
+        VersionMatch version			= null;
+        VersionMatch versionEarliest	= null;
+        VersionMatch versionLatest		= null;
+
+        if (versionString != null) {
+            try {
+                version	= StdVersionMatch.newInstance(versionString);
+            } catch (ParseException ex) {
+                if (!bLenient) {
+                    throw new DOMStructureException(nodeIdReferenceMatch, "Invalid " + XACML3.ATTRIBUTE_VERSION + " string \"" + versionString + "\" in \"" + DOMUtil.getNodeLabel(nodeIdReferenceMatch), ex);
+                }
+            }
+        }
+        if (versionEarliestString != null) {
+            try {
+                versionEarliest = StdVersionMatch.newInstance(versionEarliestString);
+            } catch (ParseException ex) {
+                if (!bLenient) {
+                    throw new DOMStructureException(nodeIdReferenceMatch, "Invalid " + XACML3.ATTRIBUTE_EARLIESTVERSION + " string \"" + versionEarliestString + "\" in \"" + DOMUtil.getNodeLabel(nodeIdReferenceMatch), ex);
+                }
+            }
+        }
+        if (versionLatestString != null) {
+            try {
+                versionLatest = StdVersionMatch.newInstance(versionLatestString);
+            } catch (ParseException ex) {
+                if (!bLenient) {
+                    throw new DOMStructureException(nodeIdReferenceMatch, "Invalid " + XACML3.ATTRIBUTE_LATESTVERSION + " string \"" + versionLatestString + "\" in \"" + DOMUtil.getNodeLabel(nodeIdReferenceMatch), ex);
+                }
+            }
         }
 
-        public static IdReferenceMatch newInstance(Node nodeIdReferenceMatch) throws DOMStructureException {
-                Element	elementIdReferenceMatch		= DOMUtil.getElement(nodeIdReferenceMatch);
-                boolean bLenient					= DOMProperties.isLenient();
-                
-                Identifier	idReferenceMatch		= DOMUtil.getIdentifierContent(elementIdReferenceMatch, !bLenient);
-                
-                String versionString			= DOMUtil.getStringAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_VERSION);
-                String versionEarliestString	= DOMUtil.getStringAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_EARLIESTVERSION);
-                String versionLatestString		= DOMUtil.getStringAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_LATESTVERSION);
-                
-                VersionMatch version			= null;
-                VersionMatch versionEarliest	= null;
-                VersionMatch versionLatest		= null;
-                
-                if (versionString != null) {
-                        try {
-                                version	= StdVersionMatch.newInstance(versionString);
-                        } catch (ParseException ex) {
-                                if (!bLenient) {
-                                        throw new DOMStructureException(nodeIdReferenceMatch, "Invalid " + XACML3.ATTRIBUTE_VERSION + " string \"" + versionString + "\" in \"" + DOMUtil.getNodeLabel(nodeIdReferenceMatch), ex);
-                                }
-                        }
-                }
-                if (versionEarliestString != null) {
-                        try {
-                                versionEarliest = StdVersionMatch.newInstance(versionEarliestString);
-                        } catch (ParseException ex) {
-                                if (!bLenient) {
-                                        throw new DOMStructureException(nodeIdReferenceMatch, "Invalid " + XACML3.ATTRIBUTE_EARLIESTVERSION + " string \"" + versionEarliestString + "\" in \"" + DOMUtil.getNodeLabel(nodeIdReferenceMatch), ex);
-                                }
-                        }
-                }
-                if (versionLatestString != null) {
-                        try {
-                                versionLatest = StdVersionMatch.newInstance(versionLatestString);
-                        } catch (ParseException ex) {
-                                if (!bLenient) {
-                                        throw new DOMStructureException(nodeIdReferenceMatch, "Invalid " + XACML3.ATTRIBUTE_LATESTVERSION + " string \"" + versionLatestString + "\" in \"" + DOMUtil.getNodeLabel(nodeIdReferenceMatch), ex);
-                                }
-                        }
-                }
-                
-                return new DOMIdReferenceMatch(idReferenceMatch, version, versionEarliest, versionLatest);
-        }
-        
-        public static boolean repair(Node nodeIdReferenceMatch) throws DOMStructureException {
-                Element	elementIdReferenceMatch		= DOMUtil.getElement(nodeIdReferenceMatch);
-                boolean result						= false;
-                
-                result	= DOMUtil.repairIdentifierContent(elementIdReferenceMatch, logger) || result;
-                result	= DOMUtil.repairVersionMatchAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_VERSION, logger) || result;
-                result	= DOMUtil.repairVersionMatchAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_EARLIESTVERSION, logger) || result;
-                result	= DOMUtil.repairVersionMatchAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_LATESTVERSION, logger) || result;
-                
-                return result;
-        }
+        return new DOMIdReferenceMatch(idReferenceMatch, version, versionEarliest, versionLatest);
+    }
+
+    public static boolean repair(Node nodeIdReferenceMatch) throws DOMStructureException {
+        Element	elementIdReferenceMatch		= DOMUtil.getElement(nodeIdReferenceMatch);
+        boolean result						= false;
+
+        result	= DOMUtil.repairIdentifierContent(elementIdReferenceMatch, logger) || result;
+        result	= DOMUtil.repairVersionMatchAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_VERSION, logger) || result;
+        result	= DOMUtil.repairVersionMatchAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_EARLIESTVERSION, logger) || result;
+        result	= DOMUtil.repairVersionMatchAttribute(elementIdReferenceMatch, XACML3.ATTRIBUTE_LATESTVERSION, logger) || result;
+
+        return result;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMMissingAttributeDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMMissingAttributeDetail.java
index ea37b35..3e896e4 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMMissingAttributeDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMMissingAttributeDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,67 +44,67 @@
 /**
  * DOMMissingAttributeDetail extends {@link com.att.research.xacml.std.StdMutableMissingAttributeDetail} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMMissingAttributeDetail {
-        private static final Log logger	= LogFactory.getLog(DOMMissingAttributeDetail.class);
-        protected DOMMissingAttributeDetail() {
-        }
-        
-        /**
-         * Creates a new <code>DOMMissingAttributeDetail</code> by parsing the given <code>Node</code> as a XACML MissingAttributeDetail element.
-         * 
-         * @param nodeMissingAttributeDetail the <code>Node</code> representing the MissingAttributeDetail element
-         * @return a new <code>DOMMissingAttributeDetail</code> parsed from the given <code>Node</code>
-         * @throws com.att.research.xacml.std.dom.DOMStructureException if the conversion is not possible
-         */
-        public static MissingAttributeDetail newInstance(Node nodeMissingAttributeDetail) throws DOMStructureException {
-                Element	elementMissingAttributeDetail				= DOMUtil.getElement(nodeMissingAttributeDetail);
-                boolean bLenient									= DOMProperties.isLenient();
-                StdMutableMissingAttributeDetail mutableMissingAttributeDetail	= new StdMutableMissingAttributeDetail();
-                
-                mutableMissingAttributeDetail.setCategory(DOMUtil.getIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_CATEGORY, !bLenient));
-                mutableMissingAttributeDetail.setAttributeId(DOMUtil.getIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));
-                mutableMissingAttributeDetail.setDataTypeId(DOMUtil.getIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_DATATYPE, !bLenient));		
-                mutableMissingAttributeDetail.setIssuer(DOMUtil.getStringAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_ISSUER));
-                
-                NodeList children	= elementMissingAttributeDetail.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
-                                                        mutableMissingAttributeDetail.addAttributeValue(DOMAttributeValue.newInstance(child, mutableMissingAttributeDetail.getCategory()));
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeMissingAttributeDetail);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeMissingAttributeDetail);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMMissingAttributeDetail.class);
+    protected DOMMissingAttributeDetail() {
+    }
+
+    /**
+     * Creates a new <code>DOMMissingAttributeDetail</code> by parsing the given <code>Node</code> as a XACML MissingAttributeDetail element.
+     *
+     * @param nodeMissingAttributeDetail the <code>Node</code> representing the MissingAttributeDetail element
+     * @return a new <code>DOMMissingAttributeDetail</code> parsed from the given <code>Node</code>
+     * @throws com.att.research.xacml.std.dom.DOMStructureException if the conversion is not possible
+     */
+    public static MissingAttributeDetail newInstance(Node nodeMissingAttributeDetail) throws DOMStructureException {
+        Element	elementMissingAttributeDetail				= DOMUtil.getElement(nodeMissingAttributeDetail);
+        boolean bLenient									= DOMProperties.isLenient();
+        StdMutableMissingAttributeDetail mutableMissingAttributeDetail	= new StdMutableMissingAttributeDetail();
+
+        mutableMissingAttributeDetail.setCategory(DOMUtil.getIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_CATEGORY, !bLenient));
+        mutableMissingAttributeDetail.setAttributeId(DOMUtil.getIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_ATTRIBUTEID, !bLenient));
+        mutableMissingAttributeDetail.setDataTypeId(DOMUtil.getIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_DATATYPE, !bLenient));
+        mutableMissingAttributeDetail.setIssuer(DOMUtil.getStringAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_ISSUER));
+
+        NodeList children	= elementMissingAttributeDetail.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTEVALUE.equals(child.getLocalName())) {
+                            mutableMissingAttributeDetail.addAttributeValue(DOMAttributeValue.newInstance(child, mutableMissingAttributeDetail.getCategory()));
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeMissingAttributeDetail);
+                            }
                         }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeMissingAttributeDetail);
+                        }
+                    }
                 }
-                
-                return new StdMissingAttributeDetail(mutableMissingAttributeDetail);
+            }
         }
-        
-        public static boolean repair(Node nodeMissingAttributeDetail) throws DOMStructureException {
-                Element	elementMissingAttributeDetail	= DOMUtil.getElement(nodeMissingAttributeDetail);
-                boolean result							= false;
-                
-                result	= DOMUtil.repairIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
-                result	= DOMUtil.repairIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
-                result	= DOMUtil.repairIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
-                
-                return result;
-        }
+
+        return new StdMissingAttributeDetail(mutableMissingAttributeDetail);
+    }
+
+    public static boolean repair(Node nodeMissingAttributeDetail) throws DOMStructureException {
+        Element	elementMissingAttributeDetail	= DOMUtil.getElement(nodeMissingAttributeDetail);
+        boolean result							= false;
+
+        result	= DOMUtil.repairIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
+        result	= DOMUtil.repairIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_ATTRIBUTEID, logger) || result;
+        result	= DOMUtil.repairIdentifierAttribute(elementMissingAttributeDetail, XACML3.ATTRIBUTE_DATATYPE, logger) || result;
+
+        return result;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMObligation.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMObligation.java
index 3d5aa21..09b379e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMObligation.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMObligation.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,155 +46,155 @@
 
 /**
  * Provides static methods for creating {@link com.att.research.xacml.api.Obligation} objects from a {@link org.w3c.dom.Node}.
- *  
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public class DOMObligation {
-        private static final Log logger	= LogFactory.getLog(DOMObligation.class);
-        
-        protected DOMObligation() {
-        }
-        
-        /**
-         * Creates a new <code>Obligation</code> by parsing the given <code>Node</code> as a XACML Obligation element.
-         * 
-         * @param nodeObligation the <code>Node</code> representing the Obligation element
-         * @return a new <code>DOMObligation</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static Obligation newInstance(Node nodeObligation) throws DOMStructureException {
-                Element	elementObligation				= DOMUtil.getElement(nodeObligation);
-                boolean bLenient						= DOMProperties.isLenient();
-                StdMutableObligation mutableObligation	= new StdMutableObligation();
-                
-                mutableObligation.setId(DOMUtil.getIdentifierAttribute(elementObligation, XACML3.ATTRIBUTE_OBLIGATIONID, !bLenient));
-                
-                NodeList children									= elementObligation.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTEASSIGNMENT.equals(child.getLocalName())) {
-                                                        mutableObligation.addAttributeAssignment(DOMAttributeAssignment.newInstance(child));
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeObligation);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeObligation);
-                                                }
-                                        }
-                                }
-                        }
-                }
-                
-                return new StdObligation(mutableObligation);
-        }
-        
-        public static boolean repair(Node nodeObligation) throws DOMStructureException {
-                Element	elementObligation	= DOMUtil.getElement(nodeObligation);
-                boolean result				= false;
-                
-                result						= DOMUtil.repairIdentifierAttribute(elementObligation, XACML3.ATTRIBUTE_OBLIGATIONID, logger) || result;
-                
-                NodeList children									= elementObligation.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_ATTRIBUTEASSIGNMENT.equals(child.getLocalName())) {
-                                                        result	= DOMAttributeAssignment.repair(child) || result;
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementObligation.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementObligation.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                
-                return result;
-        }
-        
-        /**
-         * Creates a <code>List</code> of <code>Obligation</code>s by parsing the given <code>Node</code> representing a XACML Obligations
-         * element.
-         * 
-         * @param nodeObligations the <code>Node</code> representing the XACML Obligations element
-         * @return a <code>List</code> of <code>Obligation</code>s parsed from the given <code>Node</code>
-         * @throws DOMStructureException if there is an error parsing the <code>Node</code>
-         */
-        public static List<Obligation> newList(Node nodeObligations) throws DOMStructureException {
-                Element elementObligations			= DOMUtil.getElement(nodeObligations);
-                boolean bLenient					= DOMProperties.isLenient();
-                
-                List<Obligation> listObligations	= new ArrayList<Obligation>();
-                
-                NodeList children					= elementObligations.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_OBLIGATION.equals(child.getLocalName())) {
-                                                        listObligations.add(DOMObligation.newInstance(child));							
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeObligations);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeObligations);
-                                                }
-                                        }
-                                }
-                        }
-                }
-                return listObligations;
-        }
-        
-        public static boolean repairList(Node nodeObligations) throws DOMStructureException {
-                Element elementObligations	= DOMUtil.getElement(nodeObligations);
-                boolean result				= false;
-                
-                NodeList children			= elementObligations.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (XACML3.ELEMENT_OBLIGATION.equals(child.getLocalName())) {
-                                                        result	= result || DOMObligation.repair(child);
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementObligations.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementObligations.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
+    private static final Log logger	= LogFactory.getLog(DOMObligation.class);
 
-                return result;
+    protected DOMObligation() {
+    }
+
+    /**
+     * Creates a new <code>Obligation</code> by parsing the given <code>Node</code> as a XACML Obligation element.
+     *
+     * @param nodeObligation the <code>Node</code> representing the Obligation element
+     * @return a new <code>DOMObligation</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static Obligation newInstance(Node nodeObligation) throws DOMStructureException {
+        Element	elementObligation				= DOMUtil.getElement(nodeObligation);
+        boolean bLenient						= DOMProperties.isLenient();
+        StdMutableObligation mutableObligation	= new StdMutableObligation();
+
+        mutableObligation.setId(DOMUtil.getIdentifierAttribute(elementObligation, XACML3.ATTRIBUTE_OBLIGATIONID, !bLenient));
+
+        NodeList children									= elementObligation.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTEASSIGNMENT.equals(child.getLocalName())) {
+                            mutableObligation.addAttributeAssignment(DOMAttributeAssignment.newInstance(child));
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeObligation);
+                            }
+                        }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeObligation);
+                        }
+                    }
+                }
+            }
         }
 
+        return new StdObligation(mutableObligation);
+    }
+
+    public static boolean repair(Node nodeObligation) throws DOMStructureException {
+        Element	elementObligation	= DOMUtil.getElement(nodeObligation);
+        boolean result				= false;
+
+        result						= DOMUtil.repairIdentifierAttribute(elementObligation, XACML3.ATTRIBUTE_OBLIGATIONID, logger) || result;
+
+        NodeList children									= elementObligation.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_ATTRIBUTEASSIGNMENT.equals(child.getLocalName())) {
+                            result	= DOMAttributeAssignment.repair(child) || result;
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementObligation.removeChild(child);
+                            result	= true;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementObligation.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * Creates a <code>List</code> of <code>Obligation</code>s by parsing the given <code>Node</code> representing a XACML Obligations
+     * element.
+     *
+     * @param nodeObligations the <code>Node</code> representing the XACML Obligations element
+     * @return a <code>List</code> of <code>Obligation</code>s parsed from the given <code>Node</code>
+     * @throws DOMStructureException if there is an error parsing the <code>Node</code>
+     */
+    public static List<Obligation> newList(Node nodeObligations) throws DOMStructureException {
+        Element elementObligations			= DOMUtil.getElement(nodeObligations);
+        boolean bLenient					= DOMProperties.isLenient();
+
+        List<Obligation> listObligations	= new ArrayList<Obligation>();
+
+        NodeList children					= elementObligations.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_OBLIGATION.equals(child.getLocalName())) {
+                            listObligations.add(DOMObligation.newInstance(child));
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeObligations);
+                            }
+                        }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeObligations);
+                        }
+                    }
+                }
+            }
+        }
+        return listObligations;
+    }
+
+    public static boolean repairList(Node nodeObligations) throws DOMStructureException {
+        Element elementObligations	= DOMUtil.getElement(nodeObligations);
+        boolean result				= false;
+
+        NodeList children			= elementObligations.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (XACML3.ELEMENT_OBLIGATION.equals(child.getLocalName())) {
+                            result	= result || DOMObligation.repair(child);
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementObligations.removeChild(child);
+                            result	= true;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementObligations.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+
+        return result;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMProperties.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMProperties.java
index 5a93c30..022e3ca 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMProperties.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMProperties.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,72 +37,72 @@
 
 /**
  * DOMProperties contains utilities for determining the properties for parsing XACML documents with a DOM parser.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class DOMProperties {
-        private static final String	PROP_LENIENT			= "xacml.dom.lenient";
-        private static final String PROP_EXCEPTIONS			= "xacml.dom.exceptions";
-        
-        private static Map<String,Object> cachedProperties	= new HashMap<String,Object>();
-        
-        protected static String getSourceProperty(String propertyName) {
-                String result	= System.getProperty(propertyName);
-                if (result == null) {
-                        try {
-                                result	= XACMLProperties.getProperties().getProperty(propertyName);
-                        } catch (Exception ex) {
-                                
-                        }
-                }
-                return result;
+    private static final String	PROP_LENIENT			= "xacml.dom.lenient";
+    private static final String PROP_EXCEPTIONS			= "xacml.dom.exceptions";
+
+    private static Map<String,Object> cachedProperties	= new HashMap<String,Object>();
+
+    protected static String getSourceProperty(String propertyName) {
+        String result	= System.getProperty(propertyName);
+        if (result == null) {
+            try {
+                result	= XACMLProperties.getProperties().getProperty(propertyName);
+            } catch (Exception ex) {
+
+            }
         }
-        
-        protected static String getStringProperty(String propertyName) {
-                Object cachedProperty	= cachedProperties.get(propertyName);
-                if (cachedProperty == null) {
-                        cachedProperty	= getSourceProperty(propertyName);
-                        cachedProperties.put(propertyName, cachedProperty);
-                }
-                return (cachedProperty instanceof String ? (String)cachedProperty : cachedProperty.toString());
+        return result;
+    }
+
+    protected static String getStringProperty(String propertyName) {
+        Object cachedProperty	= cachedProperties.get(propertyName);
+        if (cachedProperty == null) {
+            cachedProperty	= getSourceProperty(propertyName);
+            cachedProperties.put(propertyName, cachedProperty);
         }
-        
-        protected static Boolean getBooleanProperty(String propertyName) {
-                Object cachedProperty	= cachedProperties.get(propertyName);
-                if (cachedProperty == null) {
-                        String stringProperty	= getSourceProperty(propertyName);
-                        if (stringProperty != null) {
-                                cachedProperty	= Boolean.parseBoolean(stringProperty);
-                                cachedProperties.put(propertyName, cachedProperty);
-                        }
-                }
-                if (cachedProperty == null || (cachedProperty instanceof Boolean)) {
-                        return (Boolean)cachedProperty;
-                } else {
-                        return null;
-                }
+        return (cachedProperty instanceof String ? (String)cachedProperty : cachedProperty.toString());
+    }
+
+    protected static Boolean getBooleanProperty(String propertyName) {
+        Object cachedProperty	= cachedProperties.get(propertyName);
+        if (cachedProperty == null) {
+            String stringProperty	= getSourceProperty(propertyName);
+            if (stringProperty != null) {
+                cachedProperty	= Boolean.parseBoolean(stringProperty);
+                cachedProperties.put(propertyName, cachedProperty);
+            }
         }
-        
-        protected DOMProperties() {
+        if (cachedProperty == null || (cachedProperty instanceof Boolean)) {
+            return (Boolean)cachedProperty;
+        } else {
+            return null;
         }
-        
-        public static boolean isLenient() {
-                Boolean booleanIsLenient	= getBooleanProperty(PROP_LENIENT);
-                return (booleanIsLenient == null ? false : booleanIsLenient.booleanValue());
-        }
-        
-        public static void setLenient(boolean b) {
-                cachedProperties.put(PROP_LENIENT, (b ? Boolean.TRUE : Boolean.FALSE));
-        }
-        
-        public static boolean throwsExceptions() {
-                Boolean booleanThrowsExceptions	= getBooleanProperty(PROP_EXCEPTIONS);
-                return (booleanThrowsExceptions == null ? true : booleanThrowsExceptions.booleanValue());
-        }
-        
-        public static void setThrowsExceptions(boolean b) {
-                cachedProperties.put(PROP_EXCEPTIONS, (b ? Boolean.TRUE : Boolean.FALSE));
-        }
+    }
+
+    protected DOMProperties() {
+    }
+
+    public static boolean isLenient() {
+        Boolean booleanIsLenient	= getBooleanProperty(PROP_LENIENT);
+        return (booleanIsLenient == null ? false : booleanIsLenient.booleanValue());
+    }
+
+    public static void setLenient(boolean b) {
+        cachedProperties.put(PROP_LENIENT, (b ? Boolean.TRUE : Boolean.FALSE));
+    }
+
+    public static boolean throwsExceptions() {
+        Boolean booleanThrowsExceptions	= getBooleanProperty(PROP_EXCEPTIONS);
+        return (booleanThrowsExceptions == null ? true : booleanThrowsExceptions.booleanValue());
+    }
+
+    public static void setThrowsExceptions(boolean b) {
+        cachedProperties.put(PROP_EXCEPTIONS, (b ? Boolean.TRUE : Boolean.FALSE));
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequest.java
index 938f764..066de9a 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -57,329 +57,329 @@
  * The {@link com.att.research.xacml.api.Request} objects returned by this class are instances of
  * {@link com.att.research.xacml.std.StdMutableRequest}, not <code>DOMRequest</code>.
  * Object instances are generated by loading a file, string, InputStream, or XML Node tree representing the Request.
- * 
- * 
+ *
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class DOMRequest {
-        private static final Log logger	= LogFactory.getLog(DOMRequest.class);
-        
-        /*
-         * Prevent creation of instances - this class contains only static methods that return other object types.
-         */
-        protected DOMRequest() {
-        }
-        
-        /**
-         * Parse and XML string into a {@link com.att.research.xacml.api.Request} object.
-         * 
-         * @param xmlString
-         * @return
-         * @throws DOMStructureException
-         */
-        public static Request load(String xmlString) throws DOMStructureException {
-                Request request = null;
-                InputStream is = null;
-                try {
-                        is = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
-                        request = DOMRequest.load(is);
-                } catch (UnsupportedEncodingException ex) {
-                        throw new DOMStructureException("Exception loading String Request: " + ex.getMessage(), ex);
-                } finally {
-                        try {
-                                if (is != null) {
-                                        is.close();
-                                }
-                        } catch(Exception idontcare) {				
-                        }
-                }
-                return request;
-        }
-        
-        /**
-         * Read a file containing the XML description of a XACML Request and parse it into a {@link com.att.research.xacml.api.Request} Object.
-         * 
-         * This is only used for testing.  
-         * In normal operation a Request arrives through the RESTful interface and is processed using <code>load(String xmlString)</code>.
-         * 
-         * @param fileRequest
-         * @return
-         * @throws DOMStructureException
-         */
-        public static Request load(File fileRequest) throws DOMStructureException {
-                Request request = null;
-                FileInputStream fis = null;
-                try {
-                        fis = new FileInputStream(fileRequest);
-                        request = DOMRequest.load(fis);
-                } catch (FileNotFoundException ex) {
-                        throw new DOMStructureException("Exception loading File Request: " + ex.getMessage(), ex);
-                } finally {
-                        try {
-                                if (fis != null) {
-                                        fis.close();
-                                }
-                        } catch(Exception idontcare) {				
-                        }
-                }
-                return request;
-        }
-        
-        /**
-         * Read characters from the given <code>InputStream</code> and parse them into an XACML {@link com.att.research.xacml.api.Request} object.
-         * 
-         * @param is
-         * @return
-         * @throws DOMStructureException
-         */
-        public static Request load(InputStream is) throws DOMStructureException {
-                /*
-                 * Get the DocumentBuilderFactory
-                 */
-                DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                if (documentBuilderFactory == null) {
-                        throw new DOMStructureException("No XML DocumentBuilderFactory configured");
-                }
-                documentBuilderFactory.setNamespaceAware(true);
-                
-                /*
-                 * Get the DocumentBuilder
-                 */
-                DocumentBuilder documentBuilder	= null;
-                try {
-                        documentBuilder	= documentBuilderFactory.newDocumentBuilder();
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
-                }
-                
-                /*
-                 * Parse the XML file
-                 */
-                Document document	= null;
-                Request request	= null;
-                try {
-                        document	= documentBuilder.parse(is);
-                        if (document == null) {
-                                throw new Exception("Null document returned");
-                        }
-                        
-                        Node rootNode	= document.getFirstChild();
-                        while (rootNode != null && rootNode.getNodeType() != Node.ELEMENT_NODE) {
-                            rootNode = rootNode.getNextSibling();
-                        }
-                        if (rootNode == null) {
-                                throw new Exception("No child in document");
-                        }
-                        
-                        if (DOMUtil.isInNamespace(rootNode, XACML3.XMLNS)) {
-                                if (XACML3.ELEMENT_REQUEST.equals(rootNode.getLocalName())) {
-                                        request	= DOMRequest.newInstance(rootNode);
-                                        if (request == null) {
-                                                throw new DOMStructureException("Failed to parse Request");
-                                        }
-                                } else {
-                                        throw DOMUtil.newUnexpectedElementException(rootNode);
-                                }
-                        } else {
-                                throw DOMUtil.newUnexpectedElementException(rootNode);
-                        }
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception loading Request: " + ex.getMessage(), ex);
-                }
-                return request;
-        }
-        
-        /**
-         * Creates a new {@link com.att.research.xacml.api.Request} by parsing the given <code>Node</code> representing a XACML Request element.
-         * 
-         * @param nodeRequest the <code>Node</code> representing the XACML Request element.
-         * @return a new {@link com.att.research.xacml.std.StdMutableRequest} parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static Request newInstance(Node nodeRequest) throws DOMStructureException {
-                Element	elementRequest	= DOMUtil.getElement(nodeRequest);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                StdMutableRequest stdMutableRequest	= new StdMutableRequest();
+    private static final Log logger	= LogFactory.getLog(DOMRequest.class);
 
-                stdMutableRequest.setReturnPolicyIdList(DOMUtil.getBooleanAttribute(elementRequest, XACML3.ATTRIBUTE_RETURNPOLICYIDLIST, !bLenient));
-                stdMutableRequest.setCombinedDecision(DOMUtil.getBooleanAttribute(elementRequest, XACML3.ATTRIBUTE_COMBINEDDECISION, !bLenient));
-                
-                NodeList children	= elementRequest.getChildNodes();
-                int numChildren;
-                boolean sawAttributes	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_ATTRIBUTES.equals(childName)) {
-                                                        stdMutableRequest.add(DOMRequestAttributes.newInstance(child));
-                                                        sawAttributes	= true;
-                                                } else if (XACML3.ELEMENT_REQUESTDEFAULTS.equals(childName)) {
-                                                        stdMutableRequest.setRequestDefaults(DOMRequestDefaults.newInstance(child));
-                                                } else if (XACML3.ELEMENT_MULTIREQUESTS.equals(childName)) {
-                                                        NodeList grandchildren	= child.getChildNodes();
-                                                        int numGrandchildren;
-                                                        if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
-                                                                for (int j = 0 ; j < numGrandchildren ; j++) {
-                                                                        Node grandchild	= grandchildren.item(j);
-                                                                        if (DOMUtil.isElement(grandchild)) {
-                                                                                if (DOMUtil.isInNamespace(grandchild, XACML3.XMLNS)) {
-                                                                                        if (XACML3.ELEMENT_REQUESTREFERENCE.equals(grandchild.getLocalName())) {
-                                                                                                stdMutableRequest.add(DOMRequestReference.newInstance(grandchild));												
-                                                                                        } else {
-                                                                                                if (!bLenient) {
-                                                                                                        throw DOMUtil.newUnexpectedElementException(grandchild, nodeRequest);
-                                                                                                }
-                                                                                        }
-                                                                                } else {
-                                                                                        if (!bLenient) {
-                                                                                                throw DOMUtil.newUnexpectedElementException(grandchild, nodeRequest);
-                                                                                        }
-                                                                                }
-                                                                        }
-                                                                }
-                                                        }
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeRequest);
-                                                        }
-                                                }
-                                        } else {
+    /*
+     * Prevent creation of instances - this class contains only static methods that return other object types.
+     */
+    protected DOMRequest() {
+    }
+
+    /**
+     * Parse and XML string into a {@link com.att.research.xacml.api.Request} object.
+     *
+     * @param xmlString
+     * @return
+     * @throws DOMStructureException
+     */
+    public static Request load(String xmlString) throws DOMStructureException {
+        Request request = null;
+        InputStream is = null;
+        try {
+            is = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
+            request = DOMRequest.load(is);
+        } catch (UnsupportedEncodingException ex) {
+            throw new DOMStructureException("Exception loading String Request: " + ex.getMessage(), ex);
+        } finally {
+            try {
+                if (is != null) {
+                    is.close();
+                }
+            } catch(Exception idontcare) {
+            }
+        }
+        return request;
+    }
+
+    /**
+     * Read a file containing the XML description of a XACML Request and parse it into a {@link com.att.research.xacml.api.Request} Object.
+     *
+     * This is only used for testing.
+     * In normal operation a Request arrives through the RESTful interface and is processed using <code>load(String xmlString)</code>.
+     *
+     * @param fileRequest
+     * @return
+     * @throws DOMStructureException
+     */
+    public static Request load(File fileRequest) throws DOMStructureException {
+        Request request = null;
+        FileInputStream fis = null;
+        try {
+            fis = new FileInputStream(fileRequest);
+            request = DOMRequest.load(fis);
+        } catch (FileNotFoundException ex) {
+            throw new DOMStructureException("Exception loading File Request: " + ex.getMessage(), ex);
+        } finally {
+            try {
+                if (fis != null) {
+                    fis.close();
+                }
+            } catch(Exception idontcare) {
+            }
+        }
+        return request;
+    }
+
+    /**
+     * Read characters from the given <code>InputStream</code> and parse them into an XACML {@link com.att.research.xacml.api.Request} object.
+     *
+     * @param is
+     * @return
+     * @throws DOMStructureException
+     */
+    public static Request load(InputStream is) throws DOMStructureException {
+        /*
+         * Get the DocumentBuilderFactory
+         */
+        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+        if (documentBuilderFactory == null) {
+            throw new DOMStructureException("No XML DocumentBuilderFactory configured");
+        }
+        documentBuilderFactory.setNamespaceAware(true);
+
+        /*
+         * Get the DocumentBuilder
+         */
+        DocumentBuilder documentBuilder	= null;
+        try {
+            documentBuilder	= documentBuilderFactory.newDocumentBuilder();
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
+        }
+
+        /*
+         * Parse the XML file
+         */
+        Document document	= null;
+        Request request	= null;
+        try {
+            document	= documentBuilder.parse(is);
+            if (document == null) {
+                throw new Exception("Null document returned");
+            }
+
+            Node rootNode	= document.getFirstChild();
+            while (rootNode != null && rootNode.getNodeType() != Node.ELEMENT_NODE) {
+                rootNode = rootNode.getNextSibling();
+            }
+            if (rootNode == null) {
+                throw new Exception("No child in document");
+            }
+
+            if (DOMUtil.isInNamespace(rootNode, XACML3.XMLNS)) {
+                if (XACML3.ELEMENT_REQUEST.equals(rootNode.getLocalName())) {
+                    request	= DOMRequest.newInstance(rootNode);
+                    if (request == null) {
+                        throw new DOMStructureException("Failed to parse Request");
+                    }
+                } else {
+                    throw DOMUtil.newUnexpectedElementException(rootNode);
+                }
+            } else {
+                throw DOMUtil.newUnexpectedElementException(rootNode);
+            }
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception loading Request: " + ex.getMessage(), ex);
+        }
+        return request;
+    }
+
+    /**
+     * Creates a new {@link com.att.research.xacml.api.Request} by parsing the given <code>Node</code> representing a XACML Request element.
+     *
+     * @param nodeRequest the <code>Node</code> representing the XACML Request element.
+     * @return a new {@link com.att.research.xacml.std.StdMutableRequest} parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static Request newInstance(Node nodeRequest) throws DOMStructureException {
+        Element	elementRequest	= DOMUtil.getElement(nodeRequest);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        StdMutableRequest stdMutableRequest	= new StdMutableRequest();
+
+        stdMutableRequest.setReturnPolicyIdList(DOMUtil.getBooleanAttribute(elementRequest, XACML3.ATTRIBUTE_RETURNPOLICYIDLIST, !bLenient));
+        stdMutableRequest.setCombinedDecision(DOMUtil.getBooleanAttribute(elementRequest, XACML3.ATTRIBUTE_COMBINEDDECISION, !bLenient));
+
+        NodeList children	= elementRequest.getChildNodes();
+        int numChildren;
+        boolean sawAttributes	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_ATTRIBUTES.equals(childName)) {
+                            stdMutableRequest.add(DOMRequestAttributes.newInstance(child));
+                            sawAttributes	= true;
+                        } else if (XACML3.ELEMENT_REQUESTDEFAULTS.equals(childName)) {
+                            stdMutableRequest.setRequestDefaults(DOMRequestDefaults.newInstance(child));
+                        } else if (XACML3.ELEMENT_MULTIREQUESTS.equals(childName)) {
+                            NodeList grandchildren	= child.getChildNodes();
+                            int numGrandchildren;
+                            if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
+                                for (int j = 0 ; j < numGrandchildren ; j++) {
+                                    Node grandchild	= grandchildren.item(j);
+                                    if (DOMUtil.isElement(grandchild)) {
+                                        if (DOMUtil.isInNamespace(grandchild, XACML3.XMLNS)) {
+                                            if (XACML3.ELEMENT_REQUESTREFERENCE.equals(grandchild.getLocalName())) {
+                                                stdMutableRequest.add(DOMRequestReference.newInstance(grandchild));
+                                            } else {
                                                 if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRequest);
+                                                    throw DOMUtil.newUnexpectedElementException(grandchild, nodeRequest);
                                                 }
-                                        }
-                                }
-                        }
-                }
-                if (!sawAttributes && !bLenient) {
-                        throw DOMUtil.newMissingElementException(nodeRequest, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTES);
-                }
-                
-                return new StdRequest(stdMutableRequest);
-        }
-        
-        /**
-         * Convert XACML2 into XACML3.
-         * 
-         * @param nodeRequest
-         * @return
-         * @throws DOMStructureException
-         */
-        public static boolean repair(Node nodeRequest) throws DOMStructureException {
-                Element	elementRequest	= DOMUtil.getElement(nodeRequest);
-                boolean result			= false;
-                
-                result					= DOMUtil.repairBooleanAttribute(elementRequest, XACML3.ATTRIBUTE_RETURNPOLICYIDLIST, false, logger) || result;
-                result					= DOMUtil.repairBooleanAttribute(elementRequest, XACML3.ATTRIBUTE_COMBINEDDECISION, false, logger) || result;
-                
-                NodeList children	= elementRequest.getChildNodes();
-                int numChildren;
-                boolean sawAttributes	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_ATTRIBUTES.equals(childName)) {
-                                                        result	= DOMRequestAttributes.repair(child) || result;
-                                                        sawAttributes	= true;
-                                                } else if (XACML3.ELEMENT_REQUESTDEFAULTS.equals(childName)) {
-                                                        result	= result || DOMRequestDefaults.repair(child);
-                                                } else if (XACML3.ELEMENT_MULTIREQUESTS.equals(childName)) {
-                                                        NodeList grandchildren	= child.getChildNodes();
-                                                        int numGrandchildren;
-                                                        if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
-                                                                for (int j = 0 ; j < numGrandchildren ; j++) {
-                                                                        Node grandchild	= grandchildren.item(j);
-                                                                        if (DOMUtil.isElement(grandchild)) {
-                                                                                if (DOMUtil.isInNamespace(grandchild, XACML3.XMLNS)) {
-                                                                                        if (XACML3.ELEMENT_REQUESTREFERENCE.equals(grandchild.getLocalName())) {
-                                                                                                result	= DOMRequestReference.repair(grandchild) || result;
-                                                                                        } else {
-                                                                                                logger.warn("Unexpected element " + grandchild.getNodeName());
-                                                                                                child.removeChild(grandchild);
-                                                                                                result	= true;
-                                                                                        }
-                                                                                } else {
-                                                                                        logger.warn("Unexpected element " + grandchild.getNodeName());
-                                                                                        child.removeChild(grandchild);
-                                                                                        result	= true;
-                                                                                }
-                                                                        }
-                                                                }
-                                                        }
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementRequest.removeChild(child);
-                                                        result	= true;
-                                                }
+                                            }
                                         } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementRequest.removeChild(child);
+                                            if (!bLenient) {
+                                                throw DOMUtil.newUnexpectedElementException(grandchild, nodeRequest);
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeRequest);
+                            }
+                        }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeRequest);
+                        }
+                    }
+                }
+            }
+        }
+        if (!sawAttributes && !bLenient) {
+            throw DOMUtil.newMissingElementException(nodeRequest, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTES);
+        }
+
+        return new StdRequest(stdMutableRequest);
+    }
+
+    /**
+     * Convert XACML2 into XACML3.
+     *
+     * @param nodeRequest
+     * @return
+     * @throws DOMStructureException
+     */
+    public static boolean repair(Node nodeRequest) throws DOMStructureException {
+        Element	elementRequest	= DOMUtil.getElement(nodeRequest);
+        boolean result			= false;
+
+        result					= DOMUtil.repairBooleanAttribute(elementRequest, XACML3.ATTRIBUTE_RETURNPOLICYIDLIST, false, logger) || result;
+        result					= DOMUtil.repairBooleanAttribute(elementRequest, XACML3.ATTRIBUTE_COMBINEDDECISION, false, logger) || result;
+
+        NodeList children	= elementRequest.getChildNodes();
+        int numChildren;
+        boolean sawAttributes	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_ATTRIBUTES.equals(childName)) {
+                            result	= DOMRequestAttributes.repair(child) || result;
+                            sawAttributes	= true;
+                        } else if (XACML3.ELEMENT_REQUESTDEFAULTS.equals(childName)) {
+                            result	= result || DOMRequestDefaults.repair(child);
+                        } else if (XACML3.ELEMENT_MULTIREQUESTS.equals(childName)) {
+                            NodeList grandchildren	= child.getChildNodes();
+                            int numGrandchildren;
+                            if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
+                                for (int j = 0 ; j < numGrandchildren ; j++) {
+                                    Node grandchild	= grandchildren.item(j);
+                                    if (DOMUtil.isElement(grandchild)) {
+                                        if (DOMUtil.isInNamespace(grandchild, XACML3.XMLNS)) {
+                                            if (XACML3.ELEMENT_REQUESTREFERENCE.equals(grandchild.getLocalName())) {
+                                                result	= DOMRequestReference.repair(grandchild) || result;
+                                            } else {
+                                                logger.warn("Unexpected element " + grandchild.getNodeName());
+                                                child.removeChild(grandchild);
                                                 result	= true;
+                                            }
+                                        } else {
+                                            logger.warn("Unexpected element " + grandchild.getNodeName());
+                                            child.removeChild(grandchild);
+                                            result	= true;
                                         }
+                                    }
                                 }
+                            }
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementRequest.removeChild(child);
+                            result	= true;
                         }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementRequest.removeChild(child);
+                        result	= true;
+                    }
                 }
-                if (!sawAttributes) {
-                        throw DOMUtil.newMissingElementException(nodeRequest, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTES);
-                }
-                
-                return result;
+            }
         }
-        
-        /**
-         * Unit test program to load an XML file containing a XACML Request document.
-         * 
-         * @param args the list of Request files to load and parse
-         */
-        public static void main(String[] args) {
-                if (args.length > 0) {
-                        DocumentBuilderFactory	documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                        documentBuilderFactory.setNamespaceAware(true);
-                        for (String xmlFileName: args) {
-                                File	fileXml	= new File(xmlFileName);
-                                if (!fileXml.exists()) {
-                                        System.err.println("Input file \"" + fileXml.getAbsolutePath() + "\" does not exist.");
-                                        continue;
-                                } else if (!fileXml.canRead()) {
-                                        System.err.println("Permission denied reading input file \"" + fileXml.getAbsolutePath() + "\"");
-                                        continue;
-                                }
-                                System.out.println(fileXml.getAbsolutePath() + ":");
-                                try {
-                                        DocumentBuilder	documentBuilder	= documentBuilderFactory.newDocumentBuilder();
-                                        assert(documentBuilder.isNamespaceAware());
-                                        Document documentRequest		= documentBuilder.parse(fileXml);
-                                        assert(documentRequest != null);
-                                        
-                                        NodeList children				= documentRequest.getChildNodes();
-                                        if (children == null || children.getLength() == 0) {
-                                                System.err.println("No Requests found in \"" + fileXml.getAbsolutePath() + "\"");
-                                                continue;
-                                        } else if (children.getLength() > 1) {
-                                                System.err.println("Multiple Requests found in \"" + fileXml.getAbsolutePath() + "\"");
-                                        }
-                                        Node nodeRequest				= children.item(0);
-                                        if (!nodeRequest.getLocalName().equals(XACML3.ELEMENT_REQUEST)) {
-                                                System.err.println("\"" + fileXml.getAbsolutePath() + "\" is not a Request");
-                                                continue;
-                                        }
-                                        
-                                        Request domRequest			= DOMRequest.newInstance(nodeRequest);
-                                        System.out.println(domRequest.toString());
-                                        System.out.println();
-                                } catch (Exception ex) {
-                                        ex.printStackTrace(System.err);
-                                }
-                        }
-                }
+        if (!sawAttributes) {
+            throw DOMUtil.newMissingElementException(nodeRequest, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTES);
         }
 
+        return result;
+    }
+
+    /**
+     * Unit test program to load an XML file containing a XACML Request document.
+     *
+     * @param args the list of Request files to load and parse
+     */
+    public static void main(String[] args) {
+        if (args.length > 0) {
+            DocumentBuilderFactory	documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+            documentBuilderFactory.setNamespaceAware(true);
+            for (String xmlFileName: args) {
+                File	fileXml	= new File(xmlFileName);
+                if (!fileXml.exists()) {
+                    System.err.println("Input file \"" + fileXml.getAbsolutePath() + "\" does not exist.");
+                    continue;
+                } else if (!fileXml.canRead()) {
+                    System.err.println("Permission denied reading input file \"" + fileXml.getAbsolutePath() + "\"");
+                    continue;
+                }
+                System.out.println(fileXml.getAbsolutePath() + ":");
+                try {
+                    DocumentBuilder	documentBuilder	= documentBuilderFactory.newDocumentBuilder();
+                    assert(documentBuilder.isNamespaceAware());
+                    Document documentRequest		= documentBuilder.parse(fileXml);
+                    assert(documentRequest != null);
+
+                    NodeList children				= documentRequest.getChildNodes();
+                    if (children == null || children.getLength() == 0) {
+                        System.err.println("No Requests found in \"" + fileXml.getAbsolutePath() + "\"");
+                        continue;
+                    } else if (children.getLength() > 1) {
+                        System.err.println("Multiple Requests found in \"" + fileXml.getAbsolutePath() + "\"");
+                    }
+                    Node nodeRequest				= children.item(0);
+                    if (!nodeRequest.getLocalName().equals(XACML3.ELEMENT_REQUEST)) {
+                        System.err.println("\"" + fileXml.getAbsolutePath() + "\" is not a Request");
+                        continue;
+                    }
+
+                    Request domRequest			= DOMRequest.newInstance(nodeRequest);
+                    System.out.println(domRequest.toString());
+                    System.out.println();
+                } catch (Exception ex) {
+                    ex.printStackTrace(System.err);
+                }
+            }
+        }
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestAttributes.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestAttributes.java
index b7e2df1..c4a6cd0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestAttributes.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestAttributes.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,119 +48,119 @@
 /**
  * DOMRequestAttributes extends {@link com.att.research.xacml.std.StdRequestAttributes} with methods for creation from DOM
  * {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMRequestAttributes {
-        private static final Log logger	= LogFactory.getLog(DOMRequestAttributes.class);
-        
-        protected DOMRequestAttributes() {
-        }
-        
-        /**
-         * Creates a new <code>DOMRequestAttributes</code> from the given root <code>Node</code> of a XACML Attributes element.
-         * 
-         * @param nodeRequestAttributes the <code>Node</code> representing the Attributes element
-         * @return a new <code>DOMRequestAttributes</code> from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static RequestAttributes newInstance(Node nodeRequestAttributes) throws DOMStructureException {
-                Element	elementRequestAttributes			= DOMUtil.getElement(nodeRequestAttributes);
-                boolean bLenient							= DOMProperties.isLenient();
-                
-                Identifier identifierCategory	= DOMUtil.getIdentifierAttribute(elementRequestAttributes, XACML3.ATTRIBUTE_CATEGORY, !bLenient);
-                String xmlId					= DOMUtil.getXmlId(elementRequestAttributes);
-                Node nodeContentRoot			= null;
-                List<Attribute> listAttributes	= new ArrayList<Attribute>();
-                boolean sawContent				= false;
-                
-                NodeList children	= elementRequestAttributes.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_CONTENT.equals(childName)) {
-                                                        if (sawContent && !bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, elementRequestAttributes);
-                                                        }
-                                                        sawContent	= true;
-                                                        /*
-                                                         * Get the single root element node
-                                                         */
-                                                        NodeList grandchildren	= child.getChildNodes();
-                                                        int numGrandchildren;
-                                                        if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
-                                                                for (int j = 0 ; j < numGrandchildren ; j++) {
-                                                                        Node grandchild	= grandchildren.item(j);
-                                                                        if (DOMUtil.isElement(grandchild)) {
-                                                                                if (nodeContentRoot != null) {
-                                                                                        if (!bLenient) {
-                                                                                                throw DOMUtil.newUnexpectedElementException(grandchild, child);
-                                                                                        }
-                                                                                } else {
-                                                                                        nodeContentRoot	= DOMUtil.getDirectDocumentChild(grandchild);
-                                                                                }
-                                                                        }
-                                                                }
-                                                        }
-                                                        if (nodeContentRoot == null && !bLenient) {
-                                                                throw DOMUtil.newMissingContentException(child);
-                                                        }
-                                                } else if (XACML3.ELEMENT_ATTRIBUTE.equals(childName)) {
-                                                        listAttributes.add(DOMAttribute.newInstance(identifierCategory, child));
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeRequestAttributes);
-                                                        }
-                                                }
+    private static final Log logger	= LogFactory.getLog(DOMRequestAttributes.class);
+
+    protected DOMRequestAttributes() {
+    }
+
+    /**
+     * Creates a new <code>DOMRequestAttributes</code> from the given root <code>Node</code> of a XACML Attributes element.
+     *
+     * @param nodeRequestAttributes the <code>Node</code> representing the Attributes element
+     * @return a new <code>DOMRequestAttributes</code> from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static RequestAttributes newInstance(Node nodeRequestAttributes) throws DOMStructureException {
+        Element	elementRequestAttributes			= DOMUtil.getElement(nodeRequestAttributes);
+        boolean bLenient							= DOMProperties.isLenient();
+
+        Identifier identifierCategory	= DOMUtil.getIdentifierAttribute(elementRequestAttributes, XACML3.ATTRIBUTE_CATEGORY, !bLenient);
+        String xmlId					= DOMUtil.getXmlId(elementRequestAttributes);
+        Node nodeContentRoot			= null;
+        List<Attribute> listAttributes	= new ArrayList<Attribute>();
+        boolean sawContent				= false;
+
+        NodeList children	= elementRequestAttributes.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_CONTENT.equals(childName)) {
+                            if (sawContent && !bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, elementRequestAttributes);
+                            }
+                            sawContent	= true;
+                            /*
+                             * Get the single root element node
+                             */
+                            NodeList grandchildren	= child.getChildNodes();
+                            int numGrandchildren;
+                            if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
+                                for (int j = 0 ; j < numGrandchildren ; j++) {
+                                    Node grandchild	= grandchildren.item(j);
+                                    if (DOMUtil.isElement(grandchild)) {
+                                        if (nodeContentRoot != null) {
+                                            if (!bLenient) {
+                                                throw DOMUtil.newUnexpectedElementException(grandchild, child);
+                                            }
                                         } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRequestAttributes);
-                                                }
+                                            nodeContentRoot	= DOMUtil.getDirectDocumentChild(grandchild);
                                         }
+                                    }
                                 }
+                            }
+                            if (nodeContentRoot == null && !bLenient) {
+                                throw DOMUtil.newMissingContentException(child);
+                            }
+                        } else if (XACML3.ELEMENT_ATTRIBUTE.equals(childName)) {
+                            listAttributes.add(DOMAttribute.newInstance(identifierCategory, child));
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeRequestAttributes);
+                            }
                         }
-                }
-                
-                return new StdRequestAttributes(identifierCategory, listAttributes, nodeContentRoot, xmlId);
-        }
-        
-        public static boolean repair(Node nodeRequestAttributes) throws DOMStructureException {
-                Element	elementRequestAttributes	= DOMUtil.getElement(nodeRequestAttributes);
-                boolean result						= false;
-                
-                result								= DOMUtil.repairIdentifierAttribute(elementRequestAttributes, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
-                NodeList children	= elementRequestAttributes.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_ATTRIBUTE.equals(childName)) {
-                                                        result	= DOMAttribute.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_CONTENT.equals(childName)) {
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementRequestAttributes.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementRequestAttributes.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeRequestAttributes);
                         }
+                    }
                 }
-                
-                
-                return result;
+            }
         }
 
+        return new StdRequestAttributes(identifierCategory, listAttributes, nodeContentRoot, xmlId);
+    }
+
+    public static boolean repair(Node nodeRequestAttributes) throws DOMStructureException {
+        Element	elementRequestAttributes	= DOMUtil.getElement(nodeRequestAttributes);
+        boolean result						= false;
+
+        result								= DOMUtil.repairIdentifierAttribute(elementRequestAttributes, XACML3.ATTRIBUTE_CATEGORY, logger) || result;
+        NodeList children	= elementRequestAttributes.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_ATTRIBUTE.equals(childName)) {
+                            result	= DOMAttribute.repair(child) || result;
+                        } else if (XACML3.ELEMENT_CONTENT.equals(childName)) {
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementRequestAttributes.removeChild(child);
+                            result	= true;
+                        }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementRequestAttributes.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+
+
+        return result;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestAttributesReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestAttributesReference.java
index 59a2284..ca62a6b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestAttributesReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestAttributesReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,33 +42,33 @@
 /**
  * DOMRequestAttributesReference extends {@link com.att.research.xacml.std.StdRequestAttributesReference} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMRequestAttributesReference {
-        private static final Log logger	= LogFactory.getLog(DOMRequestAttributesReference.class);
-        
-        protected DOMRequestAttributesReference() {
-        }
-        
-        /**
-         * Creates a new <code>DOMRequestAttributesReference</code> by parsing the given root <code>Node</code> of a XACML AttributesReference element.
-         * 
-         * @param nodeAttributesReference the <code>Node</code> to parse
-         * @return a new <code>DOMRequestAttributesReference</code>
-         * @throws com.att.research.xacml.std.dom.DOMStructureException if the conversion cannot be made
-         */
-        public static RequestAttributesReference newInstance(Node nodeAttributesReference) throws DOMStructureException {
-                Element	elementAttributesReference	= DOMUtil.getElement(nodeAttributesReference);
-                boolean bLenient					= DOMProperties.isLenient();
-                
-                return new StdRequestAttributesReference(DOMUtil.getStringAttribute(elementAttributesReference, XACML3.ATTRIBUTE_REFERENCEID, !bLenient));
-        }
-        
-        public static boolean repair(Node nodeAttributesReference) throws DOMStructureException {
-                Element	elementAttributesReference	= DOMUtil.getElement(nodeAttributesReference);
-                return DOMUtil.repairStringAttribute(elementAttributesReference, XACML3.ATTRIBUTE_REFERENCEID, null, logger);
-        }
+    private static final Log logger	= LogFactory.getLog(DOMRequestAttributesReference.class);
+
+    protected DOMRequestAttributesReference() {
+    }
+
+    /**
+     * Creates a new <code>DOMRequestAttributesReference</code> by parsing the given root <code>Node</code> of a XACML AttributesReference element.
+     *
+     * @param nodeAttributesReference the <code>Node</code> to parse
+     * @return a new <code>DOMRequestAttributesReference</code>
+     * @throws com.att.research.xacml.std.dom.DOMStructureException if the conversion cannot be made
+     */
+    public static RequestAttributesReference newInstance(Node nodeAttributesReference) throws DOMStructureException {
+        Element	elementAttributesReference	= DOMUtil.getElement(nodeAttributesReference);
+        boolean bLenient					= DOMProperties.isLenient();
+
+        return new StdRequestAttributesReference(DOMUtil.getStringAttribute(elementAttributesReference, XACML3.ATTRIBUTE_REFERENCEID, !bLenient));
+    }
+
+    public static boolean repair(Node nodeAttributesReference) throws DOMStructureException {
+        Element	elementAttributesReference	= DOMUtil.getElement(nodeAttributesReference);
+        return DOMUtil.repairStringAttribute(elementAttributesReference, XACML3.ATTRIBUTE_REFERENCEID, null, logger);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestDefaults.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestDefaults.java
index 825a78d..80b3eac 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestDefaults.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestDefaults.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,77 +45,77 @@
 /**
  * DOMRequestDefaults extends {@link com.att.research.xacml.std.StdRequestDefaults} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMRequestDefaults {
-        private static final Log logger	= LogFactory.getLog(DOMRequestDefaults.class);
-        
-        protected DOMRequestDefaults() {
-                super();
-        }
-        
-        /**
-         * Creates a new <code>DOMRequestDefaults</code> by parsing the given <code>Node</code> representing a XACML RequestDefaults element.
-         * 
-         * @param nodeRequestDefaults the <code>Node</code> representing the XACML RequestDefaults element
-         * @return a new <code>DOMRequestDefaults</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static RequestDefaults newInstance(Node nodeRequestDefaults) throws DOMStructureException {
-                Element	elementRequestDefaults			= DOMUtil.getElement(nodeRequestDefaults);
-                boolean bLenient						= DOMProperties.isLenient();
-                
-                URI uriXPathVersion						= null;
-                
-                NodeList children						= elementRequestDefaults.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_XPATHVERSION.equals(child.getLocalName())) {
-                                                uriXPathVersion	= DOMUtil.getURIContent(child);
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRequestDefaults);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMRequestDefaults.class);
+
+    protected DOMRequestDefaults() {
+        super();
+    }
+
+    /**
+     * Creates a new <code>DOMRequestDefaults</code> by parsing the given <code>Node</code> representing a XACML RequestDefaults element.
+     *
+     * @param nodeRequestDefaults the <code>Node</code> representing the XACML RequestDefaults element
+     * @return a new <code>DOMRequestDefaults</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static RequestDefaults newInstance(Node nodeRequestDefaults) throws DOMStructureException {
+        Element	elementRequestDefaults			= DOMUtil.getElement(nodeRequestDefaults);
+        boolean bLenient						= DOMProperties.isLenient();
+
+        URI uriXPathVersion						= null;
+
+        NodeList children						= elementRequestDefaults.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_XPATHVERSION.equals(child.getLocalName())) {
+                        uriXPathVersion	= DOMUtil.getURIContent(child);
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeRequestDefaults);
                         }
+                    }
                 }
-                return new StdRequestDefaults(uriXPathVersion);
+            }
         }
-        
-        public static boolean repair(Node nodeRequestDefaults) throws DOMStructureException {
-                Element	elementRequestDefaults	= DOMUtil.getElement(nodeRequestDefaults);
-                boolean result					= false;
-                
-                NodeList children						= elementRequestDefaults.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_XPATHVERSION.equals(child.getLocalName())) {
-                                                try {
-                                                        DOMUtil.getURIContent(child);
-                                                } catch (DOMStructureException ex) {
-                                                        logger.warn("Deleting invalid XPathVersion " + child.getTextContent());
-                                                        elementRequestDefaults.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementRequestDefaults.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+        return new StdRequestDefaults(uriXPathVersion);
+    }
+
+    public static boolean repair(Node nodeRequestDefaults) throws DOMStructureException {
+        Element	elementRequestDefaults	= DOMUtil.getElement(nodeRequestDefaults);
+        boolean result					= false;
+
+        NodeList children						= elementRequestDefaults.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_XPATHVERSION.equals(child.getLocalName())) {
+                        try {
+                            DOMUtil.getURIContent(child);
+                        } catch (DOMStructureException ex) {
+                            logger.warn("Deleting invalid XPathVersion " + child.getTextContent());
+                            elementRequestDefaults.removeChild(child);
+                            result	= true;
                         }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementRequestDefaults.removeChild(child);
+                        result	= true;
+                    }
                 }
-                
-                return result;
+            }
         }
 
+        return result;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestReference.java
index 8c93578..11d4bd1 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMRequestReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,79 +44,79 @@
 /**
  * DOMRequestReference extends {@link com.att.research.xacml.std.StdMutableRequestReference} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMRequestReference {
-        private static final Log logger	= LogFactory.getLog(DOMRequestReference.class);
-        
-        protected DOMRequestReference() {
+    private static final Log logger	= LogFactory.getLog(DOMRequestReference.class);
+
+    protected DOMRequestReference() {
+    }
+
+    /**
+     * Creates a new <code>DOMRequestReference</code> by parsing the given <code>Node</code> representing a XACML RequestReference element.
+     *
+     * @param nodeRequestReference the <code>Node</code> representing the XACML RequestReference element
+     * @return a new <code>DOMRequestReference</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static RequestReference newInstance(Node nodeRequestReference) throws DOMStructureException {
+        Element	elementRequestReference			= DOMUtil.getElement(nodeRequestReference);
+        boolean bLenient						= DOMProperties.isLenient();
+
+        StdMutableRequestReference stdRequestReference	= new StdMutableRequestReference();
+
+        NodeList children	= elementRequestReference.getChildNodes();
+        int numChildren;
+        boolean sawAttributesReference	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTESREFERENCE.equals(child.getLocalName())) {
+                        stdRequestReference.add(DOMRequestAttributesReference.newInstance(child));
+                        sawAttributesReference	= true;
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeRequestReference);
+                        }
+                    }
+                }
+            }
+        }
+        if (!sawAttributesReference && !bLenient) {
+            throw DOMUtil.newMissingElementException(nodeRequestReference, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTESREFERENCE);
+        }
+        return new StdRequestReference(stdRequestReference);
+    }
+
+    public static boolean repair(Node nodeRequestReference) throws DOMStructureException {
+        Element	elementRequestReference			= DOMUtil.getElement(nodeRequestReference);
+        boolean result							= false;
+
+        NodeList children	= elementRequestReference.getChildNodes();
+        int numChildren;
+        boolean sawAttributesReference	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTESREFERENCE.equals(child.getLocalName())) {
+                        result					= DOMRequestAttributesReference.repair(child) || result;
+                        sawAttributesReference	= true;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementRequestReference.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+        if (!sawAttributesReference) {
+            throw DOMUtil.newMissingAttributeException(nodeRequestReference, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTESREFERENCE);
         }
 
-        /**
-         * Creates a new <code>DOMRequestReference</code> by parsing the given <code>Node</code> representing a XACML RequestReference element.
-         * 
-         * @param nodeRequestReference the <code>Node</code> representing the XACML RequestReference element
-         * @return a new <code>DOMRequestReference</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static RequestReference newInstance(Node nodeRequestReference) throws DOMStructureException {
-                Element	elementRequestReference			= DOMUtil.getElement(nodeRequestReference);
-                boolean bLenient						= DOMProperties.isLenient();
-                
-                StdMutableRequestReference stdRequestReference	= new StdMutableRequestReference();
-                
-                NodeList children	= elementRequestReference.getChildNodes();
-                int numChildren;
-                boolean sawAttributesReference	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTESREFERENCE.equals(child.getLocalName())) {
-                                                stdRequestReference.add(DOMRequestAttributesReference.newInstance(child));	
-                                                sawAttributesReference	= true;
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeRequestReference);
-                                                }
-                                        }
-                                }
-                        }
-                }
-                if (!sawAttributesReference && !bLenient) {
-                        throw DOMUtil.newMissingElementException(nodeRequestReference, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTESREFERENCE);
-                }
-                return new StdRequestReference(stdRequestReference);
-        }
-        
-        public static boolean repair(Node nodeRequestReference) throws DOMStructureException {
-                Element	elementRequestReference			= DOMUtil.getElement(nodeRequestReference);
-                boolean result							= false;
-                
-                NodeList children	= elementRequestReference.getChildNodes();
-                int numChildren;
-                boolean sawAttributesReference	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_ATTRIBUTESREFERENCE.equals(child.getLocalName())) {
-                                                result					= DOMRequestAttributesReference.repair(child) || result;
-                                                sawAttributesReference	= true;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementRequestReference.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                if (!sawAttributesReference) {
-                        throw DOMUtil.newMissingAttributeException(nodeRequestReference, XACML3.XMLNS, XACML3.ELEMENT_ATTRIBUTESREFERENCE);
-                }
-                
-                return result;
-        }
+        return result;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMResponse.java
index 5960b0f..d1508a2 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -83,7 +83,7 @@
 import com.att.research.xacml.std.json.JSONStructureException;
 
 /**
- * DOMResponse is used to convert XML into {@link com.att.research.xacml.api.Response} objects and 
+ * DOMResponse is used to convert XML into {@link com.att.research.xacml.api.Response} objects and
  * {@link com.att.research.xacml.api.Response} objects into XML strings.
  * Instances of this class are never created.
  * The {@link com.att.research.xacml.api.Response} objects returned by this class are instances of
@@ -93,793 +93,792 @@
  * because the PDP generates {@link com.att.research.xacml.std.StdResponse} objects internally.
  * Those objects are converted to XML strings for transmission through the RESTful Web Service
  * using the <code>convert</code> method in this class.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMResponse {
-        private static final Log logger	= LogFactory.getLog(DOMResponse.class);
-        
-        protected DOMResponse() {
-        }
-        
-        
-        
-        /**
-         * Creates a new <code>DOMResponse</code> by parsing the given <code>Node</code> representing a XACML Response element.
-         * 
-         * @param nodeResponse the <code>Node</code> representing the XACML Response element
-         * @return a new <code>DOMResponse</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static Response newInstance(Node nodeResponse) throws DOMStructureException {
-                Element	elementResponse		= DOMUtil.getElement(nodeResponse);
-                boolean bLenient			= DOMProperties.isLenient();
-                
-                StdMutableResponse mutableResponse		= new StdMutableResponse();
-                
-                NodeList children			= elementResponse.getChildNodes();
-                int numChildren;
-                boolean sawResult			= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)&& XACML3.ELEMENT_RESULT.equals(child.getLocalName())) {
-                                                mutableResponse.add(DOMResult.newInstance(child));
-                                                sawResult	= true;
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeResponse);
-                                                }
-                                        }
-                                }
+    private static final Log logger	= LogFactory.getLog(DOMResponse.class);
+
+    protected DOMResponse() {
+    }
+
+
+
+    /**
+     * Creates a new <code>DOMResponse</code> by parsing the given <code>Node</code> representing a XACML Response element.
+     *
+     * @param nodeResponse the <code>Node</code> representing the XACML Response element
+     * @return a new <code>DOMResponse</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static Response newInstance(Node nodeResponse) throws DOMStructureException {
+        Element	elementResponse		= DOMUtil.getElement(nodeResponse);
+        boolean bLenient			= DOMProperties.isLenient();
+
+        StdMutableResponse mutableResponse		= new StdMutableResponse();
+
+        NodeList children			= elementResponse.getChildNodes();
+        int numChildren;
+        boolean sawResult			= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)&& XACML3.ELEMENT_RESULT.equals(child.getLocalName())) {
+                        mutableResponse.add(DOMResult.newInstance(child));
+                        sawResult	= true;
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeResponse);
                         }
+                    }
                 }
-                if (!sawResult && !bLenient) {
-                        throw DOMUtil.newMissingElementException(nodeResponse, XACML3.XMLNS, XACML3.ELEMENT_RESULT);
-                }
-                
-                return new StdResponse(mutableResponse);
+            }
         }
-        
-        /**
-         * Change XACML2 into XACML3
-         * 
-         * @param nodeResponse
-         * @return
-         * @throws DOMStructureException
-         */
-        public static boolean repair(Node nodeResponse) throws DOMStructureException {
-                Element	elementResponse		= DOMUtil.getElement(nodeResponse);
-                boolean result				= false;
-                
-                NodeList children			= elementResponse.getChildNodes();
-                int numChildren;
-                boolean sawResult			= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)&& XACML3.ELEMENT_RESULT.equals(child.getLocalName())) {
-                                                result	= DOMResult.repair(child) || result;
-                                                sawResult	= true;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementResponse.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                
-                if (!sawResult) {
-                        throw DOMUtil.newMissingElementException(nodeResponse, XACML3.XMLNS, XACML3.ELEMENT_RESULT);
-                }
-                return result;
+        if (!sawResult && !bLenient) {
+            throw DOMUtil.newMissingElementException(nodeResponse, XACML3.XMLNS, XACML3.ELEMENT_RESULT);
         }
 
-        
+        return new StdResponse(mutableResponse);
+    }
 
-        public static Response load(String xmlString) throws DOMStructureException {
-                Response response = null;
-                InputStream is = null;
-                try {
-                        is = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
-                        response = load(is);
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception loading String Response: " + ex.getMessage(), ex);
-                } finally {
-                        try {
-                                if (is != null) {
-                                        is.close();
-                                }
-                        } catch(Exception idontcare) {				
-                        }
-                }
-                return response;
-        }
-        
-        
-        /**
-         * Read a file containing an XML representation of a Response and parse it into a {@link com.att.research.xacml.api.Response} Object.
-         * This is used only for testing since Responses in the normal environment are generated by the PDP code.
-         * 
-         * @param fileResponse
-         * @return
-         * @throws DOMStructureException
-         */
-        public static Response load(File fileResponse) throws DOMStructureException {
-                try {
-                        BufferedReader br = new BufferedReader(new FileReader(fileResponse));
-                        String responseString = "";
-                        String line;
-                        while ((line = br.readLine()) != null) {
-                                responseString += line;
-                        }
-                        br.close();
-                        return load(responseString);
-                } catch (Exception e) {
-                        throw new DOMStructureException("File: " + fileResponse.getName() + " " + e.getMessage());
-                }
-        }
-        
-        /**
-         * Loads a response from java nio Path object.
-         * 
-         * @param fileResponse
-         * @return
-         * @throws DOMStructureException
-         */
-        public static Response load(Path fileResponse) throws DOMStructureException {
-                try {
-                        return DOMResponse.load(Files.newInputStream(fileResponse));
-                } catch (Exception e) {
-                        throw new DOMStructureException(e);
-                }
-        }
-        
-        
-        /**
-         * Read a file containing an XML representation of a Response and parse it into a {@link com.att.research.xacml.api.Response} Object.
-         * This is used only for testing since Responses in the normal environment are generated by the PDP code.
-         * 
-         * @param fileResponse
-         * @return
-         * @throws DOMStructureException
-         */
-        public static Response load(InputStream is) throws DOMStructureException {
-                /*
-                 * Get the DocumentBuilderFactory
-                 */
-                DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                if (documentBuilderFactory == null) {
-                        throw new DOMStructureException("No XML DocumentBuilderFactory configured");
-                }
-                documentBuilderFactory.setNamespaceAware(true);
-                
-                /*
-                 * Get the DocumentBuilder
-                 */
-                DocumentBuilder documentBuilder	= null;
-                try {
-                        documentBuilder	= documentBuilderFactory.newDocumentBuilder();
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
-                }
-                
-                /*
-                 * Parse the XML file
-                 */
-                Document document	= null;
-                Response request	= null;
-                try {
-                        document	= documentBuilder.parse(is);
-                        if (document == null) {
-                                throw new Exception("Null document returned");
-                        }
-                        
-                        Node rootNode	= document.getFirstChild();
-                        while (rootNode != null && rootNode.getNodeType() != Node.ELEMENT_NODE) {
-                            rootNode = rootNode.getNextSibling();
-                        }
-                        if (rootNode == null) {
-                                throw new Exception("No child in document");
-                        }
-                        
-                        if (DOMUtil.isInNamespace(rootNode, XACML3.XMLNS)) {
-                                if (XACML3.ELEMENT_RESPONSE.equals(rootNode.getLocalName())) {
-                                        request	= DOMResponse.newInstance(rootNode);
-                                        if (request == null) {
-                                                throw new DOMStructureException("Failed to parse Response");
-                                        }
-                                } else {
-                                        throw DOMUtil.newUnexpectedElementException(rootNode);
-                                }
-                        } else {
-                                throw DOMUtil.newUnexpectedElementException(rootNode);
-                        }
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception loading Response from InputStream: " + ex.getMessage(), ex);
-                }
-                return request;
-        }
-        
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Response} into an XML string.
-         * This is used only for debugging.
-         * It assumes that pretty-printing is desired.
-         * 
-         * @param response
-         * @return
-         * @throws Exception 
-         */
-        public static String toString(Response response) throws Exception {
-                return toString(response, true);
-        }
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Response} into an XML string.
-         * This is used only for debugging.
-         * The caller chooses whether to pretty-print or not.
-         * 
-         * @param response
-         * @param prettyPrint
-         * @return
-         * @throws Exception 
-         */
-        public static String toString(Response response, boolean prettyPrint) throws Exception {
-                String outputString = null;
-                ByteArrayOutputStream os = null;
-                try {
-                        os = new ByteArrayOutputStream();
-                        DOMResponse.convert(response, os, prettyPrint);
-                        outputString = new String( os.toByteArray(), "UTF-8");
-                } catch (Exception ex) {
-                        throw ex;
-                } finally {
-                        try {
-                                if (os != null) {
-                                        os.close();
-                                }
-                        } catch(Exception idontcare) {				
-                        }
-                }
-                return outputString;
-        }
-        
+    /**
+     * Change XACML2 into XACML3
+     *
+     * @param nodeResponse
+     * @return
+     * @throws DOMStructureException
+     */
+    public static boolean repair(Node nodeResponse) throws DOMStructureException {
+        Element	elementResponse		= DOMUtil.getElement(nodeResponse);
+        boolean result				= false;
 
-        /**
-         * Helper - recursively output StatusCode objects as XML.
-         * 
-         * @param sb
-         * @param statusCode
-         * @param tabCount
-         * @param prettyPrint
-         */
-        private static void outputStatusCode(StringBuffer sb, StatusCode statusCode, int tabCount, boolean prettyPrint) {
-                String prettyPrintString = "";
-                if (prettyPrint) {
-                        prettyPrintString = "\n";
-                        for (int i = 0; i < tabCount; i++) {
-                                prettyPrintString += "\t";
-                        }
+        NodeList children			= elementResponse.getChildNodes();
+        int numChildren;
+        boolean sawResult			= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)&& XACML3.ELEMENT_RESULT.equals(child.getLocalName())) {
+                        result	= DOMResult.repair(child) || result;
+                        sawResult	= true;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementResponse.removeChild(child);
+                        result	= true;
+                    }
                 }
-                
-                sb.append(prettyPrintString);
-                sb.append("<StatusCode");
-                
-                if (statusCode.getStatusCodeValue() != null) {
-                        sb.append(" Value=\"" + statusCode.getStatusCodeValue().stringValue() + "\"");
-                } 
-                
-                if (statusCode.getChild() == null) {
-                        // no child code, so finish off the StatusCode element now
-                        sb.append("/>");
+            }
+        }
+
+        if (!sawResult) {
+            throw DOMUtil.newMissingElementException(nodeResponse, XACML3.XMLNS, XACML3.ELEMENT_RESULT);
+        }
+        return result;
+    }
+
+
+
+    public static Response load(String xmlString) throws DOMStructureException {
+        Response response = null;
+        InputStream is = null;
+        try {
+            is = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
+            response = load(is);
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception loading String Response: " + ex.getMessage(), ex);
+        } finally {
+            try {
+                if (is != null) {
+                    is.close();
+                }
+            } catch(Exception idontcare) {
+            }
+        }
+        return response;
+    }
+
+
+    /**
+     * Read a file containing an XML representation of a Response and parse it into a {@link com.att.research.xacml.api.Response} Object.
+     * This is used only for testing since Responses in the normal environment are generated by the PDP code.
+     *
+     * @param fileResponse
+     * @return
+     * @throws DOMStructureException
+     */
+    public static Response load(File fileResponse) throws DOMStructureException {
+        try {
+            BufferedReader br = new BufferedReader(new FileReader(fileResponse));
+            String responseString = "";
+            String line;
+            while ((line = br.readLine()) != null) {
+                responseString += line;
+            }
+            br.close();
+            return load(responseString);
+        } catch (Exception e) {
+            throw new DOMStructureException("File: " + fileResponse.getName() + " " + e.getMessage());
+        }
+    }
+
+    /**
+     * Loads a response from java nio Path object.
+     *
+     * @param fileResponse
+     * @return
+     * @throws DOMStructureException
+     */
+    public static Response load(Path fileResponse) throws DOMStructureException {
+        try {
+            return DOMResponse.load(Files.newInputStream(fileResponse));
+        } catch (Exception e) {
+            throw new DOMStructureException(e);
+        }
+    }
+
+
+    /**
+     * Read a file containing an XML representation of a Response and parse it into a {@link com.att.research.xacml.api.Response} Object.
+     * This is used only for testing since Responses in the normal environment are generated by the PDP code.
+     *
+     * @param fileResponse
+     * @return
+     * @throws DOMStructureException
+     */
+    public static Response load(InputStream is) throws DOMStructureException {
+        /*
+         * Get the DocumentBuilderFactory
+         */
+        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+        if (documentBuilderFactory == null) {
+            throw new DOMStructureException("No XML DocumentBuilderFactory configured");
+        }
+        documentBuilderFactory.setNamespaceAware(true);
+
+        /*
+         * Get the DocumentBuilder
+         */
+        DocumentBuilder documentBuilder	= null;
+        try {
+            documentBuilder	= documentBuilderFactory.newDocumentBuilder();
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
+        }
+
+        /*
+         * Parse the XML file
+         */
+        Document document	= null;
+        Response request	= null;
+        try {
+            document	= documentBuilder.parse(is);
+            if (document == null) {
+                throw new Exception("Null document returned");
+            }
+
+            Node rootNode	= document.getFirstChild();
+            while (rootNode != null && rootNode.getNodeType() != Node.ELEMENT_NODE) {
+                rootNode = rootNode.getNextSibling();
+            }
+            if (rootNode == null) {
+                throw new Exception("No child in document");
+            }
+
+            if (DOMUtil.isInNamespace(rootNode, XACML3.XMLNS)) {
+                if (XACML3.ELEMENT_RESPONSE.equals(rootNode.getLocalName())) {
+                    request	= DOMResponse.newInstance(rootNode);
+                    if (request == null) {
+                        throw new DOMStructureException("Failed to parse Response");
+                    }
                 } else {
-                        // there is a child, so need to use the two-part notation for this StatusCode
-                        sb.append(">");
-                        outputStatusCode(sb, statusCode.getChild(), tabCount + 1, prettyPrint);
-                        sb.append(prettyPrintString);
-                        sb.append("</StatusCode>");
+                    throw DOMUtil.newUnexpectedElementException(rootNode);
                 }
+            } else {
+                throw DOMUtil.newUnexpectedElementException(rootNode);
+            }
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception loading Response from InputStream: " + ex.getMessage(), ex);
         }
-        
-        /**
-         * Helper: When outputting as XML string, get the value of a Value (within an AttributeValue) object as a String.
-         * Most of these objects are SemanticStrings, but some are not and we cannot assume that in the places where we need to generate the output.
-         * 
-         * @param obj
-         * @return String 
-         * @throws JSONStructureException
-         * @throws DOMStructureException 
-         */
-        private static String outputValueValue(Object obj) throws DOMStructureException {
-                if (obj instanceof String ||
-                                obj instanceof Boolean ||
-                                obj instanceof Integer ||
-                                obj instanceof BigInteger ) {
-                        return obj.toString();
-                } else if (obj instanceof Double) {
-                        Double d = (Double)obj;
-                        if (d == Double.NaN) {
-                                return "NaN";
-                        } else if (d == Double.POSITIVE_INFINITY) {
-                                return "INF";
-                        } else if (d == Double.NEGATIVE_INFINITY) {
-                                return "-INF";
-                        }
-                        return obj.toString();
-                } else if (obj instanceof SemanticString) {
-                        return ((SemanticString)obj).stringValue();
-                } else if (obj instanceof X500Principal ||
-                                obj instanceof URI) {
-                        // something is very weird with X500Principal data type.  If left on its own the output is a map that includes encoding.
-                        return obj.toString();
-                } else if (obj instanceof XPathExpressionWrapper) {
+        return request;
+    }
 
-                        XPathExpressionWrapper xw = (XPathExpressionWrapper) obj;
 
-                        return xw.getPath();
+    /**
+     * Convert the {@link com.att.research.xacml.api.Response} into an XML string.
+     * This is used only for debugging.
+     * It assumes that pretty-printing is desired.
+     *
+     * @param response
+     * @return
+     * @throws Exception
+     */
+    public static String toString(Response response) throws Exception {
+        return toString(response, true);
+    }
+
+    /**
+     * Convert the {@link com.att.research.xacml.api.Response} into an XML string.
+     * This is used only for debugging.
+     * The caller chooses whether to pretty-print or not.
+     *
+     * @param response
+     * @param prettyPrint
+     * @return
+     * @throws Exception
+     */
+    public static String toString(Response response, boolean prettyPrint) throws Exception {
+        String outputString = null;
+        ByteArrayOutputStream os = null;
+        try {
+            os = new ByteArrayOutputStream();
+            DOMResponse.convert(response, os, prettyPrint);
+            outputString = new String( os.toByteArray(), "UTF-8");
+        } catch (Exception ex) {
+            throw ex;
+        } finally {
+            try {
+                if (os != null) {
+                    os.close();
+                }
+            } catch(Exception idontcare) {
+            }
+        }
+        return outputString;
+    }
+
+
+    /**
+     * Helper - recursively output StatusCode objects as XML.
+     *
+     * @param sb
+     * @param statusCode
+     * @param tabCount
+     * @param prettyPrint
+     */
+    private static void outputStatusCode(StringBuffer sb, StatusCode statusCode, int tabCount, boolean prettyPrint) {
+        String prettyPrintString = "";
+        if (prettyPrint) {
+            prettyPrintString = "\n";
+            for (int i = 0; i < tabCount; i++) {
+                prettyPrintString += "\t";
+            }
+        }
+
+        sb.append(prettyPrintString);
+        sb.append("<StatusCode");
+
+        if (statusCode.getStatusCodeValue() != null) {
+            sb.append(" Value=\"" + statusCode.getStatusCodeValue().stringValue() + "\"");
+        }
+
+        if (statusCode.getChild() == null) {
+            // no child code, so finish off the StatusCode element now
+            sb.append("/>");
+        } else {
+            // there is a child, so need to use the two-part notation for this StatusCode
+            sb.append(">");
+            outputStatusCode(sb, statusCode.getChild(), tabCount + 1, prettyPrint);
+            sb.append(prettyPrintString);
+            sb.append("</StatusCode>");
+        }
+    }
+
+    /**
+     * Helper: When outputting as XML string, get the value of a Value (within an AttributeValue) object as a String.
+     * Most of these objects are SemanticStrings, but some are not and we cannot assume that in the places where we need to generate the output.
+     *
+     * @param obj
+     * @return String
+     * @throws JSONStructureException
+     * @throws DOMStructureException
+     */
+    private static String outputValueValue(Object obj) throws DOMStructureException {
+        if (obj instanceof String ||
+                obj instanceof Boolean ||
+                obj instanceof Integer ||
+                obj instanceof BigInteger ) {
+            return obj.toString();
+        } else if (obj instanceof Double) {
+            Double d = (Double)obj;
+            if (d == Double.NaN) {
+                return "NaN";
+            } else if (d == Double.POSITIVE_INFINITY) {
+                return "INF";
+            } else if (d == Double.NEGATIVE_INFINITY) {
+                return "-INF";
+            }
+            return obj.toString();
+        } else if (obj instanceof SemanticString) {
+            return ((SemanticString)obj).stringValue();
+        } else if (obj instanceof X500Principal ||
+                   obj instanceof URI) {
+            // something is very weird with X500Principal data type.  If left on its own the output is a map that includes encoding.
+            return obj.toString();
+        } else if (obj instanceof XPathExpressionWrapper) {
+
+            XPathExpressionWrapper xw = (XPathExpressionWrapper) obj;
+
+            return xw.getPath();
+        } else {
+            throw new DOMStructureException("Unhandled data type='" + obj.getClass().getName() + "'");
+        }
+    }
+
+
+    /**
+     * Helper: When outputting as XML string, extract any Namespace info from an AttributeValue.Value.Value object.
+     * This must be done separately from getting the Value as a String because this info is put as an attribute in the surrounding element.
+     * Currently only applies to XPathExpressionWrappers.
+     *
+     * @param valueObject
+     * @return
+     */
+    private static String getNamespaces(Object valueObject) {
+        String returnString = "";
+        if ( ! (valueObject instanceof XPathExpressionWrapper)) {
+            // value is not XPathExpression, so has no Namespace info in it
+            return returnString;
+        }
+        XPathExpressionWrapper xw = (XPathExpressionWrapper) valueObject;
+
+        ExtendedNamespaceContext namespaceContext = xw.getNamespaceContext();
+        if (namespaceContext != null) {
+            // get the list of all namespace prefixes
+            Iterator<String> prefixIt = namespaceContext.getAllPrefixes();
+            while (prefixIt.hasNext()) {
+                String prefix = prefixIt.next();
+                String namespaceURI = namespaceContext.getNamespaceURI(prefix);
+                if (prefix == null ||  prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+                    returnString += " xmlns=\"" + namespaceURI + "\"";
                 } else {
-                        throw new DOMStructureException("Unhandled data type='" + obj.getClass().getName() + "'");
+                    returnString += " xmlns:" + prefix + "=\"" + namespaceURI + "\"";
                 }
+            }
+
         }
-        
-        
-        /**
-         * Helper: When outputting as XML string, extract any Namespace info from an AttributeValue.Value.Value object.
-         * This must be done separately from getting the Value as a String because this info is put as an attribute in the surrounding element.
-         * Currently only applies to XPathExpressionWrappers.
-         * 
-         * @param valueObject
-         * @return
-         */
-        private static String getNamespaces(Object valueObject) {
-                String returnString = "";
-                if ( ! (valueObject instanceof XPathExpressionWrapper)) {
-                        // value is not XPathExpression, so has no Namespace info in it
-                        return returnString;
-                }
-                XPathExpressionWrapper xw = (XPathExpressionWrapper) valueObject;
-                
-                ExtendedNamespaceContext namespaceContext = xw.getNamespaceContext();
-                if (namespaceContext != null) {
-                        // get the list of all namespace prefixes
-                        Iterator<String> prefixIt = namespaceContext.getAllPrefixes();
-                        while (prefixIt.hasNext()) {
-                                String prefix = prefixIt.next();
-                                String namespaceURI = namespaceContext.getNamespaceURI(prefix);
-                                if (prefix == null ||  prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
-                                        returnString += " xmlns=\"" + namespaceURI + "\"";
-                                } else {
-                                        returnString += " xmlns:" + prefix + "=\"" + namespaceURI + "\"";
-                                }
-                        }
-                        
-                }
-                return returnString;
+        return returnString;
+    }
+
+
+
+
+    /**
+     * Convert the {@link com.att.research.xacml.api.Response} object into a string suitable for output in an HTTPResponse.
+     * This method generates the output without any pretty-printing.
+     * This is the method normally called by the Web Service for generating the output to the PEP through the RESTful interface.
+     *
+     * @param response
+     * @param outputStream
+     * @throws java.io.IOException
+     * @throws DOMStructureException
+     */
+    public static void convert(Response response, OutputStream outputStream) throws IOException, DOMStructureException {
+        convert(response, outputStream, false);
+    }
+
+    /**
+     * Do the work of converting the {@link com.att.research.xacml.api.Response} object to a string, allowing for pretty-printing if desired.
+     *
+     * @param response
+     * @param outputStream
+     * @param prettyPrint
+     * @throws java.io.IOException
+     * @throws DOMStructureException
+     */
+    public static void convert(Response response, OutputStream outputStream, boolean prettyPrint) throws IOException, DOMStructureException {
+
+        OutputStreamWriter osw = new OutputStreamWriter(outputStream);
+
+        if (response == null) {
+            throw new DOMStructureException("No Request in convert");
         }
-        
-        
-        
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Response} object into a string suitable for output in an HTTPResponse.
-         * This method generates the output without any pretty-printing.
-         * This is the method normally called by the Web Service for generating the output to the PEP through the RESTful interface.
-         * 
-         * @param response
-         * @param outputStream
-         * @throws java.io.IOException
-         * @throws DOMStructureException 
-         */
-        public static void convert(Response response, OutputStream outputStream) throws IOException, DOMStructureException {
-                convert(response, outputStream, false);
+
+        if (response.getResults() == null || response.getResults().size() == 0) {
+            // must be at least one result
+            throw new DOMStructureException("No Result in Response");
         }
-        
-        /**
-         * Do the work of converting the {@link com.att.research.xacml.api.Response} object to a string, allowing for pretty-printing if desired.
-         * 
-         * @param response
-         * @param outputStream
-         * @param prettyPrint
-         * @throws java.io.IOException
-         * @throws DOMStructureException 
-         */
-        public static void convert(Response response, OutputStream outputStream, boolean prettyPrint) throws IOException, DOMStructureException {
-                
-                OutputStreamWriter osw = new OutputStreamWriter(outputStream);
-                
-                if (response == null) {
-                        throw new DOMStructureException("No Request in convert");
-                }
-                
-                if (response.getResults() == null || response.getResults().size() == 0) {
-                        // must be at least one result
-                        throw new DOMStructureException("No Result in Response");
-                }
-                
-                
-                StringBuffer sb = new StringBuffer();
-                
-                sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-                
-                if (prettyPrint) sb.append("\n");
-                
-                // response with attributes
-                sb.append("<Response");
-                
+
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+
+        if (prettyPrint) sb.append("\n");
+
+        // response with attributes
+        sb.append("<Response");
+
 //TODO include all Namespace info
 // Currently this is hard-coded for just the standard XACML namespaces, but ideally should use Namespaces from incoming Request to get non-standard ones.
-                sb.append(" xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\"");
-                sb.append(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
-                sb.append(" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17");
+        sb.append(" xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\"");
+        sb.append(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
+        sb.append(" xsi:schemaLocation=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17");
         sb.append(" http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd\"");
-        
+
         // end of <Response>
         sb.append(">");
-                                
-                // for each Result...
-                for (Result result : response.getResults()) {
-                        
-                        if (prettyPrint) sb.append("\n\t");
-                        
-                        sb.append("<Result>");
-                        
-                        // Decision
-                        if (prettyPrint) sb.append("\n\t\t");
-                        
-                        if (result.getDecision() == null) {
-                                throw new DOMStructureException("Result missing Decision");
-                        }
-                        sb.append("<Decision>" + result.getDecision().toString() + "</Decision>");
-                        
-                        // Status
-                        Status status = result.getStatus();
-                        if (status != null) {
-                                if (prettyPrint) sb.append("\n\t\t");
-                                sb.append("<Status>");
-                                
-                                // status code
-                                StatusCode statusCode = status.getStatusCode();
-                                Identifier statusCodeId;
-                                if (statusCode == null) {
-                                        throw new DOMStructureException("Status must have StatusCode");
-                                } else {
-                                        statusCodeId = statusCode.getStatusCodeValue();
-                                        // if there is a status code, it must agree with the decision
-                                // Permit/Deny/NotAllowed must all be OK
-                                // Indeterminate must not be OK
-                                if ( (statusCodeId.equals(StdStatusCode.STATUS_CODE_OK.getStatusCodeValue())  &&
-                                                ! (result.getDecision() == Decision.DENY || result.getDecision() == Decision.PERMIT || result.getDecision() == Decision.NOTAPPLICABLE))  ||
-                                        ( ! statusCodeId.equals(StdStatusCode.STATUS_CODE_OK.getStatusCodeValue())  &&
-                                                        ! (result.getDecision() == Decision.INDETERMINATE || result.getDecision() == Decision.INDETERMINATE_DENY || 
-                                                                result.getDecision() == Decision.INDETERMINATE_DENYPERMIT || result.getDecision() == Decision.INDETERMINATE_PERMIT ))  )
-                                                {
-                                        throw new DOMStructureException("StatusCode '" + statusCodeId.stringValue() + "' does not match Decision '" + result.getDecision().toString());
-                                }
-                                        
-                                        
-                                        outputStatusCode(sb, statusCode, 3, prettyPrint);
-                                }
-                                
-                                // status message
-                                if (status.getStatusMessage() != null) {
-        
-                                        if (prettyPrint) sb.append("\n\t\t\t");
-                                        sb.append("<StatusMessage>" + status.getStatusMessage() + "</StatusMessage>");
 
-                                }
-                                
-                                // status detail
-                                StatusDetail statusDetail = status.getStatusDetail();
-                                if (statusDetail != null) {
-                                // cross-check that rules defined in XACML Core spec section 5.5.7 re: when StatusDetail may/may-not be included have been followed
-                                if (status.isOk()) {
-                                        throw new DOMStructureException("Status '" + statusCodeId.stringValue() + "' must not return StatusDetail");
-                                } else if (statusCodeId.stringValue().equals(XACML3.ID_STATUS_MISSING_ATTRIBUTE.stringValue()) && 
-                                                status.getStatusDetail().getMissingAttributeDetails() == null) {
-                                        throw new DOMStructureException("Status '" + statusCodeId.stringValue() + "' has StatusDetail without MissingAttributeDetail");
-                                } else if (statusCodeId.stringValue().equals(XACML3.ID_STATUS_SYNTAX_ERROR.stringValue()))  {
-                                        throw new DOMStructureException("Status '" + statusCodeId.stringValue() + "' must not return StatusDetail");
-                                } else if (statusCodeId.stringValue().equals(XACML3.ID_STATUS_PROCESSING_ERROR.stringValue()))  {
-                                        throw new DOMStructureException("Status '" + statusCodeId.stringValue() + "' must not return StatusDetail");
-                                }
-                                
-                                // if included, StatusDetail is handled differently for each type of detail message and the contents are formatted into escaped XML rather than objects
-                                
-                                if (result.getStatus().getStatusDetail().getMissingAttributeDetails() != null) {
-                                                if (prettyPrint) sb.append("\n\t\t\t");
-                                                sb.append("<StatusDetail>");
-                                                
-                                                for (MissingAttributeDetail mad : statusDetail.getMissingAttributeDetails()) {
-                                                        if (mad.getAttributeId() == null || mad.getCategory() == null || mad.getDataTypeId() == null) {
-                                                                throw new DOMStructureException("MissingAttributeDetail is missing required AttributeId, Category or DataTypeId");
-                                                        }
-                                                        if (prettyPrint) sb.append("\n\t\t\t\t");
-                                                        sb.append("<MissingAttributeDetail");
-                                                        sb.append(" Category=\"" + mad.getCategory().stringValue() + "\"");
-                                                        sb.append(" AttributeId=\"" + mad.getAttributeId().stringValue() + "\"");
-                                                        sb.append(" DataTypeId=\"" + mad.getDataTypeId().stringValue() + "\"");
-                                                        if (mad.getIssuer() != null) {
-                                                                sb.append(" Issuer=\"" + mad.getIssuer() + "\"");
-                                                        }
-                                                        sb.append(">");
-                                                        if (mad.getAttributeValues() != null) {
-                                                                for (AttributeValue<?> value : mad.getAttributeValues()) {
-                                                                        if (prettyPrint) {
-                                                                                sb.append("\n\t\t\t\t\t");
-                                                                        }
-                                                                        sb.append("<AttributeValue" + getNamespaces(value.getValue()) + ">" + outputValueValue(value.getValue()) + "</AttributeValue>");
-                                                                }
-                                                        }
-                                                        if (prettyPrint) {
-                                                                sb.append("\n\t\t\t\t");
-                                                        }
-                                                        sb.append("</MissingAttributeDetail>");
-                                                }
-                                                
-                                                if (prettyPrint) {
-                                                        sb.append("\n\t\t\t");
-                                                }
-                                                sb.append("</StatusDetail>");
-                                }
-                                }
-                                
-                                if (prettyPrint) sb.append("\n\t\t");
-                                sb.append("</Status>");
-                        }
-                        
-                        // Obligations
-                        if (result.getObligations() != null && result.getObligations().size() > 0) {
-                                if (prettyPrint) sb.append("\n\t\t");
-                                sb.append("<Obligations>");
-                                
-                                for (Obligation obligation : result.getObligations()) {
-                                        if (obligation.getId() == null) {
-                                                throw new DOMStructureException("Obligation must have ObligationId");
-                                        }
-                                        if (prettyPrint) sb.append("\n\t\t\t");
-                                        sb.append("<Obligation ObligationId=\"" + obligation.getId().stringValue() + "\">");
-                                        
-                                        for (AttributeAssignment aa : obligation.getAttributeAssignments()) {
-                                                if (prettyPrint) sb.append("\n\t\t\t\t");
-                                                sb.append("<AttributeAssignment");
-                                                
-                                                if (aa.getAttributeId() == null) {
-                                                        throw new DOMStructureException("Obligation AttributeAssignment must have AttributeId");
-                                                }
-                                                sb.append(" AttributeId=\"" + aa.getAttributeId().stringValue() + "\"");
-                                                if (aa.getDataTypeId() == null || aa.getAttributeValue() == null || aa.getAttributeValue().getValue() == null) {
-                                                        throw new DOMStructureException("Obligation AttributeAssignment '" + aa.getAttributeId().stringValue() + "' must have DataType and Value");
-                                                }
-                                                sb.append(" DataType=\"" + aa.getDataTypeId().stringValue() + "\"" + getNamespaces(aa.getAttributeValue().getValue()) + ">");
-                                                sb.append(outputValueValue(aa.getAttributeValue().getValue()));
+        // for each Result...
+        for (Result result : response.getResults()) {
 
-                                                sb.append("</AttributeAssignment>");
-                                        }
-                                        
-                                        if (prettyPrint) sb.append("\n\t\t\t");
-                                        sb.append("</Obligation>");
-                                }
-                                
-                                if (prettyPrint) sb.append("\n\t\t");
-                                sb.append("</Obligations>");
-                        }
-                        
-                        // AssociatedAdvice
-                        if (result.getAssociatedAdvice() != null && result.getAssociatedAdvice().size() > 0) {
-                                if (prettyPrint) sb.append("\n\t\t");
-                                sb.append("<AssociatedAdvice>");
-                                
-                                for (Advice advice : result.getAssociatedAdvice()) {
-                                        if (advice.getId() == null) {
-                                                throw new DOMStructureException("Advice must have AdviceId");
-                                        }
-                                        if (prettyPrint) sb.append("\n\t\t\t");
-                                        sb.append("<Advice AdviceId=\"" + advice.getId().stringValue() + "\">");
-                                        
-                                        for (AttributeAssignment aa : advice.getAttributeAssignments()) {
-                                                if (prettyPrint) sb.append("\n\t\t\t\t");
-                                                sb.append("<AttributeAssignment");
-                                                
-                                                if (aa.getAttributeId() == null) {
-                                                        throw new DOMStructureException("Advice AttributeAssignment must have AttributeId");
-                                                }
-                                                sb.append(" AttributeId=\"" + aa.getAttributeId().stringValue() + "\"");
-                                                if (aa.getDataTypeId() == null || aa.getAttributeValue() == null || aa.getAttributeValue().getValue() == null) {
-                                                        throw new DOMStructureException("Advice AttributeAssignment '" + aa.getAttributeId().stringValue() + "' must have DataType and Value");
-                                                }
-                                                sb.append(" DataType=\"" + aa.getDataTypeId().stringValue() + "\"" + getNamespaces(aa.getAttributeValue().getValue()) + ">");
-                                                sb.append(outputValueValue(aa.getAttributeValue().getValue()));
+            if (prettyPrint) sb.append("\n\t");
 
-                                                sb.append("</AttributeAssignment>");
-                                        }
-                                        
-                                        if (prettyPrint) sb.append("\n\t\t\t");
-                                        sb.append("</Advice>");
-                                }
-                                
-                                if (prettyPrint) sb.append("\n\t\t");
-                                sb.append("</AssociatedAdvice>");
-                        }
-                        
-                        // Attributes
-                        if (result.getAttributes() != null && result.getAttributes().size() > 0) {
-                                // this may include attributes with IncludeInResult=false!
+            sb.append("<Result>");
 
-                                
-                                for (AttributeCategory category : result.getAttributes()) {
-                                        if (prettyPrint) sb.append("\n\t\t");
-                                        if (category.getCategory() == null) {
-                                                throw new DOMStructureException("Attributes must have Category");
-                                        }
-                                        sb.append("<Attributes Category=\"" + category.getCategory().stringValue() + "\">");
-                                        
-                                        for (Attribute attr : category.getAttributes()) {
-                                                if (attr.getIncludeInResults() == false) {
-                                                        // skip this one - do not include in results
-                                                        continue;
-                                                }
-                                                if (prettyPrint) sb.append("\n\t\t\t");
-                                                sb.append("<Attribute IncludeInResult=\""+ attr.getIncludeInResults()+"\"");
-                                                if (attr.getAttributeId() == null) {
-                                                        throw new DOMStructureException("Attribute inf Category '" + category.getCategory().stringValue() + "' must have AttributeId");
-                                                }
-                                                sb.append(" AttributeId=\"" + attr.getAttributeId().stringValue() + "\"");
-                                                if (attr.getIssuer() == null) {
-                                                        sb.append(">");
-                                                } else {
-                                                        sb.append(" Issuer=\"" + attr.getIssuer() + "\">");
-                                                }
-                                                
-                                                if (attr.getValues().size() == 0) {
-                                                        throw new DOMStructureException("Attribute '" + attr.getAttributeId() + "' must have at least one value");
-                                                }
-                                                for (AttributeValue<?> value : attr.getValues()) {
-                                                        if (value.getDataTypeId() == null || value.getValue() == null) {
-                                                                throw new DOMStructureException("Attribute '" + attr.getAttributeId() + "' has AttributeValue missing either DataType or Value");
-                                                        }
-                                                        if (prettyPrint) sb.append("\n\t\t\t\t");
-                                                        sb.append("<AttributeValue DataType=\"" + value.getDataTypeId().stringValue() + "\"");
-                                                        if (value.getXPathCategory() != null) {
-                                                                sb.append(" XPathCategory=\"" + value.getXPathCategory().stringValue() + "\"");
-                                                        }
-                                                        sb.append(">");
-                                                        
-                                                        sb.append(outputValueValue(value.getValue()));
-                                                        
-                                                        
-                                                        sb.append("</AttributeValue>");
-                                                }
-                                                
-                                                if (prettyPrint) sb.append("\n\t\t\t");
-                                                sb.append("</Attribute>");
-                                        }
-                                        
-                                        if (prettyPrint) sb.append("\n\t\t");
-                                        sb.append("</Attributes>");
-                                }
-                                
-                        }
-                        
-                        
-                        // PolicyIdentifierList
-                        Collection<IdReference> policyIds = result.getPolicyIdentifiers();
-                        Collection<IdReference> policySetIds = result.getPolicySetIdentifiers();
-                        if (policyIds != null && policyIds.size() > 0 || policySetIds != null && policySetIds.size() > 0) {
-                                if (prettyPrint) sb.append("\n\t\t\t");
-                                sb.append("<PolicyIdentifierList>");
-                                
-                                // individual Ids
-                                for (IdReference idReference : policyIds) {
-                                        if (idReference == null) {
-                                                throw new DOMStructureException("PolicyIdentifiers has null IdReference");
-                                        }
-                                        if (prettyPrint) sb.append("\n\t\t\t\t");
-                                        sb.append("<PolicyIdReference");
-                                        if (idReference.getVersion() != null) {
-                                                sb.append(" Version=\"" + idReference.getVersion().stringValue() + "\">");
-                                        } else {
-                                                sb.append(">");
-                                        }
-                                        sb.append(idReference.getId().stringValue());
-                                        sb.append("</PolicyIdReference>");		
-                                }
-                                // Set Ids
-                                for (IdReference idReference : policySetIds) {
-                                        if (idReference == null) {
-                                                throw new DOMStructureException("PolicySetIdentifiers has null IdReference");
-                                        }
-                                        if (prettyPrint) sb.append("\n\t\t\t\t");
-                                        sb.append("<PolicySetIdReference");
-                                        if (idReference.getVersion() != null) {
-                                                sb.append(" Version=\"" + idReference.getVersion().stringValue() + "\">");
-                                        } else {
-                                                sb.append(">");
-                                        }
-                                        sb.append(idReference.getId().stringValue());
-                                        sb.append("</PolicySetIdReference>");		
-                                }
-                                
-                                if (prettyPrint) sb.append("\n\t\t\t");
-                                sb.append("</PolicyIdentifierList>");
-                        }
-                        
-                        
-                        
-                        // end of Result
-                        if (prettyPrint) sb.append("\n\t");
-                        sb.append("</Result>");
+            // Decision
+            if (prettyPrint) sb.append("\n\t\t");
+
+            if (result.getDecision() == null) {
+                throw new DOMStructureException("Result missing Decision");
+            }
+            sb.append("<Decision>" + result.getDecision().toString() + "</Decision>");
+
+            // Status
+            Status status = result.getStatus();
+            if (status != null) {
+                if (prettyPrint) sb.append("\n\t\t");
+                sb.append("<Status>");
+
+                // status code
+                StatusCode statusCode = status.getStatusCode();
+                Identifier statusCodeId;
+                if (statusCode == null) {
+                    throw new DOMStructureException("Status must have StatusCode");
+                } else {
+                    statusCodeId = statusCode.getStatusCodeValue();
+                    // if there is a status code, it must agree with the decision
+                    // Permit/Deny/NotAllowed must all be OK
+                    // Indeterminate must not be OK
+                    if ( (statusCodeId.equals(StdStatusCode.STATUS_CODE_OK.getStatusCodeValue())  &&
+                            ! (result.getDecision() == Decision.DENY || result.getDecision() == Decision.PERMIT || result.getDecision() == Decision.NOTAPPLICABLE))  ||
+                            ( ! statusCodeId.equals(StdStatusCode.STATUS_CODE_OK.getStatusCodeValue())  &&
+                              ! (result.getDecision() == Decision.INDETERMINATE || result.getDecision() == Decision.INDETERMINATE_DENY ||
+                                 result.getDecision() == Decision.INDETERMINATE_DENYPERMIT || result.getDecision() == Decision.INDETERMINATE_PERMIT ))  ) {
+                        throw new DOMStructureException("StatusCode '" + statusCodeId.stringValue() + "' does not match Decision '" + result.getDecision().toString());
+                    }
+
+
+                    outputStatusCode(sb, statusCode, 3, prettyPrint);
                 }
-                
-                if (prettyPrint) sb.append("\n");
-                
-                sb.append("</Response>");
-                
-                // all done
-                
-                osw.write(sb.toString());
-                
-                // force output
-                osw.flush();
 
-        }
-        
-        
-        
-        
-        
-        
-        /**
-         * Unit test program to load an XML file containing a XACML Response document.
-         * 
-         * @param args the list of Response files to load and parse
-         */
-        public static void main(String[] args) {
-                if (args.length > 0) {
-                        DocumentBuilderFactory	documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                        documentBuilderFactory.setNamespaceAware(true);
-                        for (String xmlFileName: args) {
-                                File	fileXml	= new File(xmlFileName);
-                                if (!fileXml.exists()) {
-                                        System.err.println("Input file \"" + fileXml.getAbsolutePath() + "\" does not exist.");
-                                        continue;
-                                } else if (!fileXml.canRead()) {
-                                        System.err.println("Permission denied reading input file \"" + fileXml.getAbsolutePath() + "\"");
-                                        continue;
-                                }
-                                System.out.println(fileXml.getAbsolutePath() + ":");
-                                try {
-                                        DocumentBuilder	documentBuilder	= documentBuilderFactory.newDocumentBuilder();
-                                        assert(documentBuilder.isNamespaceAware());
-                                        Document documentResponse		= documentBuilder.parse(fileXml);
-                                        assert(documentResponse != null);
-                                        
-                                        NodeList children				= documentResponse.getChildNodes();
-                                        if (children == null || children.getLength() == 0) {
-                                                System.err.println("No Responses found in \"" + fileXml.getAbsolutePath() + "\"");
-                                                continue;
-                                        } else if (children.getLength() > 1) {
-                                                System.err.println("Multiple Responses found in \"" + fileXml.getAbsolutePath() + "\"");
-                                        }
-                                        Node nodeResponse				= children.item(0);
-                                        if (!nodeResponse.getLocalName().equals(XACML3.ELEMENT_RESPONSE)) {
-                                                System.err.println("\"" + fileXml.getAbsolutePath() + "\" is not a Response");
-                                                continue;
-                                        }
-                                        
-                                        Response domResponse			= DOMResponse.newInstance(nodeResponse);
-                                        System.out.println(domResponse.toString());
-                                        System.out.println();
-                                } catch (Exception ex) {
-                                        ex.printStackTrace(System.err);
-                                }
-                        }
+                // status message
+                if (status.getStatusMessage() != null) {
+
+                    if (prettyPrint) sb.append("\n\t\t\t");
+                    sb.append("<StatusMessage>" + status.getStatusMessage() + "</StatusMessage>");
+
                 }
+
+                // status detail
+                StatusDetail statusDetail = status.getStatusDetail();
+                if (statusDetail != null) {
+                    // cross-check that rules defined in XACML Core spec section 5.5.7 re: when StatusDetail may/may-not be included have been followed
+                    if (status.isOk()) {
+                        throw new DOMStructureException("Status '" + statusCodeId.stringValue() + "' must not return StatusDetail");
+                    } else if (statusCodeId.stringValue().equals(XACML3.ID_STATUS_MISSING_ATTRIBUTE.stringValue()) &&
+                               status.getStatusDetail().getMissingAttributeDetails() == null) {
+                        throw new DOMStructureException("Status '" + statusCodeId.stringValue() + "' has StatusDetail without MissingAttributeDetail");
+                    } else if (statusCodeId.stringValue().equals(XACML3.ID_STATUS_SYNTAX_ERROR.stringValue()))  {
+                        throw new DOMStructureException("Status '" + statusCodeId.stringValue() + "' must not return StatusDetail");
+                    } else if (statusCodeId.stringValue().equals(XACML3.ID_STATUS_PROCESSING_ERROR.stringValue()))  {
+                        throw new DOMStructureException("Status '" + statusCodeId.stringValue() + "' must not return StatusDetail");
+                    }
+
+                    // if included, StatusDetail is handled differently for each type of detail message and the contents are formatted into escaped XML rather than objects
+
+                    if (result.getStatus().getStatusDetail().getMissingAttributeDetails() != null) {
+                        if (prettyPrint) sb.append("\n\t\t\t");
+                        sb.append("<StatusDetail>");
+
+                        for (MissingAttributeDetail mad : statusDetail.getMissingAttributeDetails()) {
+                            if (mad.getAttributeId() == null || mad.getCategory() == null || mad.getDataTypeId() == null) {
+                                throw new DOMStructureException("MissingAttributeDetail is missing required AttributeId, Category or DataTypeId");
+                            }
+                            if (prettyPrint) sb.append("\n\t\t\t\t");
+                            sb.append("<MissingAttributeDetail");
+                            sb.append(" Category=\"" + mad.getCategory().stringValue() + "\"");
+                            sb.append(" AttributeId=\"" + mad.getAttributeId().stringValue() + "\"");
+                            sb.append(" DataTypeId=\"" + mad.getDataTypeId().stringValue() + "\"");
+                            if (mad.getIssuer() != null) {
+                                sb.append(" Issuer=\"" + mad.getIssuer() + "\"");
+                            }
+                            sb.append(">");
+                            if (mad.getAttributeValues() != null) {
+                                for (AttributeValue<?> value : mad.getAttributeValues()) {
+                                    if (prettyPrint) {
+                                        sb.append("\n\t\t\t\t\t");
+                                    }
+                                    sb.append("<AttributeValue" + getNamespaces(value.getValue()) + ">" + outputValueValue(value.getValue()) + "</AttributeValue>");
+                                }
+                            }
+                            if (prettyPrint) {
+                                sb.append("\n\t\t\t\t");
+                            }
+                            sb.append("</MissingAttributeDetail>");
+                        }
+
+                        if (prettyPrint) {
+                            sb.append("\n\t\t\t");
+                        }
+                        sb.append("</StatusDetail>");
+                    }
+                }
+
+                if (prettyPrint) sb.append("\n\t\t");
+                sb.append("</Status>");
+            }
+
+            // Obligations
+            if (result.getObligations() != null && result.getObligations().size() > 0) {
+                if (prettyPrint) sb.append("\n\t\t");
+                sb.append("<Obligations>");
+
+                for (Obligation obligation : result.getObligations()) {
+                    if (obligation.getId() == null) {
+                        throw new DOMStructureException("Obligation must have ObligationId");
+                    }
+                    if (prettyPrint) sb.append("\n\t\t\t");
+                    sb.append("<Obligation ObligationId=\"" + obligation.getId().stringValue() + "\">");
+
+                    for (AttributeAssignment aa : obligation.getAttributeAssignments()) {
+                        if (prettyPrint) sb.append("\n\t\t\t\t");
+                        sb.append("<AttributeAssignment");
+
+                        if (aa.getAttributeId() == null) {
+                            throw new DOMStructureException("Obligation AttributeAssignment must have AttributeId");
+                        }
+                        sb.append(" AttributeId=\"" + aa.getAttributeId().stringValue() + "\"");
+                        if (aa.getDataTypeId() == null || aa.getAttributeValue() == null || aa.getAttributeValue().getValue() == null) {
+                            throw new DOMStructureException("Obligation AttributeAssignment '" + aa.getAttributeId().stringValue() + "' must have DataType and Value");
+                        }
+                        sb.append(" DataType=\"" + aa.getDataTypeId().stringValue() + "\"" + getNamespaces(aa.getAttributeValue().getValue()) + ">");
+                        sb.append(outputValueValue(aa.getAttributeValue().getValue()));
+
+                        sb.append("</AttributeAssignment>");
+                    }
+
+                    if (prettyPrint) sb.append("\n\t\t\t");
+                    sb.append("</Obligation>");
+                }
+
+                if (prettyPrint) sb.append("\n\t\t");
+                sb.append("</Obligations>");
+            }
+
+            // AssociatedAdvice
+            if (result.getAssociatedAdvice() != null && result.getAssociatedAdvice().size() > 0) {
+                if (prettyPrint) sb.append("\n\t\t");
+                sb.append("<AssociatedAdvice>");
+
+                for (Advice advice : result.getAssociatedAdvice()) {
+                    if (advice.getId() == null) {
+                        throw new DOMStructureException("Advice must have AdviceId");
+                    }
+                    if (prettyPrint) sb.append("\n\t\t\t");
+                    sb.append("<Advice AdviceId=\"" + advice.getId().stringValue() + "\">");
+
+                    for (AttributeAssignment aa : advice.getAttributeAssignments()) {
+                        if (prettyPrint) sb.append("\n\t\t\t\t");
+                        sb.append("<AttributeAssignment");
+
+                        if (aa.getAttributeId() == null) {
+                            throw new DOMStructureException("Advice AttributeAssignment must have AttributeId");
+                        }
+                        sb.append(" AttributeId=\"" + aa.getAttributeId().stringValue() + "\"");
+                        if (aa.getDataTypeId() == null || aa.getAttributeValue() == null || aa.getAttributeValue().getValue() == null) {
+                            throw new DOMStructureException("Advice AttributeAssignment '" + aa.getAttributeId().stringValue() + "' must have DataType and Value");
+                        }
+                        sb.append(" DataType=\"" + aa.getDataTypeId().stringValue() + "\"" + getNamespaces(aa.getAttributeValue().getValue()) + ">");
+                        sb.append(outputValueValue(aa.getAttributeValue().getValue()));
+
+                        sb.append("</AttributeAssignment>");
+                    }
+
+                    if (prettyPrint) sb.append("\n\t\t\t");
+                    sb.append("</Advice>");
+                }
+
+                if (prettyPrint) sb.append("\n\t\t");
+                sb.append("</AssociatedAdvice>");
+            }
+
+            // Attributes
+            if (result.getAttributes() != null && result.getAttributes().size() > 0) {
+                // this may include attributes with IncludeInResult=false!
+
+
+                for (AttributeCategory category : result.getAttributes()) {
+                    if (prettyPrint) sb.append("\n\t\t");
+                    if (category.getCategory() == null) {
+                        throw new DOMStructureException("Attributes must have Category");
+                    }
+                    sb.append("<Attributes Category=\"" + category.getCategory().stringValue() + "\">");
+
+                    for (Attribute attr : category.getAttributes()) {
+                        if (attr.getIncludeInResults() == false) {
+                            // skip this one - do not include in results
+                            continue;
+                        }
+                        if (prettyPrint) sb.append("\n\t\t\t");
+                        sb.append("<Attribute IncludeInResult=\""+ attr.getIncludeInResults()+"\"");
+                        if (attr.getAttributeId() == null) {
+                            throw new DOMStructureException("Attribute inf Category '" + category.getCategory().stringValue() + "' must have AttributeId");
+                        }
+                        sb.append(" AttributeId=\"" + attr.getAttributeId().stringValue() + "\"");
+                        if (attr.getIssuer() == null) {
+                            sb.append(">");
+                        } else {
+                            sb.append(" Issuer=\"" + attr.getIssuer() + "\">");
+                        }
+
+                        if (attr.getValues().size() == 0) {
+                            throw new DOMStructureException("Attribute '" + attr.getAttributeId() + "' must have at least one value");
+                        }
+                        for (AttributeValue<?> value : attr.getValues()) {
+                            if (value.getDataTypeId() == null || value.getValue() == null) {
+                                throw new DOMStructureException("Attribute '" + attr.getAttributeId() + "' has AttributeValue missing either DataType or Value");
+                            }
+                            if (prettyPrint) sb.append("\n\t\t\t\t");
+                            sb.append("<AttributeValue DataType=\"" + value.getDataTypeId().stringValue() + "\"");
+                            if (value.getXPathCategory() != null) {
+                                sb.append(" XPathCategory=\"" + value.getXPathCategory().stringValue() + "\"");
+                            }
+                            sb.append(">");
+
+                            sb.append(outputValueValue(value.getValue()));
+
+
+                            sb.append("</AttributeValue>");
+                        }
+
+                        if (prettyPrint) sb.append("\n\t\t\t");
+                        sb.append("</Attribute>");
+                    }
+
+                    if (prettyPrint) sb.append("\n\t\t");
+                    sb.append("</Attributes>");
+                }
+
+            }
+
+
+            // PolicyIdentifierList
+            Collection<IdReference> policyIds = result.getPolicyIdentifiers();
+            Collection<IdReference> policySetIds = result.getPolicySetIdentifiers();
+            if (policyIds != null && policyIds.size() > 0 || policySetIds != null && policySetIds.size() > 0) {
+                if (prettyPrint) sb.append("\n\t\t\t");
+                sb.append("<PolicyIdentifierList>");
+
+                // individual Ids
+                for (IdReference idReference : policyIds) {
+                    if (idReference == null) {
+                        throw new DOMStructureException("PolicyIdentifiers has null IdReference");
+                    }
+                    if (prettyPrint) sb.append("\n\t\t\t\t");
+                    sb.append("<PolicyIdReference");
+                    if (idReference.getVersion() != null) {
+                        sb.append(" Version=\"" + idReference.getVersion().stringValue() + "\">");
+                    } else {
+                        sb.append(">");
+                    }
+                    sb.append(idReference.getId().stringValue());
+                    sb.append("</PolicyIdReference>");
+                }
+                // Set Ids
+                for (IdReference idReference : policySetIds) {
+                    if (idReference == null) {
+                        throw new DOMStructureException("PolicySetIdentifiers has null IdReference");
+                    }
+                    if (prettyPrint) sb.append("\n\t\t\t\t");
+                    sb.append("<PolicySetIdReference");
+                    if (idReference.getVersion() != null) {
+                        sb.append(" Version=\"" + idReference.getVersion().stringValue() + "\">");
+                    } else {
+                        sb.append(">");
+                    }
+                    sb.append(idReference.getId().stringValue());
+                    sb.append("</PolicySetIdReference>");
+                }
+
+                if (prettyPrint) sb.append("\n\t\t\t");
+                sb.append("</PolicyIdentifierList>");
+            }
+
+
+
+            // end of Result
+            if (prettyPrint) sb.append("\n\t");
+            sb.append("</Result>");
         }
 
+        if (prettyPrint) sb.append("\n");
+
+        sb.append("</Response>");
+
+        // all done
+
+        osw.write(sb.toString());
+
+        // force output
+        osw.flush();
+
+    }
+
+
+
+
+
+
+    /**
+     * Unit test program to load an XML file containing a XACML Response document.
+     *
+     * @param args the list of Response files to load and parse
+     */
+    public static void main(String[] args) {
+        if (args.length > 0) {
+            DocumentBuilderFactory	documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+            documentBuilderFactory.setNamespaceAware(true);
+            for (String xmlFileName: args) {
+                File	fileXml	= new File(xmlFileName);
+                if (!fileXml.exists()) {
+                    System.err.println("Input file \"" + fileXml.getAbsolutePath() + "\" does not exist.");
+                    continue;
+                } else if (!fileXml.canRead()) {
+                    System.err.println("Permission denied reading input file \"" + fileXml.getAbsolutePath() + "\"");
+                    continue;
+                }
+                System.out.println(fileXml.getAbsolutePath() + ":");
+                try {
+                    DocumentBuilder	documentBuilder	= documentBuilderFactory.newDocumentBuilder();
+                    assert(documentBuilder.isNamespaceAware());
+                    Document documentResponse		= documentBuilder.parse(fileXml);
+                    assert(documentResponse != null);
+
+                    NodeList children				= documentResponse.getChildNodes();
+                    if (children == null || children.getLength() == 0) {
+                        System.err.println("No Responses found in \"" + fileXml.getAbsolutePath() + "\"");
+                        continue;
+                    } else if (children.getLength() > 1) {
+                        System.err.println("Multiple Responses found in \"" + fileXml.getAbsolutePath() + "\"");
+                    }
+                    Node nodeResponse				= children.item(0);
+                    if (!nodeResponse.getLocalName().equals(XACML3.ELEMENT_RESPONSE)) {
+                        System.err.println("\"" + fileXml.getAbsolutePath() + "\" is not a Response");
+                        continue;
+                    }
+
+                    Response domResponse			= DOMResponse.newInstance(nodeResponse);
+                    System.out.println(domResponse.toString());
+                    System.out.println();
+                } catch (Exception ex) {
+                    ex.printStackTrace(System.err);
+                }
+            }
+        }
+    }
+
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMResult.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMResult.java
index 8801c51..8296525 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMResult.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,172 +45,172 @@
 /**
  * DOMResult extends {@link com.att.research.xacml.std.StdMutableResult} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMResult {
-        private static final Log logger	= LogFactory.getLog(DOMResult.class);
-        
-        protected DOMResult() {
+    private static final Log logger	= LogFactory.getLog(DOMResult.class);
+
+    protected DOMResult() {
+    }
+
+    /**
+     * Creates a new <code>DOMResult</code> by parsing the given <code>Node</code> representing a XACML Result element.
+     *
+     * @param nodeResult the <code>Node</code> representing the XACML Result element
+     * @return a new <code>DOMResult</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static Result newInstance(Node nodeResult) throws DOMStructureException {
+        Element elementResult	= DOMUtil.getElement(nodeResult);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        StdMutableResult mutableResult		= new StdMutableResult();
+
+        NodeList children		= elementResult.getChildNodes();
+        int numChildren;
+
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child			= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_DECISION.equals(childName)) {
+                            Decision decision	= Decision.get(child.getTextContent());
+                            if (decision == null) {
+                                if (!bLenient) {
+                                    throw new DOMStructureException(child, "Unknown Decision \"" + child.getTextContent() + "\" in \"" + DOMUtil.getNodeLabel(child) + "\"");
+                                }
+                            } else {
+                                mutableResult.setDecision(decision);
+                            }
+                        } else if (XACML3.ELEMENT_STATUS.equals(childName)) {
+                            mutableResult.setStatus(DOMStatus.newInstance(child));
+                        } else if (XACML3.ELEMENT_OBLIGATIONS.equals(childName)) {
+                            mutableResult.addObligations(DOMObligation.newList(child));
+                        } else if (XACML3.ELEMENT_ASSOCIATEDADVICE.equals(childName)) {
+                            mutableResult.addAdvice(DOMAdvice.newList(child));
+                        } else if (XACML3.ELEMENT_ATTRIBUTES.equals(childName)) {
+                            mutableResult.addAttributeCategory(DOMAttributeCategory.newInstance(child));
+                        } else if (XACML3.ELEMENT_POLICYIDENTIFIERLIST.equals(childName)) {
+                            NodeList grandchildren	= child.getChildNodes();
+                            int numGrandchildren;
+                            if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
+                                for (int j = 0 ; j < numGrandchildren ; j++) {
+                                    Node grandchild	= grandchildren.item(j);
+                                    if (DOMUtil.isElement(grandchild)) {
+                                        String grandchildName	= grandchild.getLocalName();
+                                        if (DOMUtil.isInNamespace(grandchild, XACML3.XMLNS)) {
+                                            if (XACML3.ELEMENT_POLICYIDREFERENCE.equals(grandchildName)) {
+                                                mutableResult.addPolicyIdentifier(DOMIdReference.newInstance(grandchild));
+                                            } else if (XACML3.ELEMENT_POLICYSETIDREFERENCE.equals(grandchildName)) {
+                                                mutableResult.addPolicySetIdentifier(DOMIdReference.newInstance(grandchild));
+                                            } else {
+                                                if (!bLenient) {
+                                                    throw DOMUtil.newUnexpectedElementException(grandchild, child);
+                                                }
+                                            }
+                                        } else {
+                                            if (!bLenient) {
+                                                throw DOMUtil.newUnexpectedElementException(grandchild, child);
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeResult);
+                            }
+                        }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeResult);
+                        }
+                    }
+                }
+            }
         }
 
-        /**
-         * Creates a new <code>DOMResult</code> by parsing the given <code>Node</code> representing a XACML Result element.
-         * 
-         * @param nodeResult the <code>Node</code> representing the XACML Result element
-         * @return a new <code>DOMResult</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static Result newInstance(Node nodeResult) throws DOMStructureException {
-                Element elementResult	= DOMUtil.getElement(nodeResult);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                StdMutableResult mutableResult		= new StdMutableResult();
-                
-                NodeList children		= elementResult.getChildNodes();
-                int numChildren;
-                
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child			= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_DECISION.equals(childName)) {
-                                                        Decision decision	= Decision.get(child.getTextContent());
-                                                        if (decision == null) {
-                                                                if (!bLenient) {
-                                                                        throw new DOMStructureException(child, "Unknown Decision \"" + child.getTextContent() + "\" in \"" + DOMUtil.getNodeLabel(child) + "\"");
-                                                                }
-                                                        } else {
-                                                                mutableResult.setDecision(decision);
-                                                        }
-                                                } else if (XACML3.ELEMENT_STATUS.equals(childName)) {
-                                                        mutableResult.setStatus(DOMStatus.newInstance(child));
-                                                } else if (XACML3.ELEMENT_OBLIGATIONS.equals(childName)) {
-                                                        mutableResult.addObligations(DOMObligation.newList(child));
-                                                } else if (XACML3.ELEMENT_ASSOCIATEDADVICE.equals(childName)) {
-                                                        mutableResult.addAdvice(DOMAdvice.newList(child));
-                                                } else if (XACML3.ELEMENT_ATTRIBUTES.equals(childName)) {
-                                                        mutableResult.addAttributeCategory(DOMAttributeCategory.newInstance(child));
-                                                } else if (XACML3.ELEMENT_POLICYIDENTIFIERLIST.equals(childName)) {
-                                                        NodeList grandchildren	= child.getChildNodes();
-                                                        int numGrandchildren;
-                                                        if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
-                                                                for (int j = 0 ; j < numGrandchildren ; j++) {
-                                                                        Node grandchild	= grandchildren.item(j);
-                                                                        if (DOMUtil.isElement(grandchild)) {
-                                                                                String grandchildName	= grandchild.getLocalName();
-                                                                                if (DOMUtil.isInNamespace(grandchild, XACML3.XMLNS)) {
-                                                                                        if (XACML3.ELEMENT_POLICYIDREFERENCE.equals(grandchildName)) {
-                                                                                                mutableResult.addPolicyIdentifier(DOMIdReference.newInstance(grandchild));
-                                                                                        } else if (XACML3.ELEMENT_POLICYSETIDREFERENCE.equals(grandchildName)) {
-                                                                                                mutableResult.addPolicySetIdentifier(DOMIdReference.newInstance(grandchild));
-                                                                                        } else {
-                                                                                                if (!bLenient) {
-                                                                                                        throw DOMUtil.newUnexpectedElementException(grandchild, child);
-                                                                                                }
-                                                                                        }
-                                                                                } else {
-                                                                                        if (!bLenient) {
-                                                                                                throw DOMUtil.newUnexpectedElementException(grandchild, child);
-                                                                                        }
-                                                                                }
-                                                                        }
-                                                                }
-                                                        }
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeResult);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeResult);
-                                                }
-                                        }
-                                }
-                        }
-                }
-                
-                if (mutableResult.getDecision() == null && !bLenient) {
-                        throw DOMUtil.newMissingElementException(nodeResult, XACML3.XMLNS, XACML3.ELEMENT_DECISION);
-                }
-                return new StdResult(mutableResult);		
+        if (mutableResult.getDecision() == null && !bLenient) {
+            throw DOMUtil.newMissingElementException(nodeResult, XACML3.XMLNS, XACML3.ELEMENT_DECISION);
         }
-        
-        public static boolean repair(Node nodeResult) throws DOMStructureException {
-                Element elementResult	= DOMUtil.getElement(nodeResult);
-                boolean result			= false;
-                
-                NodeList children		= elementResult.getChildNodes();
-                int numChildren;
-                boolean sawDecision		= false;
-                
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child			= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_DECISION.equals(childName)) {
-                                                        Decision decision	= Decision.get(child.getTextContent());
-                                                        if (decision == null) {
-                                                                throw new DOMStructureException(child, "Unknown Decision \"" + child.getTextContent() + "\" in \"" + DOMUtil.getNodeLabel(child) + "\"");
-                                                        }
-                                                        sawDecision	= true;
-                                                } else if (XACML3.ELEMENT_STATUS.equals(childName)) {
-                                                        result	= DOMStatus.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_OBLIGATIONS.equals(childName)) {
-                                                        result	= DOMObligation.repairList(child) || result;
-                                                } else if (XACML3.ELEMENT_ASSOCIATEDADVICE.equals(childName)) {
-                                                        result	= DOMAdvice.repairList(child) || result;
-                                                } else if (XACML3.ELEMENT_ATTRIBUTES.equals(childName)) {
-                                                        result	= DOMAttributeCategory.repair(child) || result;
-                                                } else if (XACML3.ELEMENT_POLICYIDENTIFIERLIST.equals(childName)) {
-                                                        NodeList grandchildren	= child.getChildNodes();
-                                                        int numGrandchildren;
-                                                        if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
-                                                                for (int j = 0 ; j < numGrandchildren ; j++) {
-                                                                        Node grandchild	= grandchildren.item(j);
-                                                                        if (DOMUtil.isElement(grandchild)) {
-                                                                                String grandchildName	= grandchild.getLocalName();
-                                                                                if (DOMUtil.isInNamespace(grandchild, XACML3.XMLNS)) {
-                                                                                        if (XACML3.ELEMENT_POLICYIDREFERENCE.equals(grandchildName)) {
-                                                                                                result			= DOMIdReference.repair(grandchild) || result;
-                                                                                        } else if (XACML3.ELEMENT_POLICYSETIDREFERENCE.equals(grandchildName)) {
-                                                                                                result			= DOMIdReference.repair(grandchild) || result;
-                                                                                        } else {
-                                                                                                logger.warn("Unexpected element " + grandchild.getNodeName());
-                                                                                                child.removeChild(grandchild);
-                                                                                                result	= true;
-                                                                                        }
-                                                                                } else {
-                                                                                        logger.warn("Unexpected element " + grandchild.getNodeName());
-                                                                                        child.removeChild(grandchild);
-                                                                                        result	= true;
-                                                                                }
-                                                                        }
-                                                                }
-                                                        }
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementResult.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementResult.removeChild(child);
+        return new StdResult(mutableResult);
+    }
+
+    public static boolean repair(Node nodeResult) throws DOMStructureException {
+        Element elementResult	= DOMUtil.getElement(nodeResult);
+        boolean result			= false;
+
+        NodeList children		= elementResult.getChildNodes();
+        int numChildren;
+        boolean sawDecision		= false;
+
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child			= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_DECISION.equals(childName)) {
+                            Decision decision	= Decision.get(child.getTextContent());
+                            if (decision == null) {
+                                throw new DOMStructureException(child, "Unknown Decision \"" + child.getTextContent() + "\" in \"" + DOMUtil.getNodeLabel(child) + "\"");
+                            }
+                            sawDecision	= true;
+                        } else if (XACML3.ELEMENT_STATUS.equals(childName)) {
+                            result	= DOMStatus.repair(child) || result;
+                        } else if (XACML3.ELEMENT_OBLIGATIONS.equals(childName)) {
+                            result	= DOMObligation.repairList(child) || result;
+                        } else if (XACML3.ELEMENT_ASSOCIATEDADVICE.equals(childName)) {
+                            result	= DOMAdvice.repairList(child) || result;
+                        } else if (XACML3.ELEMENT_ATTRIBUTES.equals(childName)) {
+                            result	= DOMAttributeCategory.repair(child) || result;
+                        } else if (XACML3.ELEMENT_POLICYIDENTIFIERLIST.equals(childName)) {
+                            NodeList grandchildren	= child.getChildNodes();
+                            int numGrandchildren;
+                            if (grandchildren != null && (numGrandchildren = grandchildren.getLength()) > 0) {
+                                for (int j = 0 ; j < numGrandchildren ; j++) {
+                                    Node grandchild	= grandchildren.item(j);
+                                    if (DOMUtil.isElement(grandchild)) {
+                                        String grandchildName	= grandchild.getLocalName();
+                                        if (DOMUtil.isInNamespace(grandchild, XACML3.XMLNS)) {
+                                            if (XACML3.ELEMENT_POLICYIDREFERENCE.equals(grandchildName)) {
+                                                result			= DOMIdReference.repair(grandchild) || result;
+                                            } else if (XACML3.ELEMENT_POLICYSETIDREFERENCE.equals(grandchildName)) {
+                                                result			= DOMIdReference.repair(grandchild) || result;
+                                            } else {
+                                                logger.warn("Unexpected element " + grandchild.getNodeName());
+                                                child.removeChild(grandchild);
                                                 result	= true;
+                                            }
+                                        } else {
+                                            logger.warn("Unexpected element " + grandchild.getNodeName());
+                                            child.removeChild(grandchild);
+                                            result	= true;
                                         }
+                                    }
                                 }
+                            }
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementResult.removeChild(child);
+                            result	= true;
                         }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementResult.removeChild(child);
+                        result	= true;
+                    }
                 }
-                
-                if (!sawDecision) {
-                        throw DOMUtil.newMissingElementException(nodeResult, XACML3.XMLNS, XACML3.ELEMENT_DECISION);	
-                }
-                return result;
+            }
         }
+
+        if (!sawDecision) {
+            throw DOMUtil.newMissingElementException(nodeResult, XACML3.XMLNS, XACML3.ELEMENT_DECISION);
+        }
+        return result;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatus.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatus.java
index 45fcaab..ae94ec5 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatus.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatus.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,101 +44,101 @@
 /**
  * DOMStatus extends {@link com.att.research.xacml.std.StdMutableStatus} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMStatus {
-        private static final Log logger	= LogFactory.getLog(DOMStatus.class);
-        
-        protected DOMStatus() {
+    private static final Log logger	= LogFactory.getLog(DOMStatus.class);
+
+    protected DOMStatus() {
+    }
+
+    /**
+     * Creates a new <code>DOMStatus</code> by parsing the given <code>Node</code> representing a XACML Status element.
+     *
+     * @param nodeStatus the <code>Node</code> representing the Status element
+     * @return a new <code>DOMStatus</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static Status newInstance(Node nodeStatus) throws DOMStructureException {
+        Element elementStatus	= DOMUtil.getElement(nodeStatus);
+        boolean bLenient		= DOMProperties.isLenient();
+
+        StdMutableStatus mutableStatus		= new StdMutableStatus();
+
+        NodeList children	= elementStatus.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_STATUSCODE.equals(childName)) {
+                            mutableStatus.setStatusCode(DOMStatusCode.newInstance(child));
+                        } else if (XACML3.ELEMENT_STATUSMESSAGE.equals(childName)) {
+                            mutableStatus.setStatusMessage(child.getTextContent());
+                        } else if (XACML3.ELEMENT_STATUSDETAIL.equals(childName)) {
+                            mutableStatus.setStatusDetail(DOMStatusDetail.newInstance(child));
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeStatus);
+                            }
+                        }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeStatus);
+                        }
+                    }
+                }
+            }
         }
 
-        /**
-         * Creates a new <code>DOMStatus</code> by parsing the given <code>Node</code> representing a XACML Status element.
-         * 
-         * @param nodeStatus the <code>Node</code> representing the Status element
-         * @return a new <code>DOMStatus</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static Status newInstance(Node nodeStatus) throws DOMStructureException {
-                Element elementStatus	= DOMUtil.getElement(nodeStatus);
-                boolean bLenient		= DOMProperties.isLenient();
-                
-                StdMutableStatus mutableStatus		= new StdMutableStatus();
-                
-                NodeList children	= elementStatus.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_STATUSCODE.equals(childName)) {
-                                                        mutableStatus.setStatusCode(DOMStatusCode.newInstance(child));
-                                                } else if (XACML3.ELEMENT_STATUSMESSAGE.equals(childName)) {
-                                                        mutableStatus.setStatusMessage(child.getTextContent());
-                                                } else if (XACML3.ELEMENT_STATUSDETAIL.equals(childName)) {
-                                                        mutableStatus.setStatusDetail(DOMStatusDetail.newInstance(child));
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeStatus);
-                                                        }
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeStatus);
-                                                }
-                                        }
-                                }
-                        }
-                }
-                
-                if (mutableStatus.getStatusCode() == null && !bLenient) {
-                        throw DOMUtil.newMissingElementException(nodeStatus, XACML3.XMLNS, XACML3.ELEMENT_STATUSCODE);
-                }
-                
-                return new StdStatus(mutableStatus);
+        if (mutableStatus.getStatusCode() == null && !bLenient) {
+            throw DOMUtil.newMissingElementException(nodeStatus, XACML3.XMLNS, XACML3.ELEMENT_STATUSCODE);
         }
-        
-        public static boolean repair(Node nodeStatus) throws DOMStructureException {
-                Element elementStatus	= DOMUtil.getElement(nodeStatus);
-                boolean result			= false;
-                
-                NodeList children		= elementStatus.getChildNodes();
-                int numChildren;
-                boolean sawStatusCode	= false;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                String childName	= child.getLocalName();
-                                                if (XACML3.ELEMENT_STATUSCODE.equals(childName)) {
-                                                        result	= DOMStatusCode.repair(child) || result;
-                                                        sawStatusCode	= true;
-                                                } else if (XACML3.ELEMENT_STATUSMESSAGE.equals(childName)) {
-                                                } else if (XACML3.ELEMENT_STATUSDETAIL.equals(childName)) {
-                                                        result = DOMStatusDetail.repair(child) || result;
-                                                } else {
-                                                        logger.warn("Unexpected element " + child.getNodeName());
-                                                        elementStatus.removeChild(child);
-                                                        result	= true;
-                                                }
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementStatus.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+
+        return new StdStatus(mutableStatus);
+    }
+
+    public static boolean repair(Node nodeStatus) throws DOMStructureException {
+        Element elementStatus	= DOMUtil.getElement(nodeStatus);
+        boolean result			= false;
+
+        NodeList children		= elementStatus.getChildNodes();
+        int numChildren;
+        boolean sawStatusCode	= false;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        String childName	= child.getLocalName();
+                        if (XACML3.ELEMENT_STATUSCODE.equals(childName)) {
+                            result	= DOMStatusCode.repair(child) || result;
+                            sawStatusCode	= true;
+                        } else if (XACML3.ELEMENT_STATUSMESSAGE.equals(childName)) {
+                        } else if (XACML3.ELEMENT_STATUSDETAIL.equals(childName)) {
+                            result = DOMStatusDetail.repair(child) || result;
+                        } else {
+                            logger.warn("Unexpected element " + child.getNodeName());
+                            elementStatus.removeChild(child);
+                            result	= true;
                         }
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementStatus.removeChild(child);
+                        result	= true;
+                    }
                 }
-                
-                if (!sawStatusCode) {
-                        throw DOMUtil.newMissingElementException(nodeStatus, XACML3.XMLNS, XACML3.ELEMENT_STATUSCODE);			
-                }
-                
-                return result;
+            }
         }
+
+        if (!sawStatusCode) {
+            throw DOMUtil.newMissingElementException(nodeStatus, XACML3.XMLNS, XACML3.ELEMENT_STATUSCODE);
+        }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatusCode.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatusCode.java
index 8d641ab..d707ae0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatusCode.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatusCode.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,84 +44,84 @@
 /**
  * DOMStatusCode extends {@link com.att.research.xacml.comomon.std.StdStatusCode} with methods for creation from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMStatusCode {
-        private static final Log logger	= LogFactory.getLog(DOMStatusCode.class);
-        
-        protected DOMStatusCode() {
-        }
-        
-        /**
-         * Creates a new <code>DOMStatusCode</code> by parsing the given <code>Node</code> representing a XACML StatusCode element.
-         * 
-         * @param nodeStatusCode the <code>Node</code> representing a StatusCode element
-         * @return a new <code>DOMStatusCode</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static StatusCode newInstance(Node nodeStatusCode) throws DOMStructureException {
-                Element elementStatusCode	= DOMUtil.getElement(nodeStatusCode);
-                boolean bLenient			= DOMProperties.isLenient();
-                
-                Identifier identifierStatusCode	= DOMUtil.getIdentifierAttribute(elementStatusCode, XACML3.ATTRIBUTE_VALUE, !bLenient);
-                StatusCode statusCodeChild		= null;
-                
-                NodeList children	= elementStatusCode.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                if (child.getLocalName().equals(XACML3.ELEMENT_STATUSCODE)) {
-                                                        if (statusCodeChild != null) {
-                                                                if (!bLenient) {
-                                                                        throw DOMUtil.newUnexpectedElementException(child, nodeStatusCode);
-                                                                }
-                                                        } else {
-                                                                statusCodeChild	= DOMStatusCode.newInstance(child);
-                                                        }
-                                                } else {
-                                                        if (!bLenient) {
-                                                                throw DOMUtil.newUnexpectedElementException(child, nodeStatusCode);
-                                                        }							
-                                                }
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeStatusCode);
-                                                }
-                                        }
+    private static final Log logger	= LogFactory.getLog(DOMStatusCode.class);
+
+    protected DOMStatusCode() {
+    }
+
+    /**
+     * Creates a new <code>DOMStatusCode</code> by parsing the given <code>Node</code> representing a XACML StatusCode element.
+     *
+     * @param nodeStatusCode the <code>Node</code> representing a StatusCode element
+     * @return a new <code>DOMStatusCode</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static StatusCode newInstance(Node nodeStatusCode) throws DOMStructureException {
+        Element elementStatusCode	= DOMUtil.getElement(nodeStatusCode);
+        boolean bLenient			= DOMProperties.isLenient();
+
+        Identifier identifierStatusCode	= DOMUtil.getIdentifierAttribute(elementStatusCode, XACML3.ATTRIBUTE_VALUE, !bLenient);
+        StatusCode statusCodeChild		= null;
+
+        NodeList children	= elementStatusCode.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        if (child.getLocalName().equals(XACML3.ELEMENT_STATUSCODE)) {
+                            if (statusCodeChild != null) {
+                                if (!bLenient) {
+                                    throw DOMUtil.newUnexpectedElementException(child, nodeStatusCode);
                                 }
+                            } else {
+                                statusCodeChild	= DOMStatusCode.newInstance(child);
+                            }
+                        } else {
+                            if (!bLenient) {
+                                throw DOMUtil.newUnexpectedElementException(child, nodeStatusCode);
+                            }
                         }
-                }
-                return new StdStatusCode(identifierStatusCode, statusCodeChild);
-        }
-        
-        public static boolean repair(Node nodeStatusCode) throws DOMStructureException {
-                Element elementStatusCode	= DOMUtil.getElement(nodeStatusCode);
-                boolean result				= false;
-                
-                result						= DOMUtil.repairIdentifierAttribute(elementStatusCode, XACML3.ATTRIBUTE_VALUE, logger) || result;
-                
-                NodeList children	= elementStatusCode.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
-                                                result		= DOMStatusCode.repair(child) || result;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementStatusCode.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeStatusCode);
                         }
+                    }
                 }
-                return result;
+            }
         }
+        return new StdStatusCode(identifierStatusCode, statusCodeChild);
+    }
+
+    public static boolean repair(Node nodeStatusCode) throws DOMStructureException {
+        Element elementStatusCode	= DOMUtil.getElement(nodeStatusCode);
+        boolean result				= false;
+
+        result						= DOMUtil.repairIdentifierAttribute(elementStatusCode, XACML3.ATTRIBUTE_VALUE, logger) || result;
+
+        NodeList children	= elementStatusCode.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS)) {
+                        result		= DOMStatusCode.repair(child) || result;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementStatusCode.removeChild(child);
+                        result	= true;
+                    }
+                }
+            }
+        }
+        return result;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatusDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatusDetail.java
index 100e938..ce31303 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatusDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStatusDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,70 +44,70 @@
 /**
  * DOMStatusDetail extends {@link com.att.research.xacml.std.StdMutableStatusDetail} with methods for construction from
  * DOM {@link org.w3c.dom.Node}s.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMStatusDetail {
-        private static final Log logger	= LogFactory.getLog(DOMStatusDetail.class);
-        
-        protected DOMStatusDetail() {
+    private static final Log logger	= LogFactory.getLog(DOMStatusDetail.class);
+
+    protected DOMStatusDetail() {
+    }
+
+    /**
+     * Creates a new <code>DOMStatusDetail</code> by parsing the given <code>Node</code> representing a XACML StatusDetail element.
+     *
+     * @param nodeStatusDetail the <code>Node</code> representing the StatusDetail element
+     * @return a new <code>DOMStatusDetail</code> parsed from the given <code>Node</code>
+     * @throws DOMStructureException if the conversion cannot be made
+     */
+    public static StatusDetail newInstance(Node nodeStatusDetail) throws DOMStructureException {
+        Element elementStatusDetail	= DOMUtil.getElement(nodeStatusDetail);
+        boolean bLenient			= DOMProperties.isLenient();
+
+        StdMutableStatusDetail mutableStatusDetail	= new StdMutableStatusDetail();
+
+        NodeList children	= elementStatusDetail.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_MISSINGATTRIBUTEDETAIL.equals(child.getLocalName())) {
+                        mutableStatusDetail.addMissingAttributeDetail(DOMMissingAttributeDetail.newInstance(child));
+                    } else {
+                        if (!bLenient) {
+                            throw DOMUtil.newUnexpectedElementException(child, nodeStatusDetail);
+                        }
+                    }
+                }
+            }
         }
 
-        /**
-         * Creates a new <code>DOMStatusDetail</code> by parsing the given <code>Node</code> representing a XACML StatusDetail element.
-         * 
-         * @param nodeStatusDetail the <code>Node</code> representing the StatusDetail element
-         * @return a new <code>DOMStatusDetail</code> parsed from the given <code>Node</code>
-         * @throws DOMStructureException if the conversion cannot be made
-         */
-        public static StatusDetail newInstance(Node nodeStatusDetail) throws DOMStructureException {
-                Element elementStatusDetail	= DOMUtil.getElement(nodeStatusDetail);
-                boolean bLenient			= DOMProperties.isLenient();
-                
-                StdMutableStatusDetail mutableStatusDetail	= new StdMutableStatusDetail();
-                
-                NodeList children	= elementStatusDetail.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_MISSINGATTRIBUTEDETAIL.equals(child.getLocalName())) {
-                                                mutableStatusDetail.addMissingAttributeDetail(DOMMissingAttributeDetail.newInstance(child));
-                                        } else {
-                                                if (!bLenient) {
-                                                        throw DOMUtil.newUnexpectedElementException(child, nodeStatusDetail);
-                                                }
-                                        }
-                                }
-                        }
+        return new StdStatusDetail(mutableStatusDetail);
+    }
+
+    public static boolean repair(Node nodeStatusDetail) throws DOMStructureException {
+        Element elementStatusDetail	= DOMUtil.getElement(nodeStatusDetail);
+        boolean result				= false;
+
+        NodeList children	= elementStatusDetail.getChildNodes();
+        int numChildren;
+        if (children != null && (numChildren = children.getLength()) > 0) {
+            for (int i = 0 ; i < numChildren ; i++) {
+                Node child	= children.item(i);
+                if (DOMUtil.isElement(child)) {
+                    if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_MISSINGATTRIBUTEDETAIL.equals(child.getLocalName())) {
+                        result	= DOMMissingAttributeDetail.repair(child) || result;
+                    } else {
+                        logger.warn("Unexpected element " + child.getNodeName());
+                        elementStatusDetail.removeChild(child);
+                        result	= true;
+                    }
                 }
-                
-                return new StdStatusDetail(mutableStatusDetail);
+            }
         }
-        
-        public static boolean repair(Node nodeStatusDetail) throws DOMStructureException {
-                Element elementStatusDetail	= DOMUtil.getElement(nodeStatusDetail);
-                boolean result				= false;
-                
-                NodeList children	= elementStatusDetail.getChildNodes();
-                int numChildren;
-                if (children != null && (numChildren = children.getLength()) > 0) {
-                        for (int i = 0 ; i < numChildren ; i++) {
-                                Node child	= children.item(i);
-                                if (DOMUtil.isElement(child)) {
-                                        if (DOMUtil.isInNamespace(child, XACML3.XMLNS) && XACML3.ELEMENT_MISSINGATTRIBUTEDETAIL.equals(child.getLocalName())) {
-                                                result	= DOMMissingAttributeDetail.repair(child) || result;
-                                        } else {
-                                                logger.warn("Unexpected element " + child.getNodeName());
-                                                elementStatusDetail.removeChild(child);
-                                                result	= true;
-                                        }
-                                }
-                        }
-                }
-                
-                return result;
-        }
+
+        return result;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStructureException.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStructureException.java
index f6b7349..71df277 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStructureException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMStructureException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,42 +33,42 @@
 import org.w3c.dom.Node;
 
 public class DOMStructureException extends Exception {
-        private static final long serialVersionUID = -3752478535859021127L;
-        
-        private Node	nodeError;
+    private static final long serialVersionUID = -3752478535859021127L;
 
-        public DOMStructureException() {
-        }
+    private Node	nodeError;
 
-        public DOMStructureException(String message) {
-                super(message);
-        }
+    public DOMStructureException() {
+    }
 
-        public DOMStructureException(Throwable cause) {
-                super(cause);
-        }
+    public DOMStructureException(String message) {
+        super(message);
+    }
 
-        public DOMStructureException(String message, Throwable cause) {
-                super(message, cause);
-        }
-        
-        public DOMStructureException(Node nodeErrorIn, String message, Throwable cause) {
-                super(message, cause);
-                this.nodeError	= nodeErrorIn;
-        }
-        
-        public DOMStructureException(Node nodeErrorIn, String message) {
-                super(message);
-                this.nodeError	= nodeErrorIn;
-        }
-        
-        public DOMStructureException(Node nodeErrorIn, Throwable cause) {
-                super(cause);
-                this.nodeError	= nodeErrorIn;
-        }
-        
-        public Node getNodeError() {
-                return this.nodeError;
-        }
+    public DOMStructureException(Throwable cause) {
+        super(cause);
+    }
+
+    public DOMStructureException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public DOMStructureException(Node nodeErrorIn, String message, Throwable cause) {
+        super(message, cause);
+        this.nodeError	= nodeErrorIn;
+    }
+
+    public DOMStructureException(Node nodeErrorIn, String message) {
+        super(message);
+        this.nodeError	= nodeErrorIn;
+    }
+
+    public DOMStructureException(Node nodeErrorIn, Throwable cause) {
+        super(cause);
+        this.nodeError	= nodeErrorIn;
+    }
+
+    public Node getNodeError() {
+        return this.nodeError;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMUtil.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMUtil.java
index eeb59a8..30a4f08 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMUtil.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/DOMUtil.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -63,683 +63,683 @@
 
 /**
  * DOMUtil contains a number of utility functions for DOM document elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class DOMUtil {
-        private static String[]	NAMESPACES	= {
-                XACML3.XMLNS,
-                XACML2.XMLNS
-        };
-        
+    private static String[]	NAMESPACES	= {
+        XACML3.XMLNS,
+        XACML2.XMLNS
+    };
+
+    /*
+     * The namespace string for the "xml" prefix
+     */
+    private static final String XML_NAMESPACE	= "http://www.w3.org/XML/1998/namespace";
+
+    protected DOMUtil() {
+    }
+
+    /**
+     * Creates a copy of the given <code>Node</code> such that it appears to be the direct child
+     * of a <code>Document</code>>
+     *
+     * @param node the <code>Node</code> to convert
+     * @return the new <code>Node</code>
+     */
+    public static Node getDirectDocumentChild(Node node) throws DOMStructureException {
+        Node nodeResult	= null;
+        try {
+            DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+            documentBuilderFactory.setNamespaceAware(true);
+            DocumentBuilder documentBuilder					= documentBuilderFactory.newDocumentBuilder();
+            Document documentRoot							= documentBuilder.newDocument();
+            Node nodeTopRoot								= documentRoot.importNode(node, true);
+            documentRoot.appendChild(nodeTopRoot);
+            nodeResult										= documentRoot.getDocumentElement();
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception generating Document root Node from Node: " + ex.getMessage(), ex);
+        }
+        return nodeResult;
+    }
+
+    /**
+     * Converts the given <code>Node</code> to a <code>Element</code> if possible.
+     *
+     * @param node the <code>Node</code> to convert
+     * @return the <code>Node</code> cast as an <code>Element</code>.
+     * @throws DOMStructureException if the cast cannot be made
+     */
+    public static Element getElement(Node node) throws DOMStructureException {
+        if (node == null) {
+            throw new DOMStructureException(node, new NullPointerException("Null Node"));
+        } else if (node.getNodeType() != Node.ELEMENT_NODE) {
+            throw new DOMStructureException(node, "Non-element Node");
+        }
+        return (Element)node;
+    }
+
+    /**
+     * Determines if the given <code>Node</code> is non-null and is an XML Element.
+     *
+     * @param node the <code>Node</code> to check
+     * @return true if the <code>Node</code> is non-null and is an XML element
+     */
+    public static boolean isElement(Node node) {
+        return (node != null && node.getNodeType() == Node.ELEMENT_NODE);
+    }
+
+    /**
+     * Determines if the given <code>Node</code> belongs to the namespace with the given <code>String</code> name.
+     *
+     * @param node the <code>Node</code> to check
+     * @param namespace the <code>String</code> namespace
+     * @return true if the <code>Node</code> namespace matches, else false
+     */
+    public static boolean isInNamespace(Node node, String namespace) {
+        return namespace.equals(node.getNamespaceURI());
+    }
+
+    /**
+     * Determines if the given <code>Node</code> is an <code>Element</code> and is in the
+     * given <code>String</code> namespace.
+     *
+     * @param node the <code>Node</code> to check
+     * @param namespace the <code>String</code> namespace to check or null if no namespace check is required
+     * @return true if the given <code>Node</code> is an <code>Element</code> and the <code>namespace</code> is null or matches the
+     * <code>Node</code> namespace.
+     */
+    public static boolean isNamespaceElement(Node node, String namespace) {
+        if (node == null) {
+            return false;
+        } else if (node.getNodeType() != Node.ELEMENT_NODE) {
+            return false;
+        } else if (namespace != null && !namespace.equals(node.getNamespaceURI())) {
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    public static String getNodeLabel(Node node) {
+        String namespaceURI	= node.getNamespaceURI();
+        return (namespaceURI == null ? node.getLocalName() : namespaceURI + ":" + node.getLocalName());
+    }
+
+    public static DOMStructureException newUnexpectedElementException(Node node) {
+        return new DOMStructureException(node, "Unexpected element \"" + getNodeLabel(node) + "\"");
+    }
+
+    public static DOMStructureException newUnexpectedElementException(Node node, Node parent) {
+        return new DOMStructureException(node, "Unexpected element \"" + getNodeLabel(node) + "\" in \"" + getNodeLabel(parent) + "\"");
+    }
+
+    /**
+     * Gets the first child {@link org.w3c.dom.Element} of the given <code>Node</code>.
+     *
+     * @param node the <code>Node</code> to search
+     * @return the first child <code>Element</code> of the given <code>Node</code>
+     */
+    public static Element getFirstChildElement(Node node) {
+        NodeList	children	= null;
+        int			numChildren	= 0;
+        if (node == null || (children = node.getChildNodes()) == null || (numChildren = node.getChildNodes().getLength()) == 0) {
+            return null;
+        }
+        Element	result	 = null;
+        for (int i = 0 ; i < numChildren && result == null ; i++) {
+            Node	child	= children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                result	= (Element)child;
+            }
+        }
+        return result;
+    }
+
+    protected static DOMStructureException newMissingAttributeException(Node node, String attributeName) {
+        return new DOMStructureException("Missing attribute \"" + attributeName + "\" in \"" + getNodeLabel(node) + "\"");
+    }
+
+    protected static DOMStructureException newMissingAttributeException(Node node, String namespace, String attributeName) {
+        return new DOMStructureException("Missing attribute \"" + (namespace == null ? "" : namespace + ":") + attributeName + "\" in \"" + getNodeLabel(node) + "\"");
+    }
+
+    protected static DOMStructureException newMissingContentException(Node node) {
+        return new DOMStructureException("Missing content for \"" + getNodeLabel(node) + "\"");
+    }
+
+    public static DOMStructureException newMissingElementException(Node node, String namespace, String elementName) {
+        return new DOMStructureException("Missing element \"" + (namespace == null ? "" : namespace + ":") + elementName + "\" in \"" + getNodeLabel(node));
+    }
+
+    public static Node getAttribute(Node node, String[] nameSpace, String localName, boolean bRequired) throws DOMStructureException {
+        Node	nodeResult	= null;
+        for (String namespace: nameSpace) {
+            if ((nodeResult = node.getAttributes().getNamedItemNS(namespace, localName)) != null) {
+                return nodeResult;
+            }
+        }
+        if (bRequired) {
+            throw newMissingAttributeException(node, localName);
+        }
+        return null;
+    }
+
+    public static Node getAttribute(Node node, String[] nameSpace, String localName) {
+        Node	nodeResult	= null;
+        for (String namespace: nameSpace) {
+            if ((nodeResult = node.getAttributes().getNamedItemNS(namespace, localName)) != null) {
+                return nodeResult;
+            }
+        }
+        return nodeResult;
+    }
+
+    /**
+     * Retrieves an attribute value from the given <code>Node</code> with the given <code>String</code> namespace and
+     * <code>String</code> local name.
+     *
+     * @param node
+     * @param nameSpace
+     * @param localName
+     * @return
+     */
+    public static Node getAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
+        Node nodeAttribute	= node.getAttributes().getNamedItemNS(nameSpace, localName);
+        if (bRequired && nodeAttribute == null) {
+            throw newMissingAttributeException(node, nameSpace, localName);
+        }
+        return nodeAttribute;
+    }
+
+    public static Node getAttribute(Node node, String nameSpace, String localName) {
+        return node.getAttributes().getNamedItemNS(nameSpace, localName);
+    }
+
+    /**
+     * Retrieves an attribute value from the given <code>Node</code> by the given local <code>String</code> name by searching
+     * all known namespaces.
+     *
+     * @param node
+     * @param localName
+     * @return
+     */
+    public static Node getAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
+        Node nodeAttribute	= node.getAttributes().getNamedItem(localName);
+        if (bRequired && nodeAttribute == null) {
+            throw newMissingAttributeException(node, localName);
+        }
+        return nodeAttribute;
+    }
+
+    public static Node getAttribute(Node node, String localName) {
+        return node.getAttributes().getNamedItem(localName);
+    }
+
+    public static String getStringAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
+        Node	nodeAttribute	= getAttribute(node, nameSpaces, localName, bRequired);
+        return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
+    }
+
+    public static String getStringAttribute(Node node, String[] nameSpaces, String localName) {
+        Node	nodeAttribute	= getAttribute(node, nameSpaces, localName);
+        return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
+    }
+
+    public static String getStringAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
+        Node	nodeAttribute	= getAttribute(node, nameSpace, localName, bRequired);
+        return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
+    }
+
+    public static String getStringAttribute(Node node, String nameSpace, String localName) {
+        Node	nodeAttribute	= getAttribute(node, nameSpace, localName);
+        return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
+    }
+
+    public static String getStringAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
+        Node	nodeAttribute	= getAttribute(node, localName, bRequired);
+        return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
+    }
+
+    public static String getStringAttribute(Node node, String localName) {
+        Node	nodeAttribute	= getAttribute(node, localName);
+        return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
+    }
+
+    public static String getXmlId(Node node) {
+        return getStringAttribute(node, XML_NAMESPACE, "id");
+    }
+
+    public static String getXmlId(Node node, boolean bRequired) throws DOMStructureException {
+        return getStringAttribute(node, XML_NAMESPACE, "id", bRequired);
+    }
+
+    private static Identifier getIdentifierFromString(Node node, String stringAttribute) throws DOMStructureException {
+        if (stringAttribute == null) {
+            return null;
+        } else {
+            Identifier	identifierResult	= null;
+            try {
+                identifierResult	= new IdentifierImpl(stringAttribute);
+            } catch (IllegalArgumentException ex) {
+                throw new DOMStructureException(node, "Invalid Identifier \"" + stringAttribute + "\" in \"" + getNodeLabel(node) + "\"", ex);
+            }
+            return identifierResult;
+        }
+    }
+
+    public static Identifier getIdentifierAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
+        return getIdentifierFromString(node, getStringAttribute(node, nameSpaces, localName, bRequired));
+    }
+
+    public static Identifier getIdentifierAttribute(Node node, String[] nameSpaces, String localName) throws DOMStructureException {
+        return getIdentifierFromString(node, getStringAttribute(node, nameSpaces, localName));
+    }
+
+    public static Identifier getIdentifierAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
+        return getIdentifierFromString(node, getStringAttribute(node, nameSpace, localName, bRequired));
+    }
+
+    public static Identifier getIdentifierAttribute(Node node, String nameSpace, String localName) throws DOMStructureException {
+        return getIdentifierFromString(node, getStringAttribute(node, nameSpace, localName));
+    }
+
+    public static Identifier getIdentifierAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
+        return getIdentifierFromString(node, getStringAttribute(node, localName, bRequired));
+    }
+
+    public static Identifier getIdentifierAttribute(Node node, String localName) throws DOMStructureException {
+        return getIdentifierFromString(node, getStringAttribute(node, localName));
+    }
+
+    public static Identifier getIdentifierContent(Node node, boolean bRequired) throws DOMStructureException {
+        Identifier identifier	= getIdentifierFromString(node, node.getTextContent());
+        if (bRequired && identifier == null) {
+            throw newMissingContentException(node);
+        }
+        return identifier;
+    }
+
+    public static Identifier getIdentifierContent(Node node) throws DOMStructureException {
+        return getIdentifierFromString(node, node.getTextContent());
+    }
+
+    private static Integer getIntegerFromString(Node node, String stringValue) throws DOMStructureException {
+        if (stringValue == null) {
+            return null;
+        } else {
+            Integer iresult	= null;
+            try {
+                iresult	= Integer.parseInt(stringValue);
+            } catch (NumberFormatException ex) {
+                throw new DOMStructureException(node, "Invalid Integer \"" + stringValue + "\" in \"" + getNodeLabel(node) + "\"", ex);
+            }
+            return iresult;
+        }
+    }
+
+    public static Integer getIntegerAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
+        return getIntegerFromString(node, getStringAttribute(node, nameSpaces, localName, bRequired));
+    }
+
+    public static Integer getIntegerAttribute(Node node, String[] nameSpaces, String localName) throws DOMStructureException {
+        return getIntegerFromString(node, getStringAttribute(node, nameSpaces, localName));
+    }
+
+    public static Integer getIntegerAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
+        return getIntegerFromString(node, getStringAttribute(node, nameSpace, localName, bRequired));
+    }
+
+    public static Integer getIntegerAttribute(Node node, String nameSpace, String localName) throws DOMStructureException {
+        return getIntegerFromString(node, getStringAttribute(node, nameSpace, localName));
+    }
+
+    public static Integer getIntegerAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
+        return getIntegerFromString(node, getStringAttribute(node, localName, bRequired));
+    }
+
+    public static Integer getIntegerAttribute(Node node, String localName) throws DOMStructureException {
+        return getIntegerFromString(node, getStringAttribute(node, localName));
+    }
+
+    private static Version getVersionFromString(Node node, String stringValue) throws DOMStructureException {
+        Version version	= null;
+        try {
+            version	= StdVersion.newInstance(stringValue);
+        } catch (ParseException ex) {
+            throw new DOMStructureException(node, "Invalid Version \"" + stringValue + "\" in \"" + getNodeLabel(node) + "\"", ex);
+        }
+        return version;
+    }
+
+    public static Version getVersionAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
+        return getVersionFromString(node, getStringAttribute(node, nameSpaces, localName, bRequired));
+    }
+
+    public static Version getVersionAttribute(Node node, String[] nameSpaces, String localName) throws DOMStructureException {
+        return getVersionFromString(node, getStringAttribute(node, nameSpaces, localName));
+    }
+
+    public static Version getVersionAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
+        return getVersionFromString(node, getStringAttribute(node, nameSpace, localName, bRequired));
+    }
+
+    public static Version getVersionAttribute(Node node, String nameSpace, String localName) throws DOMStructureException {
+        return getVersionFromString(node, getStringAttribute(node, nameSpace, localName));
+    }
+
+    public static Version getVersionAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
+        return getVersionFromString(node, getStringAttribute(node, localName, bRequired));
+    }
+
+    public static Version getVersionAttribute(Node node, String localName) throws DOMStructureException {
+        return getVersionFromString(node, getStringAttribute(node, localName));
+    }
+
+    private static URI getURIFromString(Node node, String stringAttribute) throws DOMStructureException {
+        if (stringAttribute == null) {
+            return null;
+        } else {
+            URI uriResult	= null;
+            try {
+                uriResult	= new URI(stringAttribute);
+            } catch (URISyntaxException ex) {
+                throw new DOMStructureException(node, "Illegal URI value \"" + stringAttribute + "\" in \"" + getNodeLabel(node) + "\"", ex);
+            }
+            return uriResult;
+        }
+    }
+
+    public static URI getURIContent(Node node, boolean bRequired) throws DOMStructureException {
+        URI uri	= getURIFromString(node, node.getTextContent());
+        if (bRequired && uri == null) {
+            throw newMissingContentException(node);
+        }
+        return uri;
+    }
+
+    public static URI getURIContent(Node node) throws DOMStructureException {
+        return getURIFromString(node, node.getTextContent());
+    }
+
+    protected static Boolean toBoolean(Node node, String stringAttribute) throws DOMStructureException {
+        if (stringAttribute == null) {
+            return null;
+        } else if (stringAttribute.equals("0") || stringAttribute.equalsIgnoreCase("false")) {
+            return Boolean.FALSE;
+        } else if (stringAttribute.equals("1") || stringAttribute.equalsIgnoreCase("true")) {
+            return Boolean.TRUE;
+        } else {
+            throw new DOMStructureException("Illegal Boolean value \"" + stringAttribute + "\" in \"" + getNodeLabel(node) + "\"");
+        }
+    }
+
+    public static Boolean getBooleanAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
+        return toBoolean(node, getStringAttribute(node, nameSpaces, localName, bRequired));
+    }
+
+    public static Boolean getBooleanAttribute(Node node, String[] nameSpaces, String localName) throws DOMStructureException {
+        return toBoolean(node, getStringAttribute(node, nameSpaces, localName));
+    }
+
+    public static Boolean getBooleanAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
+        return toBoolean(node, getStringAttribute(node, nameSpace, localName, bRequired));
+    }
+
+    public static Boolean getBooleanAttribute(Node node, String nameSpace, String localName) throws DOMStructureException {
+        return toBoolean(node, getStringAttribute(node, nameSpace, localName));
+    }
+
+    public static Boolean getBooleanAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
+        return toBoolean(node, getStringAttribute(node, localName, bRequired));
+    }
+
+    public static Boolean getBooleanAttribute(Node node, String localName) throws DOMStructureException {
+        return toBoolean(node, getStringAttribute(node, localName));
+    }
+
+    public static NodeList getNodes(Element element, String[] nameSpaces, String localName) {
+        NodeList	nodeListResult	= null;
+        for (String namespace: nameSpaces) {
+            if ((nodeListResult = element.getElementsByTagNameNS(namespace, localName)) != null && nodeListResult.getLength() > 0) {
+                return nodeListResult;
+            }
+        }
+        return null;
+    }
+
+    public static Node getNode(Element element, String[] nameSpaces, String localName) throws DOMStructureException {
+        NodeList	nodeList	= getNodes(element, nameSpaces, localName);
+        if (nodeList == null || nodeList.getLength() == 0) {
+            return null;
+        } else if (nodeList.getLength() > 1) {
+            throw new DOMStructureException(element, "More than one \"" + localName + "\" element");
+        } else {
+            return nodeList.item(0);
+        }
+    }
+
+    public static NodeList getNodes(Element element, String nameSpace, String localName) {
+        return element.getElementsByTagNameNS(nameSpace, localName);
+    }
+
+    public static Node getNode(Element element, String nameSpace, String localName) throws DOMStructureException {
+        NodeList	nodeList	= getNodes(element, nameSpace, localName);
+        if (nodeList == null || nodeList.getLength() == 0) {
+            return null;
+        } else if (nodeList.getLength() > 1) {
+            throw new DOMStructureException(element, "More than one \"" + localName + "\" element");
+        } else {
+            return nodeList.item(0);
+        }
+    }
+
+    /**
+     * Gets a {@link org.w3c.dom.NodeList} of all <code>Node</code>s that are children of the given {@link org.w3c.dom.Element} with the
+     * given <code>String</code> local name by searching all available namespaces.
+     *
+     * @param element
+     * @param localName
+     * @return
+     */
+    public static NodeList getNodes(Element element, String localName) {
+        return getNodes(element, NAMESPACES, localName);
+    }
+
+    public static Node getNode(Element element, String localName) throws DOMStructureException {
+        NodeList	nodeList	= getNodes(element, localName);
+        if (nodeList == null || nodeList.getLength() == 0) {
+            return null;
+        } else if (nodeList.getLength() > 1) {
+            throw new DOMStructureException(element, "More than one \"" + localName + "\" element");
+        } else {
+            return nodeList.item(0);
+        }
+    }
+
+    public static String toString(Document document) throws DOMStructureException {
+        try {
+            TransformerFactory	transformerFactory	= TransformerFactory.newInstance();
+            transformerFactory.setAttribute("indent-number", new Integer(4));
+            Transformer			transformer			= transformerFactory.newTransformer();
+            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+            Source				source				= new DOMSource(document);
+            StringWriter		stringOut			= new StringWriter();
+            Result				result				= new StreamResult(stringOut);
+
+            transformer.transform(source, result);
+            return stringOut.toString();
+        } catch (Exception ex) {
+            throw new DOMStructureException(document, "Exception converting Document to a String", ex);
+        }
+    }
+
+    public static boolean repairIdentifierAttribute(Element element, String attributeName, Identifier identifierDefault, Log logger) throws DOMStructureException {
+        Identifier identifier	= getIdentifierAttribute(element, attributeName);
+        if (identifier == null) {
+            if (identifierDefault != null) {
+                identifier	= identifierDefault;
+            } else {
+                identifier	= IdentifierImpl.gensym("urn:" + attributeName.toLowerCase());
+            }
+            logger.warn("Setting missing " + attributeName + " attribute to " + identifier.stringValue());
+            element.setAttribute(attributeName, identifier.stringValue());
+            return true;
+        }
+        return false;
+    }
+
+    public static boolean repairIdentifierAttribute(Element element, String attributeName, Log logger) throws DOMStructureException {
+        return repairIdentifierAttribute(element, attributeName, null, logger);
+    }
+
+    public static boolean repairIdentifierContent(Element element, Log logger) throws DOMStructureException {
+        Identifier identifier	= getIdentifierContent(element);
+        if (identifier == null) {
+            identifier	= IdentifierImpl.gensym();
+            logger.warn("Setting missing content to " + identifier.stringValue());
+            element.setTextContent(identifier.stringValue());
+            return true;
+        }
+        return false;
+    }
+
+    public static boolean repairBooleanAttribute(Element element, String attributeName, boolean bvalue, Log logger) throws DOMStructureException {
+        Boolean booleanValue	= null;
+        try {
+            booleanValue	= getBooleanAttribute(element, attributeName);
+        } catch (DOMStructureException ex) {
+            logger.warn("Setting invalid " + attributeName + " attribute to " + bvalue);
+            element.setAttribute(attributeName, Boolean.toString(bvalue));
+            return true;
+        }
+        if (booleanValue == null) {
+            logger.warn("Setting missing " + attributeName + " attribute to " + bvalue);
+            element.setAttribute(attributeName, Boolean.toString(bvalue));
+            return true;
+        }
+        return false;
+    }
+
+    public static boolean repairVersionMatchAttribute(Element element, String attributeName, Log logger) {
+        String versionString	= getStringAttribute(element, attributeName);
+        if (versionString == null) {
+            return false;
+        }
+
+        try {
+            StdVersionMatch.newInstance(versionString);
+        } catch (ParseException ex) {
+            logger.warn("Deleting invalid " + attributeName + " string " + versionString, ex);
+            element.removeAttribute(attributeName);
+            return true;
+        }
+
+        return false;
+    }
+
+    public static boolean repairVersionAttribute(Element element, String attributeName, Log logger) {
+        String versionString	= getStringAttribute(element, attributeName);
+        if (versionString == null) {
+            logger.warn("Adding default " + attributeName + " string 1.0");
+            element.setAttribute(attributeName, "1.0");
+            return true;
+        }
+
+        try {
+            StdVersion.newInstance(versionString);
+        } catch (ParseException ex) {
+            logger.warn("Setting invalid " + attributeName + " string " + versionString + " to 1.0", ex);
+            element.setAttribute(attributeName, "1.0");
+            return true;
+        }
+
+        return false;
+    }
+
+    public static boolean repairStringAttribute(Element element, String attributeName, String defaultValue, Log logger) {
+        String attributeValue	= getStringAttribute(element, attributeName);
+        if (attributeValue == null) {
+            if (defaultValue == null) {
+                defaultValue	= IdentifierImpl.gensym().stringValue();
+            }
+            logger.warn("Setting missing " + attributeName + " attribute to " + defaultValue);
+            element.setAttribute(attributeName, defaultValue);
+            return true;
+        }
+        return false;
+    }
+
+    public static Document loadDocument(File fileDocument) throws DOMStructureException {
         /*
-         * The namespace string for the "xml" prefix
+         * Get the DocumentBuilderFactory
          */
-        private static final String XML_NAMESPACE	= "http://www.w3.org/XML/1998/namespace";
-        
-        protected DOMUtil() {
+        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+        if (documentBuilderFactory == null) {
+            throw new DOMStructureException("No XML DocumentBuilderFactory configured");
         }
-        
-        /**
-         * Creates a copy of the given <code>Node</code> such that it appears to be the direct child
-         * of a <code>Document</code>>
-         *  
-         * @param node the <code>Node</code> to convert
-         * @return the new <code>Node</code>
+        documentBuilderFactory.setNamespaceAware(true);
+
+        /*
+         * Get the DocumentBuilder
          */
-        public static Node getDirectDocumentChild(Node node) throws DOMStructureException {
-                Node nodeResult	= null;
-                try {
-                        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                        documentBuilderFactory.setNamespaceAware(true);
-                        DocumentBuilder documentBuilder					= documentBuilderFactory.newDocumentBuilder();
-                        Document documentRoot							= documentBuilder.newDocument();
-                        Node nodeTopRoot								= documentRoot.importNode(node, true);
-                        documentRoot.appendChild(nodeTopRoot);
-                        nodeResult										= documentRoot.getDocumentElement();
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception generating Document root Node from Node: " + ex.getMessage(), ex);
-                }
-                return nodeResult;
-        }
-        
-        /**
-         * Converts the given <code>Node</code> to a <code>Element</code> if possible.
-         * 
-         * @param node the <code>Node</code> to convert
-         * @return the <code>Node</code> cast as an <code>Element</code>.
-         * @throws DOMStructureException if the cast cannot be made
-         */
-        public static Element getElement(Node node) throws DOMStructureException {
-                if (node == null) {
-                        throw new DOMStructureException(node, new NullPointerException("Null Node"));
-                } else if (node.getNodeType() != Node.ELEMENT_NODE) {
-                        throw new DOMStructureException(node, "Non-element Node");
-                }
-                return (Element)node;
-        }
-        
-        /**
-         * Determines if the given <code>Node</code> is non-null and is an XML Element.
-         * 
-         * @param node the <code>Node</code> to check
-         * @return true if the <code>Node</code> is non-null and is an XML element
-         */
-        public static boolean isElement(Node node) {
-                return (node != null && node.getNodeType() == Node.ELEMENT_NODE);
-        }
-        
-        /**
-         * Determines if the given <code>Node</code> belongs to the namespace with the given <code>String</code> name.
-         * 
-         * @param node the <code>Node</code> to check
-         * @param namespace the <code>String</code> namespace
-         * @return true if the <code>Node</code> namespace matches, else false
-         */
-        public static boolean isInNamespace(Node node, String namespace) {
-                return namespace.equals(node.getNamespaceURI());
-        }
-        
-        /**
-         * Determines if the given <code>Node</code> is an <code>Element</code> and is in the
-         * given <code>String</code> namespace.
-         * 
-         * @param node the <code>Node</code> to check
-         * @param namespace the <code>String</code> namespace to check or null if no namespace check is required
-         * @return true if the given <code>Node</code> is an <code>Element</code> and the <code>namespace</code> is null or matches the
-         * <code>Node</code> namespace.
-         */
-        public static boolean isNamespaceElement(Node node, String namespace) {
-                if (node == null) {
-                        return false;
-                } else if (node.getNodeType() != Node.ELEMENT_NODE) {
-                        return false;
-                } else if (namespace != null && !namespace.equals(node.getNamespaceURI())) {
-                        return false;
-                } else {
-                        return true;
-                }
-        }
-        
-        public static String getNodeLabel(Node node) {
-                String namespaceURI	= node.getNamespaceURI();
-                return (namespaceURI == null ? node.getLocalName() : namespaceURI + ":" + node.getLocalName());
-        }
-        
-        public static DOMStructureException newUnexpectedElementException(Node node) {
-                return new DOMStructureException(node, "Unexpected element \"" + getNodeLabel(node) + "\"");
-        }
-        
-        public static DOMStructureException newUnexpectedElementException(Node node, Node parent) {
-                return new DOMStructureException(node, "Unexpected element \"" + getNodeLabel(node) + "\" in \"" + getNodeLabel(parent) + "\"");
+        DocumentBuilder documentBuilder	= null;
+        try {
+            documentBuilder	= documentBuilderFactory.newDocumentBuilder();
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
         }
 
-        /**
-         * Gets the first child {@link org.w3c.dom.Element} of the given <code>Node</code>.
-         * 
-         * @param node the <code>Node</code> to search
-         * @return the first child <code>Element</code> of the given <code>Node</code>
+        /*
+         * Parse the XML file
          */
-        public static Element getFirstChildElement(Node node) {
-                NodeList	children	= null;
-                int			numChildren	= 0;
-                if (node == null || (children = node.getChildNodes()) == null || (numChildren = node.getChildNodes().getLength()) == 0) {
-                        return null;
-                }
-                Element	result	 = null;
-                for (int i = 0 ; i < numChildren && result == null ; i++) {
-                        Node	child	= children.item(i);
-                        if (child.getNodeType() == Node.ELEMENT_NODE) {
-                                result	= (Element)child;
-                        }
-                }
-                return result;
+        Document document	= null;
+        try {
+            document	= documentBuilder.parse(fileDocument);
+            if (document == null) {
+                throw new Exception("Null document returned");
+            }
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception loading file \"" + fileDocument.getAbsolutePath() + "\": " + ex.getMessage(), ex);
         }
-        
-        protected static DOMStructureException newMissingAttributeException(Node node, String attributeName) {
-                return new DOMStructureException("Missing attribute \"" + attributeName + "\" in \"" + getNodeLabel(node) + "\"");
-        }
-        
-        protected static DOMStructureException newMissingAttributeException(Node node, String namespace, String attributeName) {
-                return new DOMStructureException("Missing attribute \"" + (namespace == null ? "" : namespace + ":") + attributeName + "\" in \"" + getNodeLabel(node) + "\"");
-        }
-        
-        protected static DOMStructureException newMissingContentException(Node node) {
-                return new DOMStructureException("Missing content for \"" + getNodeLabel(node) + "\"");
-        }
-        
-        public static DOMStructureException newMissingElementException(Node node, String namespace, String elementName) {
-                return new DOMStructureException("Missing element \"" + (namespace == null ? "" : namespace + ":") + elementName + "\" in \"" + getNodeLabel(node));
-        }
-        
-        public static Node getAttribute(Node node, String[] nameSpace, String localName, boolean bRequired) throws DOMStructureException {
-                Node	nodeResult	= null;
-                for (String namespace: nameSpace) {
-                        if ((nodeResult = node.getAttributes().getNamedItemNS(namespace, localName)) != null) {
-                                return nodeResult;
-                        }
-                }
-                if (bRequired) {
-                        throw newMissingAttributeException(node, localName);
-                }
-                return null;
-        }
-        
-        public static Node getAttribute(Node node, String[] nameSpace, String localName) {
-                Node	nodeResult	= null;
-                for (String namespace: nameSpace) {
-                        if ((nodeResult = node.getAttributes().getNamedItemNS(namespace, localName)) != null) {
-                                return nodeResult;
-                        }
-                }
-                return nodeResult;
-        }
-        
-        /**
-         * Retrieves an attribute value from the given <code>Node</code> with the given <code>String</code> namespace and
-         * <code>String</code> local name.
-         * 
-         * @param node
-         * @param nameSpace
-         * @param localName
-         * @return
+        return document;
+
+    }
+
+    public static Document loadDocument(InputStream inputStreamDocument) throws DOMStructureException {
+        /*
+         * Get the DocumentBuilderFactory
          */
-        public static Node getAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
-                Node nodeAttribute	= node.getAttributes().getNamedItemNS(nameSpace, localName);
-                if (bRequired && nodeAttribute == null) {
-                        throw newMissingAttributeException(node, nameSpace, localName);
-                }
-                return nodeAttribute;
+        DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
+        if (documentBuilderFactory == null) {
+            throw new DOMStructureException("No XML DocumentBuilderFactory configured");
         }
-        
-        public static Node getAttribute(Node node, String nameSpace, String localName) {
-                return node.getAttributes().getNamedItemNS(nameSpace, localName);
-        }
-        
-        /**
-         * Retrieves an attribute value from the given <code>Node</code> by the given local <code>String</code> name by searching
-         * all known namespaces.
-         * 
-         * @param node
-         * @param localName
-         * @return
+        documentBuilderFactory.setNamespaceAware(true);
+
+        /*
+         * Get the DocumentBuilder
          */
-        public static Node getAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
-                Node nodeAttribute	= node.getAttributes().getNamedItem(localName);
-                if (bRequired && nodeAttribute == null) {
-                        throw newMissingAttributeException(node, localName);
-                }
-                return nodeAttribute;
-        }
-        
-        public static Node getAttribute(Node node, String localName) {
-                return node.getAttributes().getNamedItem(localName);
-        }
-        
-        public static String getStringAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
-                Node	nodeAttribute	= getAttribute(node, nameSpaces, localName, bRequired);
-                return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());		
-        }
-        
-        public static String getStringAttribute(Node node, String[] nameSpaces, String localName) {
-                Node	nodeAttribute	= getAttribute(node, nameSpaces, localName);
-                return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
-        }
-        
-        public static String getStringAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
-                Node	nodeAttribute	= getAttribute(node, nameSpace, localName, bRequired);
-                return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
-        }
-        
-        public static String getStringAttribute(Node node, String nameSpace, String localName) {
-                Node	nodeAttribute	= getAttribute(node, nameSpace, localName);
-                return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
-        }
-        
-        public static String getStringAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
-                Node	nodeAttribute	= getAttribute(node, localName, bRequired);
-                return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
-        }
-        
-        public static String getStringAttribute(Node node, String localName) {
-                Node	nodeAttribute	= getAttribute(node, localName);
-                return (nodeAttribute == null ? null : nodeAttribute.getNodeValue());
-        }
-        
-        public static String getXmlId(Node node) {
-                return getStringAttribute(node, XML_NAMESPACE, "id");
-        }
-        
-        public static String getXmlId(Node node, boolean bRequired) throws DOMStructureException {
-                return getStringAttribute(node, XML_NAMESPACE, "id", bRequired);
-        }
-        
-        private static Identifier getIdentifierFromString(Node node, String stringAttribute) throws DOMStructureException {
-                if (stringAttribute == null) {
-                        return null;
-                } else {
-                        Identifier	identifierResult	= null;
-                        try {
-                                identifierResult	= new IdentifierImpl(stringAttribute);
-                        } catch (IllegalArgumentException ex) {
-                                throw new DOMStructureException(node, "Invalid Identifier \"" + stringAttribute + "\" in \"" + getNodeLabel(node) + "\"", ex);
-                        }
-                        return identifierResult;
-                }
-        }
-        
-        public static Identifier getIdentifierAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
-                return getIdentifierFromString(node, getStringAttribute(node, nameSpaces, localName, bRequired));
-        }
-        
-        public static Identifier getIdentifierAttribute(Node node, String[] nameSpaces, String localName) throws DOMStructureException {
-                return getIdentifierFromString(node, getStringAttribute(node, nameSpaces, localName));
-        }
-        
-        public static Identifier getIdentifierAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
-                return getIdentifierFromString(node, getStringAttribute(node, nameSpace, localName, bRequired));
-        }
-        
-        public static Identifier getIdentifierAttribute(Node node, String nameSpace, String localName) throws DOMStructureException {
-                return getIdentifierFromString(node, getStringAttribute(node, nameSpace, localName));
-        }
-        
-        public static Identifier getIdentifierAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
-                return getIdentifierFromString(node, getStringAttribute(node, localName, bRequired));
-        }
-        
-        public static Identifier getIdentifierAttribute(Node node, String localName) throws DOMStructureException {
-                return getIdentifierFromString(node, getStringAttribute(node, localName));
-        }
-        
-        public static Identifier getIdentifierContent(Node node, boolean bRequired) throws DOMStructureException {
-                Identifier identifier	= getIdentifierFromString(node, node.getTextContent());
-                if (bRequired && identifier == null) {
-                        throw newMissingContentException(node);
-                }
-                return identifier;
-        }
-        
-        public static Identifier getIdentifierContent(Node node) throws DOMStructureException {
-                return getIdentifierFromString(node, node.getTextContent());
-        }
-        
-        private static Integer getIntegerFromString(Node node, String stringValue) throws DOMStructureException {
-                if (stringValue == null) {
-                        return null;
-                } else {
-                        Integer iresult	= null;
-                        try {
-                                iresult	= Integer.parseInt(stringValue);
-                        } catch (NumberFormatException ex) {
-                                throw new DOMStructureException(node, "Invalid Integer \"" + stringValue + "\" in \"" + getNodeLabel(node) + "\"", ex);
-                        }
-                        return iresult;
-                }
-        }
-        
-        public static Integer getIntegerAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
-                return getIntegerFromString(node, getStringAttribute(node, nameSpaces, localName, bRequired));
-        }
-        
-        public static Integer getIntegerAttribute(Node node, String[] nameSpaces, String localName) throws DOMStructureException {
-                return getIntegerFromString(node, getStringAttribute(node, nameSpaces, localName));
-        }
-        
-        public static Integer getIntegerAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
-                return getIntegerFromString(node, getStringAttribute(node, nameSpace, localName, bRequired));
-        }
-        
-        public static Integer getIntegerAttribute(Node node, String nameSpace, String localName) throws DOMStructureException {
-                return getIntegerFromString(node, getStringAttribute(node, nameSpace, localName));
-        }
-        
-        public static Integer getIntegerAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
-                return getIntegerFromString(node, getStringAttribute(node, localName, bRequired));
-        }
-        
-        public static Integer getIntegerAttribute(Node node, String localName) throws DOMStructureException {
-                return getIntegerFromString(node, getStringAttribute(node, localName));
-        }
-        
-        private static Version getVersionFromString(Node node, String stringValue) throws DOMStructureException {
-                Version version	= null;
-                try {
-                        version	= StdVersion.newInstance(stringValue);
-                } catch (ParseException ex) {
-                        throw new DOMStructureException(node, "Invalid Version \"" + stringValue + "\" in \"" + getNodeLabel(node) + "\"", ex);
-                }
-                return version;
-        }
-        
-        public static Version getVersionAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
-                return getVersionFromString(node, getStringAttribute(node, nameSpaces, localName, bRequired));
-        }
-        
-        public static Version getVersionAttribute(Node node, String[] nameSpaces, String localName) throws DOMStructureException {
-                return getVersionFromString(node, getStringAttribute(node, nameSpaces, localName));
-        }
-        
-        public static Version getVersionAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
-                return getVersionFromString(node, getStringAttribute(node, nameSpace, localName, bRequired));
-        }
-        
-        public static Version getVersionAttribute(Node node, String nameSpace, String localName) throws DOMStructureException {
-                return getVersionFromString(node, getStringAttribute(node, nameSpace, localName));
-        }
-        
-        public static Version getVersionAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
-                return getVersionFromString(node, getStringAttribute(node, localName, bRequired));
+        DocumentBuilder documentBuilder	= null;
+        try {
+            documentBuilder	= documentBuilderFactory.newDocumentBuilder();
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
         }
 
-        public static Version getVersionAttribute(Node node, String localName) throws DOMStructureException {
-                return getVersionFromString(node, getStringAttribute(node, localName));
-        }
-
-        private static URI getURIFromString(Node node, String stringAttribute) throws DOMStructureException {
-                if (stringAttribute == null) {
-                        return null;
-                } else {
-                        URI uriResult	= null;
-                        try {
-                                uriResult	= new URI(stringAttribute);
-                        } catch (URISyntaxException ex) {
-                                throw new DOMStructureException(node, "Illegal URI value \"" + stringAttribute + "\" in \"" + getNodeLabel(node) + "\"", ex);
-                        }
-                        return uriResult;
-                }
-        }
-        
-        public static URI getURIContent(Node node, boolean bRequired) throws DOMStructureException {
-                URI uri	= getURIFromString(node, node.getTextContent());
-                if (bRequired && uri == null) {
-                        throw newMissingContentException(node);
-                }
-                return uri;
-        }
-        
-        public static URI getURIContent(Node node) throws DOMStructureException {
-                return getURIFromString(node, node.getTextContent());
-        }
-        
-        protected static Boolean toBoolean(Node node, String stringAttribute) throws DOMStructureException {
-                if (stringAttribute == null) {
-                        return null;
-                } else if (stringAttribute.equals("0") || stringAttribute.equalsIgnoreCase("false")) {
-                        return Boolean.FALSE;
-                } else if (stringAttribute.equals("1") || stringAttribute.equalsIgnoreCase("true")) {
-                        return Boolean.TRUE;
-                } else {
-                        throw new DOMStructureException("Illegal Boolean value \"" + stringAttribute + "\" in \"" + getNodeLabel(node) + "\"");
-                }		
-        }
-        
-        public static Boolean getBooleanAttribute(Node node, String[] nameSpaces, String localName, boolean bRequired) throws DOMStructureException {
-                return toBoolean(node, getStringAttribute(node, nameSpaces, localName, bRequired));
-        }
-        
-        public static Boolean getBooleanAttribute(Node node, String[] nameSpaces, String localName) throws DOMStructureException {
-                return toBoolean(node, getStringAttribute(node, nameSpaces, localName));
-        }
-        
-        public static Boolean getBooleanAttribute(Node node, String nameSpace, String localName, boolean bRequired) throws DOMStructureException {
-                return toBoolean(node, getStringAttribute(node, nameSpace, localName, bRequired));
-        }
-        
-        public static Boolean getBooleanAttribute(Node node, String nameSpace, String localName) throws DOMStructureException {
-                return toBoolean(node, getStringAttribute(node, nameSpace, localName));
-        }
-        
-        public static Boolean getBooleanAttribute(Node node, String localName, boolean bRequired) throws DOMStructureException {
-                return toBoolean(node, getStringAttribute(node, localName, bRequired));
-        }
-        
-        public static Boolean getBooleanAttribute(Node node, String localName) throws DOMStructureException {
-                return toBoolean(node, getStringAttribute(node, localName));
-        }
-        
-        public static NodeList getNodes(Element element, String[] nameSpaces, String localName) {
-                NodeList	nodeListResult	= null;
-                for (String namespace: nameSpaces) {
-                        if ((nodeListResult = element.getElementsByTagNameNS(namespace, localName)) != null && nodeListResult.getLength() > 0) {
-                                return nodeListResult;
-                        }
-                }
-                return null;		
-        }
-
-        public static Node getNode(Element element, String[] nameSpaces, String localName) throws DOMStructureException {
-                NodeList	nodeList	= getNodes(element, nameSpaces, localName);
-                if (nodeList == null || nodeList.getLength() == 0) {
-                        return null;
-                } else if (nodeList.getLength() > 1) {
-                        throw new DOMStructureException(element, "More than one \"" + localName + "\" element");
-                } else {
-                        return nodeList.item(0);
-                }
-        }
-        
-        public static NodeList getNodes(Element element, String nameSpace, String localName) {
-                return element.getElementsByTagNameNS(nameSpace, localName);
-        }
-        
-        public static Node getNode(Element element, String nameSpace, String localName) throws DOMStructureException {
-                NodeList	nodeList	= getNodes(element, nameSpace, localName);
-                if (nodeList == null || nodeList.getLength() == 0) {
-                        return null;
-                } else if (nodeList.getLength() > 1) {
-                        throw new DOMStructureException(element, "More than one \"" + localName + "\" element");
-                } else {
-                        return nodeList.item(0);
-                }		
-        }
-        
-        /**
-         * Gets a {@link org.w3c.dom.NodeList} of all <code>Node</code>s that are children of the given {@link org.w3c.dom.Element} with the
-         * given <code>String</code> local name by searching all available namespaces.
-         * 
-         * @param element
-         * @param localName
-         * @return
+        /*
+         * Parse the XML file
          */
-        public static NodeList getNodes(Element element, String localName) {
-                return getNodes(element, NAMESPACES, localName);
+        Document document	= null;
+        try {
+            document	= documentBuilder.parse(inputStreamDocument);
+            if (document == null) {
+                throw new Exception("Null document returned");
+            }
+        } catch (Exception ex) {
+            throw new DOMStructureException("Exception loading file from stream: " + ex.getMessage(), ex);
         }
-        
-        public static Node getNode(Element element, String localName) throws DOMStructureException {
-                NodeList	nodeList	= getNodes(element, localName);
-                if (nodeList == null || nodeList.getLength() == 0) {
-                        return null;
-                } else if (nodeList.getLength() > 1) {
-                        throw new DOMStructureException(element, "More than one \"" + localName + "\" element");
-                } else {
-                        return nodeList.item(0);
-                }
-        }
-        
-        public static String toString(Document document) throws DOMStructureException {
-                try {
-                        TransformerFactory	transformerFactory	= TransformerFactory.newInstance();
-                        transformerFactory.setAttribute("indent-number", new Integer(4));
-                        Transformer			transformer			= transformerFactory.newTransformer();
-                        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-                        Source				source				= new DOMSource(document);
-                        StringWriter		stringOut			= new StringWriter();
-                        Result				result				= new StreamResult(stringOut);
-                        
-                        transformer.transform(source, result);
-                        return stringOut.toString();
-                } catch (Exception ex) {
-                        throw new DOMStructureException(document, "Exception converting Document to a String", ex);
-                }
-        }
+        return document;
 
-        public static boolean repairIdentifierAttribute(Element element, String attributeName, Identifier identifierDefault, Log logger) throws DOMStructureException {
-                Identifier identifier	= getIdentifierAttribute(element, attributeName);
-                if (identifier == null) {
-                        if (identifierDefault != null) {
-                                identifier	= identifierDefault;
-                        } else {
-                                identifier	= IdentifierImpl.gensym("urn:" + attributeName.toLowerCase());
-                        }
-                        logger.warn("Setting missing " + attributeName + " attribute to " + identifier.stringValue());
-                        element.setAttribute(attributeName, identifier.stringValue());
-                        return true;
-                }
-                return false;
-        }
-        
-        public static boolean repairIdentifierAttribute(Element element, String attributeName, Log logger) throws DOMStructureException {
-                return repairIdentifierAttribute(element, attributeName, null, logger);
-        }
-        
-        public static boolean repairIdentifierContent(Element element, Log logger) throws DOMStructureException {
-                Identifier identifier	= getIdentifierContent(element);
-                if (identifier == null) {
-                        identifier	= IdentifierImpl.gensym();
-                        logger.warn("Setting missing content to " + identifier.stringValue());
-                        element.setTextContent(identifier.stringValue());
-                        return true;
-                }
-                return false;
-        }
-        
-        public static boolean repairBooleanAttribute(Element element, String attributeName, boolean bvalue, Log logger) throws DOMStructureException {
-                Boolean booleanValue	= null;
-                try {
-                        booleanValue	= getBooleanAttribute(element, attributeName);
-                } catch (DOMStructureException ex) {
-                        logger.warn("Setting invalid " + attributeName + " attribute to " + bvalue);
-                        element.setAttribute(attributeName, Boolean.toString(bvalue));
-                        return true;
-                }
-                if (booleanValue == null) {
-                        logger.warn("Setting missing " + attributeName + " attribute to " + bvalue);
-                        element.setAttribute(attributeName, Boolean.toString(bvalue));
-                        return true;
-                }
-                return false;
-        }
-
-        public static boolean repairVersionMatchAttribute(Element element, String attributeName, Log logger) {
-                String versionString	= getStringAttribute(element, attributeName);
-                if (versionString == null) {
-                        return false;
-                }
-                
-                try {
-                        StdVersionMatch.newInstance(versionString);
-                } catch (ParseException ex) {
-                        logger.warn("Deleting invalid " + attributeName + " string " + versionString, ex);
-                        element.removeAttribute(attributeName);
-                        return true;
-                }
-                
-                return false;
-        }
-        
-        public static boolean repairVersionAttribute(Element element, String attributeName, Log logger) {
-                String versionString	= getStringAttribute(element, attributeName);
-                if (versionString == null) {
-                        logger.warn("Adding default " + attributeName + " string 1.0");
-                        element.setAttribute(attributeName, "1.0");
-                        return true;
-                }
-                
-                try {
-                        StdVersion.newInstance(versionString);
-                } catch (ParseException ex) {
-                        logger.warn("Setting invalid " + attributeName + " string " + versionString + " to 1.0", ex);
-                        element.setAttribute(attributeName, "1.0");
-                        return true;
-                }
-                
-                return false;
-        }
-        
-        public static boolean repairStringAttribute(Element element, String attributeName, String defaultValue, Log logger) {
-                String attributeValue	= getStringAttribute(element, attributeName);
-                if (attributeValue == null) {
-                        if (defaultValue == null) {
-                                defaultValue	= IdentifierImpl.gensym().stringValue();
-                        }
-                        logger.warn("Setting missing " + attributeName + " attribute to " + defaultValue);
-                        element.setAttribute(attributeName, defaultValue);
-                        return true;
-                }
-                return false;
-        }
-        
-        public static Document loadDocument(File fileDocument) throws DOMStructureException {
-                /*
-                 * Get the DocumentBuilderFactory
-                 */
-                DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                if (documentBuilderFactory == null) {
-                        throw new DOMStructureException("No XML DocumentBuilderFactory configured");
-                }
-                documentBuilderFactory.setNamespaceAware(true);
-                
-                /*
-                 * Get the DocumentBuilder
-                 */
-                DocumentBuilder documentBuilder	= null;
-                try {
-                        documentBuilder	= documentBuilderFactory.newDocumentBuilder();
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
-                }
-                
-                /*
-                 * Parse the XML file
-                 */
-                Document document	= null;
-                try {
-                        document	= documentBuilder.parse(fileDocument);
-                        if (document == null) {
-                                throw new Exception("Null document returned");
-                        }			
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception loading file \"" + fileDocument.getAbsolutePath() + "\": " + ex.getMessage(), ex);
-                }
-                return document;
-
-        }
-        
-        public static Document loadDocument(InputStream inputStreamDocument) throws DOMStructureException {
-                /*
-                 * Get the DocumentBuilderFactory
-                 */
-                DocumentBuilderFactory documentBuilderFactory	= DocumentBuilderFactory.newInstance();
-                if (documentBuilderFactory == null) {
-                        throw new DOMStructureException("No XML DocumentBuilderFactory configured");
-                }
-                documentBuilderFactory.setNamespaceAware(true);
-                
-                /*
-                 * Get the DocumentBuilder
-                 */
-                DocumentBuilder documentBuilder	= null;
-                try {
-                        documentBuilder	= documentBuilderFactory.newDocumentBuilder();
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception creating DocumentBuilder: " + ex.getMessage(), ex);
-                }
-                
-                /*
-                 * Parse the XML file
-                 */
-                Document document	= null;
-                try {
-                        document	= documentBuilder.parse(inputStreamDocument);
-                        if (document == null) {
-                                throw new Exception("Null document returned");
-                        }			
-                } catch (Exception ex) {
-                        throw new DOMStructureException("Exception loading file from stream: " + ex.getMessage(), ex);
-                }
-                return document;
-
-        }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/package-info.java
index e9ee9ea..4a73428 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/dom/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacml.std.dom contains the implementation of interfaces in {@link com.att.research.xacml.api} using DOM nodes.
  * This package represents DOM parsing classes for the XACML 3.0 schema.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAdvice.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAdvice.java
index a9367a4..5062662 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAdvice.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAdvice.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,31 +46,31 @@
 /**
  * JaxpAdvice extends {@link com.att.research.xacml.std.StdMutableAdvice} with methods for creation from
  * JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpAdvice extends StdMutableAdvice {
 
-        protected JaxpAdvice(Identifier idIn, Collection<AttributeAssignment> attributeAssignmentsIn) {
-                super(idIn, attributeAssignmentsIn);
-        }
+    protected JaxpAdvice(Identifier idIn, Collection<AttributeAssignment> attributeAssignmentsIn) {
+        super(idIn, attributeAssignmentsIn);
+    }
 
-        public static JaxpAdvice newInstance(AdviceType obligationType) {
-                if (obligationType == null) {
-                        throw new NullPointerException("Null AdviceType");
-                } else if (obligationType.getAdviceId() == null) {
-                        throw new IllegalArgumentException("Null obligationId for AdviceType");
-                }
-                Identifier						obligationId			= new IdentifierImpl(obligationType.getAdviceId());
-                List<AttributeAssignment>	attributeAssignments	= null;
-                if (obligationType.getAttributeAssignment() != null && obligationType.getAttributeAssignment().size() > 0) {
-                        attributeAssignments	= new ArrayList<AttributeAssignment>();
-                        Iterator<AttributeAssignmentType>	iterAttributeAssignmentTypes	= obligationType.getAttributeAssignment().iterator();
-                        while (iterAttributeAssignmentTypes.hasNext()) {
-                                attributeAssignments.add(JaxpAttributeAssignment.newInstance(iterAttributeAssignmentTypes.next()));
-                        }
-                }
-                return new JaxpAdvice(obligationId, attributeAssignments);
+    public static JaxpAdvice newInstance(AdviceType obligationType) {
+        if (obligationType == null) {
+            throw new NullPointerException("Null AdviceType");
+        } else if (obligationType.getAdviceId() == null) {
+            throw new IllegalArgumentException("Null obligationId for AdviceType");
         }
+        Identifier						obligationId			= new IdentifierImpl(obligationType.getAdviceId());
+        List<AttributeAssignment>	attributeAssignments	= null;
+        if (obligationType.getAttributeAssignment() != null && obligationType.getAttributeAssignment().size() > 0) {
+            attributeAssignments	= new ArrayList<AttributeAssignment>();
+            Iterator<AttributeAssignmentType>	iterAttributeAssignmentTypes	= obligationType.getAttributeAssignment().iterator();
+            while (iterAttributeAssignmentTypes.hasNext()) {
+                attributeAssignments.add(JaxpAttributeAssignment.newInstance(iterAttributeAssignmentTypes.next()));
+            }
+        }
+        return new JaxpAdvice(obligationId, attributeAssignments);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttribute.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttribute.java
index a04b50c7..637e537 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttribute.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttribute.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,33 +44,33 @@
 
 /**
  * JaxpAttribute extends {@link com.att.research.xacml.std.StdMutableAttribute} with methods for creation from JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpAttribute extends StdMutableAttribute {
 
-        protected JaxpAttribute(Identifier attributeIdIn, Identifier categoryIdIn, List<AttributeValue<?>> valuesIn, String issuerIn, boolean includeInResultsIn) {
-                super(attributeIdIn, categoryIdIn, valuesIn, issuerIn, includeInResultsIn);
+    protected JaxpAttribute(Identifier attributeIdIn, Identifier categoryIdIn, List<AttributeValue<?>> valuesIn, String issuerIn, boolean includeInResultsIn) {
+        super(attributeIdIn, categoryIdIn, valuesIn, issuerIn, includeInResultsIn);
+    }
+
+    public static JaxpAttribute newInstance(Identifier categoryId, AttributeType attributeType) {
+        if (categoryId == null) {
+            throw new NullPointerException("Null categoryId");
+        } else if (attributeType == null) {
+            throw new NullPointerException("Null AttributeType");
+        } else if (attributeType.getAttributeId() == null) {
+            throw new IllegalArgumentException("Null attributeId in AttributeType");
+        } else if (attributeType.getAttributeValue() == null) {
+            throw new IllegalArgumentException("Null attributeValue in AttributeType");
+        }
+        Identifier						attributeId				= new IdentifierImpl(attributeType.getAttributeId());
+        List<AttributeValue<?>>			values					= new ArrayList<AttributeValue<?>>();
+        Iterator<AttributeValueType>	iterAttributeValueTypes	= attributeType.getAttributeValue().iterator();
+        while (iterAttributeValueTypes.hasNext()) {
+            values.add(JaxpAttributeValue.newInstance(iterAttributeValueTypes.next()));
         }
 
-        public static JaxpAttribute newInstance(Identifier categoryId, AttributeType attributeType) {
-                if (categoryId == null) {
-                        throw new NullPointerException("Null categoryId");
-                } else if (attributeType == null) {
-                        throw new NullPointerException("Null AttributeType");
-                } else if (attributeType.getAttributeId() == null) {
-                        throw new IllegalArgumentException("Null attributeId in AttributeType");
-                } else if (attributeType.getAttributeValue() == null) {
-                        throw new IllegalArgumentException("Null attributeValue in AttributeType");
-                }
-                Identifier						attributeId				= new IdentifierImpl(attributeType.getAttributeId());
-                List<AttributeValue<?>>			values					= new ArrayList<AttributeValue<?>>();
-                Iterator<AttributeValueType>	iterAttributeValueTypes	= attributeType.getAttributeValue().iterator();
-                while (iterAttributeValueTypes.hasNext()) {
-                        values.add(JaxpAttributeValue.newInstance(iterAttributeValueTypes.next()));
-                }
-                
-                return new JaxpAttribute(attributeId, categoryId, values, attributeType.getIssuer(), attributeType.isIncludeInResult());
-        }
+        return new JaxpAttribute(attributeId, categoryId, values, attributeType.getIssuer(), attributeType.isIncludeInResult());
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeAssignment.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeAssignment.java
index a3d842b..75a46f4 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeAssignment.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeAssignment.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,56 +46,56 @@
 /**
  * JaxpAttributeAssignment extends {@link com.att.research.xacml.std.StdMutableAttributeAssignment} with methods for creation
  * from JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
- * 
+ *
  * @param <T> the java class of the value type for the assignment
  */
 public class JaxpAttributeAssignment extends StdMutableAttributeAssignment {
 
-        protected JaxpAttributeAssignment(Identifier attributeIdIn, Identifier categoryIdIn, String issuerIn, AttributeValue<?> attributeValueIn) {
-                super(attributeIdIn, categoryIdIn, issuerIn, attributeValueIn);
+    protected JaxpAttributeAssignment(Identifier attributeIdIn, Identifier categoryIdIn, String issuerIn, AttributeValue<?> attributeValueIn) {
+        super(attributeIdIn, categoryIdIn, issuerIn, attributeValueIn);
+    }
+
+    public static JaxpAttributeAssignment newInstance(AttributeAssignmentType attributeAssignmentType) {
+        if (attributeAssignmentType == null) {
+            throw new NullPointerException("Null AttributeAssignmentType");
+        } else if (attributeAssignmentType.getAttributeId() == null) {
+            throw new IllegalArgumentException("Null attributeId in AttributeAssignmentType");
+        } else if (attributeAssignmentType.getCategory() == null) {
+            throw new IllegalArgumentException("Null categoryId in AttributeAssignmentType");
+        } else if (attributeAssignmentType.getDataType() == null) {
+            throw new IllegalArgumentException("Null dataTypeId in AttributeAssignmentType");
+        } else if (attributeAssignmentType.getContent() == null || attributeAssignmentType.getContent().get(0) == null) {
+            throw new IllegalArgumentException("Null value in AttributeAssignmentType");
+        }
+        Identifier		attributeId	= new IdentifierImpl(attributeAssignmentType.getAttributeId());
+        Identifier		categoryId	= new IdentifierImpl(attributeAssignmentType.getCategory());
+        Identifier		dataTypeId	= new IdentifierImpl(attributeAssignmentType.getDataType());
+        DataTypeFactory dataTypeFactory		= null;
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+            if (dataTypeFactory == null) {
+                return null;
+            }
+        } catch (FactoryException ex) {
+            return null;
+        }
+        DataType<?> dataType				= dataTypeFactory.getDataType(dataTypeId);
+        if (dataType == null) {
+            throw new IllegalArgumentException("Unknown data type \"" + dataTypeId.toString() + "\"");
         }
 
-        public static JaxpAttributeAssignment newInstance(AttributeAssignmentType attributeAssignmentType) {
-                if (attributeAssignmentType == null) {
-                        throw new NullPointerException("Null AttributeAssignmentType");
-                } else if (attributeAssignmentType.getAttributeId() == null) {
-                        throw new IllegalArgumentException("Null attributeId in AttributeAssignmentType");
-                } else if (attributeAssignmentType.getCategory() == null) {
-                        throw new IllegalArgumentException("Null categoryId in AttributeAssignmentType");
-                } else if (attributeAssignmentType.getDataType() == null) {
-                        throw new IllegalArgumentException("Null dataTypeId in AttributeAssignmentType");
-                } else if (attributeAssignmentType.getContent() == null || attributeAssignmentType.getContent().get(0) == null) {
-                        throw new IllegalArgumentException("Null value in AttributeAssignmentType");
-                }
-                Identifier		attributeId	= new IdentifierImpl(attributeAssignmentType.getAttributeId());
-                Identifier		categoryId	= new IdentifierImpl(attributeAssignmentType.getCategory());
-                Identifier		dataTypeId	= new IdentifierImpl(attributeAssignmentType.getDataType());
-                DataTypeFactory dataTypeFactory		= null;
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                        if (dataTypeFactory == null) {
-                                return null;
-                        }
-                } catch (FactoryException ex) {
-                        return null;
-                }
-                DataType<?> dataType				= dataTypeFactory.getDataType(dataTypeId);
-                if (dataType == null) {
-                        throw new IllegalArgumentException("Unknown data type \"" + dataTypeId.toString() + "\"");
-                }
-                
-                List<Object>	content	= attributeAssignmentType.getContent();
-                String			issuer	= attributeAssignmentType.getIssuer();
-                AttributeValue<?> attributeValue	= null;
-                try {
-                        attributeValue = dataType.createAttributeValue(content);
-                } catch (DataTypeException ex) {
-                        throw new IllegalArgumentException("Failed to create AttributeValue from \"" + dataTypeId.toString() + "\"", ex);
-                }
-                
-                return new JaxpAttributeAssignment(attributeId, categoryId, issuer, attributeValue);		
+        List<Object>	content	= attributeAssignmentType.getContent();
+        String			issuer	= attributeAssignmentType.getIssuer();
+        AttributeValue<?> attributeValue	= null;
+        try {
+            attributeValue = dataType.createAttributeValue(content);
+        } catch (DataTypeException ex) {
+            throw new IllegalArgumentException("Failed to create AttributeValue from \"" + dataTypeId.toString() + "\"", ex);
         }
+
+        return new JaxpAttributeAssignment(attributeId, categoryId, issuer, attributeValue);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeCategory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeCategory.java
index 1b03aa6..02fa3b6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeCategory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeCategory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,31 +46,31 @@
 /**
  * JaxpAttributeCategory extends {@link com.att.research.xacml.std.StdAttributeCategory} with methods for creation from
  * JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpAttributeCategory {
 
-        protected JaxpAttributeCategory() {
+    protected JaxpAttributeCategory() {
+    }
+
+    public static AttributeCategory newInstance(AttributesType attributesType) {
+        if (attributesType == null) {
+            throw new NullPointerException("Null AttributesType");
+        } else if (attributesType.getCategory() == null) {
+            throw new IllegalArgumentException("Null categoryId for AttributesType");
         }
-        
-        public static AttributeCategory newInstance(AttributesType attributesType) {
-                if (attributesType == null) {
-                        throw new NullPointerException("Null AttributesType");
-                } else if (attributesType.getCategory() == null) {
-                        throw new IllegalArgumentException("Null categoryId for AttributesType");
-                }
-                Identifier identifierCategory	= new IdentifierImpl(attributesType.getCategory());
-                List<Attribute> listAttributes	= new ArrayList<Attribute>();
-                
-                if (attributesType.getAttribute() != null && attributesType.getAttribute().size() > 0) {
-                        Iterator<AttributeType>	iterAttributeTypes	= attributesType.getAttribute().iterator();
-                        while (iterAttributeTypes.hasNext()) {
-                                listAttributes.add(JaxpAttribute.newInstance(identifierCategory, iterAttributeTypes.next()));
-                        }
-                }
-                return new StdAttributeCategory(identifierCategory, listAttributes);
+        Identifier identifierCategory	= new IdentifierImpl(attributesType.getCategory());
+        List<Attribute> listAttributes	= new ArrayList<Attribute>();
+
+        if (attributesType.getAttribute() != null && attributesType.getAttribute().size() > 0) {
+            Iterator<AttributeType>	iterAttributeTypes	= attributesType.getAttribute().iterator();
+            while (iterAttributeTypes.hasNext()) {
+                listAttributes.add(JaxpAttribute.newInstance(identifierCategory, iterAttributeTypes.next()));
+            }
         }
+        return new StdAttributeCategory(identifierCategory, listAttributes);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeValue.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeValue.java
index cb53265..ad95c6e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeValue.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpAttributeValue.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -77,66 +77,66 @@
 /**
  * JaxpAttributeValue<T> extends {@link com.att.research.xacml.std.StdAttributeValue} to instantiate itself
  * from a JAXP {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType}.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  * @param <T> the data type of the value in the <code>AttributeValue</code>.
  */
 public class JaxpAttributeValue<T> extends StdAttributeValue<T> {
 
-        private JaxpAttributeValue(Identifier dataTypeIdIn, T valueIn) {
-                super(dataTypeIdIn, valueIn);
+    private JaxpAttributeValue(Identifier dataTypeIdIn, T valueIn) {
+        super(dataTypeIdIn, valueIn);
+    }
+
+    public static JaxpAttributeValue<?> newInstance(AttributeValueType attributeValueType) {
+        if (attributeValueType == null) {
+            throw new NullPointerException("Null AttributeValueType");
+        } else if (attributeValueType.getDataType() == null) {
+            throw new IllegalArgumentException("Null dataType in AttributeValueType");
         }
-        
-        public static JaxpAttributeValue<?> newInstance(AttributeValueType attributeValueType) {
-                if (attributeValueType == null) {
-                        throw new NullPointerException("Null AttributeValueType");
-                } else if (attributeValueType.getDataType() == null) {
-                        throw new IllegalArgumentException("Null dataType in AttributeValueType");
-                }
-                Identifier	dataTypeId	= new IdentifierImpl(attributeValueType.getDataType());
-                Object		source		= (attributeValueType.getContent() == null || attributeValueType.getContent().size() == 0 ? "" : attributeValueType.getContent().get(0));
-                try {
-                        if (dataTypeId.equals(XACML.ID_DATATYPE_ANYURI)) {
-                                return new JaxpAttributeValue<URI>(dataTypeId, DataTypeAnyURI.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_BASE64BINARY)) {
-                                return new JaxpAttributeValue<Base64Binary>(dataTypeId, DataTypeBase64Binary.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_BOOLEAN)) {
-                                return new JaxpAttributeValue<Boolean>(dataTypeId, DataTypeBoolean.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_DATE)) {
-                                return new JaxpAttributeValue<ISO8601Date>(dataTypeId, DataTypeDate.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_DATETIME)) {
-                                return new JaxpAttributeValue<ISO8601DateTime>(dataTypeId, DataTypeDateTime.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_DAYTIMEDURATION)) {
-                                return new JaxpAttributeValue<XPathDayTimeDuration>(dataTypeId, DataTypeDayTimeDuration.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML2.ID_DATATYPE_DNSNAME)) {
-                                return new JaxpAttributeValue<RFC2396DomainName>(dataTypeId, DataTypeDNSName.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_DOUBLE)) {
-                                return new JaxpAttributeValue<Double>(dataTypeId, DataTypeDouble.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_HEXBINARY)) {
-                                return new JaxpAttributeValue<HexBinary>(dataTypeId, DataTypeHexBinary.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_INTEGER)) {
-                                return new JaxpAttributeValue<BigInteger>(dataTypeId, DataTypeInteger.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML2.ID_DATATYPE_IPADDRESS)) {
-                                return new JaxpAttributeValue<IPAddress>(dataTypeId, DataTypeIpAddress.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML1.ID_DATATYPE_RFC822NAME)) {
-                                return new JaxpAttributeValue<RFC822Name>(dataTypeId, DataTypeRFC822Name.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_STRING)) {
-                                return new JaxpAttributeValue<String>(dataTypeId, DataTypeString.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_TIME)) {
-                                return new JaxpAttributeValue<ISO8601Time>(dataTypeId, DataTypeTime.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML1.ID_DATATYPE_X500NAME)) {
-                                return new JaxpAttributeValue<X500Principal>(dataTypeId, DataTypeX500Name.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML3.ID_DATATYPE_XPATHEXPRESSION)) {
-                                return new JaxpAttributeValue<XPathExpression>(dataTypeId, DataTypeXPathExpression.newInstance().convert(source));
-                        } else if (dataTypeId.equals(XACML.ID_DATATYPE_YEARMONTHDURATION)) {
-                                return new JaxpAttributeValue<XPathYearMonthDuration>(dataTypeId, DataTypeYearMonthDuration.newInstance().convert(source));
-                        } else {
-                                throw new IllegalArgumentException("Unknown dataType \"" + attributeValueType.getDataType() + "\"");
-                        }
-                } catch (DataTypeException ex) {
-                        throw new IllegalArgumentException("DataTypeException converting to dataType \"" + attributeValueType.getDataType() + "\"");
-                }
+        Identifier	dataTypeId	= new IdentifierImpl(attributeValueType.getDataType());
+        Object		source		= (attributeValueType.getContent() == null || attributeValueType.getContent().size() == 0 ? "" : attributeValueType.getContent().get(0));
+        try {
+            if (dataTypeId.equals(XACML.ID_DATATYPE_ANYURI)) {
+                return new JaxpAttributeValue<URI>(dataTypeId, DataTypeAnyURI.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_BASE64BINARY)) {
+                return new JaxpAttributeValue<Base64Binary>(dataTypeId, DataTypeBase64Binary.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_BOOLEAN)) {
+                return new JaxpAttributeValue<Boolean>(dataTypeId, DataTypeBoolean.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_DATE)) {
+                return new JaxpAttributeValue<ISO8601Date>(dataTypeId, DataTypeDate.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_DATETIME)) {
+                return new JaxpAttributeValue<ISO8601DateTime>(dataTypeId, DataTypeDateTime.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_DAYTIMEDURATION)) {
+                return new JaxpAttributeValue<XPathDayTimeDuration>(dataTypeId, DataTypeDayTimeDuration.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML2.ID_DATATYPE_DNSNAME)) {
+                return new JaxpAttributeValue<RFC2396DomainName>(dataTypeId, DataTypeDNSName.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_DOUBLE)) {
+                return new JaxpAttributeValue<Double>(dataTypeId, DataTypeDouble.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_HEXBINARY)) {
+                return new JaxpAttributeValue<HexBinary>(dataTypeId, DataTypeHexBinary.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_INTEGER)) {
+                return new JaxpAttributeValue<BigInteger>(dataTypeId, DataTypeInteger.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML2.ID_DATATYPE_IPADDRESS)) {
+                return new JaxpAttributeValue<IPAddress>(dataTypeId, DataTypeIpAddress.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML1.ID_DATATYPE_RFC822NAME)) {
+                return new JaxpAttributeValue<RFC822Name>(dataTypeId, DataTypeRFC822Name.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_STRING)) {
+                return new JaxpAttributeValue<String>(dataTypeId, DataTypeString.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_TIME)) {
+                return new JaxpAttributeValue<ISO8601Time>(dataTypeId, DataTypeTime.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML1.ID_DATATYPE_X500NAME)) {
+                return new JaxpAttributeValue<X500Principal>(dataTypeId, DataTypeX500Name.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML3.ID_DATATYPE_XPATHEXPRESSION)) {
+                return new JaxpAttributeValue<XPathExpression>(dataTypeId, DataTypeXPathExpression.newInstance().convert(source));
+            } else if (dataTypeId.equals(XACML.ID_DATATYPE_YEARMONTHDURATION)) {
+                return new JaxpAttributeValue<XPathYearMonthDuration>(dataTypeId, DataTypeYearMonthDuration.newInstance().convert(source));
+            } else {
+                throw new IllegalArgumentException("Unknown dataType \"" + attributeValueType.getDataType() + "\"");
+            }
+        } catch (DataTypeException ex) {
+            throw new IllegalArgumentException("DataTypeException converting to dataType \"" + attributeValueType.getDataType() + "\"");
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpIdReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpIdReference.java
index 1d9d11e..cf55e49 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpIdReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpIdReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,32 +43,32 @@
 /**
  * JaxpIdReference extends {@link com.att.research.xacml.std.StdIdReference} with methods for creation from
  * JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpIdReference extends StdIdReference {
 
-        protected JaxpIdReference(Identifier idIn, Version versionIn) {
-                super(idIn, versionIn);
+    protected JaxpIdReference(Identifier idIn, Version versionIn) {
+        super(idIn, versionIn);
+    }
+
+    public static JaxpIdReference newInstance(IdReferenceType idReferenceType) {
+        if (idReferenceType == null) {
+            throw new NullPointerException("Null IdReferenceType");
+        } else if (idReferenceType.getValue() == null) {
+            throw new IllegalArgumentException("Null value in IdReferenceType");
         }
-        
-        public static JaxpIdReference newInstance(IdReferenceType idReferenceType) {
-                if (idReferenceType == null) {
-                        throw new NullPointerException("Null IdReferenceType");
-                } else if (idReferenceType.getValue() == null) {
-                        throw new IllegalArgumentException("Null value in IdReferenceType");
-                }
-                
-                Version version	= null;
-                if (idReferenceType.getVersion() != null) {
-                        try {
-                                version	= StdVersion.newInstance(idReferenceType.getVersion());
-                        } catch (ParseException ex) {
-                                throw new IllegalArgumentException("Invalid version");
-                        }
-                }
-                return new JaxpIdReference(new IdentifierImpl(idReferenceType.getValue()), version);
+
+        Version version	= null;
+        if (idReferenceType.getVersion() != null) {
+            try {
+                version	= StdVersion.newInstance(idReferenceType.getVersion());
+            } catch (ParseException ex) {
+                throw new IllegalArgumentException("Invalid version");
+            }
         }
+        return new JaxpIdReference(new IdentifierImpl(idReferenceType.getValue()), version);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpIdReferenceMatch.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpIdReferenceMatch.java
index 5d4e062..77dafaf 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpIdReferenceMatch.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpIdReferenceMatch.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,50 +43,50 @@
 /**
  * JaxpIdReferenceMatch extends {@link com.att.research.xacml.std.StdIdReferenceMatch} with methods for creation
  * from JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpIdReferenceMatch extends StdIdReferenceMatch {
 
-        protected JaxpIdReferenceMatch(Identifier idIn, VersionMatch versionIn, VersionMatch earliestVersionIn, VersionMatch latestVersionIn) {
-                super(idIn, versionIn, earliestVersionIn, latestVersionIn);
+    protected JaxpIdReferenceMatch(Identifier idIn, VersionMatch versionIn, VersionMatch earliestVersionIn, VersionMatch latestVersionIn) {
+        super(idIn, versionIn, earliestVersionIn, latestVersionIn);
+    }
+
+    public static JaxpIdReferenceMatch newInstance(IdReferenceType idReferenceType) {
+        if (idReferenceType == null) {
+            throw new NullPointerException("Null IdReferenceType");
+        } else if (idReferenceType.getValue() == null) {
+            throw new IllegalArgumentException("Null value for IdReferenceType");
         }
 
-        public static JaxpIdReferenceMatch newInstance(IdReferenceType idReferenceType) {
-                if (idReferenceType == null) {
-                        throw new NullPointerException("Null IdReferenceType");
-                } else if (idReferenceType.getValue() == null) {
-                        throw new IllegalArgumentException("Null value for IdReferenceType");
-                }
-                
-                VersionMatch version			= null;
-                VersionMatch earliestVersion	= null;
-                VersionMatch latestVersion		= null;
-                
-                if (idReferenceType.getVersion() != null) {
-                        try {
-                                version	= StdVersionMatch.newInstance(idReferenceType.getVersion());
-                        } catch (ParseException ex) {
-                                throw new IllegalArgumentException("Invalid version");
-                        }
-                }
-                if (idReferenceType.getEarliestVersion() != null) {
-                        try {
-                                earliestVersion	= StdVersionMatch.newInstance(idReferenceType.getEarliestVersion());
-                        } catch (ParseException ex) {
-                                throw new IllegalArgumentException("Invalid earliest version");
-                        }
-                }
-                
-                if (idReferenceType.getLatestVersion() != null) {
-                        try {
-                                latestVersion	= StdVersionMatch.newInstance(idReferenceType.getLatestVersion());
-                        } catch (ParseException ex) {
-                                throw new IllegalArgumentException("Invalid latest version");
-                        }
-                }
-                
-                return new JaxpIdReferenceMatch(new IdentifierImpl(idReferenceType.getValue()), version, earliestVersion, latestVersion);
+        VersionMatch version			= null;
+        VersionMatch earliestVersion	= null;
+        VersionMatch latestVersion		= null;
+
+        if (idReferenceType.getVersion() != null) {
+            try {
+                version	= StdVersionMatch.newInstance(idReferenceType.getVersion());
+            } catch (ParseException ex) {
+                throw new IllegalArgumentException("Invalid version");
+            }
         }
+        if (idReferenceType.getEarliestVersion() != null) {
+            try {
+                earliestVersion	= StdVersionMatch.newInstance(idReferenceType.getEarliestVersion());
+            } catch (ParseException ex) {
+                throw new IllegalArgumentException("Invalid earliest version");
+            }
+        }
+
+        if (idReferenceType.getLatestVersion() != null) {
+            try {
+                latestVersion	= StdVersionMatch.newInstance(idReferenceType.getLatestVersion());
+            } catch (ParseException ex) {
+                throw new IllegalArgumentException("Invalid latest version");
+            }
+        }
+
+        return new JaxpIdReferenceMatch(new IdentifierImpl(idReferenceType.getValue()), version, earliestVersion, latestVersion);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpMissingAttributeDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpMissingAttributeDetail.java
index c6ae7c5..7a638b6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpMissingAttributeDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpMissingAttributeDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,38 +46,38 @@
 /**
  * JaxpMissingAttributeDetail extends {@link com.att.research.xacml.std.StdMutableMissingAttributeDetail} with methods for creation from
  * JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpMissingAttributeDetail extends StdMutableMissingAttributeDetail {
 
-        protected JaxpMissingAttributeDetail(Identifier categoryIdIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn, Collection<AttributeValue<?>> attributeValuesIn) {
-                super(categoryIdIn, attributeIdIn, dataTypeIdIn, issuerIn, attributeValuesIn);
-        }
+    protected JaxpMissingAttributeDetail(Identifier categoryIdIn, Identifier attributeIdIn, Identifier dataTypeIdIn, String issuerIn, Collection<AttributeValue<?>> attributeValuesIn) {
+        super(categoryIdIn, attributeIdIn, dataTypeIdIn, issuerIn, attributeValuesIn);
+    }
 
-        public static JaxpMissingAttributeDetail newInstance(MissingAttributeDetailType missingAttributeDetailType) {
-                if (missingAttributeDetailType == null) {
-                        throw new NullPointerException("Null MissingAttributeDetailType");
-                } else if (missingAttributeDetailType.getCategory() == null) {
-                        throw new IllegalArgumentException("Null categoryId for MissingAttributeDetailType");
-                } else if (missingAttributeDetailType.getAttributeId() == null) {
-                        throw new IllegalArgumentException("Null attributeId for MissingAttributeDetailType");
-                } else if (missingAttributeDetailType.getDataType() == null) {
-                        throw new IllegalArgumentException("Null dataTypeId for MissingAttributeDetailType");
-                }
-                Identifier	categoryId	= new IdentifierImpl(missingAttributeDetailType.getCategory());
-                Identifier	attributeId	= new IdentifierImpl(missingAttributeDetailType.getAttributeId());
-                Identifier	dataTypeId	= new IdentifierImpl(missingAttributeDetailType.getDataType());
-                
-                List<AttributeValue<?>>	attributeValues	= null;
-                if (missingAttributeDetailType.getAttributeValue() != null && missingAttributeDetailType.getAttributeValue().size() > 0) {
-                        attributeValues	= new ArrayList<AttributeValue<?>>();
-                        Iterator<AttributeValueType>	iterAttributeValueTypes	= missingAttributeDetailType.getAttributeValue().iterator();
-                        while (iterAttributeValueTypes.hasNext()) {
-                                attributeValues.add(JaxpAttributeValue.newInstance(iterAttributeValueTypes.next()));
-                        }
-                }
-                return new JaxpMissingAttributeDetail(categoryId, attributeId, dataTypeId, missingAttributeDetailType.getIssuer(), attributeValues);
+    public static JaxpMissingAttributeDetail newInstance(MissingAttributeDetailType missingAttributeDetailType) {
+        if (missingAttributeDetailType == null) {
+            throw new NullPointerException("Null MissingAttributeDetailType");
+        } else if (missingAttributeDetailType.getCategory() == null) {
+            throw new IllegalArgumentException("Null categoryId for MissingAttributeDetailType");
+        } else if (missingAttributeDetailType.getAttributeId() == null) {
+            throw new IllegalArgumentException("Null attributeId for MissingAttributeDetailType");
+        } else if (missingAttributeDetailType.getDataType() == null) {
+            throw new IllegalArgumentException("Null dataTypeId for MissingAttributeDetailType");
         }
+        Identifier	categoryId	= new IdentifierImpl(missingAttributeDetailType.getCategory());
+        Identifier	attributeId	= new IdentifierImpl(missingAttributeDetailType.getAttributeId());
+        Identifier	dataTypeId	= new IdentifierImpl(missingAttributeDetailType.getDataType());
+
+        List<AttributeValue<?>>	attributeValues	= null;
+        if (missingAttributeDetailType.getAttributeValue() != null && missingAttributeDetailType.getAttributeValue().size() > 0) {
+            attributeValues	= new ArrayList<AttributeValue<?>>();
+            Iterator<AttributeValueType>	iterAttributeValueTypes	= missingAttributeDetailType.getAttributeValue().iterator();
+            while (iterAttributeValueTypes.hasNext()) {
+                attributeValues.add(JaxpAttributeValue.newInstance(iterAttributeValueTypes.next()));
+            }
+        }
+        return new JaxpMissingAttributeDetail(categoryId, attributeId, dataTypeId, missingAttributeDetailType.getIssuer(), attributeValues);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpObligation.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpObligation.java
index 0502a17..755f083 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpObligation.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpObligation.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,31 +46,31 @@
 /**
  * JaxpObligation extends {@link com.att.research.xacml.std.StdMutableObligation} with methods for creation from
  * JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpObligation extends StdMutableObligation {
 
-        protected JaxpObligation(Identifier idIn, Collection<AttributeAssignment> attributeAssignmentsIn) {
-                super(idIn, attributeAssignmentsIn);
-        }
+    protected JaxpObligation(Identifier idIn, Collection<AttributeAssignment> attributeAssignmentsIn) {
+        super(idIn, attributeAssignmentsIn);
+    }
 
-        public static JaxpObligation newInstance(ObligationType obligationType) {
-                if (obligationType == null) {
-                        throw new NullPointerException("Null ObligationType");
-                } else if (obligationType.getObligationId() == null) {
-                        throw new IllegalArgumentException("Null obligationId for ObligationType");
-                }
-                Identifier						obligationId			= new IdentifierImpl(obligationType.getObligationId());
-                List<AttributeAssignment>	attributeAssignments	= null;
-                if (obligationType.getAttributeAssignment() != null && obligationType.getAttributeAssignment().size() > 0) {
-                        attributeAssignments	= new ArrayList<AttributeAssignment>();
-                        Iterator<AttributeAssignmentType>	iterAttributeAssignmentTypes	= obligationType.getAttributeAssignment().iterator();
-                        while (iterAttributeAssignmentTypes.hasNext()) {
-                                attributeAssignments.add(JaxpAttributeAssignment.newInstance(iterAttributeAssignmentTypes.next()));
-                        }
-                }
-                return new JaxpObligation(obligationId, attributeAssignments);
+    public static JaxpObligation newInstance(ObligationType obligationType) {
+        if (obligationType == null) {
+            throw new NullPointerException("Null ObligationType");
+        } else if (obligationType.getObligationId() == null) {
+            throw new IllegalArgumentException("Null obligationId for ObligationType");
         }
+        Identifier						obligationId			= new IdentifierImpl(obligationType.getObligationId());
+        List<AttributeAssignment>	attributeAssignments	= null;
+        if (obligationType.getAttributeAssignment() != null && obligationType.getAttributeAssignment().size() > 0) {
+            attributeAssignments	= new ArrayList<AttributeAssignment>();
+            Iterator<AttributeAssignmentType>	iterAttributeAssignmentTypes	= obligationType.getAttributeAssignment().iterator();
+            while (iterAttributeAssignmentTypes.hasNext()) {
+                attributeAssignments.add(JaxpAttributeAssignment.newInstance(iterAttributeAssignmentTypes.next()));
+            }
+        }
+        return new JaxpObligation(obligationId, attributeAssignments);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequest.java
index 09c23c5..e61ecd8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -58,110 +58,110 @@
 
 /**
  * JaxpRequest extends {@link com.att.research.xacml.std.StdMutableRequest} with methods for creation from JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpRequest extends StdMutableRequest {
-        private static Log	logger	= LogFactory.getLog(JaxpRequest.class);
-        
-        public JaxpRequest() {
+    private static Log	logger	= LogFactory.getLog(JaxpRequest.class);
+
+    public JaxpRequest() {
+    }
+
+    public static JaxpRequest newInstance(RequestType requestType) {
+        if (requestType == null) {
+            throw new NullPointerException("Null RequestType");
         }
-        
-        public static JaxpRequest newInstance(RequestType requestType) {
-                if (requestType == null) {
-                        throw new NullPointerException("Null RequestType");
-                }
-                JaxpRequest	jaxpRequest	= new JaxpRequest();
-                jaxpRequest.setCombinedDecision(requestType.isCombinedDecision());
-                jaxpRequest.setReturnPolicyIdList(requestType.isReturnPolicyIdList());
-                if (requestType.getAttributes() != null) {
-                        Iterator<AttributesType>	iterAttributesTypes			= requestType.getAttributes().iterator();
-                        while (iterAttributesTypes.hasNext()) {
-                                jaxpRequest.add(JaxpRequestAttributes.newInstance(iterAttributesTypes.next()));
-                        }
-                }
-                if (requestType.getMultiRequests() != null && requestType.getMultiRequests().getRequestReference() != null) {
-                        Iterator<RequestReferenceType>	iterRequestReferenceTypes	= requestType.getMultiRequests().getRequestReference().iterator();
-                        while (iterRequestReferenceTypes.hasNext()) {
-                                jaxpRequest.add(JaxpRequestReference.newInstance(iterRequestReferenceTypes.next()));
-                        }
-                }
-                if (requestType.getRequestDefaults() != null) {
-                        jaxpRequest.setRequestDefaults(JaxpRequestDefaults.newInstance(requestType.getRequestDefaults()));
-                }
-                
-                return jaxpRequest;
+        JaxpRequest	jaxpRequest	= new JaxpRequest();
+        jaxpRequest.setCombinedDecision(requestType.isCombinedDecision());
+        jaxpRequest.setReturnPolicyIdList(requestType.isReturnPolicyIdList());
+        if (requestType.getAttributes() != null) {
+            Iterator<AttributesType>	iterAttributesTypes			= requestType.getAttributes().iterator();
+            while (iterAttributesTypes.hasNext()) {
+                jaxpRequest.add(JaxpRequestAttributes.newInstance(iterAttributesTypes.next()));
+            }
         }
-        
-        /**
-         * Creates a new <code>JaxpRequest</code> by loading it from an XML <code>File</code>.
-         * 
-         * @param fileXmlRequest the <code>File</code> containing the Request XML
-         * @return a new <code>JaxpRequest</code> generated by parsing the given XML file 
-         * @throws javax.xml.parsers.ParserConfigurationException
-         * @throws java.io.IOException
-         * @throws org.xml.sax.SAXException
-         * @throws javax.xml.bind.JAXBException
-         */
-        public static JaxpRequest load(File fileXmlRequest) throws ParserConfigurationException, IOException, SAXException, JAXBException {
-                if (fileXmlRequest == null) {
-                        throw new NullPointerException("Null File");
-                }
-                
+        if (requestType.getMultiRequests() != null && requestType.getMultiRequests().getRequestReference() != null) {
+            Iterator<RequestReferenceType>	iterRequestReferenceTypes	= requestType.getMultiRequests().getRequestReference().iterator();
+            while (iterRequestReferenceTypes.hasNext()) {
+                jaxpRequest.add(JaxpRequestReference.newInstance(iterRequestReferenceTypes.next()));
+            }
+        }
+        if (requestType.getRequestDefaults() != null) {
+            jaxpRequest.setRequestDefaults(JaxpRequestDefaults.newInstance(requestType.getRequestDefaults()));
+        }
+
+        return jaxpRequest;
+    }
+
+    /**
+     * Creates a new <code>JaxpRequest</code> by loading it from an XML <code>File</code>.
+     *
+     * @param fileXmlRequest the <code>File</code> containing the Request XML
+     * @return a new <code>JaxpRequest</code> generated by parsing the given XML file
+     * @throws javax.xml.parsers.ParserConfigurationException
+     * @throws java.io.IOException
+     * @throws org.xml.sax.SAXException
+     * @throws javax.xml.bind.JAXBException
+     */
+    public static JaxpRequest load(File fileXmlRequest) throws ParserConfigurationException, IOException, SAXException, JAXBException {
+        if (fileXmlRequest == null) {
+            throw new NullPointerException("Null File");
+        }
+
         /*
          * Create XML document factory and builder
          */
-                DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
-            documentBuilderFactory.setNamespaceAware(true);
-                DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
-                
-                /*
-                 * Parse the file into a Document
-                 */
-                Document	document	= documentBuilder.parse(fileXmlRequest);
-                if (document == null) {
-                        logger.error("No Document returned parsing \"" + fileXmlRequest.getAbsolutePath() + "\"");
-                        return null;
-                }
-                
-                NodeList	nodeListRoot	= document.getChildNodes();
-                if (nodeListRoot == null || nodeListRoot.getLength() == 0) {
-                        logger.warn("No child elements of the XML document");
-                        return null;
-                }
-                Node		nodeRoot		= nodeListRoot.item(0);
-                if (nodeRoot == null || nodeRoot.getNodeType() != Node.ELEMENT_NODE) {
-                        logger.warn("Root of the document is not an ELEMENT");
-                        return null;
-                }
-                
-                JAXBContext 				context 			= JAXBContext.newInstance(RequestType.class);
-                Unmarshaller 				unmarshaller 		= context.createUnmarshaller();
-                JAXBElement<RequestType>	jaxbElementRequest 	= unmarshaller.unmarshal((Element)nodeRoot, RequestType.class);
-                if (jaxbElementRequest == null || jaxbElementRequest.getValue() == null) {
-                        logger.error("JAXB unmarshalling did not return a RequestType node");
-                        return null;
-                }
-                return JaxpRequest.newInstance(jaxbElementRequest.getValue());
-                
+        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+        documentBuilderFactory.setNamespaceAware(true);
+        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+
+        /*
+         * Parse the file into a Document
+         */
+        Document	document	= documentBuilder.parse(fileXmlRequest);
+        if (document == null) {
+            logger.error("No Document returned parsing \"" + fileXmlRequest.getAbsolutePath() + "\"");
+            return null;
         }
-        
-        public static void main(String[] args) {
-                for (String fileName: args) {
-                        JaxpRequest	jaxpRequest	= null;
-                        try {
-                                jaxpRequest	= JaxpRequest.load(new File(fileName));
-                        } catch (Exception ex) {
-                                logger.fatal("Failed to load \"" + fileName + "\" as a JaxpRequest", ex);
-                                continue;
-                        }
-                        if (jaxpRequest == null) {
-                                logger.warn("Null JaxpRequest returned for file \"" + fileName + "\"");
-                        } else {
-                                logger.info("JaxpRequest for file \"" + fileName + "\"=" + jaxpRequest.toString());
-                        }
-                }
+
+        NodeList	nodeListRoot	= document.getChildNodes();
+        if (nodeListRoot == null || nodeListRoot.getLength() == 0) {
+            logger.warn("No child elements of the XML document");
+            return null;
         }
+        Node		nodeRoot		= nodeListRoot.item(0);
+        if (nodeRoot == null || nodeRoot.getNodeType() != Node.ELEMENT_NODE) {
+            logger.warn("Root of the document is not an ELEMENT");
+            return null;
+        }
+
+        JAXBContext 				context 			= JAXBContext.newInstance(RequestType.class);
+        Unmarshaller 				unmarshaller 		= context.createUnmarshaller();
+        JAXBElement<RequestType>	jaxbElementRequest 	= unmarshaller.unmarshal((Element)nodeRoot, RequestType.class);
+        if (jaxbElementRequest == null || jaxbElementRequest.getValue() == null) {
+            logger.error("JAXB unmarshalling did not return a RequestType node");
+            return null;
+        }
+        return JaxpRequest.newInstance(jaxbElementRequest.getValue());
+
+    }
+
+    public static void main(String[] args) {
+        for (String fileName: args) {
+            JaxpRequest	jaxpRequest	= null;
+            try {
+                jaxpRequest	= JaxpRequest.load(new File(fileName));
+            } catch (Exception ex) {
+                logger.fatal("Failed to load \"" + fileName + "\" as a JaxpRequest", ex);
+                continue;
+            }
+            if (jaxpRequest == null) {
+                logger.warn("Null JaxpRequest returned for file \"" + fileName + "\"");
+            } else {
+                logger.info("JaxpRequest for file \"" + fileName + "\"=" + jaxpRequest.toString());
+            }
+        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestAttributes.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestAttributes.java
index 03d9e25..66f599f 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestAttributes.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestAttributes.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,41 +47,41 @@
 
 /**
  * JaxpRequestAttributes extends {@link com.att.research.xacml.std.StdRequestAttributes} with methods for creation from JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpRequestAttributes {
 
-        protected JaxpRequestAttributes() {
+    protected JaxpRequestAttributes() {
+    }
+
+    public static RequestAttributes newInstance(AttributesType attributesType) {
+        if (attributesType == null) {
+            throw new NullPointerException("Null AttributesType");
+        } else if (attributesType.getCategory() == null) {
+            throw new IllegalArgumentException("Null categoryId for AttributesType");
         }
-        
-        public static RequestAttributes newInstance(AttributesType attributesType) {
-                if (attributesType == null) {
-                        throw new NullPointerException("Null AttributesType");
-                } else if (attributesType.getCategory() == null) {
-                        throw new IllegalArgumentException("Null categoryId for AttributesType");
-                }
-                Identifier identifierCategory	= new IdentifierImpl(attributesType.getCategory());
-                Node nodeContentRoot			= null;
-                List<Attribute> listAttributes	= new ArrayList<Attribute>();
-                
-                if (attributesType.getContent() != null && attributesType.getContent().getContent() != null && attributesType.getContent().getContent().size() > 0) {
-                        // The XACML Spec says there is only one child node, so we only need the first element of the list, and it should be an Element
-                        // unless someone happens to use XACML schema types in their Content node, which could be a problem.
-                        //
-                        Object	contentObject	= attributesType.getContent().getContent().get(0);
-                        if (contentObject instanceof Node) {
-                                nodeContentRoot	= (Node)contentObject;
-                        }
-                }
-                if (attributesType.getAttribute() != null && attributesType.getAttribute().size() > 0) {
-                        Iterator<AttributeType>	iterAttributeTypes	= attributesType.getAttribute().iterator();
-                        while (iterAttributeTypes.hasNext()) {
-                                listAttributes.add(JaxpAttribute.newInstance(identifierCategory, iterAttributeTypes.next()));
-                        }
-                }
-                return new StdRequestAttributes(identifierCategory, listAttributes, nodeContentRoot, attributesType.getId());
+        Identifier identifierCategory	= new IdentifierImpl(attributesType.getCategory());
+        Node nodeContentRoot			= null;
+        List<Attribute> listAttributes	= new ArrayList<Attribute>();
+
+        if (attributesType.getContent() != null && attributesType.getContent().getContent() != null && attributesType.getContent().getContent().size() > 0) {
+            // The XACML Spec says there is only one child node, so we only need the first element of the list, and it should be an Element
+            // unless someone happens to use XACML schema types in their Content node, which could be a problem.
+            //
+            Object	contentObject	= attributesType.getContent().getContent().get(0);
+            if (contentObject instanceof Node) {
+                nodeContentRoot	= (Node)contentObject;
+            }
         }
+        if (attributesType.getAttribute() != null && attributesType.getAttribute().size() > 0) {
+            Iterator<AttributeType>	iterAttributeTypes	= attributesType.getAttribute().iterator();
+            while (iterAttributeTypes.hasNext()) {
+                listAttributes.add(JaxpAttribute.newInstance(identifierCategory, iterAttributeTypes.next()));
+            }
+        }
+        return new StdRequestAttributes(identifierCategory, listAttributes, nodeContentRoot, attributesType.getId());
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestAttributesReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestAttributesReference.java
index 6cec403..7da979d 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestAttributesReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestAttributesReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,23 +37,23 @@
 /**
  * JaxpRequestAttributesReference extends {@link com.att.research.xacml.std.StdRequestAttributesReference} with methods for
  * creation using JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpRequestAttributesReference extends StdRequestAttributesReference {
 
-        protected JaxpRequestAttributesReference(String referenceIdIn) {
-                super(referenceIdIn);
+    protected JaxpRequestAttributesReference(String referenceIdIn) {
+        super(referenceIdIn);
+    }
+
+    public static JaxpRequestAttributesReference newInstances(AttributesReferenceType attributesReferenceType) {
+        if (attributesReferenceType == null) {
+            throw new NullPointerException("Null AttributesReferenceType");
+        } else if (attributesReferenceType.getReferenceId() == null) {
+            throw new IllegalArgumentException("Null referenceId for AttributesReferenceType");
         }
-        
-        public static JaxpRequestAttributesReference newInstances(AttributesReferenceType attributesReferenceType) {
-                if (attributesReferenceType == null) {
-                        throw new NullPointerException("Null AttributesReferenceType");
-                } else if (attributesReferenceType.getReferenceId() == null) {
-                        throw new IllegalArgumentException("Null referenceId for AttributesReferenceType");
-                }
-                return new JaxpRequestAttributesReference(attributesReferenceType.getReferenceId().toString());
-        }
+        return new JaxpRequestAttributesReference(attributesReferenceType.getReferenceId().toString());
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestDefaults.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestDefaults.java
index 95788ff..2c95a83 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestDefaults.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestDefaults.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,29 +39,29 @@
 /**
  * JaxpRequestDefaults extends {@link com.att.research.xacml.std.StdRequestDefaults} with methods for creation
  * from JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpRequestDefaults extends StdRequestDefaults {
 
-        protected JaxpRequestDefaults(URI xpathVersionIn) {
-                super(xpathVersionIn);
+    protected JaxpRequestDefaults(URI xpathVersionIn) {
+        super(xpathVersionIn);
+    }
+
+    public static JaxpRequestDefaults newInstance(RequestDefaultsType requestDefaultsType) {
+        if (requestDefaultsType == null) {
+            throw new NullPointerException("Null RequestDefaultsType");
         }
-        
-        public static JaxpRequestDefaults newInstance(RequestDefaultsType requestDefaultsType) {
-                if (requestDefaultsType == null) {
-                        throw new NullPointerException("Null RequestDefaultsType");
-                }
-                URI	uriXPathVersion	= null;
-                if (requestDefaultsType.getXPathVersion() != null) {
-                        try {
-                                uriXPathVersion	= new URI(requestDefaultsType.getXPathVersion());
-                        } catch (Exception ex) {
-                                throw new IllegalArgumentException("Invalid URI for XPathVersion \"" + requestDefaultsType.getXPathVersion() + "\"", ex);
-                        }
-                }
-                return new JaxpRequestDefaults(uriXPathVersion);
+        URI	uriXPathVersion	= null;
+        if (requestDefaultsType.getXPathVersion() != null) {
+            try {
+                uriXPathVersion	= new URI(requestDefaultsType.getXPathVersion());
+            } catch (Exception ex) {
+                throw new IllegalArgumentException("Invalid URI for XPathVersion \"" + requestDefaultsType.getXPathVersion() + "\"", ex);
+            }
         }
+        return new JaxpRequestDefaults(uriXPathVersion);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestReference.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestReference.java
index 3888608..52ad7e9 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestReference.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpRequestReference.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,27 +40,27 @@
 /**
  * JaxpRequestReference extends {@link com.att.research.xacml.std.StdMutableRequestReference} with methods for
  * creation form JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpRequestReference extends StdMutableRequestReference {
 
-        protected JaxpRequestReference() {
+    protected JaxpRequestReference() {
+    }
+
+    public static JaxpRequestReference newInstance(RequestReferenceType requestReferenceType) {
+        if (requestReferenceType == null) {
+            throw new NullPointerException("Null RequestReferenceType");
+        } else if (requestReferenceType.getAttributesReference() == null || requestReferenceType.getAttributesReference().size() == 0) {
+            throw new IllegalArgumentException("No AttributesReferenceTypes in RequestReferenceType");
         }
-        
-        public static JaxpRequestReference newInstance(RequestReferenceType requestReferenceType) {
-                if (requestReferenceType == null) {
-                        throw new NullPointerException("Null RequestReferenceType");
-                } else if (requestReferenceType.getAttributesReference() == null || requestReferenceType.getAttributesReference().size() == 0) {
-                        throw new IllegalArgumentException("No AttributesReferenceTypes in RequestReferenceType");
-                }
-                JaxpRequestReference	jaxpRequestReference	= new JaxpRequestReference();
-                Iterator<AttributesReferenceType>	iterAttributesReferenceTypes	= requestReferenceType.getAttributesReference().iterator();
-                while (iterAttributesReferenceTypes.hasNext()) {
-                        jaxpRequestReference.add(JaxpRequestAttributesReference.newInstances(iterAttributesReferenceTypes.next()));
-                }
-                return jaxpRequestReference;
+        JaxpRequestReference	jaxpRequestReference	= new JaxpRequestReference();
+        Iterator<AttributesReferenceType>	iterAttributesReferenceTypes	= requestReferenceType.getAttributesReference().iterator();
+        while (iterAttributesReferenceTypes.hasNext()) {
+            jaxpRequestReference.add(JaxpRequestAttributesReference.newInstances(iterAttributesReferenceTypes.next()));
         }
+        return jaxpRequestReference;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpResponse.java
index 9a34764..408b691 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -58,99 +58,99 @@
 /**
  * JaxpResponse extends {@link com.att.research.xacml.std.StdMutableResponse} with methods for creation from
  * JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpResponse extends StdMutableResponse {
-        private static Log	logger	= LogFactory.getLog(JaxpResponse.class);
+    private static Log	logger	= LogFactory.getLog(JaxpResponse.class);
 
-        protected JaxpResponse() {
+    protected JaxpResponse() {
+    }
+
+    public static JaxpResponse newInstance(ResponseType responseType) {
+        if (responseType == null) {
+            throw new NullPointerException("Null ResponseType");
+        } else if (responseType.getResult() == null || responseType.getResult().size() == 0) {
+            throw new IllegalArgumentException("No ResultTypes in ResponseType");
+        }
+        JaxpResponse	jaxpResponse	= new JaxpResponse();
+
+        Iterator<ResultType>	iterResults	= responseType.getResult().iterator();
+        while (iterResults.hasNext()) {
+            jaxpResponse.add(JaxpResult.newInstance(iterResults.next()));
         }
 
-        public static JaxpResponse newInstance(ResponseType responseType) {
-                if (responseType == null) {
-                        throw new NullPointerException("Null ResponseType");
-                } else if (responseType.getResult() == null || responseType.getResult().size() == 0) {
-                        throw new IllegalArgumentException("No ResultTypes in ResponseType");
-                }
-                JaxpResponse	jaxpResponse	= new JaxpResponse();
-                
-                Iterator<ResultType>	iterResults	= responseType.getResult().iterator();
-                while (iterResults.hasNext()) {
-                        jaxpResponse.add(JaxpResult.newInstance(iterResults.next()));
-                }
-                
-                return jaxpResponse;
+        return jaxpResponse;
+    }
+    /**
+     * Creates a new <code>JaxpResponse</code> by loading it from an XML <code>File</code>.
+     *
+     * @param fileXmlResponse the <code>File</code> containing the Response XML
+     * @return a new <code>JaxpResponse</code> generated by parsing the given XML file
+     * @throws javax.xml.parsers.ParserConfigurationException
+     * @throws java.io.IOException
+     * @throws org.xml.sax.SAXException
+     * @throws javax.xml.bind.JAXBException
+     */
+    public static JaxpResponse load(File fileXmlResponse) throws ParserConfigurationException, IOException, SAXException, JAXBException {
+        if (fileXmlResponse == null) {
+            throw new NullPointerException("Null File");
         }
-        /**
-         * Creates a new <code>JaxpResponse</code> by loading it from an XML <code>File</code>.
-         * 
-         * @param fileXmlResponse the <code>File</code> containing the Response XML
-         * @return a new <code>JaxpResponse</code> generated by parsing the given XML file 
-         * @throws javax.xml.parsers.ParserConfigurationException
-         * @throws java.io.IOException
-         * @throws org.xml.sax.SAXException
-         * @throws javax.xml.bind.JAXBException
-         */
-        public static JaxpResponse load(File fileXmlResponse) throws ParserConfigurationException, IOException, SAXException, JAXBException {
-                if (fileXmlResponse == null) {
-                        throw new NullPointerException("Null File");
-                }
-                
+
         /*
          * Create XML document factory and builder
          */
-                DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
-            documentBuilderFactory.setNamespaceAware(true);
-                DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
-                
-                /*
-                 * Parse the file into a Document
-                 */
-                Document	document	= documentBuilder.parse(fileXmlResponse);
-                if (document == null) {
-                        logger.error("No Document returned parsing \"" + fileXmlResponse.getAbsolutePath() + "\"");
-                        return null;
-                }
-                
-                NodeList	nodeListRoot	= document.getChildNodes();
-                if (nodeListRoot == null || nodeListRoot.getLength() == 0) {
-                        logger.warn("No child elements of the XML document");
-                        return null;
-                }
-                Node		nodeRoot		= nodeListRoot.item(0);
-                if (nodeRoot == null || nodeRoot.getNodeType() != Node.ELEMENT_NODE) {
-                        logger.warn("Root of the document is not an ELEMENT");
-                        return null;
-                }
-                
-                JAXBContext 				context 			= JAXBContext.newInstance(ResponseType.class);
-                Unmarshaller 				unmarshaller 		= context.createUnmarshaller();
-                JAXBElement<ResponseType>	jaxbElementResponse = unmarshaller.unmarshal((Element)nodeRoot, ResponseType.class);
-                if (jaxbElementResponse == null || jaxbElementResponse.getValue() == null) {
-                        logger.error("JAXB unmarshalling did not return a ResponseType node");
-                        return null;
-                }
-                return JaxpResponse.newInstance(jaxbElementResponse.getValue());
-                
+        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+        documentBuilderFactory.setNamespaceAware(true);
+        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+
+        /*
+         * Parse the file into a Document
+         */
+        Document	document	= documentBuilder.parse(fileXmlResponse);
+        if (document == null) {
+            logger.error("No Document returned parsing \"" + fileXmlResponse.getAbsolutePath() + "\"");
+            return null;
         }
-        
-        public static void main(String[] args) {
-                for (String fileName: args) {
-                        JaxpResponse	jaxpResponse	= null;
-                        try {
-                                jaxpResponse	= JaxpResponse.load(new File(fileName));
-                        } catch (Exception ex) {
-                                logger.fatal("Failed to load \"" + fileName + "\" as a JaxpResponse", ex);
-                                continue;
-                        }
-                        if (jaxpResponse == null) {
-                                logger.warn("Null JaxpResponse returned for file \"" + fileName + "\"");
-                        } else {
-                                logger.info("JaxpResponse for file \"" + fileName + "\"=" + jaxpResponse.toString());
-                        }
-                }
+
+        NodeList	nodeListRoot	= document.getChildNodes();
+        if (nodeListRoot == null || nodeListRoot.getLength() == 0) {
+            logger.warn("No child elements of the XML document");
+            return null;
         }
+        Node		nodeRoot		= nodeListRoot.item(0);
+        if (nodeRoot == null || nodeRoot.getNodeType() != Node.ELEMENT_NODE) {
+            logger.warn("Root of the document is not an ELEMENT");
+            return null;
+        }
+
+        JAXBContext 				context 			= JAXBContext.newInstance(ResponseType.class);
+        Unmarshaller 				unmarshaller 		= context.createUnmarshaller();
+        JAXBElement<ResponseType>	jaxbElementResponse = unmarshaller.unmarshal((Element)nodeRoot, ResponseType.class);
+        if (jaxbElementResponse == null || jaxbElementResponse.getValue() == null) {
+            logger.error("JAXB unmarshalling did not return a ResponseType node");
+            return null;
+        }
+        return JaxpResponse.newInstance(jaxbElementResponse.getValue());
+
+    }
+
+    public static void main(String[] args) {
+        for (String fileName: args) {
+            JaxpResponse	jaxpResponse	= null;
+            try {
+                jaxpResponse	= JaxpResponse.load(new File(fileName));
+            } catch (Exception ex) {
+                logger.fatal("Failed to load \"" + fileName + "\" as a JaxpResponse", ex);
+                continue;
+            }
+            if (jaxpResponse == null) {
+                logger.warn("Null JaxpResponse returned for file \"" + fileName + "\"");
+            } else {
+                logger.info("JaxpResponse for file \"" + fileName + "\"=" + jaxpResponse.toString());
+            }
+        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpResult.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpResult.java
index 2b987a4..294f526 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpResult.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpResult.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,86 +47,86 @@
 /**
  * JaxpResult extends {@link com.att.research.xacml.std.StdMutableResult} with methods for creation
  * from JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpResult extends StdMutableResult {
 
-        protected JaxpResult() {
+    protected JaxpResult() {
+    }
+
+    public static JaxpResult newInstance(ResultType resultType) {
+        if (resultType == null) {
+            throw new NullPointerException("Null ResultType");
+        } else if (resultType.getDecision() == null) {
+            throw new IllegalArgumentException("Null Decision in ResultType");
         }
-        
-        public static JaxpResult newInstance(ResultType resultType) {
-                if (resultType == null) {
-                        throw new NullPointerException("Null ResultType");
-                } else if (resultType.getDecision() == null) {
-                        throw new IllegalArgumentException("Null Decision in ResultType");
-                }
-                JaxpResult	jaxpResult	= new JaxpResult();
-                
-                switch(resultType.getDecision()) {
-                case DENY:
-                        jaxpResult.setDecision(Decision.DENY);
-                        break;
-                case INDETERMINATE:
-                        jaxpResult.setDecision(Decision.INDETERMINATE);
-                        break;
-                case NOT_APPLICABLE:
-                        jaxpResult.setDecision(Decision.NOTAPPLICABLE);
-                        break;
-                case PERMIT:
-                        jaxpResult.setDecision(Decision.PERMIT);
-                        break;
-                default:
-                        throw new IllegalArgumentException("Invalid Decision in ResultType \"" + resultType.getDecision().toString() + "\"");
-                }
-                
-                if (resultType.getStatus() != null) {
-                        jaxpResult.setStatus(JaxpStatus.newInstance(resultType.getStatus()));
-                }
-                
-                if (resultType.getObligations() != null && 
-                        resultType.getObligations().getObligation() != null && 
-                        resultType.getObligations().getObligation().size() > 0) {
-                        Iterator<ObligationType>	iterObligationTypes	= resultType.getObligations().getObligation().iterator();
-                        while (iterObligationTypes.hasNext()) {
-                                jaxpResult.addObligation(JaxpObligation.newInstance(iterObligationTypes.next()));
-                        }
-                }
-                
-                if (resultType.getAssociatedAdvice() != null &&
-                        resultType.getAssociatedAdvice().getAdvice() != null &&
-                        resultType.getAssociatedAdvice().getAdvice().size() > 0) {
-                        Iterator<AdviceType>		iterAdviceTypes	= resultType.getAssociatedAdvice().getAdvice().iterator();
-                        while (iterAdviceTypes.hasNext()) {
-                                jaxpResult.addAdvice(JaxpAdvice.newInstance(iterAdviceTypes.next()));
-                        }
-                }
-                
-                if (resultType.getAttributes() != null && resultType.getAttributes().size() > 0) {
-                        Iterator<AttributesType>		iterAttributesTypes	= resultType.getAttributes().iterator();
-                        while (iterAttributesTypes.hasNext()) {
-                                jaxpResult.addAttributeCategory(JaxpAttributeCategory.newInstance(iterAttributesTypes.next()));
-                        }
-                }
-                
-                if (resultType.getPolicyIdentifierList() != null && 
-                        resultType.getPolicyIdentifierList().getPolicyIdReferenceOrPolicySetIdReference() != null && 
-                        resultType.getPolicyIdentifierList().getPolicyIdReferenceOrPolicySetIdReference().size() > 0) {
-                        Iterator<JAXBElement<IdReferenceType>>	iterJAXBElements	= resultType.getPolicyIdentifierList().getPolicyIdReferenceOrPolicySetIdReference().iterator();
-                        while (iterJAXBElements.hasNext()) {
-                                JAXBElement<IdReferenceType>	jaxbElement	= iterJAXBElements.next();
-                                if (jaxbElement.getName().getLocalPart().equals(XACML3.ELEMENT_POLICYIDREFERENCE)) {
-                                        jaxpResult.addPolicyIdentifier(JaxpIdReference.newInstance(jaxbElement.getValue()));
-                                } else if (jaxbElement.getName().getLocalPart().equals(XACML3.ELEMENT_POLICYSETIDREFERENCE)) {
-                                        jaxpResult.addPolicySetIdentifier(JaxpIdReference.newInstance(jaxbElement.getValue()));
-                                } else {
-                                        throw new IllegalArgumentException("Unexpected IdReferenceType found \"" + jaxbElement.getName().getLocalPart() + "\"");
-                                }
-                        }
-                }
-                
-                return jaxpResult;
+        JaxpResult	jaxpResult	= new JaxpResult();
+
+        switch(resultType.getDecision()) {
+        case DENY:
+            jaxpResult.setDecision(Decision.DENY);
+            break;
+        case INDETERMINATE:
+            jaxpResult.setDecision(Decision.INDETERMINATE);
+            break;
+        case NOT_APPLICABLE:
+            jaxpResult.setDecision(Decision.NOTAPPLICABLE);
+            break;
+        case PERMIT:
+            jaxpResult.setDecision(Decision.PERMIT);
+            break;
+        default:
+            throw new IllegalArgumentException("Invalid Decision in ResultType \"" + resultType.getDecision().toString() + "\"");
         }
 
+        if (resultType.getStatus() != null) {
+            jaxpResult.setStatus(JaxpStatus.newInstance(resultType.getStatus()));
+        }
+
+        if (resultType.getObligations() != null &&
+                resultType.getObligations().getObligation() != null &&
+                resultType.getObligations().getObligation().size() > 0) {
+            Iterator<ObligationType>	iterObligationTypes	= resultType.getObligations().getObligation().iterator();
+            while (iterObligationTypes.hasNext()) {
+                jaxpResult.addObligation(JaxpObligation.newInstance(iterObligationTypes.next()));
+            }
+        }
+
+        if (resultType.getAssociatedAdvice() != null &&
+                resultType.getAssociatedAdvice().getAdvice() != null &&
+                resultType.getAssociatedAdvice().getAdvice().size() > 0) {
+            Iterator<AdviceType>		iterAdviceTypes	= resultType.getAssociatedAdvice().getAdvice().iterator();
+            while (iterAdviceTypes.hasNext()) {
+                jaxpResult.addAdvice(JaxpAdvice.newInstance(iterAdviceTypes.next()));
+            }
+        }
+
+        if (resultType.getAttributes() != null && resultType.getAttributes().size() > 0) {
+            Iterator<AttributesType>		iterAttributesTypes	= resultType.getAttributes().iterator();
+            while (iterAttributesTypes.hasNext()) {
+                jaxpResult.addAttributeCategory(JaxpAttributeCategory.newInstance(iterAttributesTypes.next()));
+            }
+        }
+
+        if (resultType.getPolicyIdentifierList() != null &&
+                resultType.getPolicyIdentifierList().getPolicyIdReferenceOrPolicySetIdReference() != null &&
+                resultType.getPolicyIdentifierList().getPolicyIdReferenceOrPolicySetIdReference().size() > 0) {
+            Iterator<JAXBElement<IdReferenceType>>	iterJAXBElements	= resultType.getPolicyIdentifierList().getPolicyIdReferenceOrPolicySetIdReference().iterator();
+            while (iterJAXBElements.hasNext()) {
+                JAXBElement<IdReferenceType>	jaxbElement	= iterJAXBElements.next();
+                if (jaxbElement.getName().getLocalPart().equals(XACML3.ELEMENT_POLICYIDREFERENCE)) {
+                    jaxpResult.addPolicyIdentifier(JaxpIdReference.newInstance(jaxbElement.getValue()));
+                } else if (jaxbElement.getName().getLocalPart().equals(XACML3.ELEMENT_POLICYSETIDREFERENCE)) {
+                    jaxpResult.addPolicySetIdentifier(JaxpIdReference.newInstance(jaxbElement.getValue()));
+                } else {
+                    throw new IllegalArgumentException("Unexpected IdReferenceType found \"" + jaxbElement.getName().getLocalPart() + "\"");
+                }
+            }
+        }
+
+        return jaxpResult;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatus.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatus.java
index 1f67a13..7068457 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatus.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatus.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,29 +39,29 @@
 /**
  * JaxpStatus extends {@link com.att.research.StdMutableStatus.common.std.StdStatus} with methods for creation from
  * JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpStatus extends StdMutableStatus {
 
-        protected JaxpStatus(StatusCode statusCodeIn, String statusMessageIn, StatusDetail statusDetailIn) {
-                super(statusCodeIn, statusMessageIn, statusDetailIn);
+    protected JaxpStatus(StatusCode statusCodeIn, String statusMessageIn, StatusDetail statusDetailIn) {
+        super(statusCodeIn, statusMessageIn, statusDetailIn);
+    }
+
+    public static JaxpStatus newInstance(StatusType statusType) {
+        if (statusType == null) {
+            throw new NullPointerException("Null StatusType");
+        } else if (statusType.getStatusCode() == null) {
+            throw new IllegalArgumentException("Null StatusCode in StatusType");
         }
-        
-        public static JaxpStatus newInstance(StatusType statusType) {
-                if (statusType == null) {
-                        throw new NullPointerException("Null StatusType");
-                } else if (statusType.getStatusCode() == null) {
-                        throw new IllegalArgumentException("Null StatusCode in StatusType");
-                }
-                StatusCode		statusCode		= JaxpStatusCode.newInstance(statusType.getStatusCode());
-                StatusDetail	statusDetail	= null;
-                if (statusType.getStatusDetail() != null) {
-                        statusDetail	= JaxpStatusDetail.newInstance(statusType.getStatusDetail());
-                }
-                
-                return new JaxpStatus(statusCode, statusType.getStatusMessage(), statusDetail);
-                
+        StatusCode		statusCode		= JaxpStatusCode.newInstance(statusType.getStatusCode());
+        StatusDetail	statusDetail	= null;
+        if (statusType.getStatusDetail() != null) {
+            statusDetail	= JaxpStatusDetail.newInstance(statusType.getStatusDetail());
         }
+
+        return new JaxpStatus(statusCode, statusType.getStatusMessage(), statusDetail);
+
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatusCode.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatusCode.java
index 5e6f008..f77b637 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatusCode.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatusCode.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,33 +39,33 @@
 
 /**
  * JaxpStatusCode extends {@link com.att.research.xacml.std.StdStatusCode} with static methods
- * for creating a <code>StatusCode</code> object by parsing JAXP elements based on the XACML 3.0 schema. 
- * 
+ * for creating a <code>StatusCode</code> object by parsing JAXP elements based on the XACML 3.0 schema.
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpStatusCode extends StdStatusCode {
 
-        protected JaxpStatusCode(Identifier statusCodeValueIn, StatusCode childIn) {
-                super(statusCodeValueIn, childIn);
+    protected JaxpStatusCode(Identifier statusCodeValueIn, StatusCode childIn) {
+        super(statusCodeValueIn, childIn);
+    }
+
+    public static JaxpStatusCode newInstance(StatusCodeType statusCodeType) {
+        if (statusCodeType == null) {
+            throw new NullPointerException("Null StatusCodeType");
+        } else if (statusCodeType.getValue() == null) {
+            throw new IllegalArgumentException("Null StatusCodeValue");
         }
-        
-        public static JaxpStatusCode newInstance(StatusCodeType statusCodeType) {
-                if (statusCodeType == null) {
-                        throw new NullPointerException("Null StatusCodeType");
-                } else if (statusCodeType.getValue() == null) {
-                        throw new IllegalArgumentException("Null StatusCodeValue");
-                }
-                Identifier	statusCodeValue	= new IdentifierImpl(statusCodeType.getValue());
-                
-                StatusCode		statusCodeChild	= null;
-                if (statusCodeType.getStatusCode() != null) {
-                        try {
-                                statusCodeChild	= JaxpStatusCode.newInstance(statusCodeType.getStatusCode());
-                        } catch (Exception ex) {
-                                throw new IllegalArgumentException("Invalid child StatusCodeValue", ex);
-                        }
-                }
-                return new JaxpStatusCode(statusCodeValue, statusCodeChild);
+        Identifier	statusCodeValue	= new IdentifierImpl(statusCodeType.getValue());
+
+        StatusCode		statusCodeChild	= null;
+        if (statusCodeType.getStatusCode() != null) {
+            try {
+                statusCodeChild	= JaxpStatusCode.newInstance(statusCodeType.getStatusCode());
+            } catch (Exception ex) {
+                throw new IllegalArgumentException("Invalid child StatusCodeValue", ex);
+            }
         }
+        return new JaxpStatusCode(statusCodeValue, statusCodeChild);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatusDetail.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatusDetail.java
index 32377a7..721b3e7 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatusDetail.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/JaxpStatusDetail.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,33 +44,33 @@
 /**
  * JaxpStatusDetail extends {@link com.att.research.xacml.std.StdMutableStatusDetail} with methods for creation from
  * JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class JaxpStatusDetail extends StdMutableStatusDetail {
 
-        protected JaxpStatusDetail(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
-                super(missingAttributeDetailsIn);
-        }
+    protected JaxpStatusDetail(Collection<MissingAttributeDetail> missingAttributeDetailsIn) {
+        super(missingAttributeDetailsIn);
+    }
 
-        public static JaxpStatusDetail newInstance(StatusDetailType statusDetailType) {
-                if (statusDetailType == null) {
-                        throw new NullPointerException("Null StatusDetailType");
-                }
-                List<MissingAttributeDetail>	listMissingAttributeDetails	= null;
-                if (statusDetailType.getAny() != null && statusDetailType.getAny().size() > 0) {
-                        Iterator<Object>	iterObjects	= statusDetailType.getAny().iterator();
-                        while (iterObjects.hasNext()) {
-                                Object object	= iterObjects.next();
-                                if (object instanceof MissingAttributeDetailType) {
-                                        if (listMissingAttributeDetails == null) {
-                                                listMissingAttributeDetails	= new ArrayList<MissingAttributeDetail>();
-                                        }
-                                        listMissingAttributeDetails.add(JaxpMissingAttributeDetail.newInstance((MissingAttributeDetailType)object));
-                                }
-                        }
-                }
-                return new JaxpStatusDetail(listMissingAttributeDetails);
+    public static JaxpStatusDetail newInstance(StatusDetailType statusDetailType) {
+        if (statusDetailType == null) {
+            throw new NullPointerException("Null StatusDetailType");
         }
+        List<MissingAttributeDetail>	listMissingAttributeDetails	= null;
+        if (statusDetailType.getAny() != null && statusDetailType.getAny().size() > 0) {
+            Iterator<Object>	iterObjects	= statusDetailType.getAny().iterator();
+            while (iterObjects.hasNext()) {
+                Object object	= iterObjects.next();
+                if (object instanceof MissingAttributeDetailType) {
+                    if (listMissingAttributeDetails == null) {
+                        listMissingAttributeDetails	= new ArrayList<MissingAttributeDetail>();
+                    }
+                    listMissingAttributeDetails.add(JaxpMissingAttributeDetail.newInstance((MissingAttributeDetailType)object));
+                }
+            }
+        }
+        return new JaxpStatusDetail(listMissingAttributeDetails);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/package-info.java
index ffaf24e..2d22803 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/jaxp/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 
 /**
  * com.att.research.xacml.std.jaxp contains the implementation of interfaces in {@link com.att.research.xacml.api} using JAXP elements.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONRequest.java
index f868a1f..d421485 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -104,1240 +104,1240 @@
 /**
  * JSONRequest is used to convert JSON into {@link com.att.research.xacml.api.Request} objects.
  * Instances are only generated by loading a file, string, or InputStream representing the Request.
- * 
- * 
+ *
+ *
  * @author glenngriffin
  * @version $Revision: 1.3 $
  */
 public class JSONRequest {
-        private static final Log logger	= LogFactory.getLog(JSONRequest.class);
-        
-        /*
-         * Map of Data Type Identifiers used to map shorthand notation for DataTypes into the full Identifer.
-         * This is loaded the first time a Request is processed.
-         * Loading is done using Reflection.
-         * The map contains keys for both the short form and the long form of each DataType.  For example both of the following are in the table:
-         * 		http://www.w3.org/2001/XMLSchema#base64Binary = http://www.w3.org/2001/XMLSchema#base64Binary
-         * 										 base64Binary = http://www.w3.org/2001/XMLSchema#base64Binary
-         * 
-         * (Note difference in structure and usage from JSONResponse.)
-         */
-        private static Map<String, Identifier> shorthandMap = null;
-        
-        /*
-         * To check the individual data attributes for being the correct type, we need an instance of the DataTypeFactory
-         */
-        private static DataTypeFactory dataTypeFactory = null;
-        
-        /*
-         * Prevent creation of instances - this class contains only static methods that return other object types.
-         */
-        protected JSONRequest() {
+    private static final Log logger	= LogFactory.getLog(JSONRequest.class);
+
+    /*
+     * Map of Data Type Identifiers used to map shorthand notation for DataTypes into the full Identifer.
+     * This is loaded the first time a Request is processed.
+     * Loading is done using Reflection.
+     * The map contains keys for both the short form and the long form of each DataType.  For example both of the following are in the table:
+     * 		http://www.w3.org/2001/XMLSchema#base64Binary = http://www.w3.org/2001/XMLSchema#base64Binary
+     * 										 base64Binary = http://www.w3.org/2001/XMLSchema#base64Binary
+     *
+     * (Note difference in structure and usage from JSONResponse.)
+     */
+    private static Map<String, Identifier> shorthandMap = null;
+
+    /*
+     * To check the individual data attributes for being the correct type, we need an instance of the DataTypeFactory
+     */
+    private static DataTypeFactory dataTypeFactory = null;
+
+    /*
+     * Prevent creation of instances - this class contains only static methods that return other object types.
+     */
+    protected JSONRequest() {
+    }
+
+
+    //
+    // HELPER METHODS used in Parsing
+    //
+
+    /**
+     * Allow both JSON boolean and Strings containing JSON booleans.
+     * If value is null, assume it is optional and just return null.
+     * If Boolean, return same value.
+     * If String, note in log that it was string and return converted value.
+     * Otherwise throw exception.
+     *
+     * @param value
+     * @param location
+     * @return
+     * @throws JSONStructureException
+     */
+    private static Boolean makeBoolean(Object value, String location) throws JSONStructureException {
+        if (value == null || value instanceof Boolean) {
+            return (Boolean) value;
         }
-        
-        
-        //
-        // HELPER METHODS used in Parsing
-        //
-        
-        /**
-         * Allow both JSON boolean and Strings containing JSON booleans.
-         * If value is null, assume it is optional and just return null.
-         * If Boolean, return same value.
-         * If String, note in log that it was string and return converted value.
-         * Otherwise throw exception.
-         * 
-         * @param value
-         * @param location
-         * @return
-         * @throws JSONStructureException
-         */
-        private static Boolean makeBoolean(Object value, String location) throws JSONStructureException {
-                if (value == null || value instanceof Boolean) {
-                        return (Boolean) value;
+        try {
+            Boolean b = DataTypes.DT_BOOLEAN.convert(value);
+            logger.warn(location + " has string containing boolean, should be unquoted boolean value");
+            return b;
+        } catch (Exception e) {
+            throw new JSONStructureException(location + " must be Boolean");
+        }
+    }
+
+
+
+
+    /**
+     * Check the given map for all components having been removed (i.e. everything in the map was known and used).
+     * If anything remains, throw an exception based on the component and the keys left in the map
+     */
+    private static void checkUnknown(String component, Map<?,?> map) throws JSONStructureException {
+        if (map.size() == 0) {
+            return;
+        }
+
+        String keys = null;
+        Iterator<?> it = map.keySet().iterator();
+        while (it.hasNext()) {
+            if (keys == null) {
+                keys = "'" + it.next().toString() + "'";
+            } else {
+                keys += ", '" + it.next().toString() + "'";
+            }
+        }
+
+        String message = component + " contains unknown element" + ( (map.size() == 1) ? " " : "s ") + keys;
+        throw new JSONStructureException(message);
+    }
+
+
+
+
+    /**
+     * Convert a JSON representation of an XPathExpression into the internal objects.
+     * XPathExpression is the only DataType that has a complex multi-part description.
+     * It includes
+     * 	- XPathCategory - required
+     * 	- XPath - required
+     * 	- Namespaces - optional; a list of complex structures
+     *
+     * @param valueMap
+     * @return
+     * @throws JSONStructureException
+     */
+    private static AttributeValue<Object> convertXPathExpressionMapToAttributeValue(Map<?,?> valueMap) throws JSONStructureException {
+        // get required elements
+        Object xpathCategoryObject = valueMap.remove("XPathCategory");
+        Object xpathObject = valueMap.remove("XPath");
+        if ( ! (xpathCategoryObject instanceof String) || ! (xpathObject instanceof String)) {
+            throw new JSONStructureException("XpathCategory and XPath must both be strings");
+        }
+        String xpathCategoryString = (String)xpathCategoryObject;
+        String xpathString = (String)xpathObject;
+        if (xpathCategoryString == null || xpathCategoryString.length() == 0 ||
+                xpathString == null || xpathString.length() == 0) {
+            throw new JSONStructureException("XPathCategory or XPath missing or 0-length");
+        }
+
+        Identifier xpathCategoryId = new IdentifierImpl(xpathCategoryString);
+
+        // get the Namespaces, if any.
+        // Use StringNamespaceContext because we need to use the add functions to incrementally add the namespaces
+        StringNamespaceContext namespaceContext = null;
+
+        Object namespacesObject = valueMap.remove("Namespaces");
+        if (namespacesObject != null) {
+            if ( ! (namespacesObject instanceof List)) {
+                throw new JSONStructureException("Namespaces must be an array");
+            }
+            List<?> namespacesList = (List<?>)namespacesObject;
+
+            if (namespacesList.size() > 0) {
+                // create a NamespaceContext object to hold the namespaces
+                namespaceContext = new StringNamespaceContext();
+
+                for (Object n : namespacesList) {
+                    if ( ! (n instanceof Map)) {
+                        throw new JSONStructureException("Namespace within Namespaces array must be object");
+                    }
+                    Map<?,?> namespaceMap = (Map<?,?>)n;
+
+                    Object namespaceObject = namespaceMap.remove("Namespace");
+                    if (namespaceObject == null || ! (namespaceObject instanceof String)) {
+                        throw new JSONStructureException("Namespace object within Namespaces array must contain Namespace string member");
+                    }
+
+                    Object prefixObject = namespaceMap.remove("Prefix");
+                    if (prefixObject != null && ! ( prefixObject instanceof String)) {
+                        throw new JSONStructureException("Namespace object within Namespaces array Prefix must be string");
+                    }
+
+                    checkUnknown("Namespaces item", namespaceMap);
+
+                    // add this namespace to the NamespaceContext
+                    try {
+                        namespaceContext.add((String)prefixObject, (String)namespaceObject);
+                    } catch (Exception e) {
+                        throw new JSONStructureException("Unable to add namespace prefix='" + prefixObject + "' URI='" + namespaceObject + "'");
+                    }
                 }
+            }
+        }
+
+
+
+        // create the XPathExpressionWrapper to contain this value
+        XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(namespaceContext, xpathString);
+
+
+        AttributeValue<Object> attributeValue = new StdAttributeValue<Object>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, xpathCategoryId);
+
+        checkUnknown("XPathExpression", valueMap);
+
+        return attributeValue;
+    }
+
+    /**
+     * Use reflection to load the map with all the names of all DataTypes, both the long name and the shorthand,
+     * and point each name to the appropriate Identifier.
+     * The shorthand map is used differently in JSONRequest than in JSONResponse, so there are similarities and differences in the implementation.
+     * This is done once the first time a Request is processed.
+     */
+    private static void initShorthandMap() throws JSONStructureException {
+        Field[] declaredFields	= XACML3.class.getDeclaredFields();
+        shorthandMap = new HashMap<String, Identifier>();
+        for (Field field : declaredFields) {
+            if (Modifier.isStatic(field.getModifiers()) &&
+                    field.getName().startsWith("ID_DATATYPE") &&
+                    Modifier.isPublic(field.getModifiers())
+               ) {
                 try {
-                        Boolean b = DataTypes.DT_BOOLEAN.convert(value);
-                        logger.warn(location + " has string containing boolean, should be unquoted boolean value");
-                        return b;
-                } catch (Exception e) {
-                        throw new JSONStructureException(location + " must be Boolean");
-                }
-        }
-        
-        
-        
-        
-        /**
-         * Check the given map for all components having been removed (i.e. everything in the map was known and used).
-         * If anything remains, throw an exception based on the component and the keys left in the map
-         */
-        private static void checkUnknown(String component, Map<?,?> map) throws JSONStructureException {
-                if (map.size() == 0) {
-                        return;
-                }
-
-                String keys = null;
-                Iterator<?> it = map.keySet().iterator();
-                while (it.hasNext()) {
-                        if (keys == null) {
-                                keys = "'" + it.next().toString() + "'";
+                    Identifier id = (Identifier)field.get(null);
+                    String longName = id.stringValue();
+                    // most names start with 'http://www.w3.org/2001/XMLSchema#'
+                    int sharpIndex = longName.lastIndexOf("#");
+                    if (sharpIndex <= 0) {
+                        // some names start with 'urn:oasis:names:tc:xacml:1.0:data-type:'
+                        // or urn:oasis:names:tc:xacml:2.0:data-type:
+                        if (longName.contains(":data-type:")) {
+                            sharpIndex = longName.lastIndexOf(":");
                         } else {
-                                keys += ", '" + it.next().toString() + "'";
+                            continue;
                         }
+                    }
+                    String shortName = longName.substring(sharpIndex + 1);
+                    // put both the full name and the short name in the table
+                    shorthandMap.put(longName, id);
+                    shorthandMap.put(shortName, id);
+                } catch (Exception e) {
+                    throw new JSONStructureException("Error loading ID Table, e="+e);
                 }
-
-                String message = component + " contains unknown element" + ( (map.size() == 1) ? " " : "s ") + keys;
-                throw new JSONStructureException(message);
+            }
         }
-        
-        
-        
-        
-        /**
-         * Convert a JSON representation of an XPathExpression into the internal objects.
-         * XPathExpression is the only DataType that has a complex multi-part description.
-         * It includes
-         * 	- XPathCategory - required
-         * 	- XPath - required
-         * 	- Namespaces - optional; a list of complex structures
-         * 
-         * @param valueMap
-         * @return
-         * @throws JSONStructureException
-         */
-        private static AttributeValue<Object> convertXPathExpressionMapToAttributeValue(Map<?,?> valueMap) throws JSONStructureException {
-                // get required elements
-                Object xpathCategoryObject = valueMap.remove("XPathCategory");
-                Object xpathObject = valueMap.remove("XPath");
-                if ( ! (xpathCategoryObject instanceof String) || ! (xpathObject instanceof String)) {
-                        throw new JSONStructureException("XpathCategory and XPath must both be strings");
-                }
-                String xpathCategoryString = (String)xpathCategoryObject;
-                String xpathString = (String)xpathObject;
-                if (xpathCategoryString == null || xpathCategoryString.length() == 0 ||
-                                xpathString == null || xpathString.length() == 0) {
-                        throw new JSONStructureException("XPathCategory or XPath missing or 0-length");
-                }
+    }
 
-                Identifier xpathCategoryId = new IdentifierImpl(xpathCategoryString);
-                
-                // get the Namespaces, if any.
-                // Use StringNamespaceContext because we need to use the add functions to incrementally add the namespaces
-                StringNamespaceContext namespaceContext = null;
-                
-                Object namespacesObject = valueMap.remove("Namespaces");
-                if (namespacesObject != null) {
-                        if ( ! (namespacesObject instanceof List)) {
-                                throw new JSONStructureException("Namespaces must be an array");
-                        }
-                        List<?> namespacesList = (List<?>)namespacesObject;
-                        
-                        if (namespacesList.size() > 0) {
-                                // create a NamespaceContext object to hold the namespaces
-                                namespaceContext = new StringNamespaceContext();
-                            
-                                for (Object n : namespacesList) {
-                                        if ( ! (n instanceof Map)) {
-                                                throw new JSONStructureException("Namespace within Namespaces array must be object");
-                                        }
-                                        Map<?,?> namespaceMap = (Map<?,?>)n;
-                                        
-                                        Object namespaceObject = namespaceMap.remove("Namespace");
-                                        if (namespaceObject == null || ! (namespaceObject instanceof String)) {
-                                                throw new JSONStructureException("Namespace object within Namespaces array must contain Namespace string member");
-                                        }
-                                        
-                                        Object prefixObject = namespaceMap.remove("Prefix");
-                                        if (prefixObject != null && ! ( prefixObject instanceof String)) {
-                                                throw new JSONStructureException("Namespace object within Namespaces array Prefix must be string");
-                                        }
-                                        
-                                        checkUnknown("Namespaces item", namespaceMap);
-                                        
-                                        // add this namespace to the NamespaceContext
-                                        try {
-                                                namespaceContext.add((String)prefixObject, (String)namespaceObject);
-                                        } catch (Exception e) {
-                                                throw new JSONStructureException("Unable to add namespace prefix='" + prefixObject + "' URI='" + namespaceObject + "'");
-                                        }
-                                }
-                        }
-                }
-                
-                
 
-                // create the XPathExpressionWrapper to contain this value
-                XPathExpressionWrapper xpathExpressionWrapper = new XPathExpressionWrapper(namespaceContext, xpathString);
 
-                
-                AttributeValue<Object> attributeValue = new StdAttributeValue<Object>(DataTypes.DT_XPATHEXPRESSION.getId(), xpathExpressionWrapper, xpathCategoryId);
-                
-                checkUnknown("XPathExpression", valueMap);
-                
-                return attributeValue;
+    //
+    // MAIN PARSING CODE
+    //
+
+
+    /**
+     * Handle a List of Attributes for a Category
+     *
+     * @param categoryID
+     * @param attributes
+     * @param stdMutableRequest
+     * @throws JSONStructureException
+     */
+    private static List<Attribute> parseAttribute(Identifier categoryID, ArrayList<?> attributes, StdMutableRequest stdMutableRequest) throws JSONStructureException {
+        Iterator<?> iterAttributes = attributes.iterator();
+
+        List<Attribute> collectedAttributes = new ArrayList<Attribute>();
+
+        while (iterAttributes.hasNext()) {
+            Map<?,?> attributeMap = (Map<?, ?>) iterAttributes.next();
+            if (! (attributeMap instanceof Map)) {
+                throw new JSONStructureException ("Expect Attribute content to be Map got " + attributeMap.getClass());
+            }
+            Attribute attribute = parseAttribute(categoryID, attributeMap, stdMutableRequest);
+            collectedAttributes.add(attribute);
         }
-        
-        /**
-         * Use reflection to load the map with all the names of all DataTypes, both the long name and the shorthand,
-         * and point each name to the appropriate Identifier.
-         * The shorthand map is used differently in JSONRequest than in JSONResponse, so there are similarities and differences in the implementation.
-         * This is done once the first time a Request is processed.
-         */
-        private static void initShorthandMap() throws JSONStructureException {
-                Field[] declaredFields	= XACML3.class.getDeclaredFields();
-                shorthandMap = new HashMap<String, Identifier>();
-                for (Field field : declaredFields) {
-                        if (Modifier.isStatic(field.getModifiers()) && 
-                                field.getName().startsWith("ID_DATATYPE") &&
-                                Modifier.isPublic(field.getModifiers())
-                        ) {
-                                try {
-                                        Identifier id = (Identifier)field.get(null);
-                                        String longName = id.stringValue();
-                                        // most names start with 'http://www.w3.org/2001/XMLSchema#'
-                                        int sharpIndex = longName.lastIndexOf("#");
-                                        if (sharpIndex <= 0) {
-                                                // some names start with 'urn:oasis:names:tc:xacml:1.0:data-type:'
-                                                // or urn:oasis:names:tc:xacml:2.0:data-type:
-                                                if (longName.contains(":data-type:")) {
-                                                        sharpIndex = longName.lastIndexOf(":");
-                                                } else {
-                                                        continue;
-                                                }
-                                        }
-                                        String shortName = longName.substring(sharpIndex + 1);
-                                        // put both the full name and the short name in the table
-                                        shorthandMap.put(longName, id);
-                                        shorthandMap.put(shortName, id);
-                                } catch (Exception e) {
-                                        throw new JSONStructureException("Error loading ID Table, e="+e);
-                                }
-                        }
-                }
-        }
-        
-        
-        
-        //
-        // MAIN PARSING CODE
-        //
-        
-        
-        /**
-         * Handle a List of Attributes for a Category
-         * 
-         * @param categoryID
-         * @param attributes
-         * @param stdMutableRequest
-         * @throws JSONStructureException
-         */
-        private static List<Attribute> parseAttribute(Identifier categoryID, ArrayList<?> attributes, StdMutableRequest stdMutableRequest) throws JSONStructureException {
-                Iterator<?> iterAttributes = attributes.iterator();
-                                
-                List<Attribute> collectedAttributes = new ArrayList<Attribute>();
-                
-                while (iterAttributes.hasNext()) {
-                        Map<?,?> attributeMap = (Map<?, ?>) iterAttributes.next();
-                        if (! (attributeMap instanceof Map)) {
-                                throw new JSONStructureException ("Expect Attribute content to be Map got " + attributeMap.getClass());
-                        }
-                        Attribute attribute = parseAttribute(categoryID, attributeMap, stdMutableRequest);
-                        collectedAttributes.add(attribute);
-                }
-                
-                // return list of all attributes for this Category
-                return collectedAttributes;
-        }
-        
-        
-        /**
-         * Given the map of the parsed JSON representation of an Attribute, create the Attribute from the map.
-         * 
-         * @param categoryID
-         * @param attributeMap
-         * @param stdMutableRequest
-         * @return
-         * @throws JSONStructureException
-         */
-        private static Attribute parseAttribute(Identifier categoryID, Map<?,?> attributeMap, StdMutableRequest stdMutableRequest) throws JSONStructureException {
-                
+
+        // return list of all attributes for this Category
+        return collectedAttributes;
+    }
+
+
+    /**
+     * Given the map of the parsed JSON representation of an Attribute, create the Attribute from the map.
+     *
+     * @param categoryID
+     * @param attributeMap
+     * @param stdMutableRequest
+     * @return
+     * @throws JSONStructureException
+     */
+    private static Attribute parseAttribute(Identifier categoryID, Map<?,?> attributeMap, StdMutableRequest stdMutableRequest) throws JSONStructureException {
+
 //TODO - ASSUME that the spec will remove the requirement that we MUST "handle" JavaScript special values NaN, INF, -INF, none of which make sense on this interface.
-        
-//TODO - ASSUME that the spec will fix inconsistency between AttributeId and Id (both are mentioned), but we have code using both so allow both on input.
-                Object idString = attributeMap.remove("AttributeId");
-                if (idString == null) {
-                        //
-                        // This is an annoying message, and since we have PEP's that already use it
-                        // make this a debugging message. Otherwise it will clog our log file.
-                        //
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Attribute missing AttributeId, looking for Id");
-                        }
-                        idString = attributeMap.remove("Id");
-                        if (idString == null) {
-                                throw new JSONStructureException("Attribute missing AttributeId (and Id)");
-                        }
-                } else {
-                        // we have the AttributeId - should not also have Id
-                        if (attributeMap.remove("Id") != null) {
-                                throw new JSONStructureException("Found both AttributeId '" + idString + "' and Id field.  Please use only AttributeId.");
-                        }
-                }
-                if (! (idString instanceof String)) {
-                        throw new JSONStructureException ("AttributeId must be String, got " + idString.getClass());
-                }
-                Identifier id = new IdentifierImpl(idString.toString());
-                
-                Object Value = attributeMap.remove("Value");
-                if (Value == null) {
-                        throw new JSONStructureException("Attribute missing Value");
-                }
-                
-                String Issuer = (String)attributeMap.remove("Issuer");
 
-                Object includeInResultObject = attributeMap.remove("IncludeInResult");
-                Boolean includeInResult = makeBoolean(includeInResultObject, "IncludeInResult");
-                if (includeInResult == null) {
-                        includeInResult = new Boolean(false);
-                }
-                
-                //
-                // Data Type is complicated because:
-                //	- it may use shorthand (e.g. "integer" instead of full Id)
-                //	- it may be missing and have to be inferred
-                //	- inference on Arrays of values is tricky
-                //	- arrays must all use the same DataType
-                //	- we are limited in the data types that the Jackson parser is able to infer
-                //
-                Object DataType = attributeMap.remove("DataType");
-                if (DataType != null && ! (DataType instanceof String)) {
-                        throw new JSONStructureException ("DataType must be String, got " + DataType.getClass());
-                }
-                // get Identifier for either long-form or shorthand notation of DataType
-                String dataTypeString = null;
-                if (DataType != null) {
-                        dataTypeString = DataType.toString();
-                }
-                Identifier dataTypeId = shorthandMap.get(dataTypeString);
-                
-                // check for unknown DataType
-                if (DataType != null && dataTypeId == null) {
-                        // attribute contained a DataType but it was not known
-                        throw new JSONStructureException("Unknown DataType '" + dataTypeString + "'");
-                }
-                
-                // At this point the dataTypeId may be null if no explicit DataType was given.
-                // In that case we need to infer the data type from the value object.
-                // The best we can do is infer based on the JSON data type, so we recognize boolean, integer, and double, and everything else is handled as a string.
-                // Unfortunately the value may be an array of values, so we need to look at all of them before making a decision.
-                // The algorithm for arrays is:
-                //		- take the dataType of the first element in the array as the array's data type
-                //		- if the array is of type Integer and we see a Double, make the array be Double.
-                // Try to determine the over-all type for the list based on the contents.
-                // The only mixing that is allowed is Integers and Doubles, in which case the list is Double
-                
-                // Values are converted to the current DataType wherever possible.
-                // This includes converting doubles, integers and booleans into Strings if the DataType is String.
-                // Auto-conversions generate warning messages to the logger.
+//TODO - ASSUME that the spec will fix inconsistency between AttributeId and Id (both are mentioned), but we have code using both so allow both on input.
+        Object idString = attributeMap.remove("AttributeId");
+        if (idString == null) {
+            //
+            // This is an annoying message, and since we have PEP's that already use it
+            // make this a debugging message. Otherwise it will clog our log file.
+            //
+            if (logger.isDebugEnabled()) {
+                logger.debug("Attribute missing AttributeId, looking for Id");
+            }
+            idString = attributeMap.remove("Id");
+            if (idString == null) {
+                throw new JSONStructureException("Attribute missing AttributeId (and Id)");
+            }
+        } else {
+            // we have the AttributeId - should not also have Id
+            if (attributeMap.remove("Id") != null) {
+                throw new JSONStructureException("Found both AttributeId '" + idString + "' and Id field.  Please use only AttributeId.");
+            }
+        }
+        if (! (idString instanceof String)) {
+            throw new JSONStructureException ("AttributeId must be String, got " + idString.getClass());
+        }
+        Identifier id = new IdentifierImpl(idString.toString());
+
+        Object Value = attributeMap.remove("Value");
+        if (Value == null) {
+            throw new JSONStructureException("Attribute missing Value");
+        }
+
+        String Issuer = (String)attributeMap.remove("Issuer");
+
+        Object includeInResultObject = attributeMap.remove("IncludeInResult");
+        Boolean includeInResult = makeBoolean(includeInResultObject, "IncludeInResult");
+        if (includeInResult == null) {
+            includeInResult = new Boolean(false);
+        }
+
+        //
+        // Data Type is complicated because:
+        //	- it may use shorthand (e.g. "integer" instead of full Id)
+        //	- it may be missing and have to be inferred
+        //	- inference on Arrays of values is tricky
+        //	- arrays must all use the same DataType
+        //	- we are limited in the data types that the Jackson parser is able to infer
+        //
+        Object DataType = attributeMap.remove("DataType");
+        if (DataType != null && ! (DataType instanceof String)) {
+            throw new JSONStructureException ("DataType must be String, got " + DataType.getClass());
+        }
+        // get Identifier for either long-form or shorthand notation of DataType
+        String dataTypeString = null;
+        if (DataType != null) {
+            dataTypeString = DataType.toString();
+        }
+        Identifier dataTypeId = shorthandMap.get(dataTypeString);
+
+        // check for unknown DataType
+        if (DataType != null && dataTypeId == null) {
+            // attribute contained a DataType but it was not known
+            throw new JSONStructureException("Unknown DataType '" + dataTypeString + "'");
+        }
+
+        // At this point the dataTypeId may be null if no explicit DataType was given.
+        // In that case we need to infer the data type from the value object.
+        // The best we can do is infer based on the JSON data type, so we recognize boolean, integer, and double, and everything else is handled as a string.
+        // Unfortunately the value may be an array of values, so we need to look at all of them before making a decision.
+        // The algorithm for arrays is:
+        //		- take the dataType of the first element in the array as the array's data type
+        //		- if the array is of type Integer and we see a Double, make the array be Double.
+        // Try to determine the over-all type for the list based on the contents.
+        // The only mixing that is allowed is Integers and Doubles, in which case the list is Double
+
+        // Values are converted to the current DataType wherever possible.
+        // This includes converting doubles, integers and booleans into Strings if the DataType is String.
+        // Auto-conversions generate warning messages to the logger.
 
 //TODO - ASSUME that we need to infer data type for array if not given.  Spec is inconsistent on this point, but author seems to want to do it.
-//TODO - Also ASSUME that 
+//TODO - Also ASSUME that
 //			- everything other than JSON integer, double and boolean is handled as a string, and
 //			- the only mixture of data types allowed within the same array is integer and double, yielding the DataType for the array = Double, and
 //			- an array of the same JSON data type has the same data type;  for strings this means type=string irrespective of what the strings represent (e.g. Date, URI, etc).
-                
-                if (Value instanceof List) {
-                        List<?> valueList = (List<?>)Value;
-                        // if nothing in the list then we don't care about the type
-                        if (valueList.size() > 0) {
-                                Identifier inferredDataTypeId = null;
-                                if (dataTypeId == null) {
-                                        // DataType was not given in Attribute - must infer it
-                                        for (Object item : (List<?>)Value) {
-                                                // figure out what data type to use for this array
-                                                if (inferredDataTypeId == null) {
-                                                        // first item, need to set provisional inferred data type
-                                                        if (item instanceof Boolean) {
-                                                                inferredDataTypeId = DataTypes.DT_BOOLEAN.getId();
-                                                        } else if (item instanceof Integer) {
-                                                                inferredDataTypeId = DataTypes.DT_INTEGER.getId();
-                                                        } else if (item instanceof Double) {
-                                                                inferredDataTypeId = DataTypes.DT_DOUBLE.getId();
-                                                        } else {
-                                                                inferredDataTypeId = DataTypes.DT_STRING.getId();
-                                                        }
 
-                                                } else {
-                                                                if (inferredDataTypeId.equals(DataTypes.DT_INTEGER.getId())) {
+        if (Value instanceof List) {
+            List<?> valueList = (List<?>)Value;
+            // if nothing in the list then we don't care about the type
+            if (valueList.size() > 0) {
+                Identifier inferredDataTypeId = null;
+                if (dataTypeId == null) {
+                    // DataType was not given in Attribute - must infer it
+                    for (Object item : (List<?>)Value) {
+                        // figure out what data type to use for this array
+                        if (inferredDataTypeId == null) {
+                            // first item, need to set provisional inferred data type
+                            if (item instanceof Boolean) {
+                                inferredDataTypeId = DataTypes.DT_BOOLEAN.getId();
+                            } else if (item instanceof Integer) {
+                                inferredDataTypeId = DataTypes.DT_INTEGER.getId();
+                            } else if (item instanceof Double) {
+                                inferredDataTypeId = DataTypes.DT_DOUBLE.getId();
+                            } else {
+                                inferredDataTypeId = DataTypes.DT_STRING.getId();
+                            }
 
-                                                                // special case - Double seen in Integer list means whole list is really Double
-                                                                if (item instanceof Double) {
-                                                                        inferredDataTypeId = DataTypes.DT_DOUBLE.getId();
-                                                                }
-                                                        }
-                                                }
-                                        }
-                                        // we have inferred a data type for the whole array
-                                        dataTypeId = inferredDataTypeId;
-
-                                }
-                        }
-                } else  {
-                        // single-value attribute
-                        if (dataTypeId == null) {
-                                // single value with no DataType defined - Infer the XACML DataType for JSON data types
-                                if (Value instanceof Integer) {
-                                        dataTypeId = DataTypes.DT_INTEGER.getId();
-                                } else if (Value instanceof Double) {
-                                        dataTypeId = DataTypes.DT_DOUBLE.getId();
-                                } else if (Value instanceof Boolean) {
-                                        dataTypeId = DataTypes.DT_BOOLEAN.getId();
-                                } else {
-                                        // the Default DataType if none is given is String
-                                        dataTypeId = DataTypes.DT_STRING.getId();
-                                }
-                        }
-                        // all other data types are not explicitly checked for compatibility
-                }
-                
-                // we now have the DataType to convert the values into.
-
-                // create a single Attribute to return (it may contain multiple AttributeValues)
-                Attribute attribute = null;
-
-
-                
-                DataType<?> dataType = dataTypeFactory.getDataType(dataTypeId);
-
-                // Variable to use for reporting errors
-                Object incomingValue = null;
-                try {
-                        if (Value instanceof List) {
-                                // this attribute has a list of values
-                                List<AttributeValue<?>> attributeValueList = new ArrayList<AttributeValue<?>>();
-                                for (Object o : (List<?>)Value) {
-                                        // for error reporting we make a copy visible to the Catch clause
-                                        incomingValue = o;
-                                        AttributeValue<Object> attributeValue;
-                                        if (dataType.getId().equals(DataTypes.DT_XPATHEXPRESSION.getId())) {
-                                                if ( ! (o instanceof Map)) {
-                                                        throw new JSONStructureException("XPathExpression must contain object, not simple value");
-                                                }
-                                                attributeValue = convertXPathExpressionMapToAttributeValue((Map<?,?>)o);
-                                        } else {
-                                                Object convertedValue = dataType.convert(o);
-                                                attributeValue = new StdAttributeValue<Object>(dataTypeId, convertedValue);
-                                                if ( ( (convertedValue instanceof Integer ||
-                                                                convertedValue instanceof Boolean ||
-                                                                convertedValue instanceof Double) &&
-                                                                o instanceof String ) ||
-                                                        ( convertedValue instanceof Double && o instanceof Integer)  ||
-                                                        (convertedValue instanceof String && 
-                                                                        ( o instanceof Integer || o instanceof Boolean || o instanceof Double))) {
-                                                        // we converted a String to something else
-                                                        logger.warn("Attribute Id '" + id.stringValue() + "' Value '" + incomingValue + "' in Array auto-converted from '" +
-                                                                        o.getClass().getName() + "' to type '" + dataType.getId().stringValue());
-                                                }
-                                        }
-                                        attributeValueList.add(attributeValue);
-                                }
-                                attribute = new StdAttribute(categoryID, id, attributeValueList, Issuer, includeInResult);
                         } else {
-                                // for error reporting we make a copy visible to the Catch clause
-                                incomingValue = Value;
-                                // this attribute has a single value
-                                AttributeValue<Object> attributeValue;
-                                if (dataType.getId().equals(DataTypes.DT_XPATHEXPRESSION.getId())) {
-                                        if ( ! (Value instanceof Map)) {
-                                                throw new JSONStructureException("XPathExpression must contain object, not simple value");
-                                        }
-                                        attributeValue = convertXPathExpressionMapToAttributeValue((Map<?,?>)Value);
-                                } else {
-                                        Object convertedValue = dataType.convert(Value);
-                                        attributeValue = new StdAttributeValue<Object>(dataTypeId, convertedValue);
-                                        // some auto-conversions should be logged because they shouldn't be necessary
-                                        if ( ( (convertedValue instanceof BigInteger ||
-                                                        convertedValue instanceof Boolean ||
-                                                        convertedValue instanceof Double) &&
-                                                        Value instanceof String) ||
-                                                        ( convertedValue instanceof Double && Value instanceof Integer)  ||
-                                                        (convertedValue instanceof String && 
-                                                                        ( Value instanceof Integer || Value instanceof Boolean || Value instanceof Double))) {
-                                                // we converted a String to something else
-                                                logger.warn("Attribute Id '" + id.stringValue() + "' Value '" + incomingValue + "' auto-converted from '" +
-                                                                Value.getClass().getName() + "' to type '" + dataType.getId().stringValue());
-                                        }
+                            if (inferredDataTypeId.equals(DataTypes.DT_INTEGER.getId())) {
+
+                                // special case - Double seen in Integer list means whole list is really Double
+                                if (item instanceof Double) {
+                                    inferredDataTypeId = DataTypes.DT_DOUBLE.getId();
                                 }
-                                attribute = new StdAttribute(categoryID, id, attributeValue, Issuer, includeInResult);
+                            }
                         }
-                } catch (Exception e) {
-                        throw new JSONStructureException("In Id='" + id.stringValue() + "' Unable to convert Attribute Value '" + incomingValue + "' to type '" + dataTypeId.stringValue()+"'");
+                    }
+                    // we have inferred a data type for the whole array
+                    dataTypeId = inferredDataTypeId;
+
                 }
-                
-                checkUnknown( id.stringValue() + "Attribute '" + idString.toString() + "'", attributeMap);
-                
-                return attribute;
+            }
+        } else  {
+            // single-value attribute
+            if (dataTypeId == null) {
+                // single value with no DataType defined - Infer the XACML DataType for JSON data types
+                if (Value instanceof Integer) {
+                    dataTypeId = DataTypes.DT_INTEGER.getId();
+                } else if (Value instanceof Double) {
+                    dataTypeId = DataTypes.DT_DOUBLE.getId();
+                } else if (Value instanceof Boolean) {
+                    dataTypeId = DataTypes.DT_BOOLEAN.getId();
+                } else {
+                    // the Default DataType if none is given is String
+                    dataTypeId = DataTypes.DT_STRING.getId();
+                }
+            }
+            // all other data types are not explicitly checked for compatibility
         }
-        
-        
-        /**
-         * Convert the contents of a Content element from XML into XML Node
-         * 
-         * @param xmlContent
-         * @return Node
-         * @throws Exception
-         */
-        public static Node parseXML(String xmlContent) throws JSONStructureException {
-        
+
+        // we now have the DataType to convert the values into.
+
+        // create a single Attribute to return (it may contain multiple AttributeValues)
+        Attribute attribute = null;
+
+
+
+        DataType<?> dataType = dataTypeFactory.getDataType(dataTypeId);
+
+        // Variable to use for reporting errors
+        Object incomingValue = null;
+        try {
+            if (Value instanceof List) {
+                // this attribute has a list of values
+                List<AttributeValue<?>> attributeValueList = new ArrayList<AttributeValue<?>>();
+                for (Object o : (List<?>)Value) {
+                    // for error reporting we make a copy visible to the Catch clause
+                    incomingValue = o;
+                    AttributeValue<Object> attributeValue;
+                    if (dataType.getId().equals(DataTypes.DT_XPATHEXPRESSION.getId())) {
+                        if ( ! (o instanceof Map)) {
+                            throw new JSONStructureException("XPathExpression must contain object, not simple value");
+                        }
+                        attributeValue = convertXPathExpressionMapToAttributeValue((Map<?,?>)o);
+                    } else {
+                        Object convertedValue = dataType.convert(o);
+                        attributeValue = new StdAttributeValue<Object>(dataTypeId, convertedValue);
+                        if ( ( (convertedValue instanceof Integer ||
+                                convertedValue instanceof Boolean ||
+                                convertedValue instanceof Double) &&
+                                o instanceof String ) ||
+                                ( convertedValue instanceof Double && o instanceof Integer)  ||
+                                (convertedValue instanceof String &&
+                                 ( o instanceof Integer || o instanceof Boolean || o instanceof Double))) {
+                            // we converted a String to something else
+                            logger.warn("Attribute Id '" + id.stringValue() + "' Value '" + incomingValue + "' in Array auto-converted from '" +
+                                        o.getClass().getName() + "' to type '" + dataType.getId().stringValue());
+                        }
+                    }
+                    attributeValueList.add(attributeValue);
+                }
+                attribute = new StdAttribute(categoryID, id, attributeValueList, Issuer, includeInResult);
+            } else {
+                // for error reporting we make a copy visible to the Catch clause
+                incomingValue = Value;
+                // this attribute has a single value
+                AttributeValue<Object> attributeValue;
+                if (dataType.getId().equals(DataTypes.DT_XPATHEXPRESSION.getId())) {
+                    if ( ! (Value instanceof Map)) {
+                        throw new JSONStructureException("XPathExpression must contain object, not simple value");
+                    }
+                    attributeValue = convertXPathExpressionMapToAttributeValue((Map<?,?>)Value);
+                } else {
+                    Object convertedValue = dataType.convert(Value);
+                    attributeValue = new StdAttributeValue<Object>(dataTypeId, convertedValue);
+                    // some auto-conversions should be logged because they shouldn't be necessary
+                    if ( ( (convertedValue instanceof BigInteger ||
+                            convertedValue instanceof Boolean ||
+                            convertedValue instanceof Double) &&
+                            Value instanceof String) ||
+                            ( convertedValue instanceof Double && Value instanceof Integer)  ||
+                            (convertedValue instanceof String &&
+                             ( Value instanceof Integer || Value instanceof Boolean || Value instanceof Double))) {
+                        // we converted a String to something else
+                        logger.warn("Attribute Id '" + id.stringValue() + "' Value '" + incomingValue + "' auto-converted from '" +
+                                    Value.getClass().getName() + "' to type '" + dataType.getId().stringValue());
+                    }
+                }
+                attribute = new StdAttribute(categoryID, id, attributeValue, Issuer, includeInResult);
+            }
+        } catch (Exception e) {
+            throw new JSONStructureException("In Id='" + id.stringValue() + "' Unable to convert Attribute Value '" + incomingValue + "' to type '" + dataTypeId.stringValue()+"'");
+        }
+
+        checkUnknown( id.stringValue() + "Attribute '" + idString.toString() + "'", attributeMap);
+
+        return attribute;
+    }
+
+
+    /**
+     * Convert the contents of a Content element from XML into XML Node
+     *
+     * @param xmlContent
+     * @return Node
+     * @throws Exception
+     */
+    public static Node parseXML(String xmlContent) throws JSONStructureException {
+
         if (xmlContent == null || xmlContent.length() == 0) {
-                return null;
+            return null;
         }
-        
+
         //
         // Create XML document factory and builder
         //
-                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-            dbf.setNamespaceAware(true);
-                DocumentBuilder db;
-                try {
-                        db = dbf.newDocumentBuilder();
-                } catch (ParserConfigurationException e1) {
-                        throw new JSONStructureException("Content unable to setup Parser Configuration");
-                }
-                //
-                // Parse the content
-                //
-                Document doc = null;
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        dbf.setNamespaceAware(true);
+        DocumentBuilder db;
+        try {
+            db = dbf.newDocumentBuilder();
+        } catch (ParserConfigurationException e1) {
+            throw new JSONStructureException("Content unable to setup Parser Configuration");
+        }
+        //
+        // Parse the content
+        //
+        Document doc = null;
 
         //
         // First of all, the String is possible escaped.
-                //
-                // The meaning of "escaped" is defined in section 4.2.3.1 in the JSON spec
         //
-                String unescapedContent = xmlContent.replace("\\\"", "\"");
-                unescapedContent = unescapedContent.replace("\\\\", "\\");
+        // The meaning of "escaped" is defined in section 4.2.3.1 in the JSON spec
+        //
+        String unescapedContent = xmlContent.replace("\\\"", "\"");
+        unescapedContent = unescapedContent.replace("\\\\", "\\");
 
 //    	logger.info("Escaped content: \n" + unescapedContent);
-                
+
         try (InputStream is = new ByteArrayInputStream(unescapedContent.getBytes("UTF-8"))) {
-                doc = db.parse(is);
+            doc = db.parse(is);
         } catch (Exception ex) {
-                throw new JSONStructureException("Unable to parse Content '" + xmlContent + "'");
+            throw new JSONStructureException("Unable to parse Content '" + xmlContent + "'");
         }
 
-                Node node = doc.getDocumentElement();
-                
-                return node;
+        Node node = doc.getDocumentElement();
+
+        return node;
+    }
+
+
+
+    /**
+     * Helper to parse all components of one Category or default Category
+     *
+     * @param categoryMap
+     * @param request
+     */
+    private static void parseCategory(Map<?,?> categoryMap, String categoryName, Identifier defaultCategoryId, StdMutableRequest stdMutableRequest) throws JSONStructureException {
+
+        Identifier categoryId = defaultCategoryId;
+        Object categoryIDString = ((Map<?,?>) categoryMap).remove("CategoryId");
+        if (categoryIDString == null && defaultCategoryId == null) {
+            throw new JSONStructureException("Category is missing CategoryId");
         }
-        
-        
-        
-        /**
-         * Helper to parse all components of one Category or default Category
-         * 
-         * @param categoryMap
-         * @param request
-         */
-        private static void parseCategory(Map<?,?> categoryMap, String categoryName, Identifier defaultCategoryId, StdMutableRequest stdMutableRequest) throws JSONStructureException {
-                
-                Identifier categoryId = defaultCategoryId;
-                Object categoryIDString = ((Map<?,?>) categoryMap).remove("CategoryId");
-                if (categoryIDString == null && defaultCategoryId == null) {
-                        throw new JSONStructureException("Category is missing CategoryId");
-                }
-                if (categoryIDString != null) {
-                        if ( ! (categoryIDString instanceof String)) {
-                                throw new JSONStructureException ("Expect '" + categoryName + "' CategoryId to be String got " + categoryIDString.getClass());
-                        } else {				
+        if (categoryIDString != null) {
+            if ( ! (categoryIDString instanceof String)) {
+                throw new JSONStructureException ("Expect '" + categoryName + "' CategoryId to be String got " + categoryIDString.getClass());
+            } else {
 //TODO Spec says CategoryId may be shorthand, but none have been specified
-                                categoryId = new IdentifierImpl(categoryIDString.toString());
-                        }
-                }
-                // if we know the category, make sure user gave correct Id
-                if (defaultCategoryId != null && ! defaultCategoryId.equals(categoryId)) {
-                        throw new JSONStructureException(categoryName+" given CategoryId '" + categoryId + "' which does not match default id '" + defaultCategoryId + "'");
-                }
-                
-                // get the Id, a.k.a xmlId
-                String xmlId = (String)((Map<?,?>)categoryMap).remove("Id");
-                
-                
-                // get the Attributes for this Category, if any
-                List<Attribute> attributeList = new ArrayList<Attribute>();
-                Object attributesMap = ((Map<?,?>) categoryMap).remove("Attribute");
-                if (attributesMap != null) {
-                        if (attributesMap instanceof ArrayList) {
-                                attributeList = parseAttribute(categoryId, (ArrayList<?>) attributesMap, stdMutableRequest);
-                        } else if (attributesMap instanceof Map) {
-                                // underlying code expects only collections of Attributes, so create a collection of one to pass this single value
-                                ArrayList<Map<?,?>> listForOne = new ArrayList<Map<?,?>>();
-                                listForOne.add((Map<?,?>)attributesMap);
-                                attributeList = parseAttribute(categoryId, listForOne, stdMutableRequest);
-                        } else {
-                                throw new JSONStructureException ("Category '" + categoryName + "' saw unexpected Attribute class " + attributesMap.getClass());
-                        }
-                }
-                
-                // Get the Content node for this Category, if any
-                Node contentRootNode = null;
-                Object content = categoryMap.remove("Content");
-                if (content != null) {
-                        if (content instanceof String) {
-                                //
-                                // Is it Base64 Encoded?
-                                //
-                                if (Base64.isBase64(((String) content).getBytes())) {
-                                        //
-                                        // Attempt to decode it
-                                        //
-                                        byte[] realContent = Base64.decodeBase64((String) content);
-                                        //
-                                        // Now what is it? JSON or XML? Should be XML.
-                                        //
-                                        try {
-                                                contentRootNode = parseXML(new String(realContent, "UTF-8"));
-                                        } catch (UnsupportedEncodingException e) {
-                                                throw new JSONStructureException("Category '" + categoryName + "' Unsupported encoding in Content");
-                                        }
-                                } else {
-                                        //
-                                        // No, so what is it? Should be XML escaped
-                                        //
-                                        contentRootNode = parseXML((String) content);
-                                }
-                        } else if (content instanceof byte[]) {
-                                //
-                                // Should be Base64
-                                //
-                                if (Base64.isBase64(((String) content).getBytes())) {
-                                        //
-                                        // Attempt to decode it
-                                        //
-                                        byte[] realContent = Base64.decodeBase64((String) content);
-                                        //
-                                        // Now what is it? JSON or XML? Should be XML.
-                                        //
-                                        try {
-                                                contentRootNode = parseXML(new String(realContent, "UTF-8"));
-                                        } catch (UnsupportedEncodingException e) {
-                                                throw new JSONStructureException("Category '" + categoryName + "' Unsupported encoding in Content");
-                                        }
-                                } else {
-                                        throw new JSONStructureException("Category '" + categoryName + "' Content expected Base64 value");
-                                }
-                        } else {
-                                throw new JSONStructureException("Category '" + categoryName + "' Unable to determine what Content is " + content.getClass());
-                        }
-                }
-                
-                checkUnknown(categoryName, categoryMap);
-                
-                StdMutableRequestAttributes attributeCategory = new StdMutableRequestAttributes(categoryId, attributeList, contentRootNode, xmlId);
+                categoryId = new IdentifierImpl(categoryIDString.toString());
+            }
+        }
+        // if we know the category, make sure user gave correct Id
+        if (defaultCategoryId != null && ! defaultCategoryId.equals(categoryId)) {
+            throw new JSONStructureException(categoryName+" given CategoryId '" + categoryId + "' which does not match default id '" + defaultCategoryId + "'");
+        }
 
-                stdMutableRequest.add(attributeCategory);
-                
-        }
-        
+        // get the Id, a.k.a xmlId
+        String xmlId = (String)((Map<?,?>)categoryMap).remove("Id");
 
-        
-        /**
-         * Load the "Default Category" objects, if any.  This is used for the special cases of AccessSubject, Action, Resource, and Environment
-         * 
-         * @param jsonRequestMap
-         * @param categoryName
-         * @param categoryIdString
-         * @param stdMutableRequest
-         * @throws JSONStructureException
-         */
-        private static void parseDefaultCategory(Map<?,?> jsonRequestMap, String categoryName, String categoryIdString, StdMutableRequest stdMutableRequest) throws JSONStructureException {
-                Object categoryMap = jsonRequestMap.remove(categoryName);
-                if (categoryMap != null) {
-                        Identifier defaultIdentifier = new IdentifierImpl(categoryIdString);
-                        // The contents may be either a single item (whose attributes are in a Map)
-                        // or a list of items
-                        if (categoryMap instanceof Map) {
-                                // default category contains a single object
-                                parseCategory((Map<?,?>) categoryMap, categoryName, defaultIdentifier, stdMutableRequest);
-                        } else if (categoryMap instanceof List) {
-                                // Array (for Multiple Decision) of this default category - create separate element for each item in list using same CategoryId for all
-                                List<?> categoryList = (List<?>)categoryMap;
-                                for (Object subCategory : categoryList) {
-                                        if ( ! (subCategory instanceof Map)) {
-                                                throw new JSONStructureException(categoryName + " array can only contain objects within curly braces");
-                                        }
-                                        parseCategory((Map<?,?>) subCategory, categoryName, defaultIdentifier, stdMutableRequest);
-                                }
-                        } else {
-                                // do not understand this
-                                throw new JSONStructureException(categoryName + " must have one object contained within curly braces ({}) or an array of objects ([{}{}])");
-                        }
-                }
-                
+
+        // get the Attributes for this Category, if any
+        List<Attribute> attributeList = new ArrayList<Attribute>();
+        Object attributesMap = ((Map<?,?>) categoryMap).remove("Attribute");
+        if (attributesMap != null) {
+            if (attributesMap instanceof ArrayList) {
+                attributeList = parseAttribute(categoryId, (ArrayList<?>) attributesMap, stdMutableRequest);
+            } else if (attributesMap instanceof Map) {
+                // underlying code expects only collections of Attributes, so create a collection of one to pass this single value
+                ArrayList<Map<?,?>> listForOne = new ArrayList<Map<?,?>>();
+                listForOne.add((Map<?,?>)attributesMap);
+                attributeList = parseAttribute(categoryId, listForOne, stdMutableRequest);
+            } else {
+                throw new JSONStructureException ("Category '" + categoryName + "' saw unexpected Attribute class " + attributesMap.getClass());
+            }
         }
-        
-        
-        
-        
-        
-        //
-        // Primary interface methods
-        //
-        
-        
-        /**
-         * Parse and JSON string into a {@link com.att.research.xacml.api.Request} object.
-         * 
-         * @param jsonString
-         * @return
-         * @throws JSONStructureException
-         */
-        public static Request load(String jsonString) throws JSONStructureException {
-                Request request = null;
-                InputStream is = null;
-                try {
-                        is = new ByteArrayInputStream(jsonString.getBytes("UTF-8"));
-                        request = JSONRequest.load(is);
-                } catch (Exception ex) {
-                        throw new JSONStructureException("Exception loading String Request: " + ex.getMessage(), ex);
-                } finally {
-                        try {
-                                if (is != null) {
-                                        is.close();
-                                }
-                        } catch(Exception idontcare) {				
-                        }
+
+        // Get the Content node for this Category, if any
+        Node contentRootNode = null;
+        Object content = categoryMap.remove("Content");
+        if (content != null) {
+            if (content instanceof String) {
+                //
+                // Is it Base64 Encoded?
+                //
+                if (Base64.isBase64(((String) content).getBytes())) {
+                    //
+                    // Attempt to decode it
+                    //
+                    byte[] realContent = Base64.decodeBase64((String) content);
+                    //
+                    // Now what is it? JSON or XML? Should be XML.
+                    //
+                    try {
+                        contentRootNode = parseXML(new String(realContent, "UTF-8"));
+                    } catch (UnsupportedEncodingException e) {
+                        throw new JSONStructureException("Category '" + categoryName + "' Unsupported encoding in Content");
+                    }
+                } else {
+                    //
+                    // No, so what is it? Should be XML escaped
+                    //
+                    contentRootNode = parseXML((String) content);
                 }
-                return request;
-        }
-        
-        
-        /**
-         * Read a file containing the JSON description of a XACML Request and parse it into a {@link com.att.research.xacml.api.Request} Object.
-         * 
-         * This is only used for testing.  
-         * In normal operation a Request arrives through the RESTful interface and is processed using <code>load(String jsonString)</code>.
-         * 
-         * @param fileRequest
-         * @return
-         * @throws JSONStructureException
-         */
-        public static Request load(File fileRequest) throws JSONStructureException {
-                Request request = null;
-                try (FileInputStream fis = new FileInputStream(fileRequest)) {
-                        request = JSONRequest.load(fis);
-                } catch (Exception ex) {
-                        throw new JSONStructureException("Exception loading File Request: " + ex.getMessage(), ex);
+            } else if (content instanceof byte[]) {
+                //
+                // Should be Base64
+                //
+                if (Base64.isBase64(((String) content).getBytes())) {
+                    //
+                    // Attempt to decode it
+                    //
+                    byte[] realContent = Base64.decodeBase64((String) content);
+                    //
+                    // Now what is it? JSON or XML? Should be XML.
+                    //
+                    try {
+                        contentRootNode = parseXML(new String(realContent, "UTF-8"));
+                    } catch (UnsupportedEncodingException e) {
+                        throw new JSONStructureException("Category '" + categoryName + "' Unsupported encoding in Content");
+                    }
+                } else {
+                    throw new JSONStructureException("Category '" + categoryName + "' Content expected Base64 value");
                 }
-                return request;
+            } else {
+                throw new JSONStructureException("Category '" + categoryName + "' Unable to determine what Content is " + content.getClass());
+            }
         }
-        
-        
-        /**
-         * Read characters from the given <code>InputStream</code> and parse them into an XACML {@link com.att.research.xacml.api.Request} object.
-         * 
-         * @param is
-         * @return
-         * @throws JSONStructureException
-         */
-        public static Request load(InputStream is) throws JSONStructureException {
-                
+
+        checkUnknown(categoryName, categoryMap);
+
+        StdMutableRequestAttributes attributeCategory = new StdMutableRequestAttributes(categoryId, attributeList, contentRootNode, xmlId);
+
+        stdMutableRequest.add(attributeCategory);
+
+    }
+
+
+
+    /**
+     * Load the "Default Category" objects, if any.  This is used for the special cases of AccessSubject, Action, Resource, and Environment
+     *
+     * @param jsonRequestMap
+     * @param categoryName
+     * @param categoryIdString
+     * @param stdMutableRequest
+     * @throws JSONStructureException
+     */
+    private static void parseDefaultCategory(Map<?,?> jsonRequestMap, String categoryName, String categoryIdString, StdMutableRequest stdMutableRequest) throws JSONStructureException {
+        Object categoryMap = jsonRequestMap.remove(categoryName);
+        if (categoryMap != null) {
+            Identifier defaultIdentifier = new IdentifierImpl(categoryIdString);
+            // The contents may be either a single item (whose attributes are in a Map)
+            // or a list of items
+            if (categoryMap instanceof Map) {
+                // default category contains a single object
+                parseCategory((Map<?,?>) categoryMap, categoryName, defaultIdentifier, stdMutableRequest);
+            } else if (categoryMap instanceof List) {
+                // Array (for Multiple Decision) of this default category - create separate element for each item in list using same CategoryId for all
+                List<?> categoryList = (List<?>)categoryMap;
+                for (Object subCategory : categoryList) {
+                    if ( ! (subCategory instanceof Map)) {
+                        throw new JSONStructureException(categoryName + " array can only contain objects within curly braces");
+                    }
+                    parseCategory((Map<?,?>) subCategory, categoryName, defaultIdentifier, stdMutableRequest);
+                }
+            } else {
+                // do not understand this
+                throw new JSONStructureException(categoryName + " must have one object contained within curly braces ({}) or an array of objects ([{}{}])");
+            }
+        }
+
+    }
+
+
+
+
+
+    //
+    // Primary interface methods
+    //
+
+
+    /**
+     * Parse and JSON string into a {@link com.att.research.xacml.api.Request} object.
+     *
+     * @param jsonString
+     * @return
+     * @throws JSONStructureException
+     */
+    public static Request load(String jsonString) throws JSONStructureException {
+        Request request = null;
+        InputStream is = null;
+        try {
+            is = new ByteArrayInputStream(jsonString.getBytes("UTF-8"));
+            request = JSONRequest.load(is);
+        } catch (Exception ex) {
+            throw new JSONStructureException("Exception loading String Request: " + ex.getMessage(), ex);
+        } finally {
+            try {
+                if (is != null) {
+                    is.close();
+                }
+            } catch(Exception idontcare) {
+            }
+        }
+        return request;
+    }
+
+
+    /**
+     * Read a file containing the JSON description of a XACML Request and parse it into a {@link com.att.research.xacml.api.Request} Object.
+     *
+     * This is only used for testing.
+     * In normal operation a Request arrives through the RESTful interface and is processed using <code>load(String jsonString)</code>.
+     *
+     * @param fileRequest
+     * @return
+     * @throws JSONStructureException
+     */
+    public static Request load(File fileRequest) throws JSONStructureException {
+        Request request = null;
+        try (FileInputStream fis = new FileInputStream(fileRequest)) {
+            request = JSONRequest.load(fis);
+        } catch (Exception ex) {
+            throw new JSONStructureException("Exception loading File Request: " + ex.getMessage(), ex);
+        }
+        return request;
+    }
+
+
+    /**
+     * Read characters from the given <code>InputStream</code> and parse them into an XACML {@link com.att.research.xacml.api.Request} object.
+     *
+     * @param is
+     * @return
+     * @throws JSONStructureException
+     */
+    public static Request load(InputStream is) throws JSONStructureException {
+
 //TODO - ASSUME that order of members within an object does not matter (Different from XML, in JSON everything is handled as Maps so order does not matter)
-                
-                // ensure shorthand map is set up
-                if (shorthandMap == null) {
-                        initShorthandMap();
-                }
-                
-                // ensure that we have an instance of the DataTypeFactory for generating AttributeValues by DataType
+
+        // ensure shorthand map is set up
+        if (shorthandMap == null) {
+            initShorthandMap();
+        }
+
+        // ensure that we have an instance of the DataTypeFactory for generating AttributeValues by DataType
+        if (dataTypeFactory == null) {
+            try {
+                dataTypeFactory = DataTypeFactory.newInstance();
                 if (dataTypeFactory == null) {
-                        try {
-                                dataTypeFactory = DataTypeFactory.newInstance();
-                                if (dataTypeFactory == null) {
-                                        throw new NullPointerException("No DataTypeFactory found");
-                                }
-                        } catch (FactoryException e) {
-                                throw new JSONStructureException("Unable to find DataTypeFactory, e="+e);
-                        }
+                    throw new NullPointerException("No DataTypeFactory found");
                 }
-                
-                // create a new Request object to be filled in
-                StdMutableRequest stdMutableRequest = null;
-                
-                String json =  null;
-                ObjectMapper mapper = null;
-                try {
-                        
-                        // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file)
-                    java.util.Scanner scanner = new java.util.Scanner(is);
-                    scanner.useDelimiter("\\A");
-                    json =  scanner.hasNext() ? scanner.next() : "";
-                    scanner.close();
-                    
-                        mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
-                        
+            } catch (FactoryException e) {
+                throw new JSONStructureException("Unable to find DataTypeFactory, e="+e);
+            }
+        }
+
+        // create a new Request object to be filled in
+        StdMutableRequest stdMutableRequest = null;
+
+        String json =  null;
+        ObjectMapper mapper = null;
+        try {
+
+            // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file)
+            java.util.Scanner scanner = new java.util.Scanner(is);
+            scanner.useDelimiter("\\A");
+            json =  scanner.hasNext() ? scanner.next() : "";
+            scanner.close();
+
+            mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
+
 //TODO -  ASSUME that any duplicated component is a bad thing (probably indicating an error in the incoming JSON)
-                        mapper.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
-                        
-                        Map<?,?> root = mapper.readValue(json, Map.class);
+            mapper.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
 
-                        //
-                        // Does the request exist?
-                        //
-                        Map<?,?> jsonRequestMap = (Map<?, ?>) root.remove("Request");
-                        if (jsonRequestMap == null) {
-                                throw new JSONStructureException("No \"Request\" property found.");
-                        }
-                        
-                        checkUnknown("Top-level message", root);
-                        
-                        stdMutableRequest = new StdMutableRequest();
-                        
-                        //
-                        // Is there a Category?
-                        //
-                        Object categoryList =  jsonRequestMap.remove("Category");
-                        if (categoryList != null && ! (categoryList instanceof List)) {
-                                throw new JSONStructureException("Category must contain list of objects, not '" + categoryList.getClass() + "'");
-                        }
-                        if (categoryList != null) {
-                                //
-                                // Iterate each Category
-                                //
-                                Iterator<?> iter = ((List<?>)categoryList).iterator();
-                                while (iter.hasNext()) {
-                                        Object category = iter.next();
-                                        if ( ! (category instanceof Map)) {
-                                                throw new JSONStructureException("Category list must contain objects contained within curly braces ({})");
-                                        }
-                                        
-                                        parseCategory((Map<?,?>) category, "Category", null, stdMutableRequest);
+            Map<?,?> root = mapper.readValue(json, Map.class);
 
-                                }
-                        }
-                        
-                        // The following may be either a single instance or an array.  This allows multiple decisions to work with the Default Category objects.
-                        //	Example:
-                        //		"AccessSubject" : [ {attributes group one},
-                        //						{attributes group two}
-                        //					]
-                        
-                        //
-                        // Look for default Shorthand AccessSubject
-                        //
-                        parseDefaultCategory(jsonRequestMap, "AccessSubject", "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject",  stdMutableRequest);
-                        //
-                        // Provide backward compatibility for our PEP's
-                        //
-                        parseDefaultCategory(jsonRequestMap, "Subject", "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject",  stdMutableRequest);
-        
-                        //
-                        // Look for default Shorthand Action
-                        //
-                        parseDefaultCategory(jsonRequestMap, "Action", "urn:oasis:names:tc:xacml:3.0:attribute-category:action",  stdMutableRequest);
-                        
-                        //
-                        // Look for default Shorthand Resource
-                        //
-                        parseDefaultCategory(jsonRequestMap, "Resource", "urn:oasis:names:tc:xacml:3.0:attribute-category:resource",  stdMutableRequest);
-        
-                        //
-                        // Look for default Shorthand Environment
-                        //
-                        parseDefaultCategory(jsonRequestMap, "Environment", "urn:oasis:names:tc:xacml:3.0:attribute-category:environment",  stdMutableRequest);
+            //
+            // Does the request exist?
+            //
+            Map<?,?> jsonRequestMap = (Map<?, ?>) root.remove("Request");
+            if (jsonRequestMap == null) {
+                throw new JSONStructureException("No \"Request\" property found.");
+            }
 
-                        //
-                        // Look for default Shorthand RecipientSubject
-                        //
-                        parseDefaultCategory(jsonRequestMap, "RecipientSubject", "urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject",  stdMutableRequest);
-                        
-                        //
-                        // Look for default Shorthand IntermediarySubject
-                        //
-                        parseDefaultCategory(jsonRequestMap, "IntermediarySubject", "urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject",  stdMutableRequest);
-                        
-                        //
-                        // Look for default Shorthand Codebase
-                        //
-                        parseDefaultCategory(jsonRequestMap, "Codebase", "urn:oasis:names:tc:xacml:1.0:subject-category:codebase",  stdMutableRequest);
-                        
-                        //
-                        // Look for default Shorthand RequestingMachine
-                        //
-                        parseDefaultCategory(jsonRequestMap, "RequestingMachine", "urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine",  stdMutableRequest);
-                        
-                        
-                        //
-                        // MultiRequest
-                        //
-                        Map<?,?> multiRequests = (Map<?,?>) jsonRequestMap.remove("MultiRequests");
-                        if (multiRequests != null ) {
-                                if ( ! (multiRequests instanceof Map)) {
-                                        throw new JSONStructureException("MultiRequests must be object structure, not single value");
-                                }
-                                
-                                List<?> requestReferenceList = (List<?>)multiRequests.remove("RequestReference");
-                                if (requestReferenceList == null) {
-                                        throw new JSONStructureException("MultiRequest must contain a RequestReference element");
-                                }
-                                if (requestReferenceList.size() < 1) {
-                                        throw new JSONStructureException("MultiRequest must contain at least one element in the RequestReference list");
-                                }
-                                
-                                checkUnknown("MultiRequest", (Map<?,?>)multiRequests);
-                                
-                                for (Object requestReferenceMapObject : requestReferenceList) {
-                                        if ( ! (requestReferenceMapObject instanceof Map)) {
-                                                throw new JSONStructureException("MultiRequest RequestReference must be object");
-                                        }
-                                        Map<?,?> requestReferenceMap = (Map<?,?>)requestReferenceMapObject;
-                                        
-                                        // each object within the list must contain a ReferenceId and only a ReferenceId
-                                        Object referenceIdListObject = requestReferenceMap.remove("ReferenceId");
-                                        if (referenceIdListObject == null) {
-                                                throw new JSONStructureException("MultiRequest RequestReference list element must contain ReferenceId");
-                                        }
-                                        List<?> referenceIdList = (List<?>)referenceIdListObject;
-                                        if (referenceIdList.size() == 0) {
-                                                // the spec does not disallow empty list RequestReference objects
-                                                continue;
-                                        }
-                                        
-                                        checkUnknown("RequestReference", requestReferenceMap);
-                                        
-                                        // create reference corresponding to RequestReference list element
-                                        StdMutableRequestReference requestReference = new StdMutableRequestReference();
-                                        
-                                        for (Object referenceId : referenceIdList) {
-                                                // add attributes to the reference
-                                                // Since the order of the JSON is not constrained, we could process this section before the section containing attribute being referenced,
-                                                // so we cannot do a cross-check here to verify that the attribute reference exists.
-                                                // That will happen later when the PDP attempts to find the attribute.
-                                                StdRequestAttributesReference requestAttributesReference = new StdRequestAttributesReference((String) referenceId);
-                                                requestReference.add(requestAttributesReference);
-                                        }
-                                        stdMutableRequest.add(requestReference);
-                                }			
-                        }
-                        
-                        
-                        //
-                        // ReturnPolicyIdList
-                        //
-                        // If omitted this is set to a default of false by the StdMutableRequest constructor.
-                        //
-                        Object returnPolicyIdList = jsonRequestMap.remove("ReturnPolicyIdList");
-                        Boolean returnPolicyIdListBoolean = makeBoolean(returnPolicyIdList, "ReturnPolicyIdList");
-                        if (returnPolicyIdList != null) {
-                                stdMutableRequest.setReturnPolicyIdList(returnPolicyIdListBoolean);
-                        }
-                        
-                        //
-                        // CombinedDecision
-                        //
-                        // If omitted this is set to a default of false by the StdMutableRequest constructor.
-                        //
-                        Object combinedDecision = jsonRequestMap.remove("CombinedDecision");
-                        Boolean combinedDecisionBoolean = makeBoolean(combinedDecision, "CombinedDecision");
-                        if (combinedDecision != null) {
-                                stdMutableRequest.setCombinedDecision(combinedDecisionBoolean);
-                        }
-                        
-                        //
-                        // XPath
-                        //
-                        
-                        // The JSON spec says that this has a default value, implying that if it is missing in the Request we should fill it in.
-                        // However the XML (DOM) version does not do that.  If the value is missing it leaves the requestDefaults object blank.
-                        // We are following the XML approach and ignoring the Default value for this field in the spec.
-                        
-//TODO - Assume that no value for XPathVersion means "leave as null", not "fill in the default value from spec.  This violates the JSON spec			
-                        Object xPath = jsonRequestMap.remove("XPathVersion");
-                        if (xPath != null) {
-                                // XPath is given in the JSON input
-                                if ( ! (xPath instanceof String)) {
-                                        throw new JSONStructureException("XPathVersion not a URI passed as a String");
-                                }
-                                URI xPathUri = null;
-                                try {
-                                        xPathUri = new URI(xPath.toString());
-                                } catch (Exception e) {
-                                        throw new JSONStructureException("XPathVersion not a valid URI: '" + xPath + "'", e);
-                                }
-                                
-                                StdRequestDefaults requestDefaults = new StdRequestDefaults(xPathUri);
-                                stdMutableRequest.setRequestDefaults(requestDefaults);
-                        }
-                        
-                        checkUnknown("Request", jsonRequestMap);
-                        
-                } catch (JsonParseException e) {
-                        // try to point to problem area in JSON input, if possible
-                        JsonLocation location = e.getLocation();
-                        String locationOfError = "(unavailable)";
-                        if (location != null && location != JsonLocation.NA) {
-                                String jsonText = json;
-                                if (location.getLineNr() > 1) {
-                                        String[] jsonArray = jsonText.split("\\r?\\n|\\r");
-                                        jsonText = jsonArray[location.getLineNr()];
-                                }
-                                if (location.getCharOffset() < jsonText.length()) {
-                                        if (location.getCharOffset() > 0) {
-                                                locationOfError = jsonText.substring((int)location.getCharOffset() - 1);
-                                        }
-                                        if (locationOfError.length() > 30) {
-                                                locationOfError = locationOfError.substring(0, 30);
-                                        }
-                                }
-                        }
-                        throw new JSONStructureException("Unable to parse JSON starting at text'" + locationOfError + "', input was '" + json + "', exception: " + e, e);
-                } catch (JsonMappingException e) {
-                        throw new JSONStructureException("Unable to map JSON '" + json + "', exception: " + e, e);
-                } catch (IOException e) {
-                        throw new JSONStructureException("Unable to read JSON input, exception: " + e, e);
+            checkUnknown("Top-level message", root);
+
+            stdMutableRequest = new StdMutableRequest();
+
+            //
+            // Is there a Category?
+            //
+            Object categoryList =  jsonRequestMap.remove("Category");
+            if (categoryList != null && ! (categoryList instanceof List)) {
+                throw new JSONStructureException("Category must contain list of objects, not '" + categoryList.getClass() + "'");
+            }
+            if (categoryList != null) {
+                //
+                // Iterate each Category
+                //
+                Iterator<?> iter = ((List<?>)categoryList).iterator();
+                while (iter.hasNext()) {
+                    Object category = iter.next();
+                    if ( ! (category instanceof Map)) {
+                        throw new JSONStructureException("Category list must contain objects contained within curly braces ({})");
+                    }
+
+                    parseCategory((Map<?,?>) category, "Category", null, stdMutableRequest);
+
                 }
-                        
-                        
-                
-                // all done
-                return new StdRequest(stdMutableRequest);
-        }
+            }
+
+            // The following may be either a single instance or an array.  This allows multiple decisions to work with the Default Category objects.
+            //	Example:
+            //		"AccessSubject" : [ {attributes group one},
+            //						{attributes group two}
+            //					]
+
+            //
+            // Look for default Shorthand AccessSubject
+            //
+            parseDefaultCategory(jsonRequestMap, "AccessSubject", "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject",  stdMutableRequest);
+            //
+            // Provide backward compatibility for our PEP's
+            //
+            parseDefaultCategory(jsonRequestMap, "Subject", "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject",  stdMutableRequest);
+
+            //
+            // Look for default Shorthand Action
+            //
+            parseDefaultCategory(jsonRequestMap, "Action", "urn:oasis:names:tc:xacml:3.0:attribute-category:action",  stdMutableRequest);
+
+            //
+            // Look for default Shorthand Resource
+            //
+            parseDefaultCategory(jsonRequestMap, "Resource", "urn:oasis:names:tc:xacml:3.0:attribute-category:resource",  stdMutableRequest);
+
+            //
+            // Look for default Shorthand Environment
+            //
+            parseDefaultCategory(jsonRequestMap, "Environment", "urn:oasis:names:tc:xacml:3.0:attribute-category:environment",  stdMutableRequest);
+
+            //
+            // Look for default Shorthand RecipientSubject
+            //
+            parseDefaultCategory(jsonRequestMap, "RecipientSubject", "urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject",  stdMutableRequest);
+
+            //
+            // Look for default Shorthand IntermediarySubject
+            //
+            parseDefaultCategory(jsonRequestMap, "IntermediarySubject", "urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject",  stdMutableRequest);
+
+            //
+            // Look for default Shorthand Codebase
+            //
+            parseDefaultCategory(jsonRequestMap, "Codebase", "urn:oasis:names:tc:xacml:1.0:subject-category:codebase",  stdMutableRequest);
+
+            //
+            // Look for default Shorthand RequestingMachine
+            //
+            parseDefaultCategory(jsonRequestMap, "RequestingMachine", "urn:oasis:names:tc:xacml:1.0:subject-category:requesting-machine",  stdMutableRequest);
 
 
+            //
+            // MultiRequest
+            //
+            Map<?,?> multiRequests = (Map<?,?>) jsonRequestMap.remove("MultiRequests");
+            if (multiRequests != null ) {
+                if ( ! (multiRequests instanceof Map)) {
+                    throw new JSONStructureException("MultiRequests must be object structure, not single value");
+                }
 
-        //
-        // Generate JSON string from a Request object created by another means (e.g. XML).
-        //
-        // Used only in Testing
-        //
-        
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Request} into an JSON string with pretty-printing.
-         * This is used only for debugging.
-         * 
-         * @param request
-         * @return
-         * @throws Exception 
-         */
-        public static String toString(Request request) throws Exception {
-                return toString(request, true);
-        }
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Response} into an JSON string, pretty-printing is optional.
-         * This is used only for debugging.
-         * 
-         * @param response
-         * @param prettyPrint
-         * @return
-         * @throws Exception 
-         */
-        public static String toString(Request request, boolean prettyPrint) throws Exception {
-                String outputString = null;
-                ByteArrayOutputStream os = null;
+                List<?> requestReferenceList = (List<?>)multiRequests.remove("RequestReference");
+                if (requestReferenceList == null) {
+                    throw new JSONStructureException("MultiRequest must contain a RequestReference element");
+                }
+                if (requestReferenceList.size() < 1) {
+                    throw new JSONStructureException("MultiRequest must contain at least one element in the RequestReference list");
+                }
+
+                checkUnknown("MultiRequest", (Map<?,?>)multiRequests);
+
+                for (Object requestReferenceMapObject : requestReferenceList) {
+                    if ( ! (requestReferenceMapObject instanceof Map)) {
+                        throw new JSONStructureException("MultiRequest RequestReference must be object");
+                    }
+                    Map<?,?> requestReferenceMap = (Map<?,?>)requestReferenceMapObject;
+
+                    // each object within the list must contain a ReferenceId and only a ReferenceId
+                    Object referenceIdListObject = requestReferenceMap.remove("ReferenceId");
+                    if (referenceIdListObject == null) {
+                        throw new JSONStructureException("MultiRequest RequestReference list element must contain ReferenceId");
+                    }
+                    List<?> referenceIdList = (List<?>)referenceIdListObject;
+                    if (referenceIdList.size() == 0) {
+                        // the spec does not disallow empty list RequestReference objects
+                        continue;
+                    }
+
+                    checkUnknown("RequestReference", requestReferenceMap);
+
+                    // create reference corresponding to RequestReference list element
+                    StdMutableRequestReference requestReference = new StdMutableRequestReference();
+
+                    for (Object referenceId : referenceIdList) {
+                        // add attributes to the reference
+                        // Since the order of the JSON is not constrained, we could process this section before the section containing attribute being referenced,
+                        // so we cannot do a cross-check here to verify that the attribute reference exists.
+                        // That will happen later when the PDP attempts to find the attribute.
+                        StdRequestAttributesReference requestAttributesReference = new StdRequestAttributesReference((String) referenceId);
+                        requestReference.add(requestAttributesReference);
+                    }
+                    stdMutableRequest.add(requestReference);
+                }
+            }
+
+
+            //
+            // ReturnPolicyIdList
+            //
+            // If omitted this is set to a default of false by the StdMutableRequest constructor.
+            //
+            Object returnPolicyIdList = jsonRequestMap.remove("ReturnPolicyIdList");
+            Boolean returnPolicyIdListBoolean = makeBoolean(returnPolicyIdList, "ReturnPolicyIdList");
+            if (returnPolicyIdList != null) {
+                stdMutableRequest.setReturnPolicyIdList(returnPolicyIdListBoolean);
+            }
+
+            //
+            // CombinedDecision
+            //
+            // If omitted this is set to a default of false by the StdMutableRequest constructor.
+            //
+            Object combinedDecision = jsonRequestMap.remove("CombinedDecision");
+            Boolean combinedDecisionBoolean = makeBoolean(combinedDecision, "CombinedDecision");
+            if (combinedDecision != null) {
+                stdMutableRequest.setCombinedDecision(combinedDecisionBoolean);
+            }
+
+            //
+            // XPath
+            //
+
+            // The JSON spec says that this has a default value, implying that if it is missing in the Request we should fill it in.
+            // However the XML (DOM) version does not do that.  If the value is missing it leaves the requestDefaults object blank.
+            // We are following the XML approach and ignoring the Default value for this field in the spec.
+
+//TODO - Assume that no value for XPathVersion means "leave as null", not "fill in the default value from spec.  This violates the JSON spec
+            Object xPath = jsonRequestMap.remove("XPathVersion");
+            if (xPath != null) {
+                // XPath is given in the JSON input
+                if ( ! (xPath instanceof String)) {
+                    throw new JSONStructureException("XPathVersion not a URI passed as a String");
+                }
+                URI xPathUri = null;
                 try {
-                        os = new ByteArrayOutputStream();
-                        convert(request, os, prettyPrint);
-                        outputString = new String( os.toByteArray(), "UTF-8");
-                } catch (Exception ex) {
-                        throw ex;
-                } finally {
-                        try {
-                                if (os != null) {
-                                        os.close();
-                                }
-                        } catch(Exception idontcare) {				
-                        }
+                    xPathUri = new URI(xPath.toString());
+                } catch (Exception e) {
+                    throw new JSONStructureException("XPathVersion not a valid URI: '" + xPath + "'", e);
                 }
-                return outputString;
-        }
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Request} object into a string suitable for output.
-         * 
-         * IMPORTANT: This method does NOT close the outputStream.  It is the responsibility of the caller to (who opened the stream) to close it.
-         * 
-         * @param request
-         * @param outputStream
-         * @throws java.io.IOException
-         * @throws JSONStructureException 
-         */
-        public static void convert(Request request, OutputStream outputStream) throws IOException, JSONStructureException {
-                convert(request, outputStream, false);
+
+                StdRequestDefaults requestDefaults = new StdRequestDefaults(xPathUri);
+                stdMutableRequest.setRequestDefaults(requestDefaults);
+            }
+
+            checkUnknown("Request", jsonRequestMap);
+
+        } catch (JsonParseException e) {
+            // try to point to problem area in JSON input, if possible
+            JsonLocation location = e.getLocation();
+            String locationOfError = "(unavailable)";
+            if (location != null && location != JsonLocation.NA) {
+                String jsonText = json;
+                if (location.getLineNr() > 1) {
+                    String[] jsonArray = jsonText.split("\\r?\\n|\\r");
+                    jsonText = jsonArray[location.getLineNr()];
+                }
+                if (location.getCharOffset() < jsonText.length()) {
+                    if (location.getCharOffset() > 0) {
+                        locationOfError = jsonText.substring((int)location.getCharOffset() - 1);
+                    }
+                    if (locationOfError.length() > 30) {
+                        locationOfError = locationOfError.substring(0, 30);
+                    }
+                }
+            }
+            throw new JSONStructureException("Unable to parse JSON starting at text'" + locationOfError + "', input was '" + json + "', exception: " + e, e);
+        } catch (JsonMappingException e) {
+            throw new JSONStructureException("Unable to map JSON '" + json + "', exception: " + e, e);
+        } catch (IOException e) {
+            throw new JSONStructureException("Unable to read JSON input, exception: " + e, e);
         }
 
-        /**
-         * Do the work of converting the {@link com.att.research.xacml.api.Request} object to a string, allowing for pretty-printing if desired.
-         * 
-         * IMPORTANT: This method does NOT close the outputStream.  It is the responsibility of the caller to (who opened the stream) to close it.
-         * 
-         * @param request
-         * @param outputStream
-         * @param prettyPrint
-         * @throws java.io.IOException
-         * #throws JSONStructureException
-         */
-        public static void convert(Request request, OutputStream outputStream, boolean prettyPrint) throws IOException, JSONStructureException {
-                
-                if (request == null) {
-                        throw new NullPointerException("No Request in convert");
+
+
+        // all done
+        return new StdRequest(stdMutableRequest);
+    }
+
+
+
+    //
+    // Generate JSON string from a Request object created by another means (e.g. XML).
+    //
+    // Used only in Testing
+    //
+
+
+    /**
+     * Convert the {@link com.att.research.xacml.api.Request} into an JSON string with pretty-printing.
+     * This is used only for debugging.
+     *
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    public static String toString(Request request) throws Exception {
+        return toString(request, true);
+    }
+
+    /**
+     * Convert the {@link com.att.research.xacml.api.Response} into an JSON string, pretty-printing is optional.
+     * This is used only for debugging.
+     *
+     * @param response
+     * @param prettyPrint
+     * @return
+     * @throws Exception
+     */
+    public static String toString(Request request, boolean prettyPrint) throws Exception {
+        String outputString = null;
+        ByteArrayOutputStream os = null;
+        try {
+            os = new ByteArrayOutputStream();
+            convert(request, os, prettyPrint);
+            outputString = new String( os.toByteArray(), "UTF-8");
+        } catch (Exception ex) {
+            throw ex;
+        } finally {
+            try {
+                if (os != null) {
+                    os.close();
+                }
+            } catch(Exception idontcare) {
+            }
+        }
+        return outputString;
+    }
+
+    /**
+     * Convert the {@link com.att.research.xacml.api.Request} object into a string suitable for output.
+     *
+     * IMPORTANT: This method does NOT close the outputStream.  It is the responsibility of the caller to (who opened the stream) to close it.
+     *
+     * @param request
+     * @param outputStream
+     * @throws java.io.IOException
+     * @throws JSONStructureException
+     */
+    public static void convert(Request request, OutputStream outputStream) throws IOException, JSONStructureException {
+        convert(request, outputStream, false);
+    }
+
+    /**
+     * Do the work of converting the {@link com.att.research.xacml.api.Request} object to a string, allowing for pretty-printing if desired.
+     *
+     * IMPORTANT: This method does NOT close the outputStream.  It is the responsibility of the caller to (who opened the stream) to close it.
+     *
+     * @param request
+     * @param outputStream
+     * @param prettyPrint
+     * @throws java.io.IOException
+     * #throws JSONStructureException
+     */
+    public static void convert(Request request, OutputStream outputStream, boolean prettyPrint) throws IOException, JSONStructureException {
+
+        if (request == null) {
+            throw new NullPointerException("No Request in convert");
+        }
+
+        String json = null;
+
+        Map<String,Object> requestMap = new HashMap<String,Object>();
+
+        // ReturnPolicyIdList
+        requestMap.put("ReturnPolicyIdList", request.getReturnPolicyIdList());
+        // Combined
+        requestMap.put("CombinedDecision", request.getCombinedDecision());
+        // XPath
+        if (request.getRequestDefaults() != null) {
+            requestMap.put("XPathVersion", request.getRequestDefaults().getXPathVersion());
+        }
+
+        // Categories
+        Iterator<RequestAttributes> rait = request.getRequestAttributes().iterator();
+        List<Map<String,Object>> generalCategoriesList = new ArrayList<Map<String,Object>>();
+        while (rait.hasNext()) {
+            RequestAttributes ra = rait.next();
+
+            // create a new map for the category
+            Map<String,Object> categoryMap = new HashMap<String,Object>();
+
+            // fill in the category
+            if (ra.getXmlId() != null) {
+                categoryMap.put("Id", ra.getXmlId());
+            }
+            if (ra.getContentRoot() != null) {
+                StringWriter writer = new StringWriter();
+                Transformer transformer = null;
+                try {
+                    transformer = TransformerFactory.newInstance().newTransformer();
+                    transformer.transform(new DOMSource(ra.getContentRoot()), new StreamResult(writer));
+                } catch (Exception e) {
+                    throw new JSONStructureException("Unable to Content node to string; e="+e);
                 }
 
-                String json = null;
+                String xml = writer.toString();
 
-                Map<String,Object> requestMap = new HashMap<String,Object>();
-                
-                // ReturnPolicyIdList
-                requestMap.put("ReturnPolicyIdList", request.getReturnPolicyIdList());
-                // Combined
-                requestMap.put("CombinedDecision", request.getCombinedDecision());
-                // XPath
-                if (request.getRequestDefaults() != null) {
-                        requestMap.put("XPathVersion", request.getRequestDefaults().getXPathVersion());
+                categoryMap.put("Content", xml);
+            }
+
+            Iterator<Attribute> attrIt = ra.getAttributes().iterator();
+            List<Map<String,Object>> attributesList = new ArrayList<Map<String,Object>>();
+            while (attrIt.hasNext()) {
+                Attribute attr = attrIt.next();
+                Map<String, Object> attrMap = new HashMap<String,Object>();
+                attrMap.put("AttributeId", attr.getAttributeId().stringValue());
+                if (attr.getIssuer() != null) {
+                    attrMap.put("Issuer", attr.getIssuer());
                 }
-                
-                // Categories
-                Iterator<RequestAttributes> rait = request.getRequestAttributes().iterator();
-                List<Map<String,Object>> generalCategoriesList = new ArrayList<Map<String,Object>>();
-                while (rait.hasNext()) {
-                        RequestAttributes ra = rait.next();
-                        
-                        // create a new map for the category
-                        Map<String,Object> categoryMap = new HashMap<String,Object>();
-                        
-                        // fill in the category
-                        if (ra.getXmlId() != null) {
-                                categoryMap.put("Id", ra.getXmlId());
-                        }
-                        if (ra.getContentRoot() != null) {
-                                StringWriter writer = new StringWriter();
-                                Transformer transformer = null;
-                                try {
-                                        transformer = TransformerFactory.newInstance().newTransformer();
-                                        transformer.transform(new DOMSource(ra.getContentRoot()), new StreamResult(writer));
-                                } catch (Exception e) {
-                                        throw new JSONStructureException("Unable to Content node to string; e="+e);
-                                }
+                attrMap.put("IncludeInResult", attr.getIncludeInResults());
+                Collection<AttributeValue<?>> valuesCollection = attr.getValues();
+                Iterator<AttributeValue<?>> valuesIt = valuesCollection.iterator();
 
-                                String xml = writer.toString();
-                                
-                                categoryMap.put("Content", xml);
-                        }
-                        
-                        Iterator<Attribute> attrIt = ra.getAttributes().iterator();
-                        List<Map<String,Object>> attributesList = new ArrayList<Map<String,Object>>();
-                        while (attrIt.hasNext()) {
-                                Attribute attr = attrIt.next();
-                                Map<String, Object> attrMap = new HashMap<String,Object>();
-                                attrMap.put("AttributeId", attr.getAttributeId().stringValue());
-                                if (attr.getIssuer() != null) {
-                                        attrMap.put("Issuer", attr.getIssuer());
-                                }
-                                attrMap.put("IncludeInResult", attr.getIncludeInResults());
-                                Collection<AttributeValue<?>> valuesCollection = attr.getValues();
-                                Iterator<AttributeValue<?>> valuesIt = valuesCollection.iterator();
-                                
-                                if (valuesCollection.size() == 1) {
-                                        // single-value
-                                        AttributeValue<?> attrValue = valuesIt.next();
-                                        attrMap.put("DataType", attrValue.getDataTypeId().stringValue());
-                                        
-                                        attrMap.put("Value", jsonOutputObject(attrValue.getValue(), attrValue));
+                if (valuesCollection.size() == 1) {
+                    // single-value
+                    AttributeValue<?> attrValue = valuesIt.next();
+                    attrMap.put("DataType", attrValue.getDataTypeId().stringValue());
 
-                                } else if (valuesCollection.size() > 1) {
-                                        // multiple values
-                                        List<Object> attrValueList = new ArrayList<Object>();
-                                        while (valuesIt.hasNext()) {
-                                                AttributeValue<?> attrValue = valuesIt.next();
-                                                // assume all have the same type, so last one in list is fine
-                                                attrMap.put("DataType", attrValue.getDataTypeId().stringValue());
+                    attrMap.put("Value", jsonOutputObject(attrValue.getValue(), attrValue));
 
-                                                attrValueList.add(jsonOutputObject(attrValue.getValue(), attrValue));
+                } else if (valuesCollection.size() > 1) {
+                    // multiple values
+                    List<Object> attrValueList = new ArrayList<Object>();
+                    while (valuesIt.hasNext()) {
+                        AttributeValue<?> attrValue = valuesIt.next();
+                        // assume all have the same type, so last one in list is fine
+                        attrMap.put("DataType", attrValue.getDataTypeId().stringValue());
 
-                                        }
-                                        attrMap.put("Value", attrValueList);
-                                        
-                                }
+                        attrValueList.add(jsonOutputObject(attrValue.getValue(), attrValue));
 
-                                
-                                attributesList.add(attrMap);
-                        }
-                        if (attributesList.size() > 0) {
-                                categoryMap.put("Attribute", attributesList);
-                        }
-                        
-                        
-                        // We do not use the "Default" category objects because the XML may have multiples of the same Category.
-                        // This is fine when the categories are contained in the array of Category objects,
-                        // but if we use the Default category objects we might end up with multiples of the same Category name,
-                        // and the Jackson parser does not handle that well.
-                        // Example: This is ok because the AccessSubjects are independent items within the list:
-                        // 		{ "Request" : {
-                        //			"Category" : [
+                    }
+                    attrMap.put("Value", attrValueList);
+
+                }
+
+
+                attributesList.add(attrMap);
+            }
+            if (attributesList.size() > 0) {
+                categoryMap.put("Attribute", attributesList);
+            }
+
+
+            // We do not use the "Default" category objects because the XML may have multiples of the same Category.
+            // This is fine when the categories are contained in the array of Category objects,
+            // but if we use the Default category objects we might end up with multiples of the same Category name,
+            // and the Jackson parser does not handle that well.
+            // Example: This is ok because the AccessSubjects are independent items within the list:
+            // 		{ "Request" : {
+            //			"Category" : [
             //             { "CategoryId" : ""subject", " },
             //             { "CategoryId" : ""subject", " }
-                        //			]
-                        //		}}
-                        //
-                        // This is NOT ok because the Subjects are seen as duplicate elements:
-                        //		{ "Request" : {
+            //			]
+            //		}}
+            //
+            // This is NOT ok because the Subjects are seen as duplicate elements:
+            //		{ "Request" : {
             //		   "AccessSubject" : {"},
             //		   "AccessSubject" : {"},
-                        //		}}
+            //		}}
 
-                        categoryMap.put("CategoryId", ra.getCategory().stringValue());
-                        generalCategoriesList.add(categoryMap);
+            categoryMap.put("CategoryId", ra.getCategory().stringValue());
+            generalCategoriesList.add(categoryMap);
 
-                        
 
+
+        }
+
+        if (generalCategoriesList.size() > 0) {
+            requestMap.put("Category", generalCategoriesList);
+        }
+
+
+        // MultiRequests
+        if (request.getMultiRequests() != null) {
+            Collection<RequestReference> referenceCollection = request.getMultiRequests();
+
+            Map<String,Object> multiRequestMap = new HashMap<String,Object>();
+            List<Map<String,Object>> requestReferenceList = new ArrayList<Map<String,Object>>();
+
+            Iterator<RequestReference> rrIt = referenceCollection.iterator();
+            while (rrIt.hasNext()) {
+                RequestReference rr = rrIt.next();
+                Map<String, Object> requestReferenceMap = new HashMap<String,Object>();
+
+                Collection<RequestAttributesReference> rarCollection = rr.getAttributesReferences();
+                List<Object> ridList = new ArrayList<Object>();
+                Iterator<RequestAttributesReference> rarIt = rarCollection.iterator();
+                while (rarIt.hasNext()) {
+                    RequestAttributesReference rar = rarIt.next();
+                    ridList.add(rar.getReferenceId());
                 }
-                
-                if (generalCategoriesList.size() > 0) {
-                        requestMap.put("Category", generalCategoriesList);
+
+                if (ridList.size() > 0) {
+                    requestReferenceMap.put("ReferenceId", ridList);
                 }
-                
-                
-                // MultiRequests
-                if (request.getMultiRequests() != null) {
-                        Collection<RequestReference> referenceCollection = request.getMultiRequests();
-                        
-                        Map<String,Object> multiRequestMap = new HashMap<String,Object>();
-                        List<Map<String,Object>> requestReferenceList = new ArrayList<Map<String,Object>>();
-                        
-                        Iterator<RequestReference> rrIt = referenceCollection.iterator();
-                        while (rrIt.hasNext()) {
-                                RequestReference rr = rrIt.next();
-                                Map<String, Object> requestReferenceMap = new HashMap<String,Object>();
-                                
-                                Collection<RequestAttributesReference> rarCollection = rr.getAttributesReferences();
-                                List<Object> ridList = new ArrayList<Object>();
-                                Iterator<RequestAttributesReference> rarIt = rarCollection.iterator();
-                                while (rarIt.hasNext()) {
-                                        RequestAttributesReference rar = rarIt.next();
-                                        ridList.add(rar.getReferenceId());
-                                }
-                                
-                                if (ridList.size() > 0) {
-                                        requestReferenceMap.put("ReferenceId", ridList);
-                                }
-                                
-                                if (requestReferenceMap.size() > 0) {
-                                        requestReferenceList.add(requestReferenceMap);
-                                }
-                                
-                                
-                                if (requestReferenceList.size() > 0) {
-                                        multiRequestMap.put("RequestReference", requestReferenceList);
-                                }
-                        }
-                        
-                        if (multiRequestMap.size() > 0) {
-                                requestMap.put("MultiRequests", multiRequestMap);
-                        }
+
+                if (requestReferenceMap.size() > 0) {
+                    requestReferenceList.add(requestReferenceMap);
                 }
-                
-        
+
+
+                if (requestReferenceList.size() > 0) {
+                    multiRequestMap.put("RequestReference", requestReferenceList);
+                }
+            }
+
+            if (multiRequestMap.size() > 0) {
+                requestMap.put("MultiRequests", multiRequestMap);
+            }
+        }
+
+
         //
         // Create the overall Request map
         //
@@ -1346,98 +1346,98 @@
         //
         // Create a string buffer
         //
-                ObjectMapper mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
-                mapper.configure(SerializationFeature.INDENT_OUTPUT, prettyPrint);
-                try (OutputStreamWriter osw = new OutputStreamWriter(outputStream)) {
-                        
-                        // convert the request to json string
-                        json = mapper.writeValueAsString(theWholeRequest);
-                        
-                        // write it
-                        osw.write(json);
-                        
-                        // force output
-                        osw.flush();
-                } catch (Exception e) {
-                        logger.error("Failed to write to json string: " + e.getLocalizedMessage(), e);
+        ObjectMapper mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
+        mapper.configure(SerializationFeature.INDENT_OUTPUT, prettyPrint);
+        try (OutputStreamWriter osw = new OutputStreamWriter(outputStream)) {
+
+            // convert the request to json string
+            json = mapper.writeValueAsString(theWholeRequest);
+
+            // write it
+            osw.write(json);
+
+            // force output
+            osw.flush();
+        } catch (Exception e) {
+            logger.error("Failed to write to json string: " + e.getLocalizedMessage(), e);
+        }
+
+
+    }
+
+
+
+
+    /**
+     * Create the appropriate object for JSON output.
+     * This needs to be a Boolean, Integer or Double for those data types so that the ObjectMapper knows how to format the JSON text.
+     * For objects implementing stringValue we use that string.
+     * for XPathExpressions use the Path.
+     * Otherwise default to using toString.
+     *
+     * @param obj
+     * @return
+     */
+    private static Object jsonOutputObject(Object obj, AttributeValue<?> attrValue) throws JSONStructureException {
+        if (obj instanceof String ||
+                obj instanceof Boolean ||
+                obj instanceof BigInteger  ) {
+            return obj;
+        } else if (obj instanceof Double) {
+            Double d = (Double)obj;
+            if (d == Double.NaN) {
+                return "NaN";
+            } else if (d == Double.POSITIVE_INFINITY) {
+                return "INF";
+            } else if (d == Double.NEGATIVE_INFINITY) {
+                return "-INF";
+            }
+            return obj;
+        } else if (obj instanceof SemanticString) {
+            return ((SemanticString)obj).stringValue();
+        } else if (obj instanceof X500Principal ||
+                   obj instanceof URI) {
+            // something is very weird with X500Principal data type.  If left on its own the output is a map that includes encoding.
+            return obj.toString();
+        } else if (obj instanceof XPathExpressionWrapper) {
+            // create a map containing the complex value for the XPathExpression
+            Map<String,Object> xpathExpressionMap = new HashMap<String,Object>();
+            Identifier xpathCategoryId = attrValue.getXPathCategory();
+            if (xpathCategoryId == null) {
+                throw new JSONStructureException("XPathExpression is missing XPathCategory");
+            }
+            xpathExpressionMap.put("XPathCategory", attrValue.getXPathCategory().stringValue());
+
+            XPathExpressionWrapper xw = (XPathExpressionWrapper) obj;
+            xpathExpressionMap.put("XPath", xw.getPath());
+
+            ExtendedNamespaceContext namespaceContext = xw.getNamespaceContext();
+            if (namespaceContext != null) {
+                List<Object> namespaceList = new ArrayList<Object>();
+
+                // get the list of all namespace prefixes
+                Iterator<String> prefixIt = namespaceContext.getAllPrefixes();
+                while (prefixIt.hasNext()) {
+                    String prefix = prefixIt.next();
+                    String namespaceURI = namespaceContext.getNamespaceURI(prefix);
+                    Map<String,Object> namespaceMap = new HashMap<String,Object>();
+                    if (prefix != null && ! prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+                        namespaceMap.put("Prefix", prefix);
+                    }
+                    namespaceMap.put("Namespace", namespaceURI);
+                    namespaceList.add(namespaceMap);
                 }
 
-                
-        }
-        
-        
-        
-        
-        /**
-         * Create the appropriate object for JSON output.
-         * This needs to be a Boolean, Integer or Double for those data types so that the ObjectMapper knows how to format the JSON text.
-         * For objects implementing stringValue we use that string.
-         * for XPathExpressions use the Path.
-         * Otherwise default to using toString.
-         * 
-         * @param obj
-         * @return
-         */
-        private static Object jsonOutputObject(Object obj, AttributeValue<?> attrValue) throws JSONStructureException {
-                if (obj instanceof String ||
-                                obj instanceof Boolean ||
-                                obj instanceof BigInteger  ) {
-                        return obj;
-                } else if (obj instanceof Double) {
-                        Double d = (Double)obj;
-                        if (d == Double.NaN) {
-                                return "NaN";
-                        } else if (d == Double.POSITIVE_INFINITY) {
-                                return "INF";
-                        } else if (d == Double.NEGATIVE_INFINITY) {
-                                return "-INF";
-                        }
-                        return obj;
-                } else if (obj instanceof SemanticString) {
-                        return ((SemanticString)obj).stringValue();
-                } else if (obj instanceof X500Principal ||
-                                obj instanceof URI) {
-                        // something is very weird with X500Principal data type.  If left on its own the output is a map that includes encoding.
-                        return obj.toString();
-                } else if (obj instanceof XPathExpressionWrapper) {
-                        // create a map containing the complex value for the XPathExpression
-                        Map<String,Object> xpathExpressionMap = new HashMap<String,Object>();
-                        Identifier xpathCategoryId = attrValue.getXPathCategory();
-                        if (xpathCategoryId == null) {
-                                throw new JSONStructureException("XPathExpression is missing XPathCategory");
-                        }
-                        xpathExpressionMap.put("XPathCategory", attrValue.getXPathCategory().stringValue());
-                        
-                        XPathExpressionWrapper xw = (XPathExpressionWrapper) obj;
-                        xpathExpressionMap.put("XPath", xw.getPath());
-                        
-                        ExtendedNamespaceContext namespaceContext = xw.getNamespaceContext();
-                        if (namespaceContext != null) {
-                                List<Object> namespaceList = new ArrayList<Object>();
+                xpathExpressionMap.put("Namespaces", namespaceList);
+            }
+            return xpathExpressionMap;
 
-                                // get the list of all namespace prefixes
-                                Iterator<String> prefixIt = namespaceContext.getAllPrefixes();
-                                while (prefixIt.hasNext()) {
-                                        String prefix = prefixIt.next();
-                                        String namespaceURI = namespaceContext.getNamespaceURI(prefix);
-                                        Map<String,Object> namespaceMap = new HashMap<String,Object>();
-                                        if (prefix != null && ! prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
-                                                namespaceMap.put("Prefix", prefix);
-                                        }
-                                        namespaceMap.put("Namespace", namespaceURI);
-                                        namespaceList.add(namespaceMap);
-                                }
-                                
-                                xpathExpressionMap.put("Namespaces", namespaceList);
-                        }
-                        return xpathExpressionMap;
-
-                } else {
-                        throw new JSONStructureException("Unhandled data type='" + obj.getClass().getName() + "'");
-                }
+        } else {
+            throw new JSONStructureException("Unhandled data type='" + obj.getClass().getName() + "'");
         }
-        
-        
+    }
+
+
 }
 
 
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONResponse.java
index 233ef7e..5555179 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -114,7 +114,7 @@
 import com.fasterxml.jackson.databind.SerializationFeature;
 
 /**
- * JSONResponse is used to convert JSON into {@link com.att.research.xacml.api.Response} objects and 
+ * JSONResponse is used to convert JSON into {@link com.att.research.xacml.api.Response} objects and
  * {@link com.att.research.xacml.api.Response} objects into JSON strings.
  * Instances of this class are never created.
  * The {@link com.att.research.xacml.api.Response} objects returned by this class are instances of
@@ -124,1313 +124,1312 @@
  * because the PDP generates {@link com.att.research.xacml.std.StdResponse} objects internally.
  * Those objects are converted to JSON strings for transmission through the RESTful Web Service
  * using the <code>convert</code> method in this class.
- * 
+ *
  * @author glenngriffin
  * @version $Revision: 1.2 $
  */
 public class JSONResponse {
-        private static final Log logger	= LogFactory.getLog(JSONResponse.class);
-        
-        
-        /*
-         * Map of Data Type Identifiers used to map the Identifier into the shorthand name of that DataType.
-         * This is loaded the first time a Request is processed.
-         * Loading is done using Reflection.
-         * 	key = full name of the Identifier as a String
-         * 	value = shorthand version of that name
-         * 
-         * (Note difference in structure and usage from JSON Request.)
-         */
-        private static Map<String, String> outputShorthandMap = null;
-        
-        
-        /*
-         * USED ONLY IN CONVERTING File/String/InputStream JSON TEXT INTO INTERNAL RESPONSE OBJECT
-         * Map of Data Type Identifiers used to map shorthand notation for DataTypes into the full Identifer.
-         * This is loaded the first time a Request is processed.
-         * Loading is done using Reflection.
-         * The map contains keys for both the short form and the long form of each DataType.  For example both of the following are in the table:
-         * 		http://www.w3.org/2001/XMLSchema#base64Binary = http://www.w3.org/2001/XMLSchema#base64Binary
-         * 										 base64Binary = http://www.w3.org/2001/XMLSchema#base64Binary
-         * 
-         * (Note difference in structure and usage from JSONResponse.)
-         */
-        private static Map<String, Identifier> shorthandMap = null;
-        
-        
-        /*
-         * To check the individual data attributes for being the correct type, we need an instance of the DataTypeFactory
-         */
-        private static DataTypeFactory dataTypeFactory = null;
-        
-        
-        
-        protected JSONResponse() {
-        }
+    private static final Log logger	= LogFactory.getLog(JSONResponse.class);
 
-        
-        
-        //
-        // HELPER METHODS
-        //
-        
-        
-        /**
-         * Use reflection to load the map with all the names of all DataTypes
-         * allowing us to output the shorthand version rather than the full Identifier name. (to shorten the JSON output).
-         * The shorthand map is used differently in JSONRequest than in JSONResponse, so there are similarities and differences in the implementation.
-         * This is done once the first time a Request is processed.
-         */
-        private static void initOutputShorthandMap() throws JSONStructureException {
-                Field[] declaredFields	= XACML3.class.getDeclaredFields();
-                outputShorthandMap = new HashMap<String, String>();
-                for (Field field : declaredFields) {
-                        if (Modifier.isStatic(field.getModifiers()) && 
-                                field.getName().startsWith("ID_DATATYPE") &&
-                                Modifier.isPublic(field.getModifiers())
-                        ) {
-                                try {
-                                        Identifier id = (Identifier)field.get(null);
-                                        String longName = id.stringValue();
-                                        // most names start with 'http://www.w3.org/2001/XMLSchema#'
-                                        int sharpIndex = longName.lastIndexOf("#");
-                                        if (sharpIndex <= 0) {
-                                                // some names start with 'urn:oasis:names:tc:xacml:1.0:data-type:'
-                                                // or urn:oasis:names:tc:xacml:2.0:data-type:
-                                                if (longName.contains(":data-type:")) {
-                                                        sharpIndex = longName.lastIndexOf(":");
-                                                } else {
-                                                        continue;
-                                                }
-                                        }
-                                        String shortName = longName.substring(sharpIndex + 1);
-                                        // put both the full name and the short name in the table
-                                        outputShorthandMap.put(id.stringValue(), shortName);
-                                } catch (Exception e) {
-                                        throw new JSONStructureException("Error loading ID Table, e="+e);
-                                }
-                        }
-                }
-        }
-        
-        
-        /**
-         * Use reflection to load the map with all the names of all DataTypes, both the long name and the shorthand,
-         * and point each name to the appropriate Identifier.
-         * The shorthand map is used differently in JSONRequest than in JSONResponse, so there are similarities and differences in the implementation.
-         * This is done once the first time a Request is processed.
-         */
-        private static void initShorthandMap() throws JSONStructureException {
-                Field[] declaredFields	= XACML3.class.getDeclaredFields();
-                shorthandMap = new HashMap<String, Identifier>();
-                for (Field field : declaredFields) {
-                        if (Modifier.isStatic(field.getModifiers()) && 
-                                field.getName().startsWith("ID_DATATYPE") &&
-                                Modifier.isPublic(field.getModifiers())
-                        ) {
-                                try {
-                                        Identifier id = (Identifier)field.get(null);
-                                        String longName = id.stringValue();
-                                        // most names start with 'http://www.w3.org/2001/XMLSchema#'
-                                        int sharpIndex = longName.lastIndexOf("#");
-                                        if (sharpIndex <= 0) {
-                                                // some names start with 'urn:oasis:names:tc:xacml:1.0:data-type:'
-                                                // or urn:oasis:names:tc:xacml:2.0:data-type:
-                                                if (longName.contains(":data-type:")) {
-                                                        sharpIndex = longName.lastIndexOf(":");
-                                                } else {
-                                                        continue;
-                                                }
-                                        }
-                                        String shortName = longName.substring(sharpIndex + 1);
-                                        // put both the full name and the short name in the table
-                                        shorthandMap.put(longName, id);
-                                        shorthandMap.put(shortName, id);
-                                } catch (Exception e) {
-                                        throw new JSONStructureException("Error loading ID Table, e="+e);
-                                }
-                        }
-                }
-        }
-        
-        
-        /**
-         * Check the given map for all components having been removed (i.e. everything in the map was known and used).
-         * If anything remains, throw an exception based on the component and the keys left in the map
-         */
-        private static void checkUnknown(String component, Map<?,?> map) throws JSONStructureException {
-                if (map.size() == 0) {
-                        return;
-                }
 
-                String keys = null;
-                Iterator<?> it = map.keySet().iterator();
-                while (it.hasNext()) {
-                        if (keys == null) {
-                                keys = "'" + it.next().toString() + "'";
-                        } else {
-                                keys += ", '" + it.next().toString() + "'";
-                        }
-                }
+    /*
+     * Map of Data Type Identifiers used to map the Identifier into the shorthand name of that DataType.
+     * This is loaded the first time a Request is processed.
+     * Loading is done using Reflection.
+     * 	key = full name of the Identifier as a String
+     * 	value = shorthand version of that name
+     *
+     * (Note difference in structure and usage from JSON Request.)
+     */
+    private static Map<String, String> outputShorthandMap = null;
 
-                String message = component + " contains unknown element" + ( (map.size() == 1) ? " " : "s ") + keys;
-                throw new JSONStructureException(message);
-        }
-        
-        
-        /**
-         * When parsing a JSON string into an object, recursively parse the StatusCode and any child StatusCodes
-         * 
-         * @param statusCodeMap
-         * @return
-         * @throws JSONStructureException
-         */
-        private static StatusCode parseStatusCode(Map<?,?> statusCodeMap) throws JSONStructureException {
 
-                // get optional value
-                Object valueObject = statusCodeMap.remove("Value");
-                Identifier identifier = null;
-                if (valueObject != null) {
-                        identifier = new IdentifierImpl(valueObject.toString());
-                }
-                
-                // get optional child status code
-                Object childStatusCodeMap = statusCodeMap.remove("StatusCode");
-                StatusCode childStatusCode = null;
-                if (childStatusCodeMap != null) {
-                        if ( ! (childStatusCodeMap instanceof Map)) {
-                                throw new JSONStructureException("Child StatusCode must be object");
-                        }
-                        childStatusCode = parseStatusCode((Map<?,?>)childStatusCodeMap);
-                }
-                
-                checkUnknown("StatusCode", statusCodeMap);
-                
-                StdStatusCode statusCode = new StdStatusCode(identifier, childStatusCode);
-                
-                return statusCode;
-        }
-        
-        
-        /**
-         * When reading a JSON string and converting to internal objects, this converts the parsed Map into an XPathExpression AttributeValue.
-         * 
-         * @param mapObject
-         * @param categoryId
-         * @return
-         * @throws JSONStructureException
-         */
-        private static AttributeValue<?> convertMapToXPathExpression(Object mapObject) throws JSONStructureException {
-                if ( ! (mapObject instanceof Map)) {
-                        throw new JSONStructureException("XPathExpression value must be complex object containing XPath, XPathCategory and optional Namespaces");
-                        
-                }
-                Map<?,?> xpathExpressionMap = (Map<?,?>)mapObject;
-                
-                // get mandatory XPath
-                Object xpathObject = xpathExpressionMap.remove("XPath");
-                if (xpathObject == null || ! (xpathObject instanceof String)) {
-                        throw new JSONStructureException("XPathExpression must contain string XPath");
-                }
-                
-                // mandatory XPathCategory
-                Object xpathCategoryObject = xpathExpressionMap.remove("XPathCategory");
-                if (xpathCategoryObject == null || ! (xpathCategoryObject instanceof String)) {
-                        throw new JSONStructureException("XPathExpression must contain URI (string) XPathCategory");
-                }
+    /*
+     * USED ONLY IN CONVERTING File/String/InputStream JSON TEXT INTO INTERNAL RESPONSE OBJECT
+     * Map of Data Type Identifiers used to map shorthand notation for DataTypes into the full Identifer.
+     * This is loaded the first time a Request is processed.
+     * Loading is done using Reflection.
+     * The map contains keys for both the short form and the long form of each DataType.  For example both of the following are in the table:
+     * 		http://www.w3.org/2001/XMLSchema#base64Binary = http://www.w3.org/2001/XMLSchema#base64Binary
+     * 										 base64Binary = http://www.w3.org/2001/XMLSchema#base64Binary
+     *
+     * (Note difference in structure and usage from JSONResponse.)
+     */
+    private static Map<String, Identifier> shorthandMap = null;
 
-                Identifier xpathCategoryIdentifier = new IdentifierImpl(xpathCategoryObject.toString());
 
-                
-                // optional Namespaces
-                Object namespacesObject = xpathExpressionMap.remove("Namespaces");
-                StringNamespaceContext namespaceContext = null;
-                if (namespacesObject != null) {
-                        if ( ! (namespacesObject instanceof List)) {
-                                throw new JSONStructureException("Namespaces must be list");
-                        }
-                        List<?> namespacesList = (List<?>)namespacesObject;
-                        
-                        namespaceContext = new StringNamespaceContext();
-                        // get all Namespace elements and add to context
-                        for (Object namespaceObject : namespacesList) {
-                                if ( ! (namespaceObject instanceof Map)) {
-                                        throw new JSONStructureException("Namespaces array items must be object");
-                                }
-                                Map<?,?> namespaceMap = (Map<?,?>)namespaceObject;
-                                
-                                // mandatory Namespace
-                                Object namespaceURI = namespaceMap.remove("Namespace");
-                                if (namespaceURI == null) {
-                                        throw new JSONStructureException("Namespace array item must contain Namespace member");
-                                }
-                                
-                                // optional Prefix
-                                Object prefixObject = namespaceMap.remove("Prefix");
-                                String prefix = null;
-                                if (prefixObject != null) {
-                                        prefix = prefixObject.toString();
-                                }
-                                
-                                checkUnknown("Namespace", namespaceMap);
-                                
-                                try {
-                                        if (prefix == null) {
-                                                namespaceContext.add(namespaceURI.toString());
-                                        } else {
-                                                namespaceContext.add(prefix, namespaceURI.toString());
-                                        }
-                                } catch (Exception e) {
-                                        throw new JSONStructureException("Namespace array item error: " + e.getMessage());
-                                }
-                        }			
-                }
-                
-                checkUnknown("XPathExpression", xpathExpressionMap);
-                
-                // create XPathExpression
-                XPathExpressionWrapper wrapper = new XPathExpressionWrapper(namespaceContext, xpathObject.toString());
+    /*
+     * To check the individual data attributes for being the correct type, we need an instance of the DataTypeFactory
+     */
+    private static DataTypeFactory dataTypeFactory = null;
 
-                
-                // create and return AttributeValue
-                AttributeValue<XPathExpressionWrapper> attributeValue;
+
+
+    protected JSONResponse() {
+    }
+
+
+
+    //
+    // HELPER METHODS
+    //
+
+
+    /**
+     * Use reflection to load the map with all the names of all DataTypes
+     * allowing us to output the shorthand version rather than the full Identifier name. (to shorten the JSON output).
+     * The shorthand map is used differently in JSONRequest than in JSONResponse, so there are similarities and differences in the implementation.
+     * This is done once the first time a Request is processed.
+     */
+    private static void initOutputShorthandMap() throws JSONStructureException {
+        Field[] declaredFields	= XACML3.class.getDeclaredFields();
+        outputShorthandMap = new HashMap<String, String>();
+        for (Field field : declaredFields) {
+            if (Modifier.isStatic(field.getModifiers()) &&
+                    field.getName().startsWith("ID_DATATYPE") &&
+                    Modifier.isPublic(field.getModifiers())
+               ) {
                 try {
-                        attributeValue = DataTypes.DT_XPATHEXPRESSION.createAttributeValue(wrapper, xpathCategoryIdentifier);
-                } catch (DataTypeException e) {
-                        throw new JSONStructureException("Namespaces unable to create AttributeValue; reason: "+ e.getMessage());
-                }
-                
-                return attributeValue;
-
-        }
-        
-        
-        /**
-         * Parse Obligations or AssociatedAdvice and put them into the Result.
-         * This code combines Obligations and AssociatedAdvice because the operations are identical except for the final steps.
-         * 
-         * @param listObject
-         * @param stdMutableResult
-         * @param isObligation
-         * @throws JSONStructureException
-         */
-        private static void parseObligationsOrAdvice(Object listObject, StdMutableResult stdMutableResult, boolean isObligation) throws JSONStructureException {
-                String oaTypeName = (isObligation) ? "Obligations" : "AssociatedAdvice";
-                
-                if ( ! (listObject instanceof List)) {
-                        throw new JSONStructureException( oaTypeName + " must be list");
-                }
-                List<?> oaList = (List<?>) listObject;
-                
-                // for each element in list
-                for (Object oa : oaList) {
-
-                        if ( ! (oa instanceof Map)) {
-                                throw new JSONStructureException(oaTypeName + " array items must all be objects");
-                        }
-                        Map<?,?> oaMap = (Map<?,?>)oa;
-                        
-                        // get mandatory id
-                        Object idObject = oaMap.remove("Id");
-                        if (idObject == null) {
-                                throw new JSONStructureException(oaTypeName + " array item must have Id");
-                        }
-                        Identifier oaId = new IdentifierImpl(idObject.toString());
-                        
-                        // get optional list of AttributeAssignment
-                        Object aaListObject = oaMap.remove("AttributeAssignment");
-                        List<AttributeAssignment> attributeAssignmentList = new ArrayList<AttributeAssignment>();
-                        if (aaListObject != null) {
-                                if ( ! (aaListObject instanceof List)) {
-                                        throw new JSONStructureException("AttributeAssignment must be list in " + oaTypeName);
-                                }
-                                List<?> attributeAssignmentMapList = (List<?>)aaListObject;
-                                
-                                // list should contain instances of Maps which translate into AttributeAssignments
-                                for (Object aaMapObject : attributeAssignmentMapList) {
-                                        if (aaMapObject == null || ! (aaMapObject instanceof Map)) {
-                                                throw new JSONStructureException("AttributeAssignment list item must be non-null object in " + oaTypeName);
-                                        }
-                                        Map<?,?> aaMap = (Map<?,?>)aaMapObject;
-                                        StdMutableAttributeAssignment stdMutableAttributeAssignment = new StdMutableAttributeAssignment();
-                                        
-                                        // mandatory Id
-                                        Object aaIdObject = aaMap.remove("AttributeId");
-                                        if (aaIdObject == null) {
-                                                throw new JSONStructureException("AttributeAssignment list item missing AttributeId in " + oaTypeName);
-                                        }
-                                        stdMutableAttributeAssignment.setAttributeId(new IdentifierImpl(aaIdObject.toString()));
-                                        
-                                        // optional Category
-                                        Object categoryObject = aaMap.remove("Category");
-                                        if (categoryObject != null) {
-                                                stdMutableAttributeAssignment.setCategory(new IdentifierImpl(categoryObject.toString()));
-                                        }
-
-                                        // get the optional DataType so we know what to do with the mandatory value
-                                        Object dataTypeObject = aaMap.remove("DataType");
-                                        Identifier dataTypeId = null;
-                                        if (dataTypeObject != null) {
-                                                dataTypeId = shorthandMap.get(dataTypeObject.toString());
-                                                // if there was a DataType given it must be a real one
-                                                if (dataTypeId == null) {
-                                                        throw new JSONStructureException("AttributeAssignment list item has unknown DataType='" + dataTypeObject.toString() + "' in " +oaTypeName);
-                                                }
-                                        } else {
-                                                // if DataType not given, use String
-                                                dataTypeId = DataTypes.DT_STRING.getId();
-                                        }
-                                        
-                                        // mandatory Value
-                                        Object valueObject = aaMap.remove("Value");
-                                        if (valueObject == null) {
-                                                throw new JSONStructureException("AttributeAssignment list item missing Value in " + oaTypeName);
-                                        }
-                                        AttributeValue<?> attributeValue = null;
-                                        try {
-                                                DataType<?> dataType = new StdDataTypeFactory().getDataType(dataTypeId);						
-                                                if (dataType == DataTypes.DT_XPATHEXPRESSION) {
-                                                        attributeValue = convertMapToXPathExpression(valueObject);
-                                                        
-                                                } else {
-                                                        // everything other than XPathExpressions are simple values that the DataTypes know how to handle
-                                                        attributeValue = dataType.createAttributeValue(valueObject);
-                                                }	
-                                                
-                                        } catch (DataTypeException e) {
-                                                throw new JSONStructureException("AttributeAssignment list item Value='" + valueObject.toString() + "' not of type '" + dataTypeId + "' in " + oaTypeName);
-                                        }
-                                        stdMutableAttributeAssignment.setAttributeValue(attributeValue);
-                                        
-
-                                        
-                                        // optional Issuer
-                                        Object issuerObject = aaMap.remove("Issuer");
-                                        if (issuerObject != null) {
-                                                stdMutableAttributeAssignment.setIssuer(issuerObject.toString());
-                                        }
-                                        
-                                        checkUnknown("AttributeAssignment in " + oaTypeName, aaMap);
-                                        
-                                        // add to attributeAssignmentList
-                                        attributeAssignmentList.add(stdMutableAttributeAssignment);
-                                }
-                                
-                        }
-                        
-                        checkUnknown(oaTypeName + " array item", oaMap);
-                        
-                        if (isObligation) {
-                                Obligation obligation = new StdObligation(oaId, attributeAssignmentList);
-                                stdMutableResult.addObligation(obligation);
+                    Identifier id = (Identifier)field.get(null);
+                    String longName = id.stringValue();
+                    // most names start with 'http://www.w3.org/2001/XMLSchema#'
+                    int sharpIndex = longName.lastIndexOf("#");
+                    if (sharpIndex <= 0) {
+                        // some names start with 'urn:oasis:names:tc:xacml:1.0:data-type:'
+                        // or urn:oasis:names:tc:xacml:2.0:data-type:
+                        if (longName.contains(":data-type:")) {
+                            sharpIndex = longName.lastIndexOf(":");
                         } else {
-                                Advice advice = new StdAdvice(oaId, attributeAssignmentList);
-                                stdMutableResult.addAdvice(advice);
+                            continue;
                         }
-                
-                }
-                
-        }
-        
-        
-        /**
-         * When reading a JSON string to create a Result object, parse the PolicyIdReference and PolicySetIdReference texts.
-         * 
-         * @param policyIdReferenceObject
-         * @param stdMutableResult
-         * @param isSet
-         */
-        private static void parseIdReferences(Object policyIdReferenceObject, StdMutableResult stdMutableResult, boolean isSet) throws JSONStructureException {
-                String idTypeName = (isSet) ? "PolicySetIdReference" : "PolicyIdReference";
-                
-                if ( ! (policyIdReferenceObject instanceof List)) {
-                        throw new JSONStructureException(idTypeName + " must be array");
-                }
-                List<?> policyIdReferenceList = (List<?>)policyIdReferenceObject;
-                for (Object idReferenceObject : policyIdReferenceList) {
-                        if (idReferenceObject == null || ! (idReferenceObject instanceof Map)) {
-                                throw new JSONStructureException(idTypeName + " array item must be non-null object");
-                        }
-                        Map<?,?> idReferenceMap = (Map<?,?>)idReferenceObject;
-                        
-                        // mandatory Id
-                        Object idReferenceIdObject = idReferenceMap.remove("Id");
-                        if (idReferenceIdObject == null) {
-                                throw new JSONStructureException(idTypeName + " array item must contain Id");
-                        }
-                        Identifier idReferenceId = new IdentifierImpl(idReferenceIdObject.toString());
-                        
-                        // optional Version
-                        StdVersion version = null;
-                        Object idReferenceVersionObject = idReferenceMap.remove("Version");
-                        if (idReferenceVersionObject != null) {
-                                try {
-                                        version = StdVersion.newInstance(idReferenceVersionObject.toString());
-                                } catch (ParseException e) {
-                                        throw new JSONStructureException(idTypeName + " array item Version: " + e.getMessage() );
-                                }
-                        }
-                        
-                        checkUnknown("IdReference in " + idTypeName, idReferenceMap);
-                        
-                        StdIdReference policyIdentifier = new StdIdReference(idReferenceId, version);
-                        
-                        // add to the appropriate list in the Result
-                        if (isSet) {
-                                stdMutableResult.addPolicySetIdentifier(policyIdentifier);
-
-                        } else {
-                                stdMutableResult.addPolicyIdentifier(policyIdentifier);
-                        }
-                }
-                
-        }
-        
-        
-        
-        
-        
-        
-        
-        //
-        // PRIMARY INTERFACE METHODS
-        //
-        
-        
-        
-        /**
-         * Parse and JSON string into a {@link com.att.research.xacml.api.Response} object.
-         * 
-         * @param jsonString
-         * @return
-         * @throws JSONStructureException
-         */
-        public static Response load(String jsonString) throws JSONStructureException {
-                Response response = null;
-                try (InputStream is = new ByteArrayInputStream(jsonString.getBytes("UTF-8"))) {
-                        response = JSONResponse.load(is);
-                } catch (Exception ex) {
-                        throw new JSONStructureException("Exception loading String Response: " + ex.getMessage(), ex);
-                }
-                return response;
-        }
-        
-        
-        /**
-         * Read a file containing an JSON representation of a Response and parse it into a {@link com.att.research.xacml.api.Response} Object.
-         * This is used only for testing since Responses in the normal environment are generated by the PDP code.
-         * 
-         * @param fileResponse
-         * @return
-         * @throws JSONStructureException
-         */
-        public static Response load(File fileResponse) throws JSONStructureException {
-                try {
-                        BufferedReader br = new BufferedReader(new FileReader(fileResponse));
-                        String responseString = "";
-                        String line;
-                        while ((line = br.readLine()) != null) {
-                                responseString += line;
-                        }
-                        br.close();
-                        return load(responseString);
+                    }
+                    String shortName = longName.substring(sharpIndex + 1);
+                    // put both the full name and the short name in the table
+                    outputShorthandMap.put(id.stringValue(), shortName);
                 } catch (Exception e) {
-                        throw new JSONStructureException(e);
+                    throw new JSONStructureException("Error loading ID Table, e="+e);
                 }
+            }
         }
-        
-        /**
-         * Loads from Java 7 nio Path object.
-         * 
-         * @param pathResponse
-         * @return
-         * @throws JSONStructureException
-         */
-        public static Response load(Path pathResponse) throws JSONStructureException {
-                try {
-                        return JSONResponse.load(Files.newInputStream(pathResponse));
-                } catch(Exception e) {
-                        throw new JSONStructureException(e);
-                }
-        }
-        
-        /**
-         * Read characters from the given <code>InputStream</code> and parse them into an XACML {@link com.att.research.xacml.api.Request} object.
-         * 
-         * @param is
-         * @return
-         * @throws JSONStructureException
-         */
-        public static Response load(InputStream is) throws JSONStructureException {
-                
-//TODO - ASSUME that order of members within an object does not matter (Different from XML, in JSON everything is handled as Maps so order does not matter)
-                
-                // ensure shorthand map is set up
-                if (shorthandMap == null) {
-                        initShorthandMap();
-                }
-                
-                // ensure that we have an instance of the DataTypeFactory for generating AttributeValues by DataType
-                if (dataTypeFactory == null) {
-                        try {
-                                dataTypeFactory = DataTypeFactory.newInstance();
-                                if (dataTypeFactory == null) {
-                                        throw new NullPointerException("No DataTypeFactory found");
-                                }
-                        } catch (FactoryException e) {
-                                throw new JSONStructureException("Unable to find DataTypeFactory, e="+e);
-                        }
-                }
-                
-                
-                
-                // create a new Response object to be filled in
-                StdMutableResponse stdMutableResponse = null;
-                
-                String json =  null;
-                ObjectMapper mapper = null;
-                try {
-                        
-                        // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file)
-                    java.util.Scanner scanner = new java.util.Scanner(is);
-                    scanner.useDelimiter("\\A");
-                    json =  scanner.hasNext() ? scanner.next() : "";
-                    scanner.close();
-                    
-                        mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
-                        
-//TODO -  ASSUME that any duplicated component is a bad thing (probably indicating an error in the incoming JSON)
-                        mapper.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
-                        
-                        Map<?,?> root = mapper.readValue(json, Map.class);
+    }
 
-                        //
-                        // Does the Response exist?
-                        //
-                        List<?> resultList = (List<?>) root.remove("Response");
-                        if (resultList == null) {
-                                throw new JSONStructureException("No \"Response\" property found.");
+
+    /**
+     * Use reflection to load the map with all the names of all DataTypes, both the long name and the shorthand,
+     * and point each name to the appropriate Identifier.
+     * The shorthand map is used differently in JSONRequest than in JSONResponse, so there are similarities and differences in the implementation.
+     * This is done once the first time a Request is processed.
+     */
+    private static void initShorthandMap() throws JSONStructureException {
+        Field[] declaredFields	= XACML3.class.getDeclaredFields();
+        shorthandMap = new HashMap<String, Identifier>();
+        for (Field field : declaredFields) {
+            if (Modifier.isStatic(field.getModifiers()) &&
+                    field.getName().startsWith("ID_DATATYPE") &&
+                    Modifier.isPublic(field.getModifiers())
+               ) {
+                try {
+                    Identifier id = (Identifier)field.get(null);
+                    String longName = id.stringValue();
+                    // most names start with 'http://www.w3.org/2001/XMLSchema#'
+                    int sharpIndex = longName.lastIndexOf("#");
+                    if (sharpIndex <= 0) {
+                        // some names start with 'urn:oasis:names:tc:xacml:1.0:data-type:'
+                        // or urn:oasis:names:tc:xacml:2.0:data-type:
+                        if (longName.contains(":data-type:")) {
+                            sharpIndex = longName.lastIndexOf(":");
+                        } else {
+                            continue;
                         }
-                        
-                        checkUnknown("Top-level message", root);
-                        
-                        stdMutableResponse = new StdMutableResponse();
-                        
-                        // handle each Result object
-                        for (int resultIndex = 0; resultIndex < resultList.size(); resultIndex++) {
-                                // each item should be a Map<?,?> containing a Result, otherwise it is an error
-                                Object resultObj = resultList.get(resultIndex);
-                                if (resultObj == null ||  ! (resultObj instanceof Map)) {
-                                        throw new JSONStructureException("Response contains null Result or list instead of Result object");
-                                }
-                                
-                                StdMutableResult stdMutableResult = new StdMutableResult();
-                                
-                                Map<?,?> resultMap = (Map<?,?>)resultObj;
-                                
-                                // Must have a Decision
-                                Object decisionObject = resultMap.remove("Decision");
-                                if (decisionObject == null) {
-                                        throw new JSONStructureException("Result must have Decision");
-                                }
-                                Decision decision = Decision.get(decisionObject.toString());
-                                if (decision == null) {
-                                        throw new JSONStructureException("Unknown value for Decision: '" + decisionObject.toString() + "'");
-                                }
-                                stdMutableResult.setDecision(decision);
-                                
-                                // may have Status
-                                Object statusObject = resultMap.remove("Status");
-                                if (statusObject != null) {
-                                        if ( ! (statusObject instanceof Map)) {
-                                                throw new JSONStructureException("Status must be an object, not type '" + statusObject.getClass().getName() + "'");
-                                        }
-                                        StdMutableStatus stdMutableStatus = new StdMutableStatus();
-                                        Map<?,?> statusMap = (Map<?,?>)statusObject;
-                                        
-                                        // optional message
-                                        Object messageObject = statusMap.remove("StatusMessage");
-                                        if (messageObject != null) {
-                                                stdMutableStatus.setStatusMessage(messageObject.toString());
-                                        }
-                                        
-                                        // optional detail
-                                        Object detailObject = statusMap.remove("StatusDetail");
-                                        if (detailObject != null) {
-                                                StdMutableStatusDetail statusDetail = new StdMutableStatusDetail();
+                    }
+                    String shortName = longName.substring(sharpIndex + 1);
+                    // put both the full name and the short name in the table
+                    shorthandMap.put(longName, id);
+                    shorthandMap.put(shortName, id);
+                } catch (Exception e) {
+                    throw new JSONStructureException("Error loading ID Table, e="+e);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Check the given map for all components having been removed (i.e. everything in the map was known and used).
+     * If anything remains, throw an exception based on the component and the keys left in the map
+     */
+    private static void checkUnknown(String component, Map<?,?> map) throws JSONStructureException {
+        if (map.size() == 0) {
+            return;
+        }
+
+        String keys = null;
+        Iterator<?> it = map.keySet().iterator();
+        while (it.hasNext()) {
+            if (keys == null) {
+                keys = "'" + it.next().toString() + "'";
+            } else {
+                keys += ", '" + it.next().toString() + "'";
+            }
+        }
+
+        String message = component + " contains unknown element" + ( (map.size() == 1) ? " " : "s ") + keys;
+        throw new JSONStructureException(message);
+    }
+
+
+    /**
+     * When parsing a JSON string into an object, recursively parse the StatusCode and any child StatusCodes
+     *
+     * @param statusCodeMap
+     * @return
+     * @throws JSONStructureException
+     */
+    private static StatusCode parseStatusCode(Map<?,?> statusCodeMap) throws JSONStructureException {
+
+        // get optional value
+        Object valueObject = statusCodeMap.remove("Value");
+        Identifier identifier = null;
+        if (valueObject != null) {
+            identifier = new IdentifierImpl(valueObject.toString());
+        }
+
+        // get optional child status code
+        Object childStatusCodeMap = statusCodeMap.remove("StatusCode");
+        StatusCode childStatusCode = null;
+        if (childStatusCodeMap != null) {
+            if ( ! (childStatusCodeMap instanceof Map)) {
+                throw new JSONStructureException("Child StatusCode must be object");
+            }
+            childStatusCode = parseStatusCode((Map<?,?>)childStatusCodeMap);
+        }
+
+        checkUnknown("StatusCode", statusCodeMap);
+
+        StdStatusCode statusCode = new StdStatusCode(identifier, childStatusCode);
+
+        return statusCode;
+    }
+
+
+    /**
+     * When reading a JSON string and converting to internal objects, this converts the parsed Map into an XPathExpression AttributeValue.
+     *
+     * @param mapObject
+     * @param categoryId
+     * @return
+     * @throws JSONStructureException
+     */
+    private static AttributeValue<?> convertMapToXPathExpression(Object mapObject) throws JSONStructureException {
+        if ( ! (mapObject instanceof Map)) {
+            throw new JSONStructureException("XPathExpression value must be complex object containing XPath, XPathCategory and optional Namespaces");
+
+        }
+        Map<?,?> xpathExpressionMap = (Map<?,?>)mapObject;
+
+        // get mandatory XPath
+        Object xpathObject = xpathExpressionMap.remove("XPath");
+        if (xpathObject == null || ! (xpathObject instanceof String)) {
+            throw new JSONStructureException("XPathExpression must contain string XPath");
+        }
+
+        // mandatory XPathCategory
+        Object xpathCategoryObject = xpathExpressionMap.remove("XPathCategory");
+        if (xpathCategoryObject == null || ! (xpathCategoryObject instanceof String)) {
+            throw new JSONStructureException("XPathExpression must contain URI (string) XPathCategory");
+        }
+
+        Identifier xpathCategoryIdentifier = new IdentifierImpl(xpathCategoryObject.toString());
+
+
+        // optional Namespaces
+        Object namespacesObject = xpathExpressionMap.remove("Namespaces");
+        StringNamespaceContext namespaceContext = null;
+        if (namespacesObject != null) {
+            if ( ! (namespacesObject instanceof List)) {
+                throw new JSONStructureException("Namespaces must be list");
+            }
+            List<?> namespacesList = (List<?>)namespacesObject;
+
+            namespaceContext = new StringNamespaceContext();
+            // get all Namespace elements and add to context
+            for (Object namespaceObject : namespacesList) {
+                if ( ! (namespaceObject instanceof Map)) {
+                    throw new JSONStructureException("Namespaces array items must be object");
+                }
+                Map<?,?> namespaceMap = (Map<?,?>)namespaceObject;
+
+                // mandatory Namespace
+                Object namespaceURI = namespaceMap.remove("Namespace");
+                if (namespaceURI == null) {
+                    throw new JSONStructureException("Namespace array item must contain Namespace member");
+                }
+
+                // optional Prefix
+                Object prefixObject = namespaceMap.remove("Prefix");
+                String prefix = null;
+                if (prefixObject != null) {
+                    prefix = prefixObject.toString();
+                }
+
+                checkUnknown("Namespace", namespaceMap);
+
+                try {
+                    if (prefix == null) {
+                        namespaceContext.add(namespaceURI.toString());
+                    } else {
+                        namespaceContext.add(prefix, namespaceURI.toString());
+                    }
+                } catch (Exception e) {
+                    throw new JSONStructureException("Namespace array item error: " + e.getMessage());
+                }
+            }
+        }
+
+        checkUnknown("XPathExpression", xpathExpressionMap);
+
+        // create XPathExpression
+        XPathExpressionWrapper wrapper = new XPathExpressionWrapper(namespaceContext, xpathObject.toString());
+
+
+        // create and return AttributeValue
+        AttributeValue<XPathExpressionWrapper> attributeValue;
+        try {
+            attributeValue = DataTypes.DT_XPATHEXPRESSION.createAttributeValue(wrapper, xpathCategoryIdentifier);
+        } catch (DataTypeException e) {
+            throw new JSONStructureException("Namespaces unable to create AttributeValue; reason: "+ e.getMessage());
+        }
+
+        return attributeValue;
+
+    }
+
+
+    /**
+     * Parse Obligations or AssociatedAdvice and put them into the Result.
+     * This code combines Obligations and AssociatedAdvice because the operations are identical except for the final steps.
+     *
+     * @param listObject
+     * @param stdMutableResult
+     * @param isObligation
+     * @throws JSONStructureException
+     */
+    private static void parseObligationsOrAdvice(Object listObject, StdMutableResult stdMutableResult, boolean isObligation) throws JSONStructureException {
+        String oaTypeName = (isObligation) ? "Obligations" : "AssociatedAdvice";
+
+        if ( ! (listObject instanceof List)) {
+            throw new JSONStructureException( oaTypeName + " must be list");
+        }
+        List<?> oaList = (List<?>) listObject;
+
+        // for each element in list
+        for (Object oa : oaList) {
+
+            if ( ! (oa instanceof Map)) {
+                throw new JSONStructureException(oaTypeName + " array items must all be objects");
+            }
+            Map<?,?> oaMap = (Map<?,?>)oa;
+
+            // get mandatory id
+            Object idObject = oaMap.remove("Id");
+            if (idObject == null) {
+                throw new JSONStructureException(oaTypeName + " array item must have Id");
+            }
+            Identifier oaId = new IdentifierImpl(idObject.toString());
+
+            // get optional list of AttributeAssignment
+            Object aaListObject = oaMap.remove("AttributeAssignment");
+            List<AttributeAssignment> attributeAssignmentList = new ArrayList<AttributeAssignment>();
+            if (aaListObject != null) {
+                if ( ! (aaListObject instanceof List)) {
+                    throw new JSONStructureException("AttributeAssignment must be list in " + oaTypeName);
+                }
+                List<?> attributeAssignmentMapList = (List<?>)aaListObject;
+
+                // list should contain instances of Maps which translate into AttributeAssignments
+                for (Object aaMapObject : attributeAssignmentMapList) {
+                    if (aaMapObject == null || ! (aaMapObject instanceof Map)) {
+                        throw new JSONStructureException("AttributeAssignment list item must be non-null object in " + oaTypeName);
+                    }
+                    Map<?,?> aaMap = (Map<?,?>)aaMapObject;
+                    StdMutableAttributeAssignment stdMutableAttributeAssignment = new StdMutableAttributeAssignment();
+
+                    // mandatory Id
+                    Object aaIdObject = aaMap.remove("AttributeId");
+                    if (aaIdObject == null) {
+                        throw new JSONStructureException("AttributeAssignment list item missing AttributeId in " + oaTypeName);
+                    }
+                    stdMutableAttributeAssignment.setAttributeId(new IdentifierImpl(aaIdObject.toString()));
+
+                    // optional Category
+                    Object categoryObject = aaMap.remove("Category");
+                    if (categoryObject != null) {
+                        stdMutableAttributeAssignment.setCategory(new IdentifierImpl(categoryObject.toString()));
+                    }
+
+                    // get the optional DataType so we know what to do with the mandatory value
+                    Object dataTypeObject = aaMap.remove("DataType");
+                    Identifier dataTypeId = null;
+                    if (dataTypeObject != null) {
+                        dataTypeId = shorthandMap.get(dataTypeObject.toString());
+                        // if there was a DataType given it must be a real one
+                        if (dataTypeId == null) {
+                            throw new JSONStructureException("AttributeAssignment list item has unknown DataType='" + dataTypeObject.toString() + "' in " +oaTypeName);
+                        }
+                    } else {
+                        // if DataType not given, use String
+                        dataTypeId = DataTypes.DT_STRING.getId();
+                    }
+
+                    // mandatory Value
+                    Object valueObject = aaMap.remove("Value");
+                    if (valueObject == null) {
+                        throw new JSONStructureException("AttributeAssignment list item missing Value in " + oaTypeName);
+                    }
+                    AttributeValue<?> attributeValue = null;
+                    try {
+                        DataType<?> dataType = new StdDataTypeFactory().getDataType(dataTypeId);
+                        if (dataType == DataTypes.DT_XPATHEXPRESSION) {
+                            attributeValue = convertMapToXPathExpression(valueObject);
+
+                        } else {
+                            // everything other than XPathExpressions are simple values that the DataTypes know how to handle
+                            attributeValue = dataType.createAttributeValue(valueObject);
+                        }
+
+                    } catch (DataTypeException e) {
+                        throw new JSONStructureException("AttributeAssignment list item Value='" + valueObject.toString() + "' not of type '" + dataTypeId + "' in " + oaTypeName);
+                    }
+                    stdMutableAttributeAssignment.setAttributeValue(attributeValue);
+
+
+
+                    // optional Issuer
+                    Object issuerObject = aaMap.remove("Issuer");
+                    if (issuerObject != null) {
+                        stdMutableAttributeAssignment.setIssuer(issuerObject.toString());
+                    }
+
+                    checkUnknown("AttributeAssignment in " + oaTypeName, aaMap);
+
+                    // add to attributeAssignmentList
+                    attributeAssignmentList.add(stdMutableAttributeAssignment);
+                }
+
+            }
+
+            checkUnknown(oaTypeName + " array item", oaMap);
+
+            if (isObligation) {
+                Obligation obligation = new StdObligation(oaId, attributeAssignmentList);
+                stdMutableResult.addObligation(obligation);
+            } else {
+                Advice advice = new StdAdvice(oaId, attributeAssignmentList);
+                stdMutableResult.addAdvice(advice);
+            }
+
+        }
+
+    }
+
+
+    /**
+     * When reading a JSON string to create a Result object, parse the PolicyIdReference and PolicySetIdReference texts.
+     *
+     * @param policyIdReferenceObject
+     * @param stdMutableResult
+     * @param isSet
+     */
+    private static void parseIdReferences(Object policyIdReferenceObject, StdMutableResult stdMutableResult, boolean isSet) throws JSONStructureException {
+        String idTypeName = (isSet) ? "PolicySetIdReference" : "PolicyIdReference";
+
+        if ( ! (policyIdReferenceObject instanceof List)) {
+            throw new JSONStructureException(idTypeName + " must be array");
+        }
+        List<?> policyIdReferenceList = (List<?>)policyIdReferenceObject;
+        for (Object idReferenceObject : policyIdReferenceList) {
+            if (idReferenceObject == null || ! (idReferenceObject instanceof Map)) {
+                throw new JSONStructureException(idTypeName + " array item must be non-null object");
+            }
+            Map<?,?> idReferenceMap = (Map<?,?>)idReferenceObject;
+
+            // mandatory Id
+            Object idReferenceIdObject = idReferenceMap.remove("Id");
+            if (idReferenceIdObject == null) {
+                throw new JSONStructureException(idTypeName + " array item must contain Id");
+            }
+            Identifier idReferenceId = new IdentifierImpl(idReferenceIdObject.toString());
+
+            // optional Version
+            StdVersion version = null;
+            Object idReferenceVersionObject = idReferenceMap.remove("Version");
+            if (idReferenceVersionObject != null) {
+                try {
+                    version = StdVersion.newInstance(idReferenceVersionObject.toString());
+                } catch (ParseException e) {
+                    throw new JSONStructureException(idTypeName + " array item Version: " + e.getMessage() );
+                }
+            }
+
+            checkUnknown("IdReference in " + idTypeName, idReferenceMap);
+
+            StdIdReference policyIdentifier = new StdIdReference(idReferenceId, version);
+
+            // add to the appropriate list in the Result
+            if (isSet) {
+                stdMutableResult.addPolicySetIdentifier(policyIdentifier);
+
+            } else {
+                stdMutableResult.addPolicyIdentifier(policyIdentifier);
+            }
+        }
+
+    }
+
+
+
+
+
+
+
+    //
+    // PRIMARY INTERFACE METHODS
+    //
+
+
+
+    /**
+     * Parse and JSON string into a {@link com.att.research.xacml.api.Response} object.
+     *
+     * @param jsonString
+     * @return
+     * @throws JSONStructureException
+     */
+    public static Response load(String jsonString) throws JSONStructureException {
+        Response response = null;
+        try (InputStream is = new ByteArrayInputStream(jsonString.getBytes("UTF-8"))) {
+            response = JSONResponse.load(is);
+        } catch (Exception ex) {
+            throw new JSONStructureException("Exception loading String Response: " + ex.getMessage(), ex);
+        }
+        return response;
+    }
+
+
+    /**
+     * Read a file containing an JSON representation of a Response and parse it into a {@link com.att.research.xacml.api.Response} Object.
+     * This is used only for testing since Responses in the normal environment are generated by the PDP code.
+     *
+     * @param fileResponse
+     * @return
+     * @throws JSONStructureException
+     */
+    public static Response load(File fileResponse) throws JSONStructureException {
+        try {
+            BufferedReader br = new BufferedReader(new FileReader(fileResponse));
+            String responseString = "";
+            String line;
+            while ((line = br.readLine()) != null) {
+                responseString += line;
+            }
+            br.close();
+            return load(responseString);
+        } catch (Exception e) {
+            throw new JSONStructureException(e);
+        }
+    }
+
+    /**
+     * Loads from Java 7 nio Path object.
+     *
+     * @param pathResponse
+     * @return
+     * @throws JSONStructureException
+     */
+    public static Response load(Path pathResponse) throws JSONStructureException {
+        try {
+            return JSONResponse.load(Files.newInputStream(pathResponse));
+        } catch(Exception e) {
+            throw new JSONStructureException(e);
+        }
+    }
+
+    /**
+     * Read characters from the given <code>InputStream</code> and parse them into an XACML {@link com.att.research.xacml.api.Request} object.
+     *
+     * @param is
+     * @return
+     * @throws JSONStructureException
+     */
+    public static Response load(InputStream is) throws JSONStructureException {
+
+//TODO - ASSUME that order of members within an object does not matter (Different from XML, in JSON everything is handled as Maps so order does not matter)
+
+        // ensure shorthand map is set up
+        if (shorthandMap == null) {
+            initShorthandMap();
+        }
+
+        // ensure that we have an instance of the DataTypeFactory for generating AttributeValues by DataType
+        if (dataTypeFactory == null) {
+            try {
+                dataTypeFactory = DataTypeFactory.newInstance();
+                if (dataTypeFactory == null) {
+                    throw new NullPointerException("No DataTypeFactory found");
+                }
+            } catch (FactoryException e) {
+                throw new JSONStructureException("Unable to find DataTypeFactory, e="+e);
+            }
+        }
+
+
+
+        // create a new Response object to be filled in
+        StdMutableResponse stdMutableResponse = null;
+
+        String json =  null;
+        ObjectMapper mapper = null;
+        try {
+
+            // read the inputStream into a buffer (trick found online scans entire input looking for end-of-file)
+            java.util.Scanner scanner = new java.util.Scanner(is);
+            scanner.useDelimiter("\\A");
+            json =  scanner.hasNext() ? scanner.next() : "";
+            scanner.close();
+
+            mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
+
+//TODO -  ASSUME that any duplicated component is a bad thing (probably indicating an error in the incoming JSON)
+            mapper.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
+
+            Map<?,?> root = mapper.readValue(json, Map.class);
+
+            //
+            // Does the Response exist?
+            //
+            List<?> resultList = (List<?>) root.remove("Response");
+            if (resultList == null) {
+                throw new JSONStructureException("No \"Response\" property found.");
+            }
+
+            checkUnknown("Top-level message", root);
+
+            stdMutableResponse = new StdMutableResponse();
+
+            // handle each Result object
+            for (int resultIndex = 0; resultIndex < resultList.size(); resultIndex++) {
+                // each item should be a Map<?,?> containing a Result, otherwise it is an error
+                Object resultObj = resultList.get(resultIndex);
+                if (resultObj == null ||  ! (resultObj instanceof Map)) {
+                    throw new JSONStructureException("Response contains null Result or list instead of Result object");
+                }
+
+                StdMutableResult stdMutableResult = new StdMutableResult();
+
+                Map<?,?> resultMap = (Map<?,?>)resultObj;
+
+                // Must have a Decision
+                Object decisionObject = resultMap.remove("Decision");
+                if (decisionObject == null) {
+                    throw new JSONStructureException("Result must have Decision");
+                }
+                Decision decision = Decision.get(decisionObject.toString());
+                if (decision == null) {
+                    throw new JSONStructureException("Unknown value for Decision: '" + decisionObject.toString() + "'");
+                }
+                stdMutableResult.setDecision(decision);
+
+                // may have Status
+                Object statusObject = resultMap.remove("Status");
+                if (statusObject != null) {
+                    if ( ! (statusObject instanceof Map)) {
+                        throw new JSONStructureException("Status must be an object, not type '" + statusObject.getClass().getName() + "'");
+                    }
+                    StdMutableStatus stdMutableStatus = new StdMutableStatus();
+                    Map<?,?> statusMap = (Map<?,?>)statusObject;
+
+                    // optional message
+                    Object messageObject = statusMap.remove("StatusMessage");
+                    if (messageObject != null) {
+                        stdMutableStatus.setStatusMessage(messageObject.toString());
+                    }
+
+                    // optional detail
+                    Object detailObject = statusMap.remove("StatusDetail");
+                    if (detailObject != null) {
+                        StdMutableStatusDetail statusDetail = new StdMutableStatusDetail();
 //TODO - PROBLEM: The JSON spec says only that the status Detail is raw XML rather than a JSON object.  Therefore we cannot discriminate what is inside the string we just got.
 //TODO			Fortunately there is only one thing it can be: a MissingAttributeDetail.
 //TODO			Unfortunately the MissingAttributeDetail contains multiple optional elements including 0 or more values, which makes it non-trivial to parse the XML representation.
 //TODO			Unfortunately the JSON spec does not say how the XML is formatted (with/without whitespace, etc).
-                                                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-                                            dbf.setNamespaceAware(true);
-                                                DocumentBuilder db;
-                                                try {
-                                                        db = dbf.newDocumentBuilder();
-                                                } catch (ParserConfigurationException e1) {
-                                                        throw new JSONStructureException("Content unable to setup Parser Configuration");
-                                                }
-                                                //
-                                                // Parse the content
-                                                //
-                                                Document doc = null;
+                        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+                        dbf.setNamespaceAware(true);
+                        DocumentBuilder db;
+                        try {
+                            db = dbf.newDocumentBuilder();
+                        } catch (ParserConfigurationException e1) {
+                            throw new JSONStructureException("Content unable to setup Parser Configuration");
+                        }
+                        //
+                        // Parse the content
+                        //
+                        Document doc = null;
 
-                                        //
-                                        // First of all, the String is possible escaped.
-                                                //
-                                                // The meaning of "escaped" is defined in section 4.2.3.1 in the JSON spec
-                                        //
-                                                String unescapedContent = detailObject.toString().replace("\\\"", "\"");
-                                                unescapedContent = unescapedContent.replace("\\\\", "\\");
-                                                
-                                                // need to add a root element so that the MissingAttributeDetail elements are findable
-                                                unescapedContent = "<ROOT>" + unescapedContent + "</ROOT>";
+                        //
+                        // First of all, the String is possible escaped.
+                        //
+                        // The meaning of "escaped" is defined in section 4.2.3.1 in the JSON spec
+                        //
+                        String unescapedContent = detailObject.toString().replace("\\\"", "\"");
+                        unescapedContent = unescapedContent.replace("\\\\", "\\");
+
+                        // need to add a root element so that the MissingAttributeDetail elements are findable
+                        unescapedContent = "<ROOT>" + unescapedContent + "</ROOT>";
 
 //				    	logger.info("Escaped content: \n" + unescapedContent);
-                                        try (InputStream bis = new ByteArrayInputStream(unescapedContent.getBytes("UTF-8"))){
-                                                doc = db.parse(bis);
-                                        } catch (Exception ex) {
-                                                throw new JSONStructureException("Unable to parse Content '" + detailObject.toString() + "'");
-                                        }
+                        try (InputStream bis = new ByteArrayInputStream(unescapedContent.getBytes("UTF-8"))) {
+                            doc = db.parse(bis);
+                        } catch (Exception ex) {
+                            throw new JSONStructureException("Unable to parse Content '" + detailObject.toString() + "'");
+                        }
 
 
-                                        //ASSUME that this can only be an array of MissingAttributeDetail.  Example:
-                                        // <MissingAttributeDetail
-                                        //			Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"
-                                        //			AttributeId="urn:att:xacml:resource:application:motsid"
-                                        //			DataType="http://www.w3.org/2001/XMLSchema#integer">
-                                        //      <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">56</AttributeValue>
-                                        // </MissingAttributeDetail>"
-                                        Element docElement = doc.getDocumentElement();
-                                        NodeList missingAttributeDetailList = docElement.getElementsByTagName("MissingAttributeDetail");
-                                        for (int madNodeIndex = 0; madNodeIndex < missingAttributeDetailList.getLength(); madNodeIndex++) {
-                                                Node madNode = missingAttributeDetailList.item(madNodeIndex);
-                                                StdMutableMissingAttributeDetail mutableMAD = new StdMutableMissingAttributeDetail();
-                                                
-                                                NamedNodeMap attributeMap = madNode.getAttributes();
-                                                Node attributeNode = attributeMap.getNamedItem("AttributeId");
-                                                if (attributeNode == null) {
-                                                        throw new JSONStructureException("MissingAttributeDetail missing AttributeId");
-                                                }
-                                                mutableMAD.setAttributeId(new IdentifierImpl(attributeNode.getNodeValue()));
-                                                Node categoryNode = attributeMap.getNamedItem("Category");
-                                                if (categoryNode == null) {
-                                                        throw new JSONStructureException("MissingAttributeDetail missing Category");
-                                                }
-                                                mutableMAD.setCategory(new IdentifierImpl(categoryNode.getNodeValue()));
-                                                Node dataTypeNode = attributeMap.getNamedItem("DataType");
-                                                if (dataTypeNode == null) {
-                                                        throw new JSONStructureException("MissingAttributeDetail missing DataType");
-                                                }
-                                                mutableMAD.setDataTypeId(new IdentifierImpl(dataTypeNode.getNodeValue()));
-                                                Node issuerNode = attributeMap.getNamedItem("Issuer");
-                                                if (issuerNode != null) {
-                                                        mutableMAD.setIssuer(issuerNode.getNodeValue());
-                                                }
-                                                
-                                                // get any value elements
-                                                NodeList childNodeList = madNode.getChildNodes();
-                                                for (int childIndex = 0; childIndex < childNodeList.getLength(); childIndex++) {
-                                                        Node childNode = childNodeList.item(childIndex);
-                                                        if ( ! childNode.getNodeName().equals("AttributeValue")) {
-                                                                continue;
-                                                        }
-                                                        Node childDataTypeNode = childNode.getAttributes().getNamedItem("DataType");
-                                                        if (childDataTypeNode == null) {
-                                                                throw new JSONStructureException("MissingAttributeDetail contains AttributeValue '" + childNode.getNodeValue() + "' with no DataType");
-                                                        }
-                                                        String dataType = childDataTypeNode.getNodeValue();
-                                                        // this probably is not a shorthand, but look it up anyway.  The full Ids are in the table too.
-                                                        Identifier valueDataTypeId = shorthandMap.get(dataType);
-                                                        if (valueDataTypeId == null) {
-                                                                throw new JSONStructureException("MissingAttibuteDetail contains AttributeValue with unknown DataType="+dataType);
-                                                        }
-                                                        // if Id is known then it is reasonable to do the following without checking
-                                                        DataType<?> valueDataType = dataTypeFactory.getDataType(valueDataTypeId);
-                                                        AttributeValue<?> attributeValue;
-                                                        try {
-                                                                // for some reason the value may be the value of a child of this node rather than the value of this node itself.
-                                                                Node valueNode = childNode;
-                                                                if (valueNode.hasChildNodes()) {
-                                                                        valueNode = valueNode.getFirstChild();
-                                                                }
-                                                                        attributeValue = valueDataType.createAttributeValue(valueNode.getNodeValue());
-                                                                } catch (Exception ex) {
-                                                                        throw new JSONStructureException("Unable to create AttributeValue from MissingAttributeDetail AttributeValue '" + childNode.getNodeValue() +
-                                                                                        "', error was: " + ex.getMessage());
-                                                                }
-                                                        mutableMAD.addAttributeValue(attributeValue);
-                                                }
+                        //ASSUME that this can only be an array of MissingAttributeDetail.  Example:
+                        // <MissingAttributeDetail
+                        //			Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"
+                        //			AttributeId="urn:att:xacml:resource:application:motsid"
+                        //			DataType="http://www.w3.org/2001/XMLSchema#integer">
+                        //      <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">56</AttributeValue>
+                        // </MissingAttributeDetail>"
+                        Element docElement = doc.getDocumentElement();
+                        NodeList missingAttributeDetailList = docElement.getElementsByTagName("MissingAttributeDetail");
+                        for (int madNodeIndex = 0; madNodeIndex < missingAttributeDetailList.getLength(); madNodeIndex++) {
+                            Node madNode = missingAttributeDetailList.item(madNodeIndex);
+                            StdMutableMissingAttributeDetail mutableMAD = new StdMutableMissingAttributeDetail();
 
+                            NamedNodeMap attributeMap = madNode.getAttributes();
+                            Node attributeNode = attributeMap.getNamedItem("AttributeId");
+                            if (attributeNode == null) {
+                                throw new JSONStructureException("MissingAttributeDetail missing AttributeId");
+                            }
+                            mutableMAD.setAttributeId(new IdentifierImpl(attributeNode.getNodeValue()));
+                            Node categoryNode = attributeMap.getNamedItem("Category");
+                            if (categoryNode == null) {
+                                throw new JSONStructureException("MissingAttributeDetail missing Category");
+                            }
+                            mutableMAD.setCategory(new IdentifierImpl(categoryNode.getNodeValue()));
+                            Node dataTypeNode = attributeMap.getNamedItem("DataType");
+                            if (dataTypeNode == null) {
+                                throw new JSONStructureException("MissingAttributeDetail missing DataType");
+                            }
+                            mutableMAD.setDataTypeId(new IdentifierImpl(dataTypeNode.getNodeValue()));
+                            Node issuerNode = attributeMap.getNamedItem("Issuer");
+                            if (issuerNode != null) {
+                                mutableMAD.setIssuer(issuerNode.getNodeValue());
+                            }
 
-                                                statusDetail.addMissingAttributeDetail(mutableMAD);
-                                        }
-                                        
-                                        stdMutableStatus.setStatusDetail(statusDetail);
-                                        }
-                                        
-                                        // optional StatusCode which may contain recursive child StatusCode
-                                        Object statusCodeObject = statusMap.remove("StatusCode");
-                                        if (statusCodeObject != null) {
-                                                if ( ! (statusCodeObject instanceof Map)) {
-                                                        throw new JSONStructureException("StatusCode must be object");
-                                                }
-                                                StatusCode statusCode = parseStatusCode((Map<?,?>)statusCodeObject);
-                                                stdMutableStatus.setStatusCode(statusCode);
-                                        }
-                                                        
-                                        checkUnknown("Status", statusMap);
-                                        
-                                        stdMutableResult.setStatus(stdMutableStatus);
+                            // get any value elements
+                            NodeList childNodeList = madNode.getChildNodes();
+                            for (int childIndex = 0; childIndex < childNodeList.getLength(); childIndex++) {
+                                Node childNode = childNodeList.item(childIndex);
+                                if ( ! childNode.getNodeName().equals("AttributeValue")) {
+                                    continue;
                                 }
-                                
-                                // may have Obligations
-                                Object obligationsObject = resultMap.remove("Obligations");
-                                if (obligationsObject != null) {
-                                        parseObligationsOrAdvice(obligationsObject, stdMutableResult, true);
+                                Node childDataTypeNode = childNode.getAttributes().getNamedItem("DataType");
+                                if (childDataTypeNode == null) {
+                                    throw new JSONStructureException("MissingAttributeDetail contains AttributeValue '" + childNode.getNodeValue() + "' with no DataType");
                                 }
-                                
-                                // may have Advice
-                                Object adviceObject = resultMap.remove("AssociatedAdvice");
-                                if (adviceObject != null) {
-                                        parseObligationsOrAdvice(adviceObject, stdMutableResult, false);
+                                String dataType = childDataTypeNode.getNodeValue();
+                                // this probably is not a shorthand, but look it up anyway.  The full Ids are in the table too.
+                                Identifier valueDataTypeId = shorthandMap.get(dataType);
+                                if (valueDataTypeId == null) {
+                                    throw new JSONStructureException("MissingAttibuteDetail contains AttributeValue with unknown DataType="+dataType);
                                 }
-                                
-                                // may have Category (a.k.a Attributes)
+                                // if Id is known then it is reasonable to do the following without checking
+                                DataType<?> valueDataType = dataTypeFactory.getDataType(valueDataTypeId);
+                                AttributeValue<?> attributeValue;
+                                try {
+                                    // for some reason the value may be the value of a child of this node rather than the value of this node itself.
+                                    Node valueNode = childNode;
+                                    if (valueNode.hasChildNodes()) {
+                                        valueNode = valueNode.getFirstChild();
+                                    }
+                                    attributeValue = valueDataType.createAttributeValue(valueNode.getNodeValue());
+                                } catch (Exception ex) {
+                                    throw new JSONStructureException("Unable to create AttributeValue from MissingAttributeDetail AttributeValue '" + childNode.getNodeValue() +
+                                                                     "', error was: " + ex.getMessage());
+                                }
+                                mutableMAD.addAttributeValue(attributeValue);
+                            }
+
+
+                            statusDetail.addMissingAttributeDetail(mutableMAD);
+                        }
+
+                        stdMutableStatus.setStatusDetail(statusDetail);
+                    }
+
+                    // optional StatusCode which may contain recursive child StatusCode
+                    Object statusCodeObject = statusMap.remove("StatusCode");
+                    if (statusCodeObject != null) {
+                        if ( ! (statusCodeObject instanceof Map)) {
+                            throw new JSONStructureException("StatusCode must be object");
+                        }
+                        StatusCode statusCode = parseStatusCode((Map<?,?>)statusCodeObject);
+                        stdMutableStatus.setStatusCode(statusCode);
+                    }
+
+                    checkUnknown("Status", statusMap);
+
+                    stdMutableResult.setStatus(stdMutableStatus);
+                }
+
+                // may have Obligations
+                Object obligationsObject = resultMap.remove("Obligations");
+                if (obligationsObject != null) {
+                    parseObligationsOrAdvice(obligationsObject, stdMutableResult, true);
+                }
+
+                // may have Advice
+                Object adviceObject = resultMap.remove("AssociatedAdvice");
+                if (adviceObject != null) {
+                    parseObligationsOrAdvice(adviceObject, stdMutableResult, false);
+                }
+
+                // may have Category (a.k.a Attributes)
 //TODO - POSSIBLE NAME CHANGE - XML core calls this "Attributes", but name in JSON standard is questionable.
 //TODO 		The variables here are named "Attributes" because that is the internal name in our objects (based on the Core spec).
-                                Object attributesObject = resultMap.remove("Category");
-                                if (attributesObject != null) {
-                                        if ( ! (attributesObject instanceof List)) {
-                                                throw new JSONStructureException("Category must be list");
-                                        }
-                                        List<?> attributesList = (List<?>)attributesObject;
-                                        
-                                        for (Object categoryObject : attributesList) {
-                                                if (categoryObject == null || ! (categoryObject instanceof Map)) {
-                                                        throw new JSONStructureException("Category array item must be object");
-                                                }
-                                                Map<?,?> categoryMap = (Map<?,?>)categoryObject;
-                                                StdMutableAttributeCategory stdMutableAttributeCategory = new StdMutableAttributeCategory();
-                                                
-                                                // mandatory CategoryId
-                                                Object categoryIdObject = categoryMap.remove("CategoryId");
-                                                if (categoryIdObject == null) {
-                                                        throw new JSONStructureException("Category array item must contain CategoryId");
-                                                }
-                                                Identifier categoryId = new IdentifierImpl(categoryIdObject.toString());
-                                                
-                                                stdMutableAttributeCategory.setCategory(categoryId);
-                                                
-                                                // optional Attributes
-                                                Object attributeListObject = categoryMap.remove("Attribute");
-                                                if (attributeListObject != null) {
-                                                        if ( ! (attributeListObject instanceof List)) {
-                                                                throw new JSONStructureException("Category memeber Attribute must be list");
-                                                        }
-                                                        List<?> attributeList = (List<?>)attributeListObject;
-                                                        // get each attribute and add to category
-                                                        for (Object attributeMapObject : attributeList) {
-                                                                if (attributeMapObject == null || ! (attributeMapObject instanceof Map)) {
-                                                                        throw new JSONStructureException("Category member Attribute list item must be object");
-                                                                }
-                                                                Map<?,?> attributeMap = (Map<?,?>)attributeMapObject;
-                                                                
-                                                                StdMutableAttribute stdMutableAttribute = new StdMutableAttribute();
-                                                                
-                                                                // optional IncludeInResult
+                Object attributesObject = resultMap.remove("Category");
+                if (attributesObject != null) {
+                    if ( ! (attributesObject instanceof List)) {
+                        throw new JSONStructureException("Category must be list");
+                    }
+                    List<?> attributesList = (List<?>)attributesObject;
+
+                    for (Object categoryObject : attributesList) {
+                        if (categoryObject == null || ! (categoryObject instanceof Map)) {
+                            throw new JSONStructureException("Category array item must be object");
+                        }
+                        Map<?,?> categoryMap = (Map<?,?>)categoryObject;
+                        StdMutableAttributeCategory stdMutableAttributeCategory = new StdMutableAttributeCategory();
+
+                        // mandatory CategoryId
+                        Object categoryIdObject = categoryMap.remove("CategoryId");
+                        if (categoryIdObject == null) {
+                            throw new JSONStructureException("Category array item must contain CategoryId");
+                        }
+                        Identifier categoryId = new IdentifierImpl(categoryIdObject.toString());
+
+                        stdMutableAttributeCategory.setCategory(categoryId);
+
+                        // optional Attributes
+                        Object attributeListObject = categoryMap.remove("Attribute");
+                        if (attributeListObject != null) {
+                            if ( ! (attributeListObject instanceof List)) {
+                                throw new JSONStructureException("Category memeber Attribute must be list");
+                            }
+                            List<?> attributeList = (List<?>)attributeListObject;
+                            // get each attribute and add to category
+                            for (Object attributeMapObject : attributeList) {
+                                if (attributeMapObject == null || ! (attributeMapObject instanceof Map)) {
+                                    throw new JSONStructureException("Category member Attribute list item must be object");
+                                }
+                                Map<?,?> attributeMap = (Map<?,?>)attributeMapObject;
+
+                                StdMutableAttribute stdMutableAttribute = new StdMutableAttribute();
+
+                                // optional IncludeInResult
 //TODO - Odd situation!!: We are reading a string representing a Result which includes Attributes.
 //TODO		In this case, what does it mean if "IncludeInResult=false"?
 //TODO		The Attribute is obviously included in this Result because it is in the file/string we are reading.
 //TODO		Our choice: Always include the Attribute.  If the IncludeInResult is included in the input, set it's value in the object as directed.
 //TODO		This may cause mismatches between a Result read in and a new text generated from the internal Result object.
-                                                                Object includeInResultObject = attributeMap.remove("IncludeInResult");
-                                                                // the fact that the attribute is in the input means this should be true
-                                                                stdMutableAttribute.setIncludeInResults(true);
-                                                                if (includeInResultObject != null) {
-                                                                        // need to check the value in the input
-                                                                        try {
-                                                                                boolean include = DataTypes.DT_BOOLEAN.convert(includeInResultObject).booleanValue();
-                                                                                // set the value in the object exactly as directed, whether it makes sense or not
-                                                                                stdMutableAttribute.setIncludeInResults(include);
-                                                                        } catch (DataTypeException e) {
-                                                                                throw new JSONStructureException("Category member Attribute list item has IncludeInResult value '" + includeInResultObject.toString() +
-                                                                                                "' which is not boolean");
-                                                                        }
-                                                                }
+                                Object includeInResultObject = attributeMap.remove("IncludeInResult");
+                                // the fact that the attribute is in the input means this should be true
+                                stdMutableAttribute.setIncludeInResults(true);
+                                if (includeInResultObject != null) {
+                                    // need to check the value in the input
+                                    try {
+                                        boolean include = DataTypes.DT_BOOLEAN.convert(includeInResultObject).booleanValue();
+                                        // set the value in the object exactly as directed, whether it makes sense or not
+                                        stdMutableAttribute.setIncludeInResults(include);
+                                    } catch (DataTypeException e) {
+                                        throw new JSONStructureException("Category member Attribute list item has IncludeInResult value '" + includeInResultObject.toString() +
+                                                                         "' which is not boolean");
+                                    }
+                                }
 
-                                                                // category is not part of Attribute in spec - it is used internally to link attribute to Category
-                                                                stdMutableAttribute.setCategory(categoryId);
-                                                                
-                                                                // mandatory Id
-                                                                Object aaIdObject = attributeMap.remove("AttributeId");
-                                                                if (aaIdObject == null) {
-                                                                        throw new JSONStructureException("Category member Attribute list item missing AttributeId");
-                                                                }
-                                                                stdMutableAttribute.setAttributeId(new IdentifierImpl(aaIdObject.toString()));
-                                                                
-                                                                // get the optional DataType so we know what to do with the mandatory value
-                                                                Object dataTypeObject = attributeMap.remove("DataType");
-                                                                Identifier dataTypeId = null;
-                                                                if (dataTypeObject != null) {
-                                                                        dataTypeId = shorthandMap.get(dataTypeObject.toString());
-                                                                        // if there was a DataType given it must be a real one
-                                                                        if (dataTypeId == null) {
-                                                                                throw new JSONStructureException("Category member Attribute list item has unknown DataType='" + dataTypeObject.toString() + "'");
-                                                                        }
-                                                                } else {
-                                                                        // if DataType not given, use String
-                                                                        dataTypeId = DataTypes.DT_STRING.getId();
-                                                                }
-                                                                
-                                                                // mandatory Value
-                                                                Object valueObject = attributeMap.remove("Value");
-                                                                if (valueObject == null) {
-                                                                        throw new JSONStructureException("Category member Attribute list item missing Value");
-                                                                }
-                                                                AttributeValue<?> attributeValue = null;
-                                                                try {
-                                                                        DataType<?> dataType = new StdDataTypeFactory().getDataType(dataTypeId);
-                                                                        if (dataType == DataTypes.DT_XPATHEXPRESSION) {
-                                                                                // XPAthExpressions are complex data types that need special translation from the JSON form to the internal form
-                                                                                attributeValue = convertMapToXPathExpression(valueObject);
-                                                                                
-                                                                        } else {
-                                                                                // everything other than XPathExpressions are simple values that the DataTypes know how to handle
-                                                                                attributeValue = dataType.createAttributeValue(valueObject);
-                                                                        }
-                                                                } catch (DataTypeException e) {
-                                                                        throw new JSONStructureException("Category member Attribute list item Value='" + valueObject.toString() + "' not of type '" + dataTypeId + "'");
-                                                                }
-                                                                stdMutableAttribute.addValue(attributeValue);
-                                                        
-                                                                
-                                                                // optional Issuer
-                                                                Object issuerObject = attributeMap.remove("Issuer");
-                                                                if (issuerObject != null) {
-                                                                        stdMutableAttribute.setIssuer(issuerObject.toString());
-                                                                }
-                                                                
-                                                                checkUnknown("Category Attribute list item", attributeMap);
-                                                                stdMutableAttributeCategory.add(stdMutableAttribute);
-                                                        }
-                                                }
-                                        
-                                                checkUnknown("Category", categoryMap);
-                                                
-                                                // if none of the attributes are returned, do not return the category either
-                                                if (stdMutableAttributeCategory.getAttributes().size() > 0) {
-                                                        stdMutableResult.addAttributeCategory(stdMutableAttributeCategory);
-                                                }
-                                        }
+                                // category is not part of Attribute in spec - it is used internally to link attribute to Category
+                                stdMutableAttribute.setCategory(categoryId);
+
+                                // mandatory Id
+                                Object aaIdObject = attributeMap.remove("AttributeId");
+                                if (aaIdObject == null) {
+                                    throw new JSONStructureException("Category member Attribute list item missing AttributeId");
                                 }
-                                
-                                // may have PolicyIdentifierList
-                                Object policyIdObject = resultMap.remove("PolicyIdentifier");
-                                if (policyIdObject != null) {							
-                                        if ( ! (policyIdObject instanceof Map)) {
-                                                throw new JSONStructureException("PolicyIdentifier must be object");
-                                        }
-                                        Map<?,?> policyIdMap = (Map<?,?>)policyIdObject;
-                                        
-                                        // optional PolicyIdReference list
-                                        Object policyIdReferenceObject = policyIdMap.remove("PolicyIdReference");
-                                        if (policyIdReferenceObject != null) {
-                                                parseIdReferences(policyIdReferenceObject, stdMutableResult, false);
-                                        }
-                                        
-                                        // optional PolicySetIdReferenceList
-                                        Object policySetIdReferenceObject = policyIdMap.remove("PolicySetIdReference");
-                                        if (policySetIdReferenceObject != null) {
-                                                parseIdReferences(policySetIdReferenceObject, stdMutableResult, true);
-                                        }
-                                        
-                                        checkUnknown("PolicyIdentifier", policyIdMap);
-                                        
+                                stdMutableAttribute.setAttributeId(new IdentifierImpl(aaIdObject.toString()));
+
+                                // get the optional DataType so we know what to do with the mandatory value
+                                Object dataTypeObject = attributeMap.remove("DataType");
+                                Identifier dataTypeId = null;
+                                if (dataTypeObject != null) {
+                                    dataTypeId = shorthandMap.get(dataTypeObject.toString());
+                                    // if there was a DataType given it must be a real one
+                                    if (dataTypeId == null) {
+                                        throw new JSONStructureException("Category member Attribute list item has unknown DataType='" + dataTypeObject.toString() + "'");
+                                    }
+                                } else {
+                                    // if DataType not given, use String
+                                    dataTypeId = DataTypes.DT_STRING.getId();
                                 }
-                                
-                                checkUnknown("Result", resultMap);
-                                
-                                
-                                // add this result to the Response
-                                stdMutableResponse.add(stdMutableResult);
-                                
+
+                                // mandatory Value
+                                Object valueObject = attributeMap.remove("Value");
+                                if (valueObject == null) {
+                                    throw new JSONStructureException("Category member Attribute list item missing Value");
+                                }
+                                AttributeValue<?> attributeValue = null;
+                                try {
+                                    DataType<?> dataType = new StdDataTypeFactory().getDataType(dataTypeId);
+                                    if (dataType == DataTypes.DT_XPATHEXPRESSION) {
+                                        // XPAthExpressions are complex data types that need special translation from the JSON form to the internal form
+                                        attributeValue = convertMapToXPathExpression(valueObject);
+
+                                    } else {
+                                        // everything other than XPathExpressions are simple values that the DataTypes know how to handle
+                                        attributeValue = dataType.createAttributeValue(valueObject);
+                                    }
+                                } catch (DataTypeException e) {
+                                    throw new JSONStructureException("Category member Attribute list item Value='" + valueObject.toString() + "' not of type '" + dataTypeId + "'");
+                                }
+                                stdMutableAttribute.addValue(attributeValue);
+
+
+                                // optional Issuer
+                                Object issuerObject = attributeMap.remove("Issuer");
+                                if (issuerObject != null) {
+                                    stdMutableAttribute.setIssuer(issuerObject.toString());
+                                }
+
+                                checkUnknown("Category Attribute list item", attributeMap);
+                                stdMutableAttributeCategory.add(stdMutableAttribute);
+                            }
                         }
-                
-                        
-                        return stdMutableResponse;
 
-                } catch (JsonParseException e) {
-                        throw new JSONStructureException("Unable to parse JSON '" + json + "', exception: " + e, e);
-                } catch (JsonMappingException e) {
-                        throw new JSONStructureException("Unable to map JSON '" + json + "', exception: " + e, e);
-                } catch (IOException e) {
-                        throw new JSONStructureException("Unable to read JSON input, exception: " + e, e);
+                        checkUnknown("Category", categoryMap);
+
+                        // if none of the attributes are returned, do not return the category either
+                        if (stdMutableAttributeCategory.getAttributes().size() > 0) {
+                            stdMutableResult.addAttributeCategory(stdMutableAttributeCategory);
+                        }
+                    }
                 }
-                        
-                        
-                
-                // all done
+
+                // may have PolicyIdentifierList
+                Object policyIdObject = resultMap.remove("PolicyIdentifier");
+                if (policyIdObject != null) {
+                    if ( ! (policyIdObject instanceof Map)) {
+                        throw new JSONStructureException("PolicyIdentifier must be object");
+                    }
+                    Map<?,?> policyIdMap = (Map<?,?>)policyIdObject;
+
+                    // optional PolicyIdReference list
+                    Object policyIdReferenceObject = policyIdMap.remove("PolicyIdReference");
+                    if (policyIdReferenceObject != null) {
+                        parseIdReferences(policyIdReferenceObject, stdMutableResult, false);
+                    }
+
+                    // optional PolicySetIdReferenceList
+                    Object policySetIdReferenceObject = policyIdMap.remove("PolicySetIdReference");
+                    if (policySetIdReferenceObject != null) {
+                        parseIdReferences(policySetIdReferenceObject, stdMutableResult, true);
+                    }
+
+                    checkUnknown("PolicyIdentifier", policyIdMap);
+
+                }
+
+                checkUnknown("Result", resultMap);
+
+
+                // add this result to the Response
+                stdMutableResponse.add(stdMutableResult);
+
+            }
+
+
+            return stdMutableResponse;
+
+        } catch (JsonParseException e) {
+            throw new JSONStructureException("Unable to parse JSON '" + json + "', exception: " + e, e);
+        } catch (JsonMappingException e) {
+            throw new JSONStructureException("Unable to map JSON '" + json + "', exception: " + e, e);
+        } catch (IOException e) {
+            throw new JSONStructureException("Unable to read JSON input, exception: " + e, e);
+        }
+
+
+
+        // all done
 //		return new StdRequest(stdMutableRequest);
-        
+
 //		throw new JSONStructureException("JSONResponse load string and load from file not implemented");
-        }
-        
-        
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Response} into an JSON string with pretty-printing.
-         * This is used only for debugging.
-         * 
-         * @param response
-         * @return
-         * @throws Exception 
-         */
-        public static String toString(Response response) throws Exception {
-                return toString(response, true);
-        }
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Response} into an JSON string, pretty-printing is optional.
-         * This is used only for debugging.
-         * 
-         * @param response
-         * @param prettyPrint
-         * @return
-         * @throws Exception 
-         */
-        public static String toString(Response response, boolean prettyPrint) throws Exception {
-                String outputString = null;
-                ByteArrayOutputStream os = null;
-                try {
-                        os = new ByteArrayOutputStream();
-                        JSONResponse.convert(response, os, prettyPrint);
-                        outputString = new String( os.toByteArray(), "UTF-8");
-                } catch (Exception ex) {
-                        throw ex;
-                } finally {
-                        try {
-                                if (os != null) {
-                                        os.close();
-                                }
-                        } catch(Exception idontcare) {				
-                        }
+    }
+
+
+
+    /**
+     * Convert the {@link com.att.research.xacml.api.Response} into an JSON string with pretty-printing.
+     * This is used only for debugging.
+     *
+     * @param response
+     * @return
+     * @throws Exception
+     */
+    public static String toString(Response response) throws Exception {
+        return toString(response, true);
+    }
+
+    /**
+     * Convert the {@link com.att.research.xacml.api.Response} into an JSON string, pretty-printing is optional.
+     * This is used only for debugging.
+     *
+     * @param response
+     * @param prettyPrint
+     * @return
+     * @throws Exception
+     */
+    public static String toString(Response response, boolean prettyPrint) throws Exception {
+        String outputString = null;
+        ByteArrayOutputStream os = null;
+        try {
+            os = new ByteArrayOutputStream();
+            JSONResponse.convert(response, os, prettyPrint);
+            outputString = new String( os.toByteArray(), "UTF-8");
+        } catch (Exception ex) {
+            throw ex;
+        } finally {
+            try {
+                if (os != null) {
+                    os.close();
                 }
-                return outputString;
+            } catch(Exception idontcare) {
+            }
         }
-        
-        /**
-         * Convert the {@link com.att.research.xacml.api.Response} object into a string suitable for output in an HTTPResponse.
-         * This method generates the output without any pretty-printing.
-         * This is the method normally called by the Web Service for generating the output to the PEP through the RESTful interface.
-         * 
-         * IMPORTANT: This method does NOT close the outputStream.  It is the responsibility of the caller to (who opened the stream) to close it.
-         * 
-         * @param response
-         * @param outputStream
-         * @throws java.io.IOException
-         * @throws JSONStructureException 
-         */
-        public static void convert(Response response, OutputStream outputStream) throws IOException, JSONStructureException {
-                convert(response, outputStream, false);
-        }
-        
-        /**
-         * Do the work of converting the {@link com.att.research.xacml.api.Response} object to a string, allowing for pretty-printing if desired.
-         * 
-         * IMPORTANT: This method does NOT close the outputStream.  It is the responsibility of the caller to (who opened the stream) to close it.
-         * 
-         * @param response
-         * @param outputStream
-         * @param prettyPrint
-         * @throws java.io.IOException
-         * #throws JSONStructureException
-         */
-        public static void convert(Response response, OutputStream outputStream, boolean prettyPrint) throws IOException, JSONStructureException {
-                
+        return outputString;
+    }
+
+    /**
+     * Convert the {@link com.att.research.xacml.api.Response} object into a string suitable for output in an HTTPResponse.
+     * This method generates the output without any pretty-printing.
+     * This is the method normally called by the Web Service for generating the output to the PEP through the RESTful interface.
+     *
+     * IMPORTANT: This method does NOT close the outputStream.  It is the responsibility of the caller to (who opened the stream) to close it.
+     *
+     * @param response
+     * @param outputStream
+     * @throws java.io.IOException
+     * @throws JSONStructureException
+     */
+    public static void convert(Response response, OutputStream outputStream) throws IOException, JSONStructureException {
+        convert(response, outputStream, false);
+    }
+
+    /**
+     * Do the work of converting the {@link com.att.research.xacml.api.Response} object to a string, allowing for pretty-printing if desired.
+     *
+     * IMPORTANT: This method does NOT close the outputStream.  It is the responsibility of the caller to (who opened the stream) to close it.
+     *
+     * @param response
+     * @param outputStream
+     * @param prettyPrint
+     * @throws java.io.IOException
+     * #throws JSONStructureException
+     */
+    public static void convert(Response response, OutputStream outputStream, boolean prettyPrint) throws IOException, JSONStructureException {
+
 //TODO - ASSUME that order of members within an object does not matter (Different from XML, in JSON everything is handled as Maps so order does not matter)
 
 //TODO - ASSUME that the spec will fix inconsistency between AttributeId and Id (both are mentioned); for now use "AttributeId" as it is clearer.
-                
-                
-                // ensure shorthand map is set up
-                if (outputShorthandMap == null) {
-                        initOutputShorthandMap();
-                }
-        
-                
-                if (response == null) {
-                        throw new JSONStructureException("No Request in convert");
-                }
-                
-                if (response.getResults() == null || response.getResults().size() == 0) {
-                        // must be at least one result
-                        throw new JSONStructureException("No Result in Response");
-                }
 
-                String json = null;
-                ArrayList<Map<String, Object>> responses = new ArrayList<Map<String, Object>>();
-                
-                //
-                // Process each Result object
-                //
-                                
+
+        // ensure shorthand map is set up
+        if (outputShorthandMap == null) {
+            initOutputShorthandMap();
+        }
+
+
+        if (response == null) {
+            throw new JSONStructureException("No Request in convert");
+        }
+
+        if (response.getResults() == null || response.getResults().size() == 0) {
+            // must be at least one result
+            throw new JSONStructureException("No Result in Response");
+        }
+
+        String json = null;
+        ArrayList<Map<String, Object>> responses = new ArrayList<Map<String, Object>>();
+
+        //
+        // Process each Result object
+        //
+
         Iterator<Result> iter = response.getResults().iterator();
         while (iter.hasNext()) {
-                Result result = iter.next();
-                Map<String, Object> responseTree = new HashMap<String, Object> ();
-                if (result.getDecision() == null) {
-                        throw new JSONStructureException("No Decision in Result");
+            Result result = iter.next();
+            Map<String, Object> responseTree = new HashMap<String, Object> ();
+            if (result.getDecision() == null) {
+                throw new JSONStructureException("No Decision in Result");
+            }
+            responseTree.put("Decision", result.getDecision().toString());
+
+            if (result.getStatus() != null) {
+                // if the StatusCode object as a whole is missing it defaults to OK, but if it exists it must have an actual code value
+                if (result.getStatus().getStatusCode() == null) {
+                    throw new JSONStructureException("No Identifier given in StatusCode");
                 }
-                responseTree.put("Decision", result.getDecision().toString());
+                Identifier statusCodeId = result.getStatus().getStatusCode().getStatusCodeValue();
 
-                if (result.getStatus() != null) {
-                        // if the StatusCode object as a whole is missing it defaults to OK, but if it exists it must have an actual code value
-                        if (result.getStatus().getStatusCode() == null) {
-                                throw new JSONStructureException("No Identifier given in StatusCode");
-                        }
-                        Identifier statusCodeId = result.getStatus().getStatusCode().getStatusCodeValue();
+                // if there is a status code, it must agree with the decision
+                // Permit/Deny/NotAllowed must all be OK
+                // Indeterminate must not be OK
+                if ( (statusCodeId.equals(StdStatusCode.STATUS_CODE_OK.getStatusCodeValue())  &&
+                        ! (result.getDecision() == Decision.DENY || result.getDecision() == Decision.PERMIT || result.getDecision() == Decision.NOTAPPLICABLE))  ||
+                        ( ! statusCodeId.equals(StdStatusCode.STATUS_CODE_OK.getStatusCodeValue())  &&
+                          ! (result.getDecision() == Decision.INDETERMINATE || result.getDecision() == Decision.INDETERMINATE_DENY ||
+                             result.getDecision() == Decision.INDETERMINATE_DENYPERMIT || result.getDecision() == Decision.INDETERMINATE_PERMIT ))  ) {
+                    throw new JSONStructureException("StatusCode '" + statusCodeId.stringValue() + "' does not match Decision '" + result.getDecision().toString());
+                }
 
-                        // if there is a status code, it must agree with the decision
-                        // Permit/Deny/NotAllowed must all be OK
-                        // Indeterminate must not be OK
-                        if ( (statusCodeId.equals(StdStatusCode.STATUS_CODE_OK.getStatusCodeValue())  &&
-                                        ! (result.getDecision() == Decision.DENY || result.getDecision() == Decision.PERMIT || result.getDecision() == Decision.NOTAPPLICABLE))  ||
-                                ( ! statusCodeId.equals(StdStatusCode.STATUS_CODE_OK.getStatusCodeValue())  &&
-                                                ! (result.getDecision() == Decision.INDETERMINATE || result.getDecision() == Decision.INDETERMINATE_DENY || 
-                                                        result.getDecision() == Decision.INDETERMINATE_DENYPERMIT || result.getDecision() == Decision.INDETERMINATE_PERMIT ))  )
-                                        {
-                                throw new JSONStructureException("StatusCode '" + statusCodeId.stringValue() + "' does not match Decision '" + result.getDecision().toString());
+
+                //
+                // Create the status
+                //
+                Map<String, Object> statusTree = new HashMap<String, Object>();
+                Map<String, Object> statusValue = new HashMap<String, Object>();
+                statusValue.put("Value", statusCodeId.stringValue());
+                addChildStatusCodes(result.getStatus().getStatusCode(), statusValue);
+                statusTree.put("StatusCode", statusValue);
+                String message = result.getStatus().getStatusMessage();
+                if (message != null) {
+                    statusTree.put("StatusMessage", message);
+                }
+
+                /*
+                 * StatusDetail - special information
+                 * The XACML 3.0 core spec says that the StatusDetail field depends on the StatusCode:
+                 * 		StatusCode == missing-attribute  => may have StatusDetail which is a list of MissingAttributeDetail structures
+                 * 		StatusCode == anything else  => no StatusDetail allowed
+                 * This greatly simplifies handling the StatusDetail because the MissingAttributeDetail structure is well-defined.
+                 * Thus the statement in the specs (both core and RESTful/JSON) that this can contain arbitrary XML is not correct.
+                 */
+                if (result.getStatus().getStatusDetail() != null) {
+
+                    String statusDetailXMLString = "";
+
+                    // cross-check that rules defined in XACML Core spec section 5.5.7 re: when StatusDetail may/may-not be included have been followed
+                    if (result.getStatus().isOk()) {
+                        throw new JSONStructureException("Status '" + result.getStatus().getStatusCode().toString() + "' must not return StatusDetail");
+                    } else if (result.getStatus().getStatusCode().equals(XACML3.ID_STATUS_MISSING_ATTRIBUTE) &&
+                               result.getStatus().getStatusDetail().getMissingAttributeDetails() == null) {
+                        throw new JSONStructureException("Status '" + result.getStatus().getStatusCode().toString() + "' has StatusDetail without MissingAttributeDetail");
+                    } else if (result.getStatus().getStatusCode().equals(XACML3.ID_STATUS_SYNTAX_ERROR))  {
+                        throw new JSONStructureException("Status '" + result.getStatus().getStatusCode().toString() + "' must not return StatusDetail");
+                    } else if (result.getStatus().getStatusCode().equals(XACML3.ID_STATUS_PROCESSING_ERROR))  {
+                        throw new JSONStructureException("Status '" + result.getStatus().getStatusCode().toString() + "' must not return StatusDetail");
+                    }
+
+                    // if included, StatusDetail is handled differently for each type of detail message and the contents are formatted into escaped XML rather than objects
+
+                    if (result.getStatus().getStatusDetail().getMissingAttributeDetails() != null) {
+                        if ( ! statusCodeId.equals(XACML3.ID_STATUS_MISSING_ATTRIBUTE)) {
+                            throw new JSONStructureException("MissingAttributeDetails can only be included when StatusCode is MISSING_ATTRIBUTES, not '" + statusCodeId.stringValue());
                         }
-                        
-                        
-                        //
-                        // Create the status
-                        //
-                        Map<String, Object> statusTree = new HashMap<String, Object>();
-                        Map<String, Object> statusValue = new HashMap<String, Object>();
-                        statusValue.put("Value", statusCodeId.stringValue());
-                        addChildStatusCodes(result.getStatus().getStatusCode(), statusValue);
-                        statusTree.put("StatusCode", statusValue);
-                        String message = result.getStatus().getStatusMessage();
-                        if (message != null) {
-                                statusTree.put("StatusMessage", message);
-                        }
-        
-                        /*
-                         * StatusDetail - special information
-                         * The XACML 3.0 core spec says that the StatusDetail field depends on the StatusCode:
-                         * 		StatusCode == missing-attribute  => may have StatusDetail which is a list of MissingAttributeDetail structures
-                         * 		StatusCode == anything else  => no StatusDetail allowed
-                         * This greatly simplifies handling the StatusDetail because the MissingAttributeDetail structure is well-defined.
-                         * Thus the statement in the specs (both core and RESTful/JSON) that this can contain arbitrary XML is not correct.
-                         */
-                        if (result.getStatus().getStatusDetail() != null) {
-                                
-                                String statusDetailXMLString = "";
-                                
-                                // cross-check that rules defined in XACML Core spec section 5.5.7 re: when StatusDetail may/may-not be included have been followed
-                                if (result.getStatus().isOk()) {
-                                        throw new JSONStructureException("Status '" + result.getStatus().getStatusCode().toString() + "' must not return StatusDetail");
-                                } else if (result.getStatus().getStatusCode().equals(XACML3.ID_STATUS_MISSING_ATTRIBUTE) && 
-                                                result.getStatus().getStatusDetail().getMissingAttributeDetails() == null) {
-                                        throw new JSONStructureException("Status '" + result.getStatus().getStatusCode().toString() + "' has StatusDetail without MissingAttributeDetail");
-                                } else if (result.getStatus().getStatusCode().equals(XACML3.ID_STATUS_SYNTAX_ERROR))  {
-                                        throw new JSONStructureException("Status '" + result.getStatus().getStatusCode().toString() + "' must not return StatusDetail");
-                                } else if (result.getStatus().getStatusCode().equals(XACML3.ID_STATUS_PROCESSING_ERROR))  {
-                                        throw new JSONStructureException("Status '" + result.getStatus().getStatusCode().toString() + "' must not return StatusDetail");
-                                }
-                                
-                                // if included, StatusDetail is handled differently for each type of detail message and the contents are formatted into escaped XML rather than objects
-                                
-                                if (result.getStatus().getStatusDetail().getMissingAttributeDetails() != null) {
-                                        if ( ! statusCodeId.equals(XACML3.ID_STATUS_MISSING_ATTRIBUTE)) {
-                                                throw new JSONStructureException("MissingAttributeDetails can only be included when StatusCode is MISSING_ATTRIBUTES, not '" + statusCodeId.stringValue());
-                                        }
-                                        // ASSUME that a list of length 0 should be treated as having no MissingAttributeDetails and ignored
-                                        if (result.getStatus().getStatusDetail().getMissingAttributeDetails().size() > 0) {
+                        // ASSUME that a list of length 0 should be treated as having no MissingAttributeDetails and ignored
+                        if (result.getStatus().getStatusDetail().getMissingAttributeDetails().size() > 0) {
 //TODO - ASSUME no newlines or indentation in XML - NOTE that white-space IS significant in XML
-                                                statusDetailXMLString = "";
-                                                
-                                                for (MissingAttributeDetail mad : result.getStatus().getStatusDetail().getMissingAttributeDetails()) {
-                                                        statusDetailXMLString += "<MissingAttributeDetail";
-                                                        
-                                                        if (mad.getCategory() == null || mad.getAttributeId() == null || mad.getDataTypeId() == null) {
-                                                                throw new JSONStructureException("MissingAttributeDetail must have Category, AttributeId and DataType");
-                                                        }
-                                                        statusDetailXMLString += " Category=\"" + mad.getCategory().stringValue() + "\"";
-                                                        statusDetailXMLString += " AttributeId=\"" + mad.getAttributeId().stringValue() + "\"";
+                            statusDetailXMLString = "";
+
+                            for (MissingAttributeDetail mad : result.getStatus().getStatusDetail().getMissingAttributeDetails()) {
+                                statusDetailXMLString += "<MissingAttributeDetail";
+
+                                if (mad.getCategory() == null || mad.getAttributeId() == null || mad.getDataTypeId() == null) {
+                                    throw new JSONStructureException("MissingAttributeDetail must have Category, AttributeId and DataType");
+                                }
+                                statusDetailXMLString += " Category=\"" + mad.getCategory().stringValue() + "\"";
+                                statusDetailXMLString += " AttributeId=\"" + mad.getAttributeId().stringValue() + "\"";
 //TODO - In this case we do NOT use the shorthand notation for the DataType because we are generating XML and it is not clear who should will be using it on client
-                                                        statusDetailXMLString += " DataType=\"" + mad.getDataTypeId().stringValue() + "\"";
-                                                        if (mad.getIssuer() != null) {
-                                                                statusDetailXMLString += " Issuer=\"" + mad.getIssuer() + "\"";
-                                                        }
-
-                                                        // done with attibutes
-                                                        statusDetailXMLString += ">";
-
-                                                        // Now get Values and add as child element nodes
-                                                        if (mad.getAttributeValues() != null && mad.getAttributeValues().size() > 0) {
-                                                                for (AttributeValue<?> av : mad.getAttributeValues()) {
-                                                                        statusDetailXMLString += "<AttributeValue";
-                                                                        statusDetailXMLString += " DataType=\""+av.getDataTypeId() + "\">";
-                                                                        statusDetailXMLString +=  jsonOutputObject(av.getValue(), av).toString() + "</AttributeValue>";
-                                                                }
-                                                        }
-
-                                                }
-                                                statusDetailXMLString += "</MissingAttributeDetail>";
-                                        }
-                                } else {
-                                        throw new JSONStructureException("Unhandled StatusDetail contents (statusDetail exists but is not MissingAttributeDetail)" );
+                                statusDetailXMLString += " DataType=\"" + mad.getDataTypeId().stringValue() + "\"";
+                                if (mad.getIssuer() != null) {
+                                    statusDetailXMLString += " Issuer=\"" + mad.getIssuer() + "\"";
                                 }
-                                
-                                if (statusDetailXMLString.length() > 0) {
-                                        // make sure all backslashes and double-quotes are escaped
-                                        // (will only exist in string values)
-                                        statusDetailXMLString = statusDetailXMLString.replace("\\", "\\\\");
-                                        statusDetailXMLString = statusDetailXMLString.replace("\"",  "\\\"");
-                                        statusTree.put("StatusDetail", statusDetailXMLString);
+
+                                // done with attibutes
+                                statusDetailXMLString += ">";
+
+                                // Now get Values and add as child element nodes
+                                if (mad.getAttributeValues() != null && mad.getAttributeValues().size() > 0) {
+                                    for (AttributeValue<?> av : mad.getAttributeValues()) {
+                                        statusDetailXMLString += "<AttributeValue";
+                                        statusDetailXMLString += " DataType=\""+av.getDataTypeId() + "\">";
+                                        statusDetailXMLString +=  jsonOutputObject(av.getValue(), av).toString() + "</AttributeValue>";
+                                    }
                                 }
-                                
+
+                            }
+                            statusDetailXMLString += "</MissingAttributeDetail>";
                         }
-        
-                        responseTree.put("Status", statusTree);
-                }
-                
-                //
-                // Obligations
-                //
-                if (result.getObligations() != null && result.getObligations().size() > 0) {
-                        Iterator<Obligation> iterObs = result.getObligations().iterator();
-                        List<Object> obligationCollectionList = new ArrayList<Object>();
-                        while (iterObs.hasNext()) {
-                                Obligation ob = iterObs.next();
-                                Map<String, Object> obligationTree = new HashMap<String, Object>();
-                                if (ob.getId() == null) {
-                                        throw new JSONStructureException("Obligation must have Id");
-                                }
-                                obligationTree.put("Id", ob.getId().stringValue());
-                                if (ob.getAttributeAssignments() != null && ob.getAttributeAssignments().size() > 0) {
-                                        Iterator<AttributeAssignment> iterSetObs = ob.getAttributeAssignments().iterator();
-                                        ArrayList<HashMap<String, Object>> attributes = new ArrayList<HashMap<String, Object>>();
-                                        while (iterSetObs.hasNext()) {
-                                                AttributeAssignment entity = iterSetObs.next();
-                                                HashMap<String, Object> entityTree = new HashMap<String, Object>();
-                                                if (entity.getAttributeId() == null) {
-                                                        throw new JSONStructureException("Obligation Attribute must have AttributeId");
-                                                }
-                                                entityTree.put("AttributeId", entity.getAttributeId().stringValue());
-                                                if (entity.getCategory() != null) {
-                                                        entityTree.put("Category", entity.getCategory().stringValue());
-                                                }
-                                                if (entity.getIssuer() != null) {
-                                                        entityTree.put("Issuer", entity.getIssuer());
-                                                }
-                                                AttributeValue<?> value = entity.getAttributeValue();
-                                                if (value == null || value.getValue() == null) {
-                                                        // Yes it can
-                                                        //throw new JSONStructureException("Obligation Attribute must have Value");
-                                                        entityTree.put("Value", new String(""));
-                                                } else {
-                                                        // we are "encouraged" to us Shorthand notation for DataType, but it is not required
-                                                        if (value.getDataTypeId() != null) {
-                                                                //
-                                                                // Don't use shorthand by default, for backwards compatibility
-                                                                // to our pep's.
-                                                                //
-                                                                entityTree.put("DataType", value.getDataTypeId().stringValue());
-                                                        }
-        
-                                                        // Internally the XPathCategory is in the AttributeValue object, but in the JSON format it is part of the Value (handled by jsonOutputObject() )
-                                                        // so do not handle it here
-        
-                                                        
-                                                        entityTree.put("Value", jsonOutputObject(value.getValue(), value));
-                                                }
-                                                attributes.add(entityTree);
-                                        }
-                                        obligationTree.put("AttributeAssignment", attributes);
-                                }
-                                obligationCollectionList.add(obligationTree);
-                        }
-                        responseTree.put("Obligations", obligationCollectionList);
-                }
-                
-                //
-                // Advice
-                //
-                if (result.getAssociatedAdvice() != null && result.getAssociatedAdvice().size() > 0) {
-                        Iterator<Advice> iterAAs = result.getAssociatedAdvice().iterator();
-                        List<Object> adviceCollectionList = new ArrayList<Object>();
-                        while (iterAAs.hasNext()) {
-                                Advice advice = iterAAs.next();
-                                Map<String, Object> adviceTree = new HashMap<String, Object>();
-                                if (advice.getId() == null) {
-                                        throw new JSONStructureException("Advice must have Id");
-                                }
-                                adviceTree.put("Id", advice.getId().stringValue());
-                                if (advice.getAttributeAssignments() != null && advice.getAttributeAssignments().size() > 0) {
-                                        Iterator<AttributeAssignment> iterSetObs = advice.getAttributeAssignments().iterator();
-                                        ArrayList<HashMap<String, Object>> attributes = new ArrayList<HashMap<String, Object>>();
-                                        while (iterSetObs.hasNext()) {
-                                                AttributeAssignment entity = iterSetObs.next();
-                                                HashMap<String, Object> entityTree = new HashMap<String, Object>();
-                                                if (entity.getAttributeId() == null) {
-                                                        throw new JSONStructureException("Advice Attribute must have AttributeId");
-                                                }
-                                                entityTree.put("AttributeId", entity.getAttributeId().stringValue());
-                                                if (entity.getCategory() != null) {
-                                                        entityTree.put("Category", entity.getCategory().stringValue());
-                                                }
-                                                if (entity.getIssuer() != null) {
-                                                        entityTree.put("Issuer", entity.getIssuer());
-                                                }
-                                                AttributeValue<?> value = entity.getAttributeValue();
-                                                if (value == null || value.getValue() == null) {
-                                                        // NO - it can have a null or empty string etc.
-                                                        //throw new JSONStructureException("Advice Attribute must have Value");
-                                                        entityTree.put("Value",  new String(""));
-                                                } else {
-                                                        // we are "encouraged" to us Shorthand notation for DataType, but it is not required
-                                                        if (value.getDataTypeId() != null) {
-                                                                //
-                                                                // Don't use shorthand by default, for backwards compatibility
-                                                                // to our pep's.
-                                                                //
-                                                                entityTree.put("DataType", value.getDataTypeId().stringValue());
-                                                        }
-                                                        
-                                                        // Internally the XPathCategory is in the AttributeValue object, but in the JSON format it is part of the Value (handled by jsonOutputObject() ) 
-                                                        // so do not handle it here
-        
-        
-                                                        entityTree.put("Value", jsonOutputObject(value.getValue(), value));
-                                                }
-                                                attributes.add(entityTree);
-                                        }
-                                        adviceTree.put("AttributeAssignment", attributes);
-                                }
-                                adviceCollectionList.add(adviceTree);
-                        }
-                        responseTree.put("AssociatedAdvice", adviceCollectionList);
-                }
-                
-                //
-                // Attributes
-                //
-                // (note change in name from XML to JSON spec; this is called Category in the XML)
-                //
+                    } else {
+                        throw new JSONStructureException("Unhandled StatusDetail contents (statusDetail exists but is not MissingAttributeDetail)" );
+                    }
 
-                        if (result.getAttributes() != null && result.getAttributes().size() > 0) {
-                                Iterator<AttributeCategory> iterAttributes = result.getAttributes().iterator();
-                                ArrayList<HashMap<String, Object>> categoryArray = new ArrayList<HashMap<String, Object>>();
-                                while (iterAttributes.hasNext()) {
-                                        AttributeCategory entity = iterAttributes.next();
-                                        HashMap<String, Object> categoryTree = new HashMap<String, Object>();
-                                        categoryTree.put("CategoryId", entity.getCategory().stringValue());
-                                        
-// The JSON and XML spec both imply that we can return Content here, but they do not say so explicitly and give no indication of when to include/not-include it			
+                    if (statusDetailXMLString.length() > 0) {
+                        // make sure all backslashes and double-quotes are escaped
+                        // (will only exist in string values)
+                        statusDetailXMLString = statusDetailXMLString.replace("\\", "\\\\");
+                        statusDetailXMLString = statusDetailXMLString.replace("\"",  "\\\"");
+                        statusTree.put("StatusDetail", statusDetailXMLString);
+                    }
+
+                }
+
+                responseTree.put("Status", statusTree);
+            }
+
+            //
+            // Obligations
+            //
+            if (result.getObligations() != null && result.getObligations().size() > 0) {
+                Iterator<Obligation> iterObs = result.getObligations().iterator();
+                List<Object> obligationCollectionList = new ArrayList<Object>();
+                while (iterObs.hasNext()) {
+                    Obligation ob = iterObs.next();
+                    Map<String, Object> obligationTree = new HashMap<String, Object>();
+                    if (ob.getId() == null) {
+                        throw new JSONStructureException("Obligation must have Id");
+                    }
+                    obligationTree.put("Id", ob.getId().stringValue());
+                    if (ob.getAttributeAssignments() != null && ob.getAttributeAssignments().size() > 0) {
+                        Iterator<AttributeAssignment> iterSetObs = ob.getAttributeAssignments().iterator();
+                        ArrayList<HashMap<String, Object>> attributes = new ArrayList<HashMap<String, Object>>();
+                        while (iterSetObs.hasNext()) {
+                            AttributeAssignment entity = iterSetObs.next();
+                            HashMap<String, Object> entityTree = new HashMap<String, Object>();
+                            if (entity.getAttributeId() == null) {
+                                throw new JSONStructureException("Obligation Attribute must have AttributeId");
+                            }
+                            entityTree.put("AttributeId", entity.getAttributeId().stringValue());
+                            if (entity.getCategory() != null) {
+                                entityTree.put("Category", entity.getCategory().stringValue());
+                            }
+                            if (entity.getIssuer() != null) {
+                                entityTree.put("Issuer", entity.getIssuer());
+                            }
+                            AttributeValue<?> value = entity.getAttributeValue();
+                            if (value == null || value.getValue() == null) {
+                                // Yes it can
+                                //throw new JSONStructureException("Obligation Attribute must have Value");
+                                entityTree.put("Value", new String(""));
+                            } else {
+                                // we are "encouraged" to us Shorthand notation for DataType, but it is not required
+                                if (value.getDataTypeId() != null) {
+                                    //
+                                    // Don't use shorthand by default, for backwards compatibility
+                                    // to our pep's.
+                                    //
+                                    entityTree.put("DataType", value.getDataTypeId().stringValue());
+                                }
+
+                                // Internally the XPathCategory is in the AttributeValue object, but in the JSON format it is part of the Value (handled by jsonOutputObject() )
+                                // so do not handle it here
+
+
+                                entityTree.put("Value", jsonOutputObject(value.getValue(), value));
+                            }
+                            attributes.add(entityTree);
+                        }
+                        obligationTree.put("AttributeAssignment", attributes);
+                    }
+                    obligationCollectionList.add(obligationTree);
+                }
+                responseTree.put("Obligations", obligationCollectionList);
+            }
+
+            //
+            // Advice
+            //
+            if (result.getAssociatedAdvice() != null && result.getAssociatedAdvice().size() > 0) {
+                Iterator<Advice> iterAAs = result.getAssociatedAdvice().iterator();
+                List<Object> adviceCollectionList = new ArrayList<Object>();
+                while (iterAAs.hasNext()) {
+                    Advice advice = iterAAs.next();
+                    Map<String, Object> adviceTree = new HashMap<String, Object>();
+                    if (advice.getId() == null) {
+                        throw new JSONStructureException("Advice must have Id");
+                    }
+                    adviceTree.put("Id", advice.getId().stringValue());
+                    if (advice.getAttributeAssignments() != null && advice.getAttributeAssignments().size() > 0) {
+                        Iterator<AttributeAssignment> iterSetObs = advice.getAttributeAssignments().iterator();
+                        ArrayList<HashMap<String, Object>> attributes = new ArrayList<HashMap<String, Object>>();
+                        while (iterSetObs.hasNext()) {
+                            AttributeAssignment entity = iterSetObs.next();
+                            HashMap<String, Object> entityTree = new HashMap<String, Object>();
+                            if (entity.getAttributeId() == null) {
+                                throw new JSONStructureException("Advice Attribute must have AttributeId");
+                            }
+                            entityTree.put("AttributeId", entity.getAttributeId().stringValue());
+                            if (entity.getCategory() != null) {
+                                entityTree.put("Category", entity.getCategory().stringValue());
+                            }
+                            if (entity.getIssuer() != null) {
+                                entityTree.put("Issuer", entity.getIssuer());
+                            }
+                            AttributeValue<?> value = entity.getAttributeValue();
+                            if (value == null || value.getValue() == null) {
+                                // NO - it can have a null or empty string etc.
+                                //throw new JSONStructureException("Advice Attribute must have Value");
+                                entityTree.put("Value",  new String(""));
+                            } else {
+                                // we are "encouraged" to us Shorthand notation for DataType, but it is not required
+                                if (value.getDataTypeId() != null) {
+                                    //
+                                    // Don't use shorthand by default, for backwards compatibility
+                                    // to our pep's.
+                                    //
+                                    entityTree.put("DataType", value.getDataTypeId().stringValue());
+                                }
+
+                                // Internally the XPathCategory is in the AttributeValue object, but in the JSON format it is part of the Value (handled by jsonOutputObject() )
+                                // so do not handle it here
+
+
+                                entityTree.put("Value", jsonOutputObject(value.getValue(), value));
+                            }
+                            attributes.add(entityTree);
+                        }
+                        adviceTree.put("AttributeAssignment", attributes);
+                    }
+                    adviceCollectionList.add(adviceTree);
+                }
+                responseTree.put("AssociatedAdvice", adviceCollectionList);
+            }
+
+            //
+            // Attributes
+            //
+            // (note change in name from XML to JSON spec; this is called Category in the XML)
+            //
+
+            if (result.getAttributes() != null && result.getAttributes().size() > 0) {
+                Iterator<AttributeCategory> iterAttributes = result.getAttributes().iterator();
+                ArrayList<HashMap<String, Object>> categoryArray = new ArrayList<HashMap<String, Object>>();
+                while (iterAttributes.hasNext()) {
+                    AttributeCategory entity = iterAttributes.next();
+                    HashMap<String, Object> categoryTree = new HashMap<String, Object>();
+                    categoryTree.put("CategoryId", entity.getCategory().stringValue());
+
+// The JSON and XML spec both imply that we can return Content here, but they do not say so explicitly and give no indication of when to include/not-include it
 // Also we should be able to return the xml:Id associated with this attribute, but that does not seem to be available in the AttributeCategory object
 // Note: Our choice is to not include these.
 //		There is a question of when they would be included (since IncludeInResult is only on the individual Attribute (singular) objects, not the Attributes),
@@ -1438,182 +1437,182 @@
 //		We could potentially return these only when at least one of the Attribute components has IncludeInResult=true.
 //		However the focus seems to be on returning the individual Attribute objects so the caller can see what the response is referring to, and the Attributes (plural)
 //		container is just re-used from the Request object without understanding that the Result should be different or explicitly stating in the Spec what to do with those fields.
-                                
-                                        Collection<Attribute> attrs = entity.getAttributes();
-                                        if (attrs != null) {
-                                                Iterator<Attribute> iterAttrs = attrs.iterator();
-                                                ArrayList<HashMap<String, Object>> arrayAttributes = new ArrayList<HashMap<String, Object>>();
-                                                while (iterAttrs.hasNext()) {
-                                                        Attribute attribute = iterAttrs.next();
-                                                        if (attribute.getIncludeInResults() == false) {
-                                                                // Would this be an error?  This is an internal matter and we arbitrarily decided to just ignore it.  
-                                                                // The attribute will not be included in the output, so the receiver won't know that this happened.
-                                                                continue;
-                                                        }
-                                                        
-                                                        HashMap<String, Object> theAttribute = new HashMap<String, Object>();
+
+                    Collection<Attribute> attrs = entity.getAttributes();
+                    if (attrs != null) {
+                        Iterator<Attribute> iterAttrs = attrs.iterator();
+                        ArrayList<HashMap<String, Object>> arrayAttributes = new ArrayList<HashMap<String, Object>>();
+                        while (iterAttrs.hasNext()) {
+                            Attribute attribute = iterAttrs.next();
+                            if (attribute.getIncludeInResults() == false) {
+                                // Would this be an error?  This is an internal matter and we arbitrarily decided to just ignore it.
+                                // The attribute will not be included in the output, so the receiver won't know that this happened.
+                                continue;
+                            }
+
+                            HashMap<String, Object> theAttribute = new HashMap<String, Object>();
 //TODO - no need to put this in Result because, by definition, if it is in the result then this must be true?  Since it is optional we do not want to add to length of JSON output
 //							theAttribute.put("IncludeInResult", true);
-                                                        
-                                                        if (attribute.getAttributeId() == null) {
-                                                        throw new JSONStructureException("Attribute must have AttributeId");
-                                                        }
-                                                        theAttribute.put("AttributeId", attribute.getAttributeId().stringValue());
-                                                        if (attribute.getValues() == null || attribute.getValues().size() == 0) {
-                                                                throw new JSONStructureException("Attribute missing required Value");
-                                                        }
-                                                        Iterator<AttributeValue<?>> valueIterator = attribute.getValues().iterator();
-                                                        
-                                                        // The spec talks about inferring the data type from the value and what to do if it is a list.
-                                                        // However this is output from the PDP, and the attributes would have been screened while processing the Request,
-                                                        // so we can assume at this point that we always have a DataType associated with the values and that the values are
-                                                        // consistent with that DataType (because otherwise the Request would have been rejected and we would never get here).
-                                                        // However we do need to extract the DataType from one of the Values and that is done slightly differently
-                                                        // when there is one vs a list.
-                                                        if (attribute.getValues().size() == 1) {
-                                                                // exactly one value, so no need for list of values AND we know exactly what the DataType is
-                                                                AttributeValue<?> attributeValue = valueIterator.next();
-                                                                if (attributeValue == null || attributeValue.getValue() == null) {
-                                                                        throw new JSONStructureException("Attribute must have value");
-                                                                }
-                                                                theAttribute.put("Value", jsonOutputObject(attributeValue.getValue(), attributeValue));
-                                                                if (attributeValue.getDataTypeId() != null) {
-                                                                // we are "encouraged" to us Shorthand notation for DataType, but it is not required
-                                                                //
-                                                                // Don't use shorthand by default, for backwards compatibility
-                                                                // to our pep's.
-                                                                //
-                                                                        theAttribute.put("DataType", attributeValue.getDataTypeId().stringValue());
-                                                                }
-                                                        } else {
-                                                                // there are multiple values so we have to make a list of the Values
-                                                                List<Object> attrValueList = new ArrayList<Object>();
-                                                                boolean mixedTypes = false;
-                                                                Identifier inferredDataTypeId = null;
-                                                                while (valueIterator.hasNext()) {
-                                                                        AttributeValue<?> attrValue = valueIterator.next();
-                                                                        if (attrValue == null || attrValue.getValue() == null) {
-                                                                                throw new JSONStructureException("Attribute in array must have value");
-                                                                        }
-                                                                        attrValueList.add(jsonOutputObject(attrValue.getValue(), attrValue));
-                                                                        
-                                                                        // try to infer the data type
-                                                                        if (attrValue.getDataTypeId() != null) {
-                                                                                if (inferredDataTypeId == null) {
-                                                                                        inferredDataTypeId = attrValue.getDataTypeId();
-                                                                                } else {
-                                                                                        if (inferredDataTypeId.equals(DataTypes.DT_INTEGER.getId()) && attrValue.getDataTypeId().equals(DataTypes.DT_DOUBLE.getId())) {
-                                                                                                // seeing a double anywhere in a list of integers means the type is double
-                                                                                                inferredDataTypeId = attrValue.getDataTypeId();
-                                                                                        } else if (inferredDataTypeId.equals(DataTypes.DT_DOUBLE.getId()) && attrValue.getDataTypeId().equals(DataTypes.DT_INTEGER.getId())) {
-                                                                                                // integers are ok in a list of doubles
-                                                                                                continue;
-                                                                                        } else if ( ! inferredDataTypeId.equals(attrValue.getDataTypeId())) {
-                                                                                                // all other combinations of types are illegal.
-                                                                                                // Note: these attribute values were read from the client's Request and were assigned the appropriate DataType at that time.
-                                                                                                // That DataType would have been the same for each one (e.g. String) so there should never be a case where
-                                                                                                // there are multiple different types here.
-                                                                                                // NOTE THAT IF THIS CHANGES and we want to allow mixed types, just replace this throws with
-                                                                                                //			mixedTypes = true;
-                                                                                                throw new JSONStructureException("Mixed DataTypes in Attribute values, '" + attrValue.getDataTypeId().stringValue() +
-                                                                                                                "' in list of '" + inferredDataTypeId.stringValue() + "'");
-                                                                                        }
-                                                                                }
-                                                                        }
-                                                                }
-                                                                theAttribute.put("Value", attrValueList);
-                                                                
-                                                                if (inferredDataTypeId != null && ! mixedTypes) {
-                                                                        // list is uniform and we know the type
-                                                                //
-                                                                // Don't use shorthand by default, for backwards compatibility
-                                                                // to our pep's.
-                                                                //
-                                                                        theAttribute.put("DataType", inferredDataTypeId.stringValue());
-                                                                }
 
-                                                        }
-                                                        
-                                                        if (attribute.getIssuer() != null) {
-                                                                theAttribute.put("Issuer", attribute.getIssuer());
-                                                        }
-                                                        
-                                                        arrayAttributes.add(theAttribute);
-                                                }
-                                                categoryTree.put("Attribute", arrayAttributes);
-                                        }
+                            if (attribute.getAttributeId() == null) {
+                                throw new JSONStructureException("Attribute must have AttributeId");
+                            }
+                            theAttribute.put("AttributeId", attribute.getAttributeId().stringValue());
+                            if (attribute.getValues() == null || attribute.getValues().size() == 0) {
+                                throw new JSONStructureException("Attribute missing required Value");
+                            }
+                            Iterator<AttributeValue<?>> valueIterator = attribute.getValues().iterator();
 
-                                        if (categoryTree.size() > 0) {
-                                                categoryArray.add(categoryTree);
-                                        }
+                            // The spec talks about inferring the data type from the value and what to do if it is a list.
+                            // However this is output from the PDP, and the attributes would have been screened while processing the Request,
+                            // so we can assume at this point that we always have a DataType associated with the values and that the values are
+                            // consistent with that DataType (because otherwise the Request would have been rejected and we would never get here).
+                            // However we do need to extract the DataType from one of the Values and that is done slightly differently
+                            // when there is one vs a list.
+                            if (attribute.getValues().size() == 1) {
+                                // exactly one value, so no need for list of values AND we know exactly what the DataType is
+                                AttributeValue<?> attributeValue = valueIterator.next();
+                                if (attributeValue == null || attributeValue.getValue() == null) {
+                                    throw new JSONStructureException("Attribute must have value");
                                 }
-                                if (categoryArray.size() > 0) {
+                                theAttribute.put("Value", jsonOutputObject(attributeValue.getValue(), attributeValue));
+                                if (attributeValue.getDataTypeId() != null) {
+                                    // we are "encouraged" to us Shorthand notation for DataType, but it is not required
+                                    //
+                                    // Don't use shorthand by default, for backwards compatibility
+                                    // to our pep's.
+                                    //
+                                    theAttribute.put("DataType", attributeValue.getDataTypeId().stringValue());
+                                }
+                            } else {
+                                // there are multiple values so we have to make a list of the Values
+                                List<Object> attrValueList = new ArrayList<Object>();
+                                boolean mixedTypes = false;
+                                Identifier inferredDataTypeId = null;
+                                while (valueIterator.hasNext()) {
+                                    AttributeValue<?> attrValue = valueIterator.next();
+                                    if (attrValue == null || attrValue.getValue() == null) {
+                                        throw new JSONStructureException("Attribute in array must have value");
+                                    }
+                                    attrValueList.add(jsonOutputObject(attrValue.getValue(), attrValue));
+
+                                    // try to infer the data type
+                                    if (attrValue.getDataTypeId() != null) {
+                                        if (inferredDataTypeId == null) {
+                                            inferredDataTypeId = attrValue.getDataTypeId();
+                                        } else {
+                                            if (inferredDataTypeId.equals(DataTypes.DT_INTEGER.getId()) && attrValue.getDataTypeId().equals(DataTypes.DT_DOUBLE.getId())) {
+                                                // seeing a double anywhere in a list of integers means the type is double
+                                                inferredDataTypeId = attrValue.getDataTypeId();
+                                            } else if (inferredDataTypeId.equals(DataTypes.DT_DOUBLE.getId()) && attrValue.getDataTypeId().equals(DataTypes.DT_INTEGER.getId())) {
+                                                // integers are ok in a list of doubles
+                                                continue;
+                                            } else if ( ! inferredDataTypeId.equals(attrValue.getDataTypeId())) {
+                                                // all other combinations of types are illegal.
+                                                // Note: these attribute values were read from the client's Request and were assigned the appropriate DataType at that time.
+                                                // That DataType would have been the same for each one (e.g. String) so there should never be a case where
+                                                // there are multiple different types here.
+                                                // NOTE THAT IF THIS CHANGES and we want to allow mixed types, just replace this throws with
+                                                //			mixedTypes = true;
+                                                throw new JSONStructureException("Mixed DataTypes in Attribute values, '" + attrValue.getDataTypeId().stringValue() +
+                                                                                 "' in list of '" + inferredDataTypeId.stringValue() + "'");
+                                            }
+                                        }
+                                    }
+                                }
+                                theAttribute.put("Value", attrValueList);
+
+                                if (inferredDataTypeId != null && ! mixedTypes) {
+                                    // list is uniform and we know the type
+                                    //
+                                    // Don't use shorthand by default, for backwards compatibility
+                                    // to our pep's.
+                                    //
+                                    theAttribute.put("DataType", inferredDataTypeId.stringValue());
+                                }
+
+                            }
+
+                            if (attribute.getIssuer() != null) {
+                                theAttribute.put("Issuer", attribute.getIssuer());
+                            }
+
+                            arrayAttributes.add(theAttribute);
+                        }
+                        categoryTree.put("Attribute", arrayAttributes);
+                    }
+
+                    if (categoryTree.size() > 0) {
+                        categoryArray.add(categoryTree);
+                    }
+                }
+                if (categoryArray.size() > 0) {
 //TODO - Spec changing from Attributes to Category - change is for no good reason other than they didn't like the XML name.
-                                        responseTree.put("Category", categoryArray);
-                                }
+                    responseTree.put("Category", categoryArray);
+                }
+            }
+
+            //
+            // PolicyIdentifier
+            //
+            // (These seem to be handled differently from the XML version where multiple PolicyIdRef and PolicySetIdRef items can be jumbled together in any order.
+            //	In the XACML JSON spec (5.2.10) it says that the PolicyIdReference and PolicySetIdReference are separate groups
+            //	where each group is a list of IdReferences.)
+            //
+            //
+
+            if ((result.getPolicyIdentifiers() != null && result.getPolicyIdentifiers().size() > 0) ||
+                    (result.getPolicySetIdentifiers() != null && result.getPolicySetIdentifiers().size() > 0) ) {
+
+                Map<String, Object> policyIdentifierCollectionList = new HashMap<String, Object>();
+                // handle PolicyIds separately from PolicySetIds
+                if (result.getPolicyIdentifiers() != null && result.getPolicyIdentifiers().size() > 0) {
+                    List<Object> policyIdentifierList = new ArrayList<Object>();
+                    for (IdReference  idRef : result.getPolicyIdentifiers()) {
+                        if (idRef == null) {
+                            throw new JSONStructureException("PolicyIdReference with null reference");
                         }
-                        
-                        //
-                        // PolicyIdentifier
-                        //
-                        // (These seem to be handled differently from the XML version where multiple PolicyIdRef and PolicySetIdRef items can be jumbled together in any order.
-                        //	In the XACML JSON spec (5.2.10) it says that the PolicyIdReference and PolicySetIdReference are separate groups
-                        //	where each group is a list of IdReferences.)
-                        //
-                        //
-                        
-                        if ((result.getPolicyIdentifiers() != null && result.getPolicyIdentifiers().size() > 0) ||
-                                        (result.getPolicySetIdentifiers() != null && result.getPolicySetIdentifiers().size() > 0) ) {
-                                
-                        Map<String, Object> policyIdentifierCollectionList = new HashMap<String, Object>();
-                        // handle PolicyIds separately from PolicySetIds 
-                        if (result.getPolicyIdentifiers() != null && result.getPolicyIdentifiers().size() > 0) {
-                                List<Object> policyIdentifierList = new ArrayList<Object>();
-                                for (IdReference  idRef : result.getPolicyIdentifiers()) {
-                                        if (idRef == null) {
-                                                throw new JSONStructureException("PolicyIdReference with null reference");
-                                        }
-                                                HashMap<String, Object> entityTree = new HashMap<String, Object>();
-                                                entityTree.put("Id", idRef.getId().stringValue());
-                                                if (idRef.getVersion() != null) {
-                                                        entityTree.put("Version", idRef.getVersion().stringValue());
-                                                }
-                                                
-                                                policyIdentifierList.add(entityTree);
-                                }
-                                
-                                policyIdentifierCollectionList.put("PolicyIdReference", policyIdentifierList);
-                        }
-                        // handle PolicySetIds
-                        if (result.getPolicySetIdentifiers() != null && result.getPolicySetIdentifiers().size() > 0) {
-                                List<Object> policyIdentifierList = new ArrayList<Object>();
-                                for (IdReference  idRef : result.getPolicySetIdentifiers()) {
-                                        if (idRef == null) {
-                                                throw new JSONStructureException("PolicySetIdReference with null reference");
-                                        }
-                                                HashMap<String, Object> entityTree = new HashMap<String, Object>();
-                                                entityTree.put("Id", idRef.getId().stringValue());
-                                                if (idRef.getVersion() != null) {
-                                                        entityTree.put("Version", idRef.getVersion().stringValue());
-                                                }
-                                                
-                                                policyIdentifierList.add(entityTree);
-                                }
-                                
-                                policyIdentifierCollectionList.put("PolicySetIdReference", policyIdentifierList);
+                        HashMap<String, Object> entityTree = new HashMap<String, Object>();
+                        entityTree.put("Id", idRef.getId().stringValue());
+                        if (idRef.getVersion() != null) {
+                            entityTree.put("Version", idRef.getVersion().stringValue());
                         }
 
-                        responseTree.put("PolicyIdentifier", policyIdentifierCollectionList);
-                        }
-                        
+                        policyIdentifierList.add(entityTree);
+                    }
 
-                
-                //
-                // Finished
-                //
-                responses.add(responseTree);
+                    policyIdentifierCollectionList.put("PolicyIdReference", policyIdentifierList);
+                }
+                // handle PolicySetIds
+                if (result.getPolicySetIdentifiers() != null && result.getPolicySetIdentifiers().size() > 0) {
+                    List<Object> policyIdentifierList = new ArrayList<Object>();
+                    for (IdReference  idRef : result.getPolicySetIdentifiers()) {
+                        if (idRef == null) {
+                            throw new JSONStructureException("PolicySetIdReference with null reference");
+                        }
+                        HashMap<String, Object> entityTree = new HashMap<String, Object>();
+                        entityTree.put("Id", idRef.getId().stringValue());
+                        if (idRef.getVersion() != null) {
+                            entityTree.put("Version", idRef.getVersion().stringValue());
+                        }
+
+                        policyIdentifierList.add(entityTree);
+                    }
+
+                    policyIdentifierCollectionList.put("PolicySetIdReference", policyIdentifierList);
+                }
+
+                responseTree.put("PolicyIdentifier", policyIdentifierCollectionList);
+            }
+
+
+
+            //
+            // Finished
+            //
+            responses.add(responseTree);
         }
-        
+
         //
         // Create the overall response
         //
@@ -1622,115 +1621,115 @@
         //
         // Create a string buffer
         //
-                ObjectMapper mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
-                mapper.configure(SerializationFeature.INDENT_OUTPUT, prettyPrint);
-                try (		OutputStreamWriter osw = new OutputStreamWriter(outputStream)) {
-                        json = mapper.writeValueAsString(theWholeResponse);
-                        
-                        osw.write(json);
-                        
-                        // force output
-                        osw.flush();
-                        
-                } catch (Exception e) {
-                        logger.error("Failed to write to json string: " + e.getLocalizedMessage(), e);
+        ObjectMapper mapper = new ObjectMapper().setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
+        mapper.configure(SerializationFeature.INDENT_OUTPUT, prettyPrint);
+        try (		OutputStreamWriter osw = new OutputStreamWriter(outputStream)) {
+            json = mapper.writeValueAsString(theWholeResponse);
+
+            osw.write(json);
+
+            // force output
+            osw.flush();
+
+        } catch (Exception e) {
+            logger.error("Failed to write to json string: " + e.getLocalizedMessage(), e);
+        }
+
+    }
+
+
+    /*
+     * Recursively add sub-status codes.
+     *
+     * Note there is inconsistency in the Core and JSON specs where the Core XML says that each statusCode may contain at most 1 sub-statusCode
+     * but the text in both specs says that the statusCode may contain a sequence of statusCodes.
+     * We interpret the spec to say there is one optional sub-status code.
+     */
+    private static void addChildStatusCodes(StatusCode statusCode, Map<String, Object> map) {
+        if (statusCode.getChild() != null ) {
+            StatusCode child = statusCode.getChild();
+            Map<String, Object> childMap = new HashMap<String, Object>();
+            childMap.put("Value", child.getStatusCodeValue().stringValue());
+            addChildStatusCodes(child, childMap);
+
+
+            // the spec is not clear on whether the sequence of child StatusCodes has a name or not,
+            // but since JSON components are either sequences or objects (whose components have name:value)
+            // and the parent StatusCode (represented by the map passed in) is an object, not a sequence, the component must be named.
+            // The only name mentioned in the the specs for this list of children is "StatusCode".
+            map.put("StatusCode", childMap);
+        }
+    }
+
+
+    /**
+     * Create the appropriate object for JSON output.
+     * This needs to be a Boolean, Integer or Double for those data types so that the ObjectMapper knows how to format the JSON text.
+     * For objects implementing stringValue we use that string.
+     * for XPathExpressions use the Path.
+     * Otherwise default to using toString.
+     *
+     * @param obj
+     * @return
+     */
+    private static Object jsonOutputObject(Object obj, AttributeValue<?> attrValue) throws JSONStructureException {
+        if (obj instanceof String ||
+                obj instanceof Boolean ||
+                obj instanceof BigInteger  ) {
+            return obj;
+        } else if (obj instanceof Double) {
+            Double d = (Double)obj;
+            if (d == Double.NaN) {
+                return "NaN";
+            } else if (d == Double.POSITIVE_INFINITY) {
+                return "INF";
+            } else if (d == Double.NEGATIVE_INFINITY) {
+                return "-INF";
+            }
+            return obj;
+        } else if (obj instanceof SemanticString) {
+            return ((SemanticString)obj).stringValue();
+        } else if (obj instanceof X500Principal ||
+                   obj instanceof URI) {
+            // something is very weird with X500Principal data type.  If left on its own the output is a map that includes encoding.
+            return obj.toString();
+        } else if (obj instanceof XPathExpressionWrapper) {
+            // create a map containing the complex value for the XPathExpression
+            Map<String,Object> xpathExpressionMap = new HashMap<String,Object>();
+            Identifier xpathCategoryId = attrValue.getXPathCategory();
+            if (xpathCategoryId == null) {
+                throw new JSONStructureException("XPathExpression is missing XPathCategory");
+            }
+            xpathExpressionMap.put("XPathCategory", attrValue.getXPathCategory().stringValue());
+
+            XPathExpressionWrapper xw = (XPathExpressionWrapper) obj;
+            xpathExpressionMap.put("XPath", xw.getPath());
+
+            ExtendedNamespaceContext namespaceContext = xw.getNamespaceContext();
+            if (namespaceContext != null) {
+                List<Object> namespaceList = new ArrayList<Object>();
+
+                // get the list of all namespace prefixes
+                Iterator<String> prefixIt = namespaceContext.getAllPrefixes();
+                while (prefixIt.hasNext()) {
+                    String prefix = prefixIt.next();
+                    String namespaceURI = namespaceContext.getNamespaceURI(prefix);
+                    Map<String,Object> namespaceMap = new HashMap<String,Object>();
+                    if (prefix != null && ! prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+                        namespaceMap.put("Prefix", prefix);
+                    }
+                    namespaceMap.put("Namespace", namespaceURI);
+                    namespaceList.add(namespaceMap);
                 }
 
+                xpathExpressionMap.put("Namespaces", namespaceList);
+            }
+            return xpathExpressionMap;
+        } else {
+            throw new JSONStructureException("Unhandled data type='" + obj.getClass().getName() + "'");
         }
-        
-        
-        /*
-         * Recursively add sub-status codes.
-         * 
-         * Note there is inconsistency in the Core and JSON specs where the Core XML says that each statusCode may contain at most 1 sub-statusCode
-         * but the text in both specs says that the statusCode may contain a sequence of statusCodes.
-         * We interpret the spec to say there is one optional sub-status code.
-         */
-        private static void addChildStatusCodes(StatusCode statusCode, Map<String, Object> map) {
-                if (statusCode.getChild() != null ) {
-                        StatusCode child = statusCode.getChild();
-                        Map<String, Object> childMap = new HashMap<String, Object>();
-                childMap.put("Value", child.getStatusCodeValue().stringValue());
-                addChildStatusCodes(child, childMap);
-                                
-                        
-                        // the spec is not clear on whether the sequence of child StatusCodes has a name or not,
-                        // but since JSON components are either sequences or objects (whose components have name:value)
-                        // and the parent StatusCode (represented by the map passed in) is an object, not a sequence, the component must be named.
-                        // The only name mentioned in the the specs for this list of children is "StatusCode".
-                        map.put("StatusCode", childMap);
-                }
-        }
-        
+    }
 
-        /**
-         * Create the appropriate object for JSON output.
-         * This needs to be a Boolean, Integer or Double for those data types so that the ObjectMapper knows how to format the JSON text.
-         * For objects implementing stringValue we use that string.
-         * for XPathExpressions use the Path.
-         * Otherwise default to using toString.
-         * 
-         * @param obj
-         * @return
-         */
-        private static Object jsonOutputObject(Object obj, AttributeValue<?> attrValue) throws JSONStructureException {
-                if (obj instanceof String ||
-                                obj instanceof Boolean ||
-                                obj instanceof BigInteger  ) {
-                        return obj;
-                } else if (obj instanceof Double) {
-                        Double d = (Double)obj;
-                        if (d == Double.NaN) {
-                                return "NaN";
-                        } else if (d == Double.POSITIVE_INFINITY) {
-                                return "INF";
-                        } else if (d == Double.NEGATIVE_INFINITY) {
-                                return "-INF";
-                        }
-                        return obj;
-                } else if (obj instanceof SemanticString) {
-                        return ((SemanticString)obj).stringValue();
-                } else if (obj instanceof X500Principal ||
-                                obj instanceof URI) {
-                        // something is very weird with X500Principal data type.  If left on its own the output is a map that includes encoding.
-                        return obj.toString();
-                } else if (obj instanceof XPathExpressionWrapper) {
-                        // create a map containing the complex value for the XPathExpression
-                        Map<String,Object> xpathExpressionMap = new HashMap<String,Object>();
-                        Identifier xpathCategoryId = attrValue.getXPathCategory();
-                        if (xpathCategoryId == null) {
-                                throw new JSONStructureException("XPathExpression is missing XPathCategory");
-                        }
-                        xpathExpressionMap.put("XPathCategory", attrValue.getXPathCategory().stringValue());
-                        
-                        XPathExpressionWrapper xw = (XPathExpressionWrapper) obj;
-                        xpathExpressionMap.put("XPath", xw.getPath());
-                        
-                        ExtendedNamespaceContext namespaceContext = xw.getNamespaceContext();
-                        if (namespaceContext != null) {
-                                List<Object> namespaceList = new ArrayList<Object>();
 
-                                // get the list of all namespace prefixes
-                                Iterator<String> prefixIt = namespaceContext.getAllPrefixes();
-                                while (prefixIt.hasNext()) {
-                                        String prefix = prefixIt.next();
-                                        String namespaceURI = namespaceContext.getNamespaceURI(prefix);
-                                        Map<String,Object> namespaceMap = new HashMap<String,Object>();
-                                        if (prefix != null && ! prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
-                                                namespaceMap.put("Prefix", prefix);
-                                        }
-                                        namespaceMap.put("Namespace", namespaceURI);
-                                        namespaceList.add(namespaceMap);
-                                }
-                                
-                                xpathExpressionMap.put("Namespaces", namespaceList);
-                        }
-                        return xpathExpressionMap;
-                } else {
-                        throw new JSONStructureException("Unhandled data type='" + obj.getClass().getName() + "'");
-                }
-        }
-        
-        
-        
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONStructureException.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONStructureException.java
index 3443a63..1f20aca 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONStructureException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/json/JSONStructureException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -32,32 +32,32 @@
 
 /**
  * Exception indicating that a JSON structure is incorrect.
- * 
+ *
  * @author glenngriffin
  *
  */
 public class JSONStructureException extends Exception {
-        
-        /**
-         * 
-         */
-        private static final long serialVersionUID = 3375547841298623008L;
 
-        
-        public JSONStructureException() {
-        }
+    /**
+     *
+     */
+    private static final long serialVersionUID = 3375547841298623008L;
 
-        public JSONStructureException(String message) {
-                super(message);
-        }
 
-        public JSONStructureException(Throwable cause) {
-                super(cause);
-        }
+    public JSONStructureException() {
+    }
 
-        public JSONStructureException(String message, Throwable cause) {
-                super(message, cause);
-        }
+    public JSONStructureException(String message) {
+        super(message);
+    }
+
+    public JSONStructureException(Throwable cause) {
+        super(cause);
+    }
+
+    public JSONStructureException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/package-info.java
index 32c4f50..2587af3 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * Provides standard implementations of the interfaces from the {@link com.att.research.xacml} package.  All of the standard classes implement
  * immutable objects.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdEngine.java
index 6b9804c..0732048 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -68,936 +68,933 @@
 /**
  * This is a simple PAP engine that uses some property files and a simple directory
  * structure in the file system to manage a policy repository and set of PDP nodes.
- * 
+ *
  * @author pameladragosh
  *
  */
 public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPEngine {
-        private static Log	logger	= LogFactory.getLog(StdEngine.class);
+    private static Log	logger	= LogFactory.getLog(StdEngine.class);
 
-        public static String	PROP_PAP_REPO = "xacml.pap.pdps";
-        public static String	PROP_PAP_GROUPS = "xacml.pap.groups";
-        public static String	PROP_PAP_GROUPS_DEFAULT = "xacml.pap.groups.default";
-        public static String	PROP_PAP_GROUPS_DEFAULT_NAME = "default";
+    public static String	PROP_PAP_REPO = "xacml.pap.pdps";
+    public static String	PROP_PAP_GROUPS = "xacml.pap.groups";
+    public static String	PROP_PAP_GROUPS_DEFAULT = "xacml.pap.groups.default";
+    public static String	PROP_PAP_GROUPS_DEFAULT_NAME = "default";
 
     protected final Path repository;
-        protected Set<StdPDPGroup> groups;
-                
-        public StdEngine() throws PAPException, IOException {
-                //
-                // Get the location in the file system of our repository
-                //
-                this.repository = Paths.get(XACMLProperties.getProperty(PROP_PAP_REPO));
-                //
-                // Initialize
-                //
-                this.intialize();
-        }
-        
-        public StdEngine(Properties properties) throws PAPException, IOException {
-                //
-                // Get the location in the file system of our repository
-                //
-                this.repository = Paths.get(properties.getProperty(PROP_PAP_REPO));
-                //
-                // Initialize
-                //
-                this.intialize();
-        }
-        
-        public StdEngine(Path repository) throws PAPException, IOException {
-                //
-                // Save our location
-                //
-                this.repository = repository;
-                //
-                // Initialize
-                //
-                this.intialize();
-        }
-        
-        private void intialize() throws PAPException, IOException {
-                //
-                // Sanity check the repository path
-                //
-                if (this.repository == null) {
-                        throw new PAPException ("No repository specified.");
-                }
-                if (Files.notExists(this.repository)) {
-                        Files.createDirectory(repository);
-                }
-                if (Files.isDirectory(this.repository) == false) {
-                        throw new PAPException ("Repository is NOT a directory: " + this.repository.toAbsolutePath());
-                }
-                if (Files.isWritable(this.repository) == false) {
-                        throw new PAPException ("Repository is NOT writable: " + this.repository.toAbsolutePath());
-                }
-                //
-                // Load our groups
-                //
-                this.loadGroups();
-        }
-        
-        private void loadGroups() throws PAPException {
-                //
-                // Create a properties object
-                //
-                Properties properties = new Properties();
-                Path file = Paths.get(this.repository.toString(), XACMLProperties.XACML_PROPERTIES_NAME);
-                try {
-                        //
-                        // Load the properties
-                        //
-                        try (InputStream is = new FileInputStream(file.toFile())) {
-                                properties.load(is);
-                        }
+    protected Set<StdPDPGroup> groups;
 
-                        //
-                        // Parse it
-                        //
-                        this.groups = this.readProperties(this.repository, properties);
-                } catch (IOException e) {
-                        logger.error("Failed to load " + file.toAbsolutePath().toString());
-                        this.groups = new HashSet<StdPDPGroup>();
-                }
-                //
-                // Initialize the default group
-                //
-                PDPGroup defaultGroup = this.initializeDefaultGroup(file, properties);
-                logger.info("Default group is: " + defaultGroup.getId() + "=" + defaultGroup.getName());
-        }
-        
-        private PDPGroup initializeDefaultGroup(Path file, Properties properties) throws PAPException {
-                //
-                // Make sure we have the default group
-                //
-                PDPGroup group = this.getDefaultGroup();
-                if (group != null) {
-                        return group;
-                }
-                //
-                // We don't have the default group, create it
-                //
-                String defaultId = properties.getProperty(PROP_PAP_GROUPS_DEFAULT, PROP_PAP_GROUPS_DEFAULT_NAME);
-                logger.warn("Default group does NOT exist, creating " + defaultId);
-                Path defaultPath = Paths.get(this.repository.toString(), defaultId);
-                try {
-                        //
-                        // Does it exist?
-                        //
-                        if (Files.notExists(defaultPath)) {
-                                //
-                                // Create its directory
-                                //
-                                Files.createDirectory(defaultPath);
-                                //
-                                // Create property files
-                                //
-                                {
-                                        Properties props = new Properties();
-                                        props.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "");
-                                        props.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "");
-                                        Path policyPath = Paths.get(defaultPath.toAbsolutePath().toString(), "xacml.policy.properties");
-                                        Files.createFile(policyPath);
-                                        try (OutputStream os = Files.newOutputStream(policyPath)) {
-                                                props.store(os, "");
-                                        } catch (IOException e) {
-                                                logger.error("Failed to write default policy properties", e);
-                                        }
-                                }
-                                {
-                                        Properties props = new Properties();
-                                        props.setProperty(XACMLProperties.PROP_PIP_ENGINES, "");
-                                        Path pipPath = Paths.get(defaultPath.toAbsolutePath().toString(), "xacml.pip.properties");
-                                        Files.createFile(pipPath);
-                                        try (OutputStream os = Files.newOutputStream(pipPath)) {
-                                                props.store(os, "");
-                                        } catch (IOException e) {
-                                                logger.error("Failed to write default pip properties", e);
-                                        }					
-                                }
-                        }
-                        //
-                        // Create the default group
-                        //
-                        StdPDPGroup newDefault = new StdPDPGroup(defaultId, true, "default", "The default group where new PDP's are put.", defaultPath);
-                        //
-                        // Add it to our list
-                        //
-                        this.groups.add(newDefault);
-                        //
-                        // Save our properties out since we have
-                        // a new default group.
-                        //
-                        StdEngine.setGroupProperties(newDefault, properties);
-                        //
-                        // Save it to disk
-                        //
-                        try {
-                                try (OutputStream os = Files.newOutputStream(file)) {
-                                        properties.store(os, "");
-                                }
-                        } catch (IOException e) {
-                                logger.error("Failed to save properties with new default group information.", e);
-                        }
-                        //
-                        // Return it
-                        //
-                        return newDefault;
-                } catch (IOException e) {
-                        logger.error("Failed to create default group: " + defaultId, e);
-                        throw new PAPException("Failed to create default group");
-                }
-        }
-        
-
-    
-    
-        @Override
-        public PDPGroup getDefaultGroup() throws PAPException
-        {
-                for (PDPGroup group : this.groups) {
-                        if (group.isDefaultGroup()) {
-                                return group;
-                        }
-                }
-                //
-                // Default group doesn't exist
-                //
-                return null;
-        }
-
-        @Override
-        public void	SetDefaultGroup(PDPGroup group) throws PAPException {
-                
-                boolean changesMade = false;
-                for (PDPGroup aGroup : groups) {
-                        if (aGroup.getId().equals(group.getId())) {
-                                if ( ! aGroup.isDefaultGroup()) {
-//TODO - since the original code checked for type we do also.
-                                        if (aGroup instanceof StdPDPGroup) {
-                                                ((StdPDPGroup) aGroup).setDefault(true);
-                                                changesMade = true;
-                                        } else {
-                                                throw new IllegalArgumentException("Group in groups of unknown type '" + aGroup.getClass().getName() + "'");
-                                        }
-                                }
-                        } else {
-                                // not the new default group
-                                if (aGroup.isDefaultGroup()) {
-//TODO - since the original code checked for type we do also.
-                                        if (aGroup instanceof StdPDPGroup) {
-                                                ((StdPDPGroup) aGroup).setDefault(false);
-                                                changesMade = true;
-                                        } else {
-                                                throw new IllegalArgumentException("Group in groups of unknown type '" + aGroup.getClass().getName() + "'");
-                                        }
-                                }
-                        }
-                }
-                if (changesMade) {
-                        this.doSave();
-                }
-                
-                return;	
-        }
-
-        @Override
-        public Set<PDPGroup> getPDPGroups() throws PAPException {
-                final Set<PDPGroup> grps = new HashSet<PDPGroup>();
-                for (PDPGroup g : this.groups) {
-                        grps.add(g);
-                }
-                return Collections.unmodifiableSet(grps);
-        }
-        
-        @Override
-        public PDPGroup	getGroup(String id) throws PAPException {
-                for (PDPGroup g: this.groups) {
-                        if (g.getId().equals(id)) {
-                                return g;
-                        }
-                }
-                return null;
-        }
-
-        @Override
-        public void	newGroup(String name, String description) throws PAPException, NullPointerException
-        {	
-                //
-                // Null check
-                //
-                if (name == null) {
-                        throw new NullPointerException();
-                }
-                //
-                // Do we already have this group?
-                //
-                for (PDPGroup group : this.groups) {
-                        if (group.getName().equals(name)) {
-                                throw new PAPException("Group with this name=" + name + " already exists.");
-                        }
-                }
-                
-                
-                // create an Id that can be used as a file name and a properties file key.
-                // Ids must not contain \/:*?"<>|=,;
-                // The ID must also be unique within the current set of PDPGroups.
-                String id = createNewPDPGroupId(name);
-                
-                
-                //
-                // Construct the directory path
-                //
-                Path groupPath = Paths.get(this.repository.toString(), id);
-                //
-                // If it exists already
-                //
-                if (Files.exists(groupPath)) {
-                        logger.warn("addGroup " + id + " directory exists" + groupPath.toString());
-                } else {
-                        try {
-                                //
-                                // Create the directory
-                                //
-                                Files.createDirectory(groupPath);
-                        } catch (IOException e) {
-                                logger.error("Failed to create " + groupPath);
-                                throw new PAPException("Failed to create " + id);
-                        }
-                }
-                //
-                // Create the Policies
-                //
-
-                Path policyProperties = Paths.get(groupPath.toString(), "xacml.policy.properties");
-                if (Files.exists(policyProperties)) {
-                        logger.warn("addGroup " + id + " file exists: " + policyProperties.toString());
-                } else {
-                        Properties props = new Properties();
-                        props.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "");
-                        props.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "");
-                        try {
-                                Files.createFile(policyProperties);
-                                try (OutputStream os = Files.newOutputStream(policyProperties)) {
-                                        props.store(os, "");
-                                }
-                        } catch (IOException e) {
-                                logger.error("Failed to create " + policyProperties);
-                                throw new PAPException("Failed to create " + id);
-                        }
-                }
-                //
-                // Create the PIP config
-                //
-                Path pipProperties = Paths.get(groupPath.toString(), "xacml.pip.properties");
-                if (Files.exists(pipProperties)) {
-                        logger.warn("addGroup " + id + " file exists: " + pipProperties.toString());
-                } else {
-                        try {
-                                Properties props = new Properties();
-                                props.setProperty(XACMLProperties.PROP_PIP_ENGINES, "");
-                                Files.createFile(pipProperties);
-                                try (OutputStream os = Files.newOutputStream(pipProperties)) {
-                                        props.store(os, "");
-                                }
-                        } catch (IOException e) {
-                                logger.error("Failed to create " + pipProperties);
-                                throw new PAPException("Failed to create " + id);
-                        }	
-
-                }
-                //
-                // Ok now add it
-                //
-                StdPDPGroup newGroup = new StdPDPGroup(id, name, description, groupPath);
-                if (this.groups.add(newGroup)) {
-                        // save the new group in our properties and notify any listeners of the change
-                        groupChanged(newGroup);
-                }
-
-        }
-        
-
-        
-        
-        /**
-         * Helper to create a new Group ID.
-         * Use the Name field to create the Id.
-         * The Name is expected to not be null; if it is then this method throws an exception.
-         * The name is supposed to be unique within the current set of groups,
-         * so creating the ID based on the name will create a unique string.
-         * 
-         * @param name
-         * @return
-         */
-        private String createNewPDPGroupId(String name) {
-                String id = name;
-                // replace "bad" characters with sequences that will be ok for file names and properties keys.
-                id = id.replace(" ", "_sp_");
-                id = id.replace("\t", "_tab_");
-                id = id.replace("\\", "_bksl_");
-                id = id.replace("/", "_sl_");
-                id = id.replace(":", "_col_");
-                id = id.replace("*", "_ast_");
-                id = id.replace("?", "_q_");
-                id = id.replace("\"", "_quo_");
-                id = id.replace("<", "_lt_");
-                id = id.replace(">", "_gt_");
-                id = id.replace("|", "_bar_");
-                id = id.replace("=", "_eq_");
-                id = id.replace(",", "_com_");
-                id = id.replace(";", "_scom_");
-
-                return id;
-        }
-        
-        
-        
-        
-
-        @Override
-        public void updateGroup(PDPGroup group) throws PAPException {
-                if (group == null || group.getId() == null) {
-                        throw new PAPException("Group or id is null");
-                }
-                if (group.getName() == null || group.getName().trim().length() == 0) {
-                        throw new PAPException("New name for group cannot be null or blank");
-                }
-                StdPDPGroup existingGroup = (StdPDPGroup)getGroup(group.getId());
-                if (existingGroup == null) {
-                        throw new PAPException("Update found no existing group with id '" + group.getId() + "'");
-                }
-                
-                
-                // We do dramatically different things when the Name changes
-                // because the Name is essentially the identity of the group (as the User knows it) so when the Identity changes we have to change the group ID.
-                if (group.getName().equals(existingGroup.getName())) {
-
-                        // update the disk
-                        try {
-                                ((StdPDPGroup)group).saveGroupConfiguration();
-                        } catch (IOException e) {
-                                throw new PAPException("Unable to save new configuration for '" + group.getName() + "': " + e.getMessage());
-                        }
-                        // update the group in the set by simply replacing the old instance with the new one
-                        this.groups.remove(existingGroup);
-                        this.groups.add((StdPDPGroup)group);
-                        
-                } else {
-                        // the name/identity of the group has changed
-                        // generate the new id
-                        String newId = createNewPDPGroupId(group.getName());
-                        
-                        // make sure no other group uses the new id
-                        for (PDPGroup g : groups) {
-                                if (g.getId().equals(newId)) {
-                                        throw new PAPException("Replacement name maps to ID '" + newId + "' which is already in use");
-                                }
-                        }
-                        ((StdPDPGroup)group).setId(newId);
-
-                        // rename the existing directory to the new id
-                        Path oldPath = existingGroup.getDirectory();
-                        Path newPath = Paths.get(oldPath.getParent().toString(), newId);
-                        ((StdPDPGroup)group).setDirectory(newPath);
-                        
-                        try {
-                                boolean success = oldPath.toFile().renameTo(newPath.toFile());
-                                if ( ! success) {
-                                        throw new PAPException("Unable to rename directory; reason unknown");
-                                }
-                        } catch (Exception e) {
-                                logger.error("Move '" + oldPath + "' to '" + newPath + "': " + e.getMessage(), e);
-                                throw new PAPException("Unable to move directory from '" + oldPath + "' to '" + newPath + "': " + e.getMessage());
-                        }
-                        // update the disk
-                        try {
-                                ((StdPDPGroup)group).saveGroupConfiguration();
-                        } catch (IOException e) {
-                                throw new PAPException("Unable to save new configuration for '" + group.getName() + "': " + e.getMessage());
-                        }
-                        
-                        // save the new group into the Set
-                        groups.remove(existingGroup);
-                        groups.add((StdPDPGroup)group);
-                        
-                }
-                
-                // perhaps only the group changed, but if the name/id changed it may look to a listener like more than one group
-                changed();
-
-        }
-                
-        @Override
-        public void	removeGroup(PDPGroup group, PDPGroup newGroup) throws PAPException, NullPointerException
-        {
-                if (group == null) {
-                        throw new NullPointerException();
-                }
-                //
-                // Does this group exist?
-                //
-                if (this.groups.contains(group) == false) {
-                        logger.error("This group doesn't exist.");
-                        throw new PAPException("The group '" + group.getId() + "' does not exist");
-                }
-                //
-                // Is it the default group?
-                //
-                if (group.isDefaultGroup()) {
-                        throw new PAPException("You cannot delete the default group.");
-                }
-                Set<PDP> pdps = group.getPdps();
-                //
-                // Are there PDPs? If so, then we need a target group
-                //
-                if (pdps.isEmpty() == false && newGroup == null) {
-                        throw new NullPointerException("Group targeted for deletion has PDPs, you must provide a new group for them.");
-                }
-                //
-                // Move the PDPs
-                //
-                if (pdps.isEmpty() == false) {
-                        if (! (newGroup instanceof StdPDPGroup)) {
-                                throw new PAPException("Unexpected class for newGroup: " + newGroup.getClass().getCanonicalName());
-                        }
-                        // The movePDP function will modify the set of PDPs in the group.
-                        // To avoid concurrent modification exceptions we need to duplicate the list before calling that function.
-                        List<PDP> pdpList = new ArrayList<PDP>();
-                        for (PDP pdp : pdps) {
-                                pdpList.add(pdp);
-                        }
-                        // now we can use the PDPs from the list without having ConcurrentAccessExceptions
-                        for (PDP pdp : pdpList) {
-                                this.movePDP(pdp, newGroup);
-                        }
-                }
-                //
-                // remove the directory for the group
-                //
-                String id = group.getId();
-                Path groupPath = Paths.get(this.repository.toString(), id);
-                //
-                // If it exists already
-                //
-                if ( ! Files.exists(groupPath)) {
-                        logger.warn("removeGroup " + id + " directory does not exist" + groupPath.toString());
-                } else {
-                        try {
-                                Files.walkFileTree(groupPath, new SimpleFileVisitor<Path>() {
-
-                                        @Override
-                                        public FileVisitResult visitFile(Path file,
-                                                        BasicFileAttributes attrs) throws IOException {
-                                                Files.delete(file);
-                                                return super.visitFile(file, attrs);
-                                        }
-                                        
-                                });
-                                //
-                                // delete the directory
-                                //
-                                Files.delete(groupPath);
-                        } catch (IOException e) {
-                                logger.error("Failed to delete " + groupPath + ": " +e);
-                                throw new PAPException("Failed to delete " + id);
-                        }
-                }
-                
-                // remove the group from the set of all groups
-                groups.remove(group);
-                
-                //
-                // Save changes
-                //
-                changed();
-                this.doSave();
-                return;
-        }
-        
-        @Override
-        public PDPGroup getPDPGroup(PDP pdp) throws PAPException {
-                for (PDPGroup group : this.groups) {
-                        if (group.getPdps().contains(pdp)) {
-                                return group;
-                        }
-                }
-                return null;
-        }	
-        
-        @Override
-        public PDPGroup getPDPGroup(String pdpId) throws PAPException {
-                for (PDPGroup group : this.groups) {
-                        for (PDP pdp : group.getPdps()) {
-                                if (pdp.getId().equals(pdpId)) {
-                                        return group;
-                                }
-                        }
-                }
-                return null;
-        }
-        
-        @Override
-        public PDP	getPDP(String pdpId) throws PAPException {
-                for (PDPGroup group : this.groups) {
-                        for (PDP pdp : group.getPdps()) {
-                                if (pdp.getId().equals(pdpId)) {
-                                        return pdp;
-                                }
-                        }
-                }
-                return null;
-        }
-        
-        @Override
-        public void newPDP(String id, PDPGroup group, String name, String description) throws PAPException, NullPointerException {
-                if (group == null) {
-                        throw new PAPException("You must specify which group the PDP will belong to.");
-                }
-                if (this.groups.contains(group) == false) {
-                        throw new PAPException("Unknown group, not in our list.");
-                }
-                for (PDP p : group.getPdps()) {
-                        if (p.getId().equals(id)) {
-                                throw new PAPException("A PDP with this ID exists.");
-                        }
-                }
-                if (group instanceof StdPDPGroup) {
-                        StdPDP pdp = new StdPDP(id, name, description);
-                        if (((StdPDPGroup) group).addPDP(pdp)) {
-                                //
-                                // Save the properties and notify any listeners
-                                //
-                                pdpChanged(pdp);
-                                return;
-                        }
-                }
-                return;
-        }
-
-        
-        @Override
-        public void movePDP(PDP pdp, PDPGroup newGroup) throws PAPException {
-                if (newGroup == null) {
-                        throw new NullPointerException("You must specify which group the PDP will belong to.");
-                }
-                PDPGroup currentGroup = this.getPDPGroup(pdp);
-                if (currentGroup == null) {
-                        throw new PAPException("PDP must already belong to a group.");
-                }
-                if (currentGroup.equals(newGroup)) {
-                        logger.warn("Already in that group.");
-                        return;
-                }
-                if (currentGroup instanceof StdPDPGroup && newGroup instanceof StdPDPGroup) {
-                        if (((StdPDPGroup) currentGroup).removePDP(pdp)) {
-                                boolean result = ((StdPDPGroup) newGroup).addPDP(pdp);
-                                if (result) {
-                                        //
-                                        // Save the configuration
-                                        //
-                                        this.doSave();
-                                } else {
-                                        logger.error("Failed to add to new group, putting back into original group.");
-                                        if (((StdPDPGroup) currentGroup).removePDP(pdp) == false) {
-                                                logger.error("Failed to put PDP back into original group.");
-                                        }
-                                }
-                        }
-                } else {
-                        String message = "Unknown PDP group class: " + newGroup.getClass().getCanonicalName() + " and " + currentGroup.getClass().getCanonicalName();
-                        logger.warn(message);
-                        throw new PAPException(message);
-                }
-        }
-
-        
-        @Override
-        public void	updatePDP(PDP pdp) throws PAPException {
-                PDP currentPDP = this.getPDP(pdp.getId());
-                if (currentPDP == null) {
-                        String message = "Unknown PDP id '" + pdp.getId() + "'";
-                        logger.warn(message);
-                        throw new PAPException(message);
-                }
-                
-                // the only things that the user can change are name and description
-                currentPDP.setDescription(pdp.getDescription());
-                currentPDP.setName(pdp.getName());
-                
-                this.doSave();
-        }
-        
-        @Override
-        public void removePDP(PDP pdp) throws PAPException {
-                PDPGroup group = this.getPDPGroup(pdp);
-                if (group == null) {
-                        throw new NullPointerException();
-                }
-                if (group instanceof StdPDPGroup) {
-                        boolean result = ((StdPDPGroup) group).removePDP(pdp);
-                        if (result) {
-                                this.doSave();
-                        }
-                        return;
-                }
-                String message = "Unknown PDP group class: " + group.getClass().getCanonicalName();
-                logger.warn(message);
-                throw new PAPException(message);
-        }
-
-        
-        @Override
-        /**
-         * Should never be called - Detailed status is held on the PDP, not the PAP
-         */
-        public PDPStatus getStatus(PDP pdp) throws PAPException {
-                return getPDP(pdp.getId()).getStatus();
-        }
-        
-        @Override
-        public void publishPolicy(String id, String name, boolean isRoot, InputStream policy, PDPGroup group) throws PAPException {
-                if (group == null) {
-                        throw new NullPointerException();
-                }
-                if (group instanceof StdPDPGroup && this.groups.contains(group)) {
-                        ((StdPDPGroup) group).publishPolicy(id, name, isRoot, policy);
-                        return;
-                }
-                logger.warn("unknown PDP Group: " + group);
-                throw new PAPException("Unknown PDP Group: " + group.getId());
-        }
-
-        // Currently not used on the PAP side.  This is done by ((StdPDPGroup) group).copyPolicyToFile
-        @Override
-        public void copyPolicy(PDPPolicy policy, PDPGroup group)
-                        throws PAPException {
-        }
-        
-        
-        @Override
-        public void removePolicy(PDPPolicy policy, PDPGroup group) throws PAPException {
-                if (group == null) {
-                        throw new NullPointerException();
-                }
-                if (group instanceof StdPDPGroup && this.groups.contains(group)) {
-                        ((StdPDPGroup) group).removePolicy(policy);
-                        return;
-                }
-                logger.warn("unknown PDP Group: " + group);
-                throw new PAPException("Unknown PDP Group: " + group.getId());
-        }
-
-        
+    public StdEngine() throws PAPException, IOException {
         //
-        // HELPER methods
+        // Get the location in the file system of our repository
         //
-        
-        private Set<StdPDPGroup>	readProperties(Path repository, Properties properties) throws PAPException {
-                Set<StdPDPGroup> groups = new HashSet<StdPDPGroup>();
-                //
-                // See if there is a groups property
-                //
-                String groupList = properties.getProperty(PROP_PAP_GROUPS, "");
-                if (groupList == null) {
-                        logger.warn("null group list " + PROP_PAP_GROUPS);
-                        groupList = "";
-                }
-                if (logger.isDebugEnabled()) {
-                        logger.debug("group list: " + groupList);
-                }
-                //
-                // Iterate the groups, converting to a set ensures we have unique groups.
-                //
-                for (String id : Splitter.on(',').trimResults().omitEmptyStrings().split(groupList)) {
-                        //
-                        // Add our Group Object
-                        //
-                        StdPDPGroup g = new StdPDPGroup(id.trim(), 
-                                                                id.equals(properties.getProperty(PROP_PAP_GROUPS_DEFAULT, PROP_PAP_GROUPS_DEFAULT_NAME)), 
-                                                                properties,
-                                                                Paths.get(repository.toString(), id));
+        this.repository = Paths.get(XACMLProperties.getProperty(PROP_PAP_REPO));
+        //
+        // Initialize
+        //
+        this.intialize();
+    }
 
-                        //
-                        // Add it in
-                        //
-                        groups.add(g);
-                }
-                //
-                // Dump what we got
-                //
-                if (logger.isDebugEnabled()) {
-                        logger.debug("PDP Group List: " + groups.toString());
-                }
-                return groups;
+    public StdEngine(Properties properties) throws PAPException, IOException {
+        //
+        // Get the location in the file system of our repository
+        //
+        this.repository = Paths.get(properties.getProperty(PROP_PAP_REPO));
+        //
+        // Initialize
+        //
+        this.intialize();
+    }
+
+    public StdEngine(Path repository) throws PAPException, IOException {
+        //
+        // Save our location
+        //
+        this.repository = repository;
+        //
+        // Initialize
+        //
+        this.intialize();
+    }
+
+    private void intialize() throws PAPException, IOException {
+        //
+        // Sanity check the repository path
+        //
+        if (this.repository == null) {
+            throw new PAPException ("No repository specified.");
         }
-        
-        private void saveConfiguration() throws PAPException, IOException {
+        if (Files.notExists(this.repository)) {
+            Files.createDirectory(repository);
+        }
+        if (Files.isDirectory(this.repository) == false) {
+            throw new PAPException ("Repository is NOT a directory: " + this.repository.toAbsolutePath());
+        }
+        if (Files.isWritable(this.repository) == false) {
+            throw new PAPException ("Repository is NOT writable: " + this.repository.toAbsolutePath());
+        }
+        //
+        // Load our groups
+        //
+        this.loadGroups();
+    }
+
+    private void loadGroups() throws PAPException {
+        //
+        // Create a properties object
+        //
+        Properties properties = new Properties();
+        Path file = Paths.get(this.repository.toString(), XACMLProperties.XACML_PROPERTIES_NAME);
+        try {
+            //
+            // Load the properties
+            //
+            try (InputStream is = new FileInputStream(file.toFile())) {
+                properties.load(is);
+            }
+
+            //
+            // Parse it
+            //
+            this.groups = this.readProperties(this.repository, properties);
+        } catch (IOException e) {
+            logger.error("Failed to load " + file.toAbsolutePath().toString());
+            this.groups = new HashSet<StdPDPGroup>();
+        }
+        //
+        // Initialize the default group
+        //
+        PDPGroup defaultGroup = this.initializeDefaultGroup(file, properties);
+        logger.info("Default group is: " + defaultGroup.getId() + "=" + defaultGroup.getName());
+    }
+
+    private PDPGroup initializeDefaultGroup(Path file, Properties properties) throws PAPException {
+        //
+        // Make sure we have the default group
+        //
+        PDPGroup group = this.getDefaultGroup();
+        if (group != null) {
+            return group;
+        }
+        //
+        // We don't have the default group, create it
+        //
+        String defaultId = properties.getProperty(PROP_PAP_GROUPS_DEFAULT, PROP_PAP_GROUPS_DEFAULT_NAME);
+        logger.warn("Default group does NOT exist, creating " + defaultId);
+        Path defaultPath = Paths.get(this.repository.toString(), defaultId);
+        try {
+            //
+            // Does it exist?
+            //
+            if (Files.notExists(defaultPath)) {
                 //
-                // Create our properties object
+                // Create its directory
                 //
-                Properties properties = new Properties() {
-                        private static final long serialVersionUID = 1L;
-                        // For Debugging it is helpful for the file to be in a sorted order,
-                        // any by returning the keys in the natural Alpha order for strings we get close enough.
-                        // TreeSet is sorted, and this just overrides the normal Properties method to get the keys.
-                        @Override
-                    public synchronized Enumeration<Object> keys() {
-                        return Collections.enumeration(new TreeSet<Object>(super.keySet()));
+                Files.createDirectory(defaultPath);
+                //
+                // Create property files
+                //
+                {
+                    Properties props = new Properties();
+                    props.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "");
+                    props.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "");
+                    Path policyPath = Paths.get(defaultPath.toAbsolutePath().toString(), "xacml.policy.properties");
+                    Files.createFile(policyPath);
+                    try (OutputStream os = Files.newOutputStream(policyPath)) {
+                        props.store(os, "");
+                    } catch (IOException e) {
+                        logger.error("Failed to write default policy properties", e);
                     }
-            };
-                //
-                // Iterate our groups
-                //
-                List<String> ids = new ArrayList<String>();
-                for (PDPGroup group : this.groups) {
-                        ids.add(group.getId());
-                        properties.setProperty(group.getId() + ".name", (group.getName() == null ? "" : group.getName()));
-                        properties.setProperty(group.getId() + ".description", (group.getDescription() == null ? "" : group.getDescription()));
-                        //
-                        // Iterate its PDPs
-                        //
-                        List<String> pdps = new ArrayList<String>();
-                        for (PDP pdp : group.getPdps()) {
-                                pdps.add(pdp.getId());
-                                properties.setProperty(pdp.getId() + ".name", (pdp.getName() == null ? "" : pdp.getName()));
-                                properties.setProperty(pdp.getId() + ".description", (pdp.getDescription() == null ? "" : pdp.getDescription()));
-                        }
-                        String pdpList = "";
-                        if (pdps.size() == 1) {
-                                pdpList = pdps.get(0);
-                        } else if (pdps.size() > 1) {
-                                pdpList = Joiner.on(',').skipNulls().join(pdps);
-                        }
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Group " + group.getId() + " PDPS: " + pdpList);
-                        }
-                        properties.setProperty(group.getId() + ".pdps", pdpList);
                 }
-                if (ids.isEmpty()) {
-                        throw new PAPException("Inconsistency - we have NO groups. We should have at least one.");
+                {
+                    Properties props = new Properties();
+                    props.setProperty(XACMLProperties.PROP_PIP_ENGINES, "");
+                    Path pipPath = Paths.get(defaultPath.toAbsolutePath().toString(), "xacml.pip.properties");
+                    Files.createFile(pipPath);
+                    try (OutputStream os = Files.newOutputStream(pipPath)) {
+                        props.store(os, "");
+                    } catch (IOException e) {
+                        logger.error("Failed to write default pip properties", e);
+                    }
                 }
-                String groupList = "";
-                if (ids.size() == 1) {
-                        groupList = ids.get(0);
-                } else if (ids.size() > 1){
-                        groupList = Joiner.on(',').skipNulls().join(ids);
-                }
-                logger.info("New Group List: " + groupList);
-                
-                properties.setProperty(PROP_PAP_GROUPS, groupList);
-                //
-                // Get the default group
-                //
-                PDPGroup defaultGroup = this.getDefaultGroup();
-                if (defaultGroup == null) {
-                        throw new PAPException("Invalid state - no default group.");
-                }
-                properties.setProperty(PROP_PAP_GROUPS_DEFAULT, defaultGroup.getId());
-                //
-                // Now we can save the file
-                //
-                Path file = Paths.get(this.repository.toString(), "xacml.properties");
+            }
+            //
+            // Create the default group
+            //
+            StdPDPGroup newDefault = new StdPDPGroup(defaultId, true, "default", "The default group where new PDP's are put.", defaultPath);
+            //
+            // Add it to our list
+            //
+            this.groups.add(newDefault);
+            //
+            // Save our properties out since we have
+            // a new default group.
+            //
+            StdEngine.setGroupProperties(newDefault, properties);
+            //
+            // Save it to disk
+            //
+            try {
                 try (OutputStream os = Files.newOutputStream(file)) {
-                        properties.store(os, "");
+                    properties.store(os, "");
                 }
+            } catch (IOException e) {
+                logger.error("Failed to save properties with new default group information.", e);
+            }
+            //
+            // Return it
+            //
+            return newDefault;
+        } catch (IOException e) {
+            logger.error("Failed to create default group: " + defaultId, e);
+            throw new PAPException("Failed to create default group");
         }
-        
-        public static void	removeGroupProperties(String id, Properties properties) {
-                for (Object key : properties.keySet()) {
-                        if (key.toString().startsWith(id + ".")) {
-                                properties.remove(key);
-                        }
-                }
+    }
+
+
+
+
+    @Override
+    public PDPGroup getDefaultGroup() throws PAPException {
+        for (PDPGroup group : this.groups) {
+            if (group.isDefaultGroup()) {
+                return group;
+            }
         }
-        
-        public static void setGroupProperties(PDPGroup group, Properties properties) {
-                //
-                // make sure its in the list of groups
-                //
-                Iterable<String> groups = Splitter.on(',').trimResults().omitEmptyStrings().split( properties.getProperty(PROP_PAP_GROUPS, ""));
-                boolean inList = false;
-                for (String g : groups) {
-                        if (g.equals(group.getId())) {
-                                inList = true;
-                        }
+        //
+        // Default group doesn't exist
+        //
+        return null;
+    }
+
+    @Override
+    public void	SetDefaultGroup(PDPGroup group) throws PAPException {
+
+        boolean changesMade = false;
+        for (PDPGroup aGroup : groups) {
+            if (aGroup.getId().equals(group.getId())) {
+                if ( ! aGroup.isDefaultGroup()) {
+//TODO - since the original code checked for type we do also.
+                    if (aGroup instanceof StdPDPGroup) {
+                        ((StdPDPGroup) aGroup).setDefault(true);
+                        changesMade = true;
+                    } else {
+                        throw new IllegalArgumentException("Group in groups of unknown type '" + aGroup.getClass().getName() + "'");
+                    }
                 }
-                if (inList == false) {
-                        Set<String> grps = Sets.newHashSet(groups);
-                        grps.add(group.getId());
-                        String newGroupList = "";;
-                        if (grps.size() == 1) {
-                                newGroupList = grps.iterator().next();
-                        } else if (grps.size() > 1) {
-                                newGroupList = Joiner.on(',').skipNulls().join(grps);
-                        }
-                        logger.info("New Group List: " + newGroupList);
-                        properties.setProperty(PROP_PAP_GROUPS, newGroupList);
+            } else {
+                // not the new default group
+                if (aGroup.isDefaultGroup()) {
+//TODO - since the original code checked for type we do also.
+                    if (aGroup instanceof StdPDPGroup) {
+                        ((StdPDPGroup) aGroup).setDefault(false);
+                        changesMade = true;
+                    } else {
+                        throw new IllegalArgumentException("Group in groups of unknown type '" + aGroup.getClass().getName() + "'");
+                    }
                 }
+            }
+        }
+        if (changesMade) {
+            this.doSave();
+        }
+
+        return;
+    }
+
+    @Override
+    public Set<PDPGroup> getPDPGroups() throws PAPException {
+        final Set<PDPGroup> grps = new HashSet<PDPGroup>();
+        for (PDPGroup g : this.groups) {
+            grps.add(g);
+        }
+        return Collections.unmodifiableSet(grps);
+    }
+
+    @Override
+    public PDPGroup	getGroup(String id) throws PAPException {
+        for (PDPGroup g: this.groups) {
+            if (g.getId().equals(id)) {
+                return g;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public void	newGroup(String name, String description) throws PAPException, NullPointerException {
+        //
+        // Null check
+        //
+        if (name == null) {
+            throw new NullPointerException();
+        }
+        //
+        // Do we already have this group?
+        //
+        for (PDPGroup group : this.groups) {
+            if (group.getName().equals(name)) {
+                throw new PAPException("Group with this name=" + name + " already exists.");
+            }
+        }
+
+
+        // create an Id that can be used as a file name and a properties file key.
+        // Ids must not contain \/:*?"<>|=,;
+        // The ID must also be unique within the current set of PDPGroups.
+        String id = createNewPDPGroupId(name);
+
+
+        //
+        // Construct the directory path
+        //
+        Path groupPath = Paths.get(this.repository.toString(), id);
+        //
+        // If it exists already
+        //
+        if (Files.exists(groupPath)) {
+            logger.warn("addGroup " + id + " directory exists" + groupPath.toString());
+        } else {
+            try {
                 //
-                // Set its properties
+                // Create the directory
                 //
-                properties.setProperty(group.getId() + ".name", group.getName());
-                properties.setProperty(group.getId() + ".description", group.getDescription());
+                Files.createDirectory(groupPath);
+            } catch (IOException e) {
+                logger.error("Failed to create " + groupPath);
+                throw new PAPException("Failed to create " + id);
+            }
+        }
+        //
+        // Create the Policies
+        //
+
+        Path policyProperties = Paths.get(groupPath.toString(), "xacml.policy.properties");
+        if (Files.exists(policyProperties)) {
+            logger.warn("addGroup " + id + " file exists: " + policyProperties.toString());
+        } else {
+            Properties props = new Properties();
+            props.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "");
+            props.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "");
+            try {
+                Files.createFile(policyProperties);
+                try (OutputStream os = Files.newOutputStream(policyProperties)) {
+                    props.store(os, "");
+                }
+            } catch (IOException e) {
+                logger.error("Failed to create " + policyProperties);
+                throw new PAPException("Failed to create " + id);
+            }
+        }
+        //
+        // Create the PIP config
+        //
+        Path pipProperties = Paths.get(groupPath.toString(), "xacml.pip.properties");
+        if (Files.exists(pipProperties)) {
+            logger.warn("addGroup " + id + " file exists: " + pipProperties.toString());
+        } else {
+            try {
+                Properties props = new Properties();
+                props.setProperty(XACMLProperties.PROP_PIP_ENGINES, "");
+                Files.createFile(pipProperties);
+                try (OutputStream os = Files.newOutputStream(pipProperties)) {
+                    props.store(os, "");
+                }
+            } catch (IOException e) {
+                logger.error("Failed to create " + pipProperties);
+                throw new PAPException("Failed to create " + id);
+            }
+
+        }
+        //
+        // Ok now add it
+        //
+        StdPDPGroup newGroup = new StdPDPGroup(id, name, description, groupPath);
+        if (this.groups.add(newGroup)) {
+            // save the new group in our properties and notify any listeners of the change
+            groupChanged(newGroup);
+        }
+
+    }
+
+
+
+
+    /**
+     * Helper to create a new Group ID.
+     * Use the Name field to create the Id.
+     * The Name is expected to not be null; if it is then this method throws an exception.
+     * The name is supposed to be unique within the current set of groups,
+     * so creating the ID based on the name will create a unique string.
+     *
+     * @param name
+     * @return
+     */
+    private String createNewPDPGroupId(String name) {
+        String id = name;
+        // replace "bad" characters with sequences that will be ok for file names and properties keys.
+        id = id.replace(" ", "_sp_");
+        id = id.replace("\t", "_tab_");
+        id = id.replace("\\", "_bksl_");
+        id = id.replace("/", "_sl_");
+        id = id.replace(":", "_col_");
+        id = id.replace("*", "_ast_");
+        id = id.replace("?", "_q_");
+        id = id.replace("\"", "_quo_");
+        id = id.replace("<", "_lt_");
+        id = id.replace(">", "_gt_");
+        id = id.replace("|", "_bar_");
+        id = id.replace("=", "_eq_");
+        id = id.replace(",", "_com_");
+        id = id.replace(";", "_scom_");
+
+        return id;
+    }
+
+
+
+
+
+    @Override
+    public void updateGroup(PDPGroup group) throws PAPException {
+        if (group == null || group.getId() == null) {
+            throw new PAPException("Group or id is null");
+        }
+        if (group.getName() == null || group.getName().trim().length() == 0) {
+            throw new PAPException("New name for group cannot be null or blank");
+        }
+        StdPDPGroup existingGroup = (StdPDPGroup)getGroup(group.getId());
+        if (existingGroup == null) {
+            throw new PAPException("Update found no existing group with id '" + group.getId() + "'");
+        }
+
+
+        // We do dramatically different things when the Name changes
+        // because the Name is essentially the identity of the group (as the User knows it) so when the Identity changes we have to change the group ID.
+        if (group.getName().equals(existingGroup.getName())) {
+
+            // update the disk
+            try {
+                ((StdPDPGroup)group).saveGroupConfiguration();
+            } catch (IOException e) {
+                throw new PAPException("Unable to save new configuration for '" + group.getName() + "': " + e.getMessage());
+            }
+            // update the group in the set by simply replacing the old instance with the new one
+            this.groups.remove(existingGroup);
+            this.groups.add((StdPDPGroup)group);
+
+        } else {
+            // the name/identity of the group has changed
+            // generate the new id
+            String newId = createNewPDPGroupId(group.getName());
+
+            // make sure no other group uses the new id
+            for (PDPGroup g : groups) {
+                if (g.getId().equals(newId)) {
+                    throw new PAPException("Replacement name maps to ID '" + newId + "' which is already in use");
+                }
+            }
+            ((StdPDPGroup)group).setId(newId);
+
+            // rename the existing directory to the new id
+            Path oldPath = existingGroup.getDirectory();
+            Path newPath = Paths.get(oldPath.getParent().toString(), newId);
+            ((StdPDPGroup)group).setDirectory(newPath);
+
+            try {
+                boolean success = oldPath.toFile().renameTo(newPath.toFile());
+                if ( ! success) {
+                    throw new PAPException("Unable to rename directory; reason unknown");
+                }
+            } catch (Exception e) {
+                logger.error("Move '" + oldPath + "' to '" + newPath + "': " + e.getMessage(), e);
+                throw new PAPException("Unable to move directory from '" + oldPath + "' to '" + newPath + "': " + e.getMessage());
+            }
+            // update the disk
+            try {
+                ((StdPDPGroup)group).saveGroupConfiguration();
+            } catch (IOException e) {
+                throw new PAPException("Unable to save new configuration for '" + group.getName() + "': " + e.getMessage());
+            }
+
+            // save the new group into the Set
+            groups.remove(existingGroup);
+            groups.add((StdPDPGroup)group);
+
+        }
+
+        // perhaps only the group changed, but if the name/id changed it may look to a listener like more than one group
+        changed();
+
+    }
+
+    @Override
+    public void	removeGroup(PDPGroup group, PDPGroup newGroup) throws PAPException, NullPointerException {
+        if (group == null) {
+            throw new NullPointerException();
+        }
+        //
+        // Does this group exist?
+        //
+        if (this.groups.contains(group) == false) {
+            logger.error("This group doesn't exist.");
+            throw new PAPException("The group '" + group.getId() + "' does not exist");
+        }
+        //
+        // Is it the default group?
+        //
+        if (group.isDefaultGroup()) {
+            throw new PAPException("You cannot delete the default group.");
+        }
+        Set<PDP> pdps = group.getPdps();
+        //
+        // Are there PDPs? If so, then we need a target group
+        //
+        if (pdps.isEmpty() == false && newGroup == null) {
+            throw new NullPointerException("Group targeted for deletion has PDPs, you must provide a new group for them.");
+        }
+        //
+        // Move the PDPs
+        //
+        if (pdps.isEmpty() == false) {
+            if (! (newGroup instanceof StdPDPGroup)) {
+                throw new PAPException("Unexpected class for newGroup: " + newGroup.getClass().getCanonicalName());
+            }
+            // The movePDP function will modify the set of PDPs in the group.
+            // To avoid concurrent modification exceptions we need to duplicate the list before calling that function.
+            List<PDP> pdpList = new ArrayList<PDP>();
+            for (PDP pdp : pdps) {
+                pdpList.add(pdp);
+            }
+            // now we can use the PDPs from the list without having ConcurrentAccessExceptions
+            for (PDP pdp : pdpList) {
+                this.movePDP(pdp, newGroup);
+            }
+        }
+        //
+        // remove the directory for the group
+        //
+        String id = group.getId();
+        Path groupPath = Paths.get(this.repository.toString(), id);
+        //
+        // If it exists already
+        //
+        if ( ! Files.exists(groupPath)) {
+            logger.warn("removeGroup " + id + " directory does not exist" + groupPath.toString());
+        } else {
+            try {
+                Files.walkFileTree(groupPath, new SimpleFileVisitor<Path>() {
+
+                    @Override
+                    public FileVisitResult visitFile(Path file,
+                                                     BasicFileAttributes attrs) throws IOException {
+                        Files.delete(file);
+                        return super.visitFile(file, attrs);
+                    }
+
+                });
                 //
-                // Set its PDP list
+                // delete the directory
                 //
-                if (group.getPdps().size() > 0) {
-                        String pdpList = "";
-                        if (group.getPdps().size() == 1) {
-                                pdpList = group.getPdps().iterator().next().getId();
-                        } else if (group.getPdps().size() > 1) {
-                                Set<String> ids = new HashSet<String>();
-                                for (PDP pdp : group.getPdps()) {
-                                        ids.add(pdp.getId());
-                                }
-                                pdpList = Joiner.on(',').skipNulls().join(ids);
-                        }
-                        properties.setProperty(group.getId() + ".pdps", pdpList);
+                Files.delete(groupPath);
+            } catch (IOException e) {
+                logger.error("Failed to delete " + groupPath + ": " +e);
+                throw new PAPException("Failed to delete " + id);
+            }
+        }
+
+        // remove the group from the set of all groups
+        groups.remove(group);
+
+        //
+        // Save changes
+        //
+        changed();
+        this.doSave();
+        return;
+    }
+
+    @Override
+    public PDPGroup getPDPGroup(PDP pdp) throws PAPException {
+        for (PDPGroup group : this.groups) {
+            if (group.getPdps().contains(pdp)) {
+                return group;
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public PDPGroup getPDPGroup(String pdpId) throws PAPException {
+        for (PDPGroup group : this.groups) {
+            for (PDP pdp : group.getPdps()) {
+                if (pdp.getId().equals(pdpId)) {
+                    return group;
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public PDP	getPDP(String pdpId) throws PAPException {
+        for (PDPGroup group : this.groups) {
+            for (PDP pdp : group.getPdps()) {
+                if (pdp.getId().equals(pdpId)) {
+                    return pdp;
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public void newPDP(String id, PDPGroup group, String name, String description) throws PAPException, NullPointerException {
+        if (group == null) {
+            throw new PAPException("You must specify which group the PDP will belong to.");
+        }
+        if (this.groups.contains(group) == false) {
+            throw new PAPException("Unknown group, not in our list.");
+        }
+        for (PDP p : group.getPdps()) {
+            if (p.getId().equals(id)) {
+                throw new PAPException("A PDP with this ID exists.");
+            }
+        }
+        if (group instanceof StdPDPGroup) {
+            StdPDP pdp = new StdPDP(id, name, description);
+            if (((StdPDPGroup) group).addPDP(pdp)) {
+                //
+                // Save the properties and notify any listeners
+                //
+                pdpChanged(pdp);
+                return;
+            }
+        }
+        return;
+    }
+
+
+    @Override
+    public void movePDP(PDP pdp, PDPGroup newGroup) throws PAPException {
+        if (newGroup == null) {
+            throw new NullPointerException("You must specify which group the PDP will belong to.");
+        }
+        PDPGroup currentGroup = this.getPDPGroup(pdp);
+        if (currentGroup == null) {
+            throw new PAPException("PDP must already belong to a group.");
+        }
+        if (currentGroup.equals(newGroup)) {
+            logger.warn("Already in that group.");
+            return;
+        }
+        if (currentGroup instanceof StdPDPGroup && newGroup instanceof StdPDPGroup) {
+            if (((StdPDPGroup) currentGroup).removePDP(pdp)) {
+                boolean result = ((StdPDPGroup) newGroup).addPDP(pdp);
+                if (result) {
+                    //
+                    // Save the configuration
+                    //
+                    this.doSave();
                 } else {
-                        properties.setProperty(group.getId() + ".pdps", "");
+                    logger.error("Failed to add to new group, putting back into original group.");
+                    if (((StdPDPGroup) currentGroup).removePDP(pdp) == false) {
+                        logger.error("Failed to put PDP back into original group.");
+                    }
                 }
+            }
+        } else {
+            String message = "Unknown PDP group class: " + newGroup.getClass().getCanonicalName() + " and " + currentGroup.getClass().getCanonicalName();
+            logger.warn(message);
+            throw new PAPException(message);
+        }
+    }
+
+
+    @Override
+    public void	updatePDP(PDP pdp) throws PAPException {
+        PDP currentPDP = this.getPDP(pdp.getId());
+        if (currentPDP == null) {
+            String message = "Unknown PDP id '" + pdp.getId() + "'";
+            logger.warn(message);
+            throw new PAPException(message);
         }
 
-        
-        public void changed() {
-                if (logger.isDebugEnabled()) {
-                        logger.debug("changed");
-                }
+        // the only things that the user can change are name and description
+        currentPDP.setDescription(pdp.getDescription());
+        currentPDP.setName(pdp.getName());
+
+        this.doSave();
+    }
+
+    @Override
+    public void removePDP(PDP pdp) throws PAPException {
+        PDPGroup group = this.getPDPGroup(pdp);
+        if (group == null) {
+            throw new NullPointerException();
+        }
+        if (group instanceof StdPDPGroup) {
+            boolean result = ((StdPDPGroup) group).removePDP(pdp);
+            if (result) {
                 this.doSave();
-                this.fireChanged();
+            }
+            return;
         }
+        String message = "Unknown PDP group class: " + group.getClass().getCanonicalName();
+        logger.warn(message);
+        throw new PAPException(message);
+    }
 
-        public void groupChanged(PDPGroup group) {
-                if (logger.isDebugEnabled()) {
-                        logger.debug("groupChanged: " + group);
+
+    @Override
+    /**
+     * Should never be called - Detailed status is held on the PDP, not the PAP
+     */
+    public PDPStatus getStatus(PDP pdp) throws PAPException {
+        return getPDP(pdp.getId()).getStatus();
+    }
+
+    @Override
+    public void publishPolicy(String id, String name, boolean isRoot, InputStream policy, PDPGroup group) throws PAPException {
+        if (group == null) {
+            throw new NullPointerException();
+        }
+        if (group instanceof StdPDPGroup && this.groups.contains(group)) {
+            ((StdPDPGroup) group).publishPolicy(id, name, isRoot, policy);
+            return;
+        }
+        logger.warn("unknown PDP Group: " + group);
+        throw new PAPException("Unknown PDP Group: " + group.getId());
+    }
+
+    // Currently not used on the PAP side.  This is done by ((StdPDPGroup) group).copyPolicyToFile
+    @Override
+    public void copyPolicy(PDPPolicy policy, PDPGroup group)
+    throws PAPException {
+    }
+
+
+    @Override
+    public void removePolicy(PDPPolicy policy, PDPGroup group) throws PAPException {
+        if (group == null) {
+            throw new NullPointerException();
+        }
+        if (group instanceof StdPDPGroup && this.groups.contains(group)) {
+            ((StdPDPGroup) group).removePolicy(policy);
+            return;
+        }
+        logger.warn("unknown PDP Group: " + group);
+        throw new PAPException("Unknown PDP Group: " + group.getId());
+    }
+
+
+    //
+    // HELPER methods
+    //
+
+    private Set<StdPDPGroup>	readProperties(Path repository, Properties properties) throws PAPException {
+        Set<StdPDPGroup> groups = new HashSet<StdPDPGroup>();
+        //
+        // See if there is a groups property
+        //
+        String groupList = properties.getProperty(PROP_PAP_GROUPS, "");
+        if (groupList == null) {
+            logger.warn("null group list " + PROP_PAP_GROUPS);
+            groupList = "";
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug("group list: " + groupList);
+        }
+        //
+        // Iterate the groups, converting to a set ensures we have unique groups.
+        //
+        for (String id : Splitter.on(',').trimResults().omitEmptyStrings().split(groupList)) {
+            //
+            // Add our Group Object
+            //
+            StdPDPGroup g = new StdPDPGroup(id.trim(),
+                                            id.equals(properties.getProperty(PROP_PAP_GROUPS_DEFAULT, PROP_PAP_GROUPS_DEFAULT_NAME)),
+                                            properties,
+                                            Paths.get(repository.toString(), id));
+
+            //
+            // Add it in
+            //
+            groups.add(g);
+        }
+        //
+        // Dump what we got
+        //
+        if (logger.isDebugEnabled()) {
+            logger.debug("PDP Group List: " + groups.toString());
+        }
+        return groups;
+    }
+
+    private void saveConfiguration() throws PAPException, IOException {
+        //
+        // Create our properties object
+        //
+        Properties properties = new Properties() {
+            private static final long serialVersionUID = 1L;
+            // For Debugging it is helpful for the file to be in a sorted order,
+            // any by returning the keys in the natural Alpha order for strings we get close enough.
+            // TreeSet is sorted, and this just overrides the normal Properties method to get the keys.
+            @Override
+            public synchronized Enumeration<Object> keys() {
+                return Collections.enumeration(new TreeSet<Object>(super.keySet()));
+            }
+        };
+        //
+        // Iterate our groups
+        //
+        List<String> ids = new ArrayList<String>();
+        for (PDPGroup group : this.groups) {
+            ids.add(group.getId());
+            properties.setProperty(group.getId() + ".name", (group.getName() == null ? "" : group.getName()));
+            properties.setProperty(group.getId() + ".description", (group.getDescription() == null ? "" : group.getDescription()));
+            //
+            // Iterate its PDPs
+            //
+            List<String> pdps = new ArrayList<String>();
+            for (PDP pdp : group.getPdps()) {
+                pdps.add(pdp.getId());
+                properties.setProperty(pdp.getId() + ".name", (pdp.getName() == null ? "" : pdp.getName()));
+                properties.setProperty(pdp.getId() + ".description", (pdp.getDescription() == null ? "" : pdp.getDescription()));
+            }
+            String pdpList = "";
+            if (pdps.size() == 1) {
+                pdpList = pdps.get(0);
+            } else if (pdps.size() > 1) {
+                pdpList = Joiner.on(',').skipNulls().join(pdps);
+            }
+            if (logger.isDebugEnabled()) {
+                logger.debug("Group " + group.getId() + " PDPS: " + pdpList);
+            }
+            properties.setProperty(group.getId() + ".pdps", pdpList);
+        }
+        if (ids.isEmpty()) {
+            throw new PAPException("Inconsistency - we have NO groups. We should have at least one.");
+        }
+        String groupList = "";
+        if (ids.size() == 1) {
+            groupList = ids.get(0);
+        } else if (ids.size() > 1) {
+            groupList = Joiner.on(',').skipNulls().join(ids);
+        }
+        logger.info("New Group List: " + groupList);
+
+        properties.setProperty(PROP_PAP_GROUPS, groupList);
+        //
+        // Get the default group
+        //
+        PDPGroup defaultGroup = this.getDefaultGroup();
+        if (defaultGroup == null) {
+            throw new PAPException("Invalid state - no default group.");
+        }
+        properties.setProperty(PROP_PAP_GROUPS_DEFAULT, defaultGroup.getId());
+        //
+        // Now we can save the file
+        //
+        Path file = Paths.get(this.repository.toString(), "xacml.properties");
+        try (OutputStream os = Files.newOutputStream(file)) {
+            properties.store(os, "");
+        }
+    }
+
+    public static void	removeGroupProperties(String id, Properties properties) {
+        for (Object key : properties.keySet()) {
+            if (key.toString().startsWith(id + ".")) {
+                properties.remove(key);
+            }
+        }
+    }
+
+    public static void setGroupProperties(PDPGroup group, Properties properties) {
+        //
+        // make sure its in the list of groups
+        //
+        Iterable<String> groups = Splitter.on(',').trimResults().omitEmptyStrings().split( properties.getProperty(PROP_PAP_GROUPS, ""));
+        boolean inList = false;
+        for (String g : groups) {
+            if (g.equals(group.getId())) {
+                inList = true;
+            }
+        }
+        if (inList == false) {
+            Set<String> grps = Sets.newHashSet(groups);
+            grps.add(group.getId());
+            String newGroupList = "";;
+            if (grps.size() == 1) {
+                newGroupList = grps.iterator().next();
+            } else if (grps.size() > 1) {
+                newGroupList = Joiner.on(',').skipNulls().join(grps);
+            }
+            logger.info("New Group List: " + newGroupList);
+            properties.setProperty(PROP_PAP_GROUPS, newGroupList);
+        }
+        //
+        // Set its properties
+        //
+        properties.setProperty(group.getId() + ".name", group.getName());
+        properties.setProperty(group.getId() + ".description", group.getDescription());
+        //
+        // Set its PDP list
+        //
+        if (group.getPdps().size() > 0) {
+            String pdpList = "";
+            if (group.getPdps().size() == 1) {
+                pdpList = group.getPdps().iterator().next().getId();
+            } else if (group.getPdps().size() > 1) {
+                Set<String> ids = new HashSet<String>();
+                for (PDP pdp : group.getPdps()) {
+                    ids.add(pdp.getId());
                 }
-                this.doSave();
-                this.firePDPGroupChanged(group);
+                pdpList = Joiner.on(',').skipNulls().join(ids);
+            }
+            properties.setProperty(group.getId() + ".pdps", pdpList);
+        } else {
+            properties.setProperty(group.getId() + ".pdps", "");
         }
+    }
 
 
-        public void pdpChanged(PDP pdp) {
-                if (logger.isDebugEnabled()) {
-                        logger.debug("pdpChanged: " + pdp);
-                }
-                this.doSave();
-                this.firePDPChanged(pdp);
+    public void changed() {
+        if (logger.isDebugEnabled()) {
+            logger.debug("changed");
         }
+        this.doSave();
+        this.fireChanged();
+    }
 
-        private void doSave() {
-                try {
-                        //
-                        // Save the configuration
-                        //
-                        this.saveConfiguration();
-                } catch (IOException e) {
-                        logger.error("Failed to save configuration", e);
-                } catch (PAPException e) {
-                        logger.error("Failed to save configuration", e);
-                }		
+    public void groupChanged(PDPGroup group) {
+        if (logger.isDebugEnabled()) {
+            logger.debug("groupChanged: " + group);
         }
+        this.doSave();
+        this.firePDPGroupChanged(group);
+    }
+
+
+    public void pdpChanged(PDP pdp) {
+        if (logger.isDebugEnabled()) {
+            logger.debug("pdpChanged: " + pdp);
+        }
+        this.doSave();
+        this.firePDPChanged(pdp);
+    }
+
+    private void doSave() {
+        try {
+            //
+            // Save the configuration
+            //
+            this.saveConfiguration();
+        } catch (IOException e) {
+            logger.error("Failed to save configuration", e);
+        } catch (PAPException e) {
+            logger.error("Failed to save configuration", e);
+        }
+    }
 
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdEngineFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdEngineFactory.java
index db6f689..41855cb 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdEngineFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,27 +42,27 @@
 import com.att.research.xacml.util.FactoryException;
 
 public class StdEngineFactory extends PAPEngineFactory {
-        private static Log	logger	= LogFactory.getLog(StdEngineFactory.class);
-        
-        @Override
-        public PAPEngine newEngine() throws FactoryException, PAPException {
-                try {
-                        return new StdEngine();
-                } catch (IOException e) {
-                        logger.error("Failed to create engine: ", e);
-                        return null;
-                }
-        }
+    private static Log	logger	= LogFactory.getLog(StdEngineFactory.class);
 
-        @Override
-        public PAPEngine newEngine(Properties properties) throws FactoryException,
-                        PAPException {
-                try {
-                        return new StdEngine(properties);
-                } catch (IOException e) {
-                        logger.error("Failed to create engine: ", e);
-                        return null;
-                }
+    @Override
+    public PAPEngine newEngine() throws FactoryException, PAPException {
+        try {
+            return new StdEngine();
+        } catch (IOException e) {
+            logger.error("Failed to create engine: ", e);
+            return null;
         }
+    }
+
+    @Override
+    public PAPEngine newEngine(Properties properties) throws FactoryException,
+        PAPException {
+        try {
+            return new StdEngine(properties);
+        } catch (IOException e) {
+            logger.error("Failed to create engine: ", e);
+            return null;
+        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDP.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDP.java
index 6b2d1e4..279edb4 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDP.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDP.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,168 +45,168 @@
 import com.att.research.xacml.api.pap.PDPStatus;
 
 public class StdPDP extends StdPDPItemSetChangeNotifier implements PDP, Comparable<StdPDP>, Serializable {
-        private static final long serialVersionUID = 1L;
-        private static Log	logger	= LogFactory.getLog(StdPDP.class);
-        
-        private String id;
-        
-        private String name;
-        
-        private String description;
-        
-        private PDPStatus status = new StdPDPStatus();
-        
-        private Set<PDPPolicy> policies = new HashSet<PDPPolicy>();
-        
-        private Set<PDPPIPConfig> pipConfigs = new HashSet<PDPPIPConfig>();
-        
-        public StdPDP() {
-                
-        }
-        
-        public StdPDP(String id) {
-                this(id, null, null);
-        }
-        
-        public StdPDP(String id, String name) {
-                this(id, name, null);
-        }
-        
-        public StdPDP(String id, String name, String description) {
-                this.id = id;
-                this.name = name;
-                this.description = description;
-        }
-        
-        public StdPDP(String id, Properties properties) {
-                this(id);
-                
-                this.initialize(properties);
-        }
-        
-        public void initialize(Properties properties) {
-                for (Object key : properties.keySet()) {
-                        if (key.toString().startsWith(this.id + ".")) {
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("Found: " + key);
-                                }
-                                if (key.toString().endsWith(".name")) {
-                                        this.name = properties.getProperty(key.toString());
-                                } else if (key.toString().endsWith(".description")) {
-                                        this.description = properties.getProperty(key.toString());
-                                }
-                        }
+    private static final long serialVersionUID = 1L;
+    private static Log	logger	= LogFactory.getLog(StdPDP.class);
+
+    private String id;
+
+    private String name;
+
+    private String description;
+
+    private PDPStatus status = new StdPDPStatus();
+
+    private Set<PDPPolicy> policies = new HashSet<PDPPolicy>();
+
+    private Set<PDPPIPConfig> pipConfigs = new HashSet<PDPPIPConfig>();
+
+    public StdPDP() {
+
+    }
+
+    public StdPDP(String id) {
+        this(id, null, null);
+    }
+
+    public StdPDP(String id, String name) {
+        this(id, name, null);
+    }
+
+    public StdPDP(String id, String name, String description) {
+        this.id = id;
+        this.name = name;
+        this.description = description;
+    }
+
+    public StdPDP(String id, Properties properties) {
+        this(id);
+
+        this.initialize(properties);
+    }
+
+    public void initialize(Properties properties) {
+        for (Object key : properties.keySet()) {
+            if (key.toString().startsWith(this.id + ".")) {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Found: " + key);
                 }
-        }
-
-        @Override
-        public String getId() {
-                return this.id;
-        }
-
-        public void setId(String id) {
-                this.id=id;
-        }
-
-        @Override
-        public String getName() {
-                return this.name;
-        }
-        
-        @Override
-        public void setName(String name) {
-                this.name = name;
-                this.firePDPChanged(this);
-        }
-
-        @Override
-        public String getDescription() {
-                return this.description;
-        }
-        
-        @Override
-        public void setDescription(String description) {
-                this.description = description;
-                this.firePDPChanged(this);
-        }
-
-        @Override
-        public PDPStatus getStatus() {
-                return this.status;
-        }
-
-        public void setStatus(PDPStatus status) {
-                this.status = status;
-        }
-        
-        @Override
-        public Set<PDPPolicy> getPolicies() {
-                return Collections.unmodifiableSet(this.policies);
-        }
-        
-        public void setPolicies(Set<PDPPolicy> policies) {
-                this.policies = policies;
-        }
-
-        @Override
-        public Set<PDPPIPConfig> getPipConfigs() {
-                return Collections.unmodifiableSet(this.pipConfigs);
-        }
-        
-        public void setPipConfigs(Set<PDPPIPConfig> pipConfigs) {
-                this.pipConfigs = pipConfigs;
-        }
-
-        @Override
-        public int hashCode() {
-                final int prime = 31;
-                int result = 1;
-                result = prime * result + ((id == null) ? 0 : id.hashCode());
-                return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-                if (this == obj)
-                        return true;
-                if (obj == null)
-                        return false;
-                if (getClass() != obj.getClass())
-                        return false;
-                StdPDP other = (StdPDP) obj;
-                if (id == null) {
-                        if (other.id != null)
-                                return false;
-                } else if (!id.equals(other.id))
-                        return false;
-                return true;
-        }
-
-        @Override
-        public String toString() {
-                return "StdPDP [id=" + id + ", name=" + name + ", description="
-                                + description + ", status=" + status + ", policies=" + policies
-                                + ", pipConfigs=" + pipConfigs + "]";
-        }
-        
-        //
-        // Comparable interface
-        //
-        @Override
-        public int compareTo(StdPDP o) {
-                if (o == null) {
-                        return -1;
+                if (key.toString().endsWith(".name")) {
+                    this.name = properties.getProperty(key.toString());
+                } else if (key.toString().endsWith(".description")) {
+                    this.description = properties.getProperty(key.toString());
                 }
-                if ( ! (o instanceof StdPDP)) {
-                        return -1;
-                }
-                if (((StdPDP)o).name == null) {
-                        return -1;
-                }
-                if (name == null) {
-                        return 1;
-                }
-                return name.compareTo(((StdPDP)o).name);
+            }
         }
-        
+    }
+
+    @Override
+    public String getId() {
+        return this.id;
+    }
+
+    public void setId(String id) {
+        this.id=id;
+    }
+
+    @Override
+    public String getName() {
+        return this.name;
+    }
+
+    @Override
+    public void setName(String name) {
+        this.name = name;
+        this.firePDPChanged(this);
+    }
+
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
+
+    @Override
+    public void setDescription(String description) {
+        this.description = description;
+        this.firePDPChanged(this);
+    }
+
+    @Override
+    public PDPStatus getStatus() {
+        return this.status;
+    }
+
+    public void setStatus(PDPStatus status) {
+        this.status = status;
+    }
+
+    @Override
+    public Set<PDPPolicy> getPolicies() {
+        return Collections.unmodifiableSet(this.policies);
+    }
+
+    public void setPolicies(Set<PDPPolicy> policies) {
+        this.policies = policies;
+    }
+
+    @Override
+    public Set<PDPPIPConfig> getPipConfigs() {
+        return Collections.unmodifiableSet(this.pipConfigs);
+    }
+
+    public void setPipConfigs(Set<PDPPIPConfig> pipConfigs) {
+        this.pipConfigs = pipConfigs;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((id == null) ? 0 : id.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        StdPDP other = (StdPDP) obj;
+        if (id == null) {
+            if (other.id != null)
+                return false;
+        } else if (!id.equals(other.id))
+            return false;
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "StdPDP [id=" + id + ", name=" + name + ", description="
+               + description + ", status=" + status + ", policies=" + policies
+               + ", pipConfigs=" + pipConfigs + "]";
+    }
+
+    //
+    // Comparable interface
+    //
+    @Override
+    public int compareTo(StdPDP o) {
+        if (o == null) {
+            return -1;
+        }
+        if ( ! (o instanceof StdPDP)) {
+            return -1;
+        }
+        if (((StdPDP)o).name == null) {
+            return -1;
+        }
+        if (name == null) {
+            return 1;
+        }
+        return name.compareTo(((StdPDP)o).name);
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPGroup.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPGroup.java
index 2224685..40c06d7 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPGroup.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPGroup.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -64,191 +64,191 @@
 import com.google.common.io.ByteStreams;
 
 public class StdPDPGroup extends StdPDPItemSetChangeNotifier implements PDPGroup, StdItemSetChangeListener, Comparable<Object>, Serializable {
-        private static final long serialVersionUID = 1L;
-        private static Log	logger	= LogFactory.getLog(StdPDPGroup.class);
-        
-        private String id;
-        
-        private boolean isDefault = false;
-        
-        private String name;
-        
-        private String description;
-        
-        private StdPDPGroupStatus status = new StdPDPGroupStatus(Status.UNKNOWN);
-        
-        private Set<PDP>	pdps = new HashSet<PDP>();
-        
-        private Set<PDPPolicy> policies = new HashSet<PDPPolicy>();
-        
-        private Set<PDPPIPConfig> pipConfigs = new HashSet<PDPPIPConfig>();
-        
-        @JsonIgnore
-        private  Path directory;
-        
+    private static final long serialVersionUID = 1L;
+    private static Log	logger	= LogFactory.getLog(StdPDPGroup.class);
 
-        
-        public StdPDPGroup(String id, Path directory) {
-                this.id = id;
-                this.directory = directory;
-        }
-        
-        public StdPDPGroup(String id, boolean isDefault, Path directory) {
-                this(id, directory);
-                this.isDefault = isDefault;
-        }
-        
-        public StdPDPGroup(String id, boolean isDefault, String name, String description, Path directory) {
-                this(id, isDefault, directory);
-                this.name = name;
-                // force all policies to have a name
-                if (name == null) {
-                        this.name = id;
-                }
-                this.description = description;
-        }
-        
-        public StdPDPGroup(String id, String name, String description, Path directory) {
-                this(id, false, name, description, directory);
-                this.resetStatus();
-        }
-        
-        public StdPDPGroup(String id, boolean isDefault, Properties properties, Path directory) throws PAPException {
-                this(id, isDefault, directory);
-                this.initialize(properties, directory);
-                this.resetStatus();
-        }
-        
-        private void initialize(Properties properties, Path directory) throws PAPException {
-                if (this.id == null || this.id.length() == 0) {
-                        logger.warn("Cannot initialize with a null or zero length id");
-                        return;
-                }
-                //
-                // Pull the group's properties
-                //
-                for (Object key : properties.keySet()) {
-                        if (key.toString().startsWith(this.id + ".")) {
-                                if (key.toString().endsWith(".name")) {
-                                        this.name = properties.getProperty(key.toString());
-                                } else if (key.toString().endsWith(".description")) {
-                                        this.description = properties.getProperty(key.toString());
-                                } else if (key.toString().endsWith(".pdps")) {
-                                        String pdpList = properties.getProperty(key.toString());
-                                        if (pdpList != null && pdpList.length() > 0) {
-                                                for (String id : Splitter.on(',').omitEmptyStrings().trimResults().split(pdpList)) {
-                                                        StdPDP pdp = new StdPDP(id, properties);
-                                                        pdp.addItemSetChangeListener(this);
-                                                        this.pdps.add(pdp);
-                                                }
-                                        }
-                                }
-                        }
-                        // force all policies to have a name
-                        if (this.name == null) {
-                                this.name = this.id;
-                        }
-                }
-                //
-                // Validate our directory
-                //
-                if (Files.notExists(directory)) {
-                        logger.warn("Group directory does NOT exist: " + directory.toString());
-                        try {
-                                Files.createDirectory(directory);
-                                this.status.addLoadWarning("Group directory does NOT exist");
-                        } catch (IOException e) {
-                                logger.error(e);
-                                this.status.addLoadError("Group directory does NOT exist");
-                                this.status.setStatus(Status.LOAD_ERRORS);
-                        }
-                }
-                //
-                // Parse policies
-                //
-                this.loadPolicies(Paths.get(directory.toString(), "xacml.policy.properties"));
-                //
-                // Parse pip config
-                //
-                this.loadPIPConfig(Paths.get(directory.toString(), "xacml.pip.properties"));
-        }
-        
-        public void loadPolicies(Path file) throws PAPException {
-                //
-                // Read the Groups Policies
-                //
-                Properties policyProperties = new Properties();
-                if ( ! file.toFile().exists()) {
-                        // need to create the properties file with default values
-                        policyProperties.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "");
-                        policyProperties.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "");
-                        // save properties to file
-                        try (OutputStream os = Files.newOutputStream(file)) {
-                                policyProperties.store(os, "");
-                        } catch (Exception e) {
-                                throw new PAPException("Failed to create new default policy properties file '" + file +"'");
-                        }
-                } else {
-                        // load previously existing file
-                        try {
-                                //
-                                // Load the properties
-                                //
-                                try (InputStream is = Files.newInputStream(file)) {
-                                        policyProperties.load(is);
-                                }
-                                //
-                                // Parse the policies
-                                //
-                                this.readPolicyProperties(directory, policyProperties);
-                        } catch (IOException e) {
-                                logger.warn("Failed to load group policy properties file: " + file, e);
-                                this.status.addLoadError("Not policy properties defined");
-                                this.status.setStatus(Status.LOAD_ERRORS);
-                                throw new PAPException("Failed to load group policy properties file: " + file);
-                        }
-                }
-        }
-        
-        public void loadPIPConfig(Path file) throws PAPException {
-                //
-                // Read the Groups' PIP configuration
-                //
-                Properties pipProperties = new Properties();
-                if ( ! file.toFile().exists()) {
-                        // need to create the properties file with no values
-                        pipProperties.setProperty(XACMLProperties.PROP_PIP_ENGINES, "");
-                        // save properties to file
-                        try {
-                                try (OutputStream os = Files.newOutputStream(file)) {
-                                        pipProperties.store(os, "");
-                                }
-                        } catch (Exception e) {
-                                throw new PAPException("Failed to create new default pip properties file '" + file +"'");
-                        }
-                } else {
-                        try {
-                                //
-                                // Load the properties
-                                //
-                                try (InputStream is = Files.newInputStream(file)) {
-                                        pipProperties.load(is);
-                                }
-                                //
-                                // Parse the pips
-                                //
-                                this.readPIPProperties(directory, pipProperties);
-                        } catch (IOException e) {
-                                logger.warn("Failed to open group PIP Config properties file: " + file, e);
-                                this.status.addLoadError("Not PIP config properties defined");
-                                this.status.setStatus(Status.LOAD_ERRORS);
-                                throw new PAPException("Failed to load group policy properties file: " + file);
+    private String id;
 
-                        }
-                }
+    private boolean isDefault = false;
+
+    private String name;
+
+    private String description;
+
+    private StdPDPGroupStatus status = new StdPDPGroupStatus(Status.UNKNOWN);
+
+    private Set<PDP>	pdps = new HashSet<PDP>();
+
+    private Set<PDPPolicy> policies = new HashSet<PDPPolicy>();
+
+    private Set<PDPPIPConfig> pipConfigs = new HashSet<PDPPIPConfig>();
+
+    @JsonIgnore
+    private  Path directory;
+
+
+
+    public StdPDPGroup(String id, Path directory) {
+        this.id = id;
+        this.directory = directory;
+    }
+
+    public StdPDPGroup(String id, boolean isDefault, Path directory) {
+        this(id, directory);
+        this.isDefault = isDefault;
+    }
+
+    public StdPDPGroup(String id, boolean isDefault, String name, String description, Path directory) {
+        this(id, isDefault, directory);
+        this.name = name;
+        // force all policies to have a name
+        if (name == null) {
+            this.name = id;
         }
-        
-        public void resetStatus() {
+        this.description = description;
+    }
+
+    public StdPDPGroup(String id, String name, String description, Path directory) {
+        this(id, false, name, description, directory);
+        this.resetStatus();
+    }
+
+    public StdPDPGroup(String id, boolean isDefault, Properties properties, Path directory) throws PAPException {
+        this(id, isDefault, directory);
+        this.initialize(properties, directory);
+        this.resetStatus();
+    }
+
+    private void initialize(Properties properties, Path directory) throws PAPException {
+        if (this.id == null || this.id.length() == 0) {
+            logger.warn("Cannot initialize with a null or zero length id");
+            return;
+        }
+        //
+        // Pull the group's properties
+        //
+        for (Object key : properties.keySet()) {
+            if (key.toString().startsWith(this.id + ".")) {
+                if (key.toString().endsWith(".name")) {
+                    this.name = properties.getProperty(key.toString());
+                } else if (key.toString().endsWith(".description")) {
+                    this.description = properties.getProperty(key.toString());
+                } else if (key.toString().endsWith(".pdps")) {
+                    String pdpList = properties.getProperty(key.toString());
+                    if (pdpList != null && pdpList.length() > 0) {
+                        for (String id : Splitter.on(',').omitEmptyStrings().trimResults().split(pdpList)) {
+                            StdPDP pdp = new StdPDP(id, properties);
+                            pdp.addItemSetChangeListener(this);
+                            this.pdps.add(pdp);
+                        }
+                    }
+                }
+            }
+            // force all policies to have a name
+            if (this.name == null) {
+                this.name = this.id;
+            }
+        }
+        //
+        // Validate our directory
+        //
+        if (Files.notExists(directory)) {
+            logger.warn("Group directory does NOT exist: " + directory.toString());
+            try {
+                Files.createDirectory(directory);
+                this.status.addLoadWarning("Group directory does NOT exist");
+            } catch (IOException e) {
+                logger.error(e);
+                this.status.addLoadError("Group directory does NOT exist");
+                this.status.setStatus(Status.LOAD_ERRORS);
+            }
+        }
+        //
+        // Parse policies
+        //
+        this.loadPolicies(Paths.get(directory.toString(), "xacml.policy.properties"));
+        //
+        // Parse pip config
+        //
+        this.loadPIPConfig(Paths.get(directory.toString(), "xacml.pip.properties"));
+    }
+
+    public void loadPolicies(Path file) throws PAPException {
+        //
+        // Read the Groups Policies
+        //
+        Properties policyProperties = new Properties();
+        if ( ! file.toFile().exists()) {
+            // need to create the properties file with default values
+            policyProperties.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "");
+            policyProperties.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "");
+            // save properties to file
+            try (OutputStream os = Files.newOutputStream(file)) {
+                policyProperties.store(os, "");
+            } catch (Exception e) {
+                throw new PAPException("Failed to create new default policy properties file '" + file +"'");
+            }
+        } else {
+            // load previously existing file
+            try {
+                //
+                // Load the properties
+                //
+                try (InputStream is = Files.newInputStream(file)) {
+                    policyProperties.load(is);
+                }
+                //
+                // Parse the policies
+                //
+                this.readPolicyProperties(directory, policyProperties);
+            } catch (IOException e) {
+                logger.warn("Failed to load group policy properties file: " + file, e);
+                this.status.addLoadError("Not policy properties defined");
+                this.status.setStatus(Status.LOAD_ERRORS);
+                throw new PAPException("Failed to load group policy properties file: " + file);
+            }
+        }
+    }
+
+    public void loadPIPConfig(Path file) throws PAPException {
+        //
+        // Read the Groups' PIP configuration
+        //
+        Properties pipProperties = new Properties();
+        if ( ! file.toFile().exists()) {
+            // need to create the properties file with no values
+            pipProperties.setProperty(XACMLProperties.PROP_PIP_ENGINES, "");
+            // save properties to file
+            try {
+                try (OutputStream os = Files.newOutputStream(file)) {
+                    pipProperties.store(os, "");
+                }
+            } catch (Exception e) {
+                throw new PAPException("Failed to create new default pip properties file '" + file +"'");
+            }
+        } else {
+            try {
+                //
+                // Load the properties
+                //
+                try (InputStream is = Files.newInputStream(file)) {
+                    pipProperties.load(is);
+                }
+                //
+                // Parse the pips
+                //
+                this.readPIPProperties(directory, pipProperties);
+            } catch (IOException e) {
+                logger.warn("Failed to open group PIP Config properties file: " + file, e);
+                this.status.addLoadError("Not PIP config properties defined");
+                this.status.setStatus(Status.LOAD_ERRORS);
+                throw new PAPException("Failed to load group policy properties file: " + file);
+
+            }
+        }
+    }
+
+    public void resetStatus() {
 //		//
 //		// If we are updating, don't allow reset
 //		//
@@ -263,270 +263,268 @@
 //			logger.warn("We had load errors.");
 //			return;
 //		}
-                //
-                // Reset our status object
-                //
-                this.status.reset();
-                //
-                // Determine our status
-                //
-                for (PDP pdp : this.pdps) {
-                        switch (pdp.getStatus().getStatus()) {
-                        case OUT_OF_SYNCH:
-                                this.status.addOutOfSynchPDP(pdp);
-                                break;
-                        case LAST_UPDATE_FAILED:
-                                this.status.addLastUpdateFailedPDP(pdp);
-                                break;
-                        case LOAD_ERRORS:
-                                this.status.addFailedPDP(pdp);
-                                break;
-                        case UPDATING_CONFIGURATION:
-                                this.status.addUpdatingPDP(pdp);
-                                break;
-                        case UP_TO_DATE:
-                                this.status.addInSynchPDP(pdp);
-                                break;
-                        case UNKNOWN:
-                        case CANNOT_CONNECT:
-                        case NO_SUCH_HOST:
-                        default:
-                                this.status.addUnknownPDP(pdp);
-                                break;
-                        }
-                }
-                
-                // priority is worst-cast to best case
-                if (this.status.getUnknownPDPs().size() > 0) {
-                        this.status.setStatus(Status.UNKNOWN);
-                } else if (this.status.getFailedPDPs().size() > 0 || this.status.getLastUpdateFailedPDPs().size() > 0) {
-                        this.status.setStatus(Status.LOAD_ERRORS);
-                } else if (this.status.getOutOfSynchPDPs().size() > 0) {
-                        this.status.setStatus(Status.OUT_OF_SYNCH);
-                } else if (this.status.getUpdatingPDPs().size() > 0) {
-                        this.status.setStatus(Status.UPDATING_CONFIGURATION);
-                } else {
-                        this.status.setStatus(Status.OK); 
-                }
+        //
+        // Reset our status object
+        //
+        this.status.reset();
+        //
+        // Determine our status
+        //
+        for (PDP pdp : this.pdps) {
+            switch (pdp.getStatus().getStatus()) {
+            case OUT_OF_SYNCH:
+                this.status.addOutOfSynchPDP(pdp);
+                break;
+            case LAST_UPDATE_FAILED:
+                this.status.addLastUpdateFailedPDP(pdp);
+                break;
+            case LOAD_ERRORS:
+                this.status.addFailedPDP(pdp);
+                break;
+            case UPDATING_CONFIGURATION:
+                this.status.addUpdatingPDP(pdp);
+                break;
+            case UP_TO_DATE:
+                this.status.addInSynchPDP(pdp);
+                break;
+            case UNKNOWN:
+            case CANNOT_CONNECT:
+            case NO_SUCH_HOST:
+            default:
+                this.status.addUnknownPDP(pdp);
+                break;
+            }
         }
 
-        @Override
-        public String getId() {
-                return this.id;
+        // priority is worst-cast to best case
+        if (this.status.getUnknownPDPs().size() > 0) {
+            this.status.setStatus(Status.UNKNOWN);
+        } else if (this.status.getFailedPDPs().size() > 0 || this.status.getLastUpdateFailedPDPs().size() > 0) {
+            this.status.setStatus(Status.LOAD_ERRORS);
+        } else if (this.status.getOutOfSynchPDPs().size() > 0) {
+            this.status.setStatus(Status.OUT_OF_SYNCH);
+        } else if (this.status.getUpdatingPDPs().size() > 0) {
+            this.status.setStatus(Status.UPDATING_CONFIGURATION);
+        } else {
+            this.status.setStatus(Status.OK);
         }
-        
-        public void setId(String id) {
-                this.id = id;
+    }
+
+    @Override
+    public String getId() {
+        return this.id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    @Override
+    public boolean isDefaultGroup() {
+        return this.isDefault;
+    }
+
+    public void setDefaultGroup(boolean isDefault) {
+        this.isDefault = isDefault;
+        //
+        // Cannot fire this because 2 operations have
+        // to occur: 1) old default=false (don't want to fire) and
+        // then 2) new default=true (yes fire - but we'll have to do that
+        // elsewhere.
+        //this.firePDPGroupChanged(this);
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public void setName(String groupName) {
+        this.name = groupName;
+        this.firePDPGroupChanged(this);
+    }
+
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
+
+    @Override
+    public void setDescription(String groupDescription) {
+        this.description = groupDescription;
+        this.firePDPGroupChanged(this);
+    }
+
+    public Path getDirectory() {
+        return this.directory;
+    }
+
+    public void setDirectory(Path groupDirectory) {
+        this.directory = groupDirectory;
+        // this is used only for transmission on the RESTful interface, so no need to fire group changed?
+    }
+
+    @Override
+    public PDPGroupStatus getStatus() {
+        return this.status;
+    }
+
+    @Override
+    public Set<PDP> getPdps() {
+        return Collections.unmodifiableSet(pdps);
+    }
+
+    public void setPdps(Set<PDP> pdps) {
+        this.pdps = pdps;
+    }
+
+    public boolean addPDP(PDP pdp) {
+        return this.pdps.add(pdp);
+    }
+
+    public boolean removePDP(PDP pdp) {
+        return this.pdps.remove(pdp);
+    }
+
+    @Override
+    public Set<PDPPolicy> getPolicies() {
+        return Collections.unmodifiableSet(this.policies);
+    }
+
+    @Override
+    public PDPPolicy getPolicy(String id) {
+        for (PDPPolicy policy : this.policies) {
+            if (policy.getId().equals(id)) {
+                return policy;
+            }
+        }
+        return null;
+    }
+
+    public Properties getPolicyProperties() {
+        Properties properties = new Properties() {
+            private static final long serialVersionUID = 1L;
+            // For Debugging it is helpful for the file to be in a sorted order,
+            // any by returning the keys in the natural Alpha order for strings we get close enough.
+            // TreeSet is sorted, and this just overrides the normal Properties method to get the keys.
+            @Override
+            public synchronized Enumeration<Object> keys() {
+                return Collections.enumeration(new TreeSet<Object>(super.keySet()));
+            }
+        };;
+        List<String> roots = new ArrayList<String>();
+        List<String> refs = new ArrayList<String>();
+
+        for (PDPPolicy policy : this.policies) {
+            // for all policies need to tell PDP the "name", which is the base name for the file id
+            if (policy.getName() != null) {
+                properties.setProperty(policy.getId() + ".name", policy.getName());
+            }
+            // put the policy on the correct list
+            if (policy.isRoot()) {
+                roots.add(policy.getId());
+            } else {
+                refs.add(policy.getId());
+            }
         }
 
-        @Override
-        public boolean isDefaultGroup() {
-                return this.isDefault;
-        }
-        
-        public void setDefaultGroup(boolean isDefault) {
-                this.isDefault = isDefault;
-                //
-                // Cannot fire this because 2 operations have
-                // to occur: 1) old default=false (don't want to fire) and
-                // then 2) new default=true (yes fire - but we'll have to do that
-                // elsewhere.
-                //this.firePDPGroupChanged(this);
-        }
+        properties.setProperty(XACMLProperties.PROP_ROOTPOLICIES, Joiner.on(',').join(roots));
+        properties.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, Joiner.on(',').join(refs));
 
-        @Override
-        public String getName() {
-                return name;
-        }
+        return properties;
+    }
 
-        @Override
-        public void setName(String groupName) {
-                this.name = groupName;
-                this.firePDPGroupChanged(this);
+    public PDPPolicy publishPolicy(String id, String name, boolean isRoot, InputStream policy) throws PAPException {
+        //
+        // Does it exist already?
+        //
+        if (this.getPolicy(id) != null) {
+            throw new PAPException("Policy with id " + id + " already exists - unpublish it first.");
         }
+        Path tempFile = null;
+        try {
+            //
+            // Copy the policy over
+            //
+            tempFile = Files.createFile(Paths.get(this.directory.toAbsolutePath().toString(), id));
+            long num;
+            try (OutputStream os = Files.newOutputStream(tempFile)) {
+                num = ByteStreams.copy(policy, os);
+            }
+            logger.info("Copied " + num + " bytes for policy " + name);
 
-        @Override
-        public String getDescription() {
-                return this.description;
-        }
-
-        @Override
-        public void setDescription(String groupDescription) {
-                this.description = groupDescription;
-                this.firePDPGroupChanged(this);
-        }
-        
-        public Path getDirectory() {
-                return this.directory;
-        }
-
-        public void setDirectory(Path groupDirectory) {
-                this.directory = groupDirectory;
-                // this is used only for transmission on the RESTful interface, so no need to fire group changed?
-        }
-
-        @Override
-        public PDPGroupStatus getStatus()
-        {
-                return this.status;
-        }
-        
-        @Override
-        public Set<PDP> getPdps() {
-                return Collections.unmodifiableSet(pdps);
-        }
-
-        public void setPdps(Set<PDP> pdps) {
-                this.pdps = pdps;
-        }
-        
-        public boolean addPDP(PDP pdp) {
-                return this.pdps.add(pdp);
-        }
-        
-        public boolean removePDP(PDP pdp) {
-                return this.pdps.remove(pdp);
-        }
-
-        @Override
-        public Set<PDPPolicy> getPolicies() {
-                return Collections.unmodifiableSet(this.policies);
-        }
-
-        @Override
-        public PDPPolicy getPolicy(String id) {
-                for (PDPPolicy policy : this.policies) {
-                        if (policy.getId().equals(id)) {
-                                return policy;
-                        }
-                }
-                return null;
-        }
-
-        public Properties getPolicyProperties()
-        {
-                Properties properties = new Properties(){
-                        private static final long serialVersionUID = 1L;
-                        // For Debugging it is helpful for the file to be in a sorted order,
-                        // any by returning the keys in the natural Alpha order for strings we get close enough.
-                        // TreeSet is sorted, and this just overrides the normal Properties method to get the keys.
-                        @Override
-                    public synchronized Enumeration<Object> keys() {
-                        return Collections.enumeration(new TreeSet<Object>(super.keySet()));
-                    }
-            };;
-                List<String> roots = new ArrayList<String>();
-                List<String> refs = new ArrayList<String>();
-                
-                for (PDPPolicy policy : this.policies) {
-                        // for all policies need to tell PDP the "name", which is the base name for the file id
-                        if (policy.getName() != null) {
-                                properties.setProperty(policy.getId() + ".name", policy.getName());
-                        }
-                        // put the policy on the correct list
-                        if (policy.isRoot()) {
-                                roots.add(policy.getId());
-                        } else {
-                                refs.add(policy.getId());
-                        }
-                }
-                
-                properties.setProperty(XACMLProperties.PROP_ROOTPOLICIES, Joiner.on(',').join(roots));
-                properties.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, Joiner.on(',').join(refs));
-        
-                return properties;
-        }
-        
-        public PDPPolicy publishPolicy(String id, String name, boolean isRoot, InputStream policy) throws PAPException {
-                //
-                // Does it exist already?
-                //
-                if (this.getPolicy(id) != null) {
-                        throw new PAPException("Policy with id " + id + " already exists - unpublish it first.");
-                }
-                Path tempFile = null;
+            StdPDPPolicy tempRootPolicy = new StdPDPPolicy(id, isRoot, name, tempFile.toUri());
+            if (tempRootPolicy.isValid() == false) {
                 try {
-                        //
-                        // Copy the policy over
-                        //
-                        tempFile = Files.createFile(Paths.get(this.directory.toAbsolutePath().toString(), id));
-                        long num;
-                        try (OutputStream os = Files.newOutputStream(tempFile)) {
-                                num = ByteStreams.copy(policy, os);
-                        }
-                        logger.info("Copied " + num + " bytes for policy " + name);
-                        
-                        StdPDPPolicy tempRootPolicy = new StdPDPPolicy(id, isRoot, name, tempFile.toUri());
-                        if (tempRootPolicy.isValid() == false) {
-                                try {
-                                        Files.delete(tempFile);
-                                } catch(Exception ee) {
-                                        logger.error("Policy was invalid, could NOT delete it.", ee);
-                                }
-                                throw new PAPException("Policy is invalid");
-                        }
-                        //
-                        // Add it in
-                        //
-                        this.policies.add(tempRootPolicy);
-                        //
-                        // We are changed
-                        //
-                        this.firePDPGroupChanged(this);
-                        //
-                        // Return our new object.
-                        //
-                        return tempRootPolicy;
-                } catch (IOException e) {
-                        logger.error("Failed to publishPolicy: ", e);
+                    Files.delete(tempFile);
+                } catch(Exception ee) {
+                    logger.error("Policy was invalid, could NOT delete it.", ee);
                 }
-                return null;
+                throw new PAPException("Policy is invalid");
+            }
+            //
+            // Add it in
+            //
+            this.policies.add(tempRootPolicy);
+            //
+            // We are changed
+            //
+            this.firePDPGroupChanged(this);
+            //
+            // Return our new object.
+            //
+            return tempRootPolicy;
+        } catch (IOException e) {
+            logger.error("Failed to publishPolicy: ", e);
         }
-        
-        /**
-         * Copy one policy file into the Group's directory but do not change the configuration.
-         * This is one part of a multi-step process of publishing policies.
-         * There may be multiple changes in the group (adding multiple policies, deleting policies, changine root<->referenced)
-         * that must be done all at once, so we just copy the file in preparation for a later "update whole group" operation.
-         * 
-         * @param id
-         * @param name
-         * @param isRoot
-         * @param policy
-         * @return
-         * @throws com.att.research.xacml.api.pap.PAPException
-         */
-        public void copyPolicyToFile(String id,  InputStream policy) throws PAPException {
-                try {
-                        //
-                        // Copy the policy over
-                        //
-                        long num;
-                        Path policyFilePath = Paths.get(this.directory.toAbsolutePath().toString(), id);
-                        
-                        //
-                        // THERE IS A WEIRD PROBLEM ON WINDOWS...
-                        // The file is already "in use" when we try to access it.  
-                        // Looking at the file externally while this is halted here does not show the file in use,
-                        // so there is no indication what is causing the problem.
-                        //
-                        // As a way to by-pass the issue, I simply check if the input and the existing file are identical
-                        // and generate an exception if they are not.
-                        //
-                        
+        return null;
+    }
 
-                        
+    /**
+     * Copy one policy file into the Group's directory but do not change the configuration.
+     * This is one part of a multi-step process of publishing policies.
+     * There may be multiple changes in the group (adding multiple policies, deleting policies, changine root<->referenced)
+     * that must be done all at once, so we just copy the file in preparation for a later "update whole group" operation.
+     *
+     * @param id
+     * @param name
+     * @param isRoot
+     * @param policy
+     * @return
+     * @throws com.att.research.xacml.api.pap.PAPException
+     */
+    public void copyPolicyToFile(String id,  InputStream policy) throws PAPException {
+        try {
+            //
+            // Copy the policy over
+            //
+            long num;
+            Path policyFilePath = Paths.get(this.directory.toAbsolutePath().toString(), id);
+
+            //
+            // THERE IS A WEIRD PROBLEM ON WINDOWS...
+            // The file is already "in use" when we try to access it.
+            // Looking at the file externally while this is halted here does not show the file in use,
+            // so there is no indication what is causing the problem.
+            //
+            // As a way to by-pass the issue, I simply check if the input and the existing file are identical
+            // and generate an exception if they are not.
+            //
+
+
+
 //			if (Files.exists(policyFilePath)) {
-//				// compare the 
+//				// compare the
 //				String incomingPolicyString = null;
 //				try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
 //					num = ByteStreams.copy(policy, os);
-//					incomingPolicyString = new String(os.toByteArray(), "UTF-8"); 
+//					incomingPolicyString = new String(os.toByteArray(), "UTF-8");
 //				}
 //				String existingPolicyString = null;
 //				try {
 //					byte[] bytes =  Files.readAllBytes(policyFilePath);
-//					existingPolicyString = new String(bytes, "UTF-8"); 
+//					existingPolicyString = new String(bytes, "UTF-8");
 //				} catch (Exception e) {
 //					logger.error("Unable to read existing file '" + policyFilePath + "': " + e, e);
 //					throw new PAPException("Unable to read policy file for comparison: " + e);
@@ -537,419 +535,419 @@
 //				// input is same as existing file
 //				return;
 //			}
-                        
-                        
-                        Path policyFile;
-                        if (Files.exists(policyFilePath)) {
-                                policyFile = policyFilePath;
-                        } else {
-                                policyFile = Files.createFile(policyFilePath);
-                        }
 
-                        try (OutputStream os = Files.newOutputStream(policyFile)) {
-                                num = ByteStreams.copy(policy, os);
-                        }
-                        
-                        logger.info("Copied " + num + " bytes for policy " + name);
 
-                        for (PDPPolicy p : policies) {
-                                if (p.getId().equals(id)) {
-                                        // we just re-copied/refreshed/updated the policy file for a policy that already exists in this group
-                                        logger.info("Policy '" + id + "' already exists in group '" + getId() + "'");
-                                        return;
-                                }
-                        }
-                        
-                        // policy is new to this group
-                        StdPDPPolicy tempRootPolicy = new StdPDPPolicy(id, true, name, policyFile.toUri());
-                        if (tempRootPolicy.isValid() == false) {
-                                try {
-                                        Files.delete(policyFile);
-                                } catch(Exception ee) {
-                                        logger.error("Policy was invalid, could NOT delete it.", ee);
-                                }
-                                throw new PAPException("Policy is invalid");
-                        }
-                        //
-                        // Add it in
-                        //
-                        this.policies.add(tempRootPolicy);
-                        //
-                        // We are changed
-                        //
-                        this.firePDPGroupChanged(this);
-                        
-                        
-                        
-                        
+            Path policyFile;
+            if (Files.exists(policyFilePath)) {
+                policyFile = policyFilePath;
+            } else {
+                policyFile = Files.createFile(policyFilePath);
+            }
+
+            try (OutputStream os = Files.newOutputStream(policyFile)) {
+                num = ByteStreams.copy(policy, os);
+            }
+
+            logger.info("Copied " + num + " bytes for policy " + name);
+
+            for (PDPPolicy p : policies) {
+                if (p.getId().equals(id)) {
+                    // we just re-copied/refreshed/updated the policy file for a policy that already exists in this group
+                    logger.info("Policy '" + id + "' already exists in group '" + getId() + "'");
+                    return;
+                }
+            }
+
+            // policy is new to this group
+            StdPDPPolicy tempRootPolicy = new StdPDPPolicy(id, true, name, policyFile.toUri());
+            if (tempRootPolicy.isValid() == false) {
+                try {
+                    Files.delete(policyFile);
+                } catch(Exception ee) {
+                    logger.error("Policy was invalid, could NOT delete it.", ee);
+                }
+                throw new PAPException("Policy is invalid");
+            }
+            //
+            // Add it in
+            //
+            this.policies.add(tempRootPolicy);
+            //
+            // We are changed
+            //
+            this.firePDPGroupChanged(this);
+
+
+
+
+        } catch (IOException e) {
+            logger.error("Failed to copyPolicyToFile: ", e);
+            throw new PAPException("Failed to copy policy to file: " + e);
+        }
+        return;
+    }
+
+
+    public boolean removePolicy(PDPPolicy policy) {
+        StdPDPPolicy currentPolicy = (StdPDPPolicy) this.getPolicy(policy.getId());
+        if (currentPolicy == null) {
+            logger.error("Policy " + policy.getId() + " does not exist.");
+            return false;
+        }
+        try {
+            //
+            // Delete it on disk
+            //
+            Files.delete(Paths.get(currentPolicy.getLocation()));
+            //
+            // Remove it from our list
+            //
+            this.policies.remove(currentPolicy);
+            //
+            // We are changed
+            //
+            this.firePDPGroupChanged(this);
+            return true;
+        } catch (Exception e) {
+            logger.error("Failed to delete policy " + policy);
+        }
+        return false;
+    }
+
+    @Override
+    public Set<PDPPIPConfig> getPipConfigs() {
+        return Collections.unmodifiableSet(this.pipConfigs);
+    }
+
+    @Override
+    public PDPPIPConfig getPipConfig(String id) {
+        for (PDPPIPConfig config : this.pipConfigs) {
+            if (config.getId().equals(id)) {
+                return config;
+            }
+        }
+        return null;
+    }
+
+    public void setPipConfigs(Set<PDPPIPConfig> pipConfigs) {
+        this.pipConfigs = pipConfigs;
+        this.firePDPGroupChanged(this);
+    }
+
+    public void removeAllPIPConfigs() {
+        this.pipConfigs.clear();
+        this.firePDPGroupChanged(this);
+    }
+
+    public Properties getPipConfigProperties() {
+        Properties properties = new Properties();
+        List<String> configs = new ArrayList<String>();
+
+        for (PDPPIPConfig config : this.pipConfigs) {
+            configs.add(config.getId());
+            properties.putAll(config.getConfiguration());
+        }
+
+        properties.setProperty(XACMLProperties.PROP_PIP_ENGINES, Joiner.on(',').join(configs));
+
+        return properties;
+    }
+
+    @Override
+    public void repair() {
+        //
+        // Reset the status object
+        //
+        this.status.reset();
+        //
+        // Validate our directory
+        //
+        boolean fire = false;
+        if (Files.notExists(directory)) {
+            logger.warn("Group directory does NOT exist: " + directory.toString());
+            try {
+                Files.createDirectory(directory);
+                fire = true;
+                this.status.addLoadWarning("Created missing group directory");
+            } catch (IOException e) {
+                logger.error(e);
+                this.status.addLoadError("Failed to create missing Group directory.");
+                this.status.setStatus(Status.LOAD_ERRORS);
+            }
+        }
+        //
+        // Validate our PIP config file
+        //
+        Path pipPropertiesFile = Paths.get(directory.toString(), "xacml.pip.properties");
+        if (Files.notExists(pipPropertiesFile)) {
+            try {
+                Files.createFile(pipPropertiesFile);
+                fire = true;
+                this.status.addLoadWarning("Created missing PIP properties file");
+            } catch (IOException e) {
+                logger.error(e);
+                this.status.addLoadError("Failed to create missing PIP properties file");
+                this.status.setStatus(Status.LOAD_ERRORS);
+            }
+        }
+        //
+        // Valid our policy properties file
+        //
+        Path policyPropertiesFile = Paths.get(directory.toString(), "xacml.policy.properties");
+        if (Files.notExists(policyPropertiesFile)) {
+            try {
+                Files.createFile(policyPropertiesFile);
+                fire = true;
+                this.status.addLoadWarning("Created missing Policy properties file");
+            } catch (IOException e) {
+                logger.error(e);
+                this.status.addLoadError("Failed to create missing Policy properties file");
+                this.status.setStatus(Status.LOAD_ERRORS);
+            }
+        }
+        this.resetStatus();
+        if (fire) {
+            this.fireChanged();
+        }
+    }
+
+    private void	readPolicyProperties(Path directory, Properties properties) {
+        //
+        // There are 2 property values that hold policies, root and referenced
+        //
+        String[] lists = new String[2];
+        lists[0] = properties.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
+        lists[1] = properties.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
+        //
+        // Iterate each policy list
+        //
+        boolean isRoot = true;
+        for (String list : lists) {
+            //
+            // Was there actually a property?
+            //
+            if (list == null || list.length() == 0) {
+                isRoot = false;
+                continue;
+            }
+            //
+            // Parse it out
+            //
+            Iterable<String> policyList = Splitter.on(',').trimResults().omitEmptyStrings().split(list);
+            //
+            // Was there actually a list
+            //
+            if (policyList == null) {
+                isRoot = false;
+                continue;
+            }
+            for (String id : policyList) {
+                //
+                // Construct the policy filename
+                //
+                Path policyPath = Paths.get(directory.toString(), id );
+                //
+                // Create the Policy Object
+                //
+                StdPDPPolicy policy;
+                try {
+                    policy = new StdPDPPolicy(id, isRoot, policyPath.toUri(), properties);
                 } catch (IOException e) {
-                        logger.error("Failed to copyPolicyToFile: ", e);
-                        throw new PAPException("Failed to copy policy to file: " + e);
+                    logger.error("Failed to create policy object", e);
+                    policy = null;
                 }
-                return;
+                //
+                // Is it valid?
+                //
+                if (policy != null && policy.isValid()) {
+                    this.policies.add(policy);
+                    this.status.addLoadedPolicy(policy);
+                } else {
+                    this.status.addFailedPolicy(policy);
+                    this.status.setStatus(Status.LOAD_ERRORS);
+                }
+                // force all policies to have a name
+                if (policy.getName() == null) {
+                    policy.setName(policy.getId());
+                }
+            }
+            isRoot = false;
         }
-        
-        
-        public boolean removePolicy(PDPPolicy policy) {
-                StdPDPPolicy currentPolicy = (StdPDPPolicy) this.getPolicy(policy.getId());
-                if (currentPolicy == null) {
-                        logger.error("Policy " + policy.getId() + " does not exist.");
-                        return false;
-                }
-                try {
-                        //
-                        // Delete it on disk
-                        //
-                        Files.delete(Paths.get(currentPolicy.getLocation()));
-                        //
-                        // Remove it from our list
-                        //
-                        this.policies.remove(currentPolicy);
-                        //
-                        // We are changed
-                        //
-                        this.firePDPGroupChanged(this);
-                        return true;
-                } catch (Exception e) {
-                        logger.error("Failed to delete policy " + policy);
-                }
+    }
+
+    private void	readPIPProperties(Path directory, Properties properties) {
+        String list = properties.getProperty(XACMLProperties.PROP_PIP_ENGINES);
+        if (list == null || list.length() == 0) {
+            return;
+        }
+        for (String id : list.split("[,]")) {
+            StdPDPPIPConfig config = new StdPDPPIPConfig(id, properties);
+            if (config.isConfigured()) {
+                this.pipConfigs.add(config);
+                this.status.addLoadedPipConfig(config);
+            } else {
+                this.status.addFailedPipConfig(config);
+                this.status.setStatus(Status.LOAD_ERRORS);
+            }
+        }
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((id == null) ? 0 : id.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        StdPDPGroup other = (StdPDPGroup) obj;
+        if (id == null) {
+            if (other.id != null)
                 return false;
+        } else if (!id.equals(other.id))
+            return false;
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "StdPDPGroup [id=" + id + ", isDefault=" + isDefault + ", name="
+               + name + ", description=" + description + ", status=" + status
+               + ", pdps=" + pdps + ", policies=" + policies + ", pipConfigs="
+               + pipConfigs + ", directory=" + directory + "]";
+    }
+
+    @Override
+    public void changed() {
+
+        // save the (changed) properties
+        try {
+            saveGroupConfiguration();
+        } catch (PAPException | IOException e) {
+            logger.error("Unable to save group configuration change");
+            // don't notify other things of change if we cannot save it???
+            return;
         }
 
-        @Override
-        public Set<PDPPIPConfig> getPipConfigs() {
-                return Collections.unmodifiableSet(this.pipConfigs);
-        }
+        this.firePDPGroupChanged(this);
 
-        @Override
-        public PDPPIPConfig getPipConfig(String id) {
-                for (PDPPIPConfig config : this.pipConfigs) {
-                        if (config.getId().equals(id)) {
-                                return config;
-                        }
-                }
-                return null;
-        }
-        
-        public void setPipConfigs(Set<PDPPIPConfig> pipConfigs) {
-                this.pipConfigs = pipConfigs;
-                this.firePDPGroupChanged(this);
-        }
-        
-        public void removeAllPIPConfigs() {
-                this.pipConfigs.clear();
-                this.firePDPGroupChanged(this);
-        }
-        
-        public Properties getPipConfigProperties() {
-                Properties properties = new Properties();
-                List<String> configs = new ArrayList<String>();
-                
-                for (PDPPIPConfig config : this.pipConfigs) {
-                        configs.add(config.getId());
-                        properties.putAll(config.getConfiguration());
-                }
-                
-                properties.setProperty(XACMLProperties.PROP_PIP_ENGINES, Joiner.on(',').join(configs));
+    }
 
-                return properties;
-        }
+    @Override
+    public void groupChanged(PDPGroup group) {
+        this.changed();
+    }
 
-        @Override
-        public void repair() {
-                //
-                // Reset the status object
-                //
-                this.status.reset();
-                //
-                // Validate our directory
-                //
-                boolean fire = false;
-                if (Files.notExists(directory)) {
-                        logger.warn("Group directory does NOT exist: " + directory.toString());
-                        try {
-                                Files.createDirectory(directory);
-                                fire = true;
-                                this.status.addLoadWarning("Created missing group directory");
-                        } catch (IOException e) {
-                                logger.error(e);
-                                this.status.addLoadError("Failed to create missing Group directory.");
-                                this.status.setStatus(Status.LOAD_ERRORS);
-                        }
-                }
-                //
-                // Validate our PIP config file
-                //
-                Path pipPropertiesFile = Paths.get(directory.toString(), "xacml.pip.properties");
-                if (Files.notExists(pipPropertiesFile)) {
-                        try {
-                                Files.createFile(pipPropertiesFile);
-                                fire = true;
-                                this.status.addLoadWarning("Created missing PIP properties file");
-                        } catch (IOException e) {
-                                logger.error(e);
-                                this.status.addLoadError("Failed to create missing PIP properties file");
-                                this.status.setStatus(Status.LOAD_ERRORS);
-                        }
-                }
-                //
-                // Valid our policy properties file
-                //
-                Path policyPropertiesFile = Paths.get(directory.toString(), "xacml.policy.properties");
-                if (Files.notExists(policyPropertiesFile)) {
-                        try {
-                                Files.createFile(policyPropertiesFile);
-                                fire = true;
-                                this.status.addLoadWarning("Created missing Policy properties file");
-                        } catch (IOException e) {
-                                logger.error(e);
-                                this.status.addLoadError("Failed to create missing Policy properties file");
-                                this.status.setStatus(Status.LOAD_ERRORS);
-                        }
-                }
-                this.resetStatus();
-                if (fire) {
-                        this.fireChanged();
-                }
-        }
-
-        private void	readPolicyProperties(Path directory, Properties properties) {
-                //
-                // There are 2 property values that hold policies, root and referenced
-                //
-                String[] lists = new String[2];
-                lists[0] = properties.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
-                lists[1] = properties.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
-                //
-                // Iterate each policy list
-                //
-                boolean isRoot = true;
-                for (String list : lists) {
-                        //
-                        // Was there actually a property?
-                        //
-                        if (list == null || list.length() == 0) {
-                                isRoot = false;
-                                continue;
-                        }
-                        //
-                        // Parse it out
-                        //
-                        Iterable<String> policyList = Splitter.on(',').trimResults().omitEmptyStrings().split(list);
-                        //
-                        // Was there actually a list
-                        //
-                        if (policyList == null) {
-                                isRoot = false;
-                                continue;
-                        }
-                        for (String id : policyList) {
-                                //
-                                // Construct the policy filename
-                                //
-                                Path policyPath = Paths.get(directory.toString(), id );
-                                //
-                                // Create the Policy Object
-                                //
-                                StdPDPPolicy policy;
-                                try {
-                                        policy = new StdPDPPolicy(id, isRoot, policyPath.toUri(), properties);
-                                } catch (IOException e) {
-                                        logger.error("Failed to create policy object", e);
-                                        policy = null;
-                                }
-                                //
-                                // Is it valid?
-                                //
-                                if (policy != null && policy.isValid()) {
-                                        this.policies.add(policy);
-                                        this.status.addLoadedPolicy(policy);
-                                } else {
-                                        this.status.addFailedPolicy(policy);
-                                        this.status.setStatus(Status.LOAD_ERRORS);
-                                }
-                                // force all policies to have a name
-                                if (policy.getName() == null) {
-                                        policy.setName(policy.getId());
-                                }
-                        }
-                        isRoot = false;
-                }
-        }
-
-        private void	readPIPProperties(Path directory, Properties properties) {
-                String list = properties.getProperty(XACMLProperties.PROP_PIP_ENGINES);
-                if (list == null || list.length() == 0) {
-                        return;
-                }
-                for (String id : list.split("[,]")) {
-                        StdPDPPIPConfig config = new StdPDPPIPConfig(id, properties);
-                        if (config.isConfigured()) {
-                                this.pipConfigs.add(config);
-                                this.status.addLoadedPipConfig(config);
-                        } else {
-                                this.status.addFailedPipConfig(config);
-                                this.status.setStatus(Status.LOAD_ERRORS);
-                        }
-                }
-        }
-
-        @Override
-        public int hashCode() {
-                final int prime = 31;
-                int result = 1;
-                result = prime * result + ((id == null) ? 0 : id.hashCode());
-                return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-                if (this == obj)
-                        return true;
-                if (obj == null)
-                        return false;
-                if (getClass() != obj.getClass())
-                        return false;
-                StdPDPGroup other = (StdPDPGroup) obj;
-                if (id == null) {
-                        if (other.id != null)
-                                return false;
-                } else if (!id.equals(other.id))
-                        return false;
-                return true;
-        }
-
-        @Override
-        public String toString() {
-                return "StdPDPGroup [id=" + id + ", isDefault=" + isDefault + ", name="
-                                + name + ", description=" + description + ", status=" + status
-                                + ", pdps=" + pdps + ", policies=" + policies + ", pipConfigs="
-                                + pipConfigs + ", directory=" + directory + "]";
-        }
-
-        @Override
-        public void changed() {
-
-                // save the (changed) properties
-                try {
-                        saveGroupConfiguration();
-                } catch (PAPException | IOException e) {
-                        logger.error("Unable to save group configuration change");
-                        // don't notify other things of change if we cannot save it???
-                        return;
-                }
-                
-                this.firePDPGroupChanged(this);
-
-        }
-
-        @Override
-        public void groupChanged(PDPGroup group) {
-                this.changed();
-        }
-
-        @Override
-        public void pdpChanged(PDP pdp) {
-                //
-                // If one of the group's PDP's changed, then the group changed
-                //
-                // TODO Really?
-                //
-                this.changed();
-        }
-
-        
+    @Override
+    public void pdpChanged(PDP pdp) {
         //
-        // Methods needed for JSON deserialization
+        // If one of the group's PDP's changed, then the group changed
         //
-        public StdPDPGroup() {
-                
-        }
-        
-        public StdPDPGroup(PDPGroup group) {
-                this.id = group.getId();
-                this.name = group.getName();
-                this.description = group.getDescription();
-                this.isDefault = group.isDefaultGroup();
-                this.pdps = group.getPdps();
-                this.policies = group.getPolicies();
-                this.pipConfigs = group.getPipConfigs();
-        }
+        // TODO Really?
+        //
+        this.changed();
+    }
 
-        public boolean isDefault() {
-                return isDefault;
-        }
-        public void setDefault(boolean isDefault) {
-                this.isDefault = isDefault;
-        }
-        public void setStatus(PDPGroupStatus status) {
-                this.status = new StdPDPGroupStatus(status);
-        }
-        public void setPolicies(Set<PDPPolicy> policies) {
-                this.policies = policies;
-        }
 
-        
-        
-        public void saveGroupConfiguration() throws PAPException, IOException {
-                
-                // First save the Policy properties
-                
-                // save the lists of policies
-                Properties policyProperties = this.getPolicyProperties();
-                
-                // save info about each policy
-                for (PDPPolicy policy : this.policies){
-                        policyProperties.put(policy.getId() + ".name", policy.getName());
-                }
+    //
+    // Methods needed for JSON deserialization
+    //
+    public StdPDPGroup() {
 
-                //
-                // Now we can save the file
-                //
-                Path file = Paths.get(this.directory.toString(), "xacml.policy.properties");
-                try (OutputStream os = Files.newOutputStream(file)) {
-                        policyProperties.store(os, "");
-                } catch (Exception e) {
-                        logger.error("Group Policies Config save failed: " + e, e);
-                        throw new PAPException("Failed to save policy properties file '" + file +"'");
-                }
-                
-                                
-                // Now save the PIP Config properties
-                Properties pipProperties = this.getPipConfigProperties();
+    }
 
-                //
-                // Now we can save the file
-                //
-                file = Paths.get(this.directory.toString(), "xacml.pip.properties");
-                try (OutputStream os = Files.newOutputStream(file)) {
-                        pipProperties.store(os, "");
-                } catch (Exception e) {
-                        logger.error("Group PIP Config save failed: " + e, e);
-                        throw new PAPException("Failed to save pip properties file '" + file +"'");
-                }
+    public StdPDPGroup(PDPGroup group) {
+        this.id = group.getId();
+        this.name = group.getName();
+        this.description = group.getDescription();
+        this.isDefault = group.isDefaultGroup();
+        this.pdps = group.getPdps();
+        this.policies = group.getPolicies();
+        this.pipConfigs = group.getPipConfigs();
+    }
+
+    public boolean isDefault() {
+        return isDefault;
+    }
+    public void setDefault(boolean isDefault) {
+        this.isDefault = isDefault;
+    }
+    public void setStatus(PDPGroupStatus status) {
+        this.status = new StdPDPGroupStatus(status);
+    }
+    public void setPolicies(Set<PDPPolicy> policies) {
+        this.policies = policies;
+    }
+
+
+
+    public void saveGroupConfiguration() throws PAPException, IOException {
+
+        // First save the Policy properties
+
+        // save the lists of policies
+        Properties policyProperties = this.getPolicyProperties();
+
+        // save info about each policy
+        for (PDPPolicy policy : this.policies) {
+            policyProperties.put(policy.getId() + ".name", policy.getName());
         }
 
         //
-        // Comparable Interface
+        // Now we can save the file
         //
-        @Override
-        public int compareTo(Object arg0) {
-                if (arg0 == null) {
-                        return -1;
-                }
-                if ( ! (arg0 instanceof StdPDPGroup)) {
-                        return -1;
-                }
-                if (((StdPDPGroup)arg0).name == null) {
-                        return -1;
-                }
-                if (name == null) {
-                        return 1;
-                }
-
-                return name.compareTo(((StdPDPGroup)arg0).name);
+        Path file = Paths.get(this.directory.toString(), "xacml.policy.properties");
+        try (OutputStream os = Files.newOutputStream(file)) {
+            policyProperties.store(os, "");
+        } catch (Exception e) {
+            logger.error("Group Policies Config save failed: " + e, e);
+            throw new PAPException("Failed to save policy properties file '" + file +"'");
         }
 
 
+        // Now save the PIP Config properties
+        Properties pipProperties = this.getPipConfigProperties();
+
+        //
+        // Now we can save the file
+        //
+        file = Paths.get(this.directory.toString(), "xacml.pip.properties");
+        try (OutputStream os = Files.newOutputStream(file)) {
+            pipProperties.store(os, "");
+        } catch (Exception e) {
+            logger.error("Group PIP Config save failed: " + e, e);
+            throw new PAPException("Failed to save pip properties file '" + file +"'");
+        }
+    }
+
+    //
+    // Comparable Interface
+    //
+    @Override
+    public int compareTo(Object arg0) {
+        if (arg0 == null) {
+            return -1;
+        }
+        if ( ! (arg0 instanceof StdPDPGroup)) {
+            return -1;
+        }
+        if (((StdPDPGroup)arg0).name == null) {
+            return -1;
+        }
+        if (name == null) {
+            return 1;
+        }
+
+        return name.compareTo(((StdPDPGroup)arg0).name);
+    }
+
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPGroupStatus.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPGroupStatus.java
index ece05f8..99d6ca2 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPGroupStatus.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPGroupStatus.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,376 +41,388 @@
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
 public class StdPDPGroupStatus implements PDPGroupStatus {
-        
-        private Status status = Status.UNKNOWN;
-        
-        private Set<String>	loadErrors = new HashSet<String>();
-        
-        private Set<String> loadWarnings = new HashSet<String>();
-        
-        private Set<PDPPolicy> loadedPolicies = new HashSet<PDPPolicy>();
-        
-        private Set<PDPPolicy> failedPolicies = new HashSet<PDPPolicy>();
-        
-        private Set<PDPPIPConfig>	loadedPIPConfigs = new HashSet<PDPPIPConfig>();
-        
-        private Set<PDPPIPConfig>	failedPIPConfigs = new HashSet<PDPPIPConfig>();
-        
-        private Set<PDP>			inSynchPDPs = new HashSet<PDP>();
-        
-        private Set<PDP>			outOfSynchPDPs = new HashSet<PDP>();
-        
-        private Set<PDP>			failedPDPs = new HashSet<PDP>();
-        
-        private Set<PDP>			updatingPDPs = new HashSet<PDP>();
-        
-        private Set<PDP>			lastUpdateFailedPDPs = new HashSet<PDP>();
-        
-        private Set<PDP>			unknownPDPs = new HashSet<PDP>();
-        
-        
-        // Constructor needed for JSON deserialization
-        public StdPDPGroupStatus() {
-                
-        }
-        
-        public StdPDPGroupStatus(Status status) {
-                this.status = status;
-        }
 
-        public StdPDPGroupStatus(PDPGroupStatus stat) {
-                this.status = stat.getStatus();
-                this.failedPDPs.clear(); this.failedPDPs.addAll(stat.getFailedPDPs());
-                this.failedPIPConfigs.clear(); this.failedPIPConfigs.addAll(stat.getFailedPipConfigs());
-                this.failedPolicies.clear(); this.failedPolicies.addAll(stat.getFailedPolicies());
-                this.inSynchPDPs.clear(); this.inSynchPDPs.addAll(stat.getInSynchPDPs());
-                this.lastUpdateFailedPDPs.clear(); this.lastUpdateFailedPDPs.addAll(stat.getLastUpdateFailedPDPs());
-                this.loadedPIPConfigs.clear(); this.loadedPIPConfigs.addAll(stat.getLoadedPipConfigs());
-                this.loadedPolicies.clear(); this.loadedPolicies.addAll(stat.getLoadedPolicies());
-                this.loadErrors.clear(); this.loadErrors.addAll(stat.getLoadErrors());
-                this.loadWarnings.clear(); this.loadWarnings.addAll(stat.getLoadWarnings());
-                this.outOfSynchPDPs.clear(); this.outOfSynchPDPs.addAll(stat.getOutOfSynchPDPs());
-                this.unknownPDPs.clear(); this.unknownPDPs.addAll(stat.getUpdatingPDPs());
-                this.updatingPDPs.clear(); this.updatingPDPs.addAll(stat.getUpdatingPDPs());
-        }
+    private Status status = Status.UNKNOWN;
 
-        public Set<PDPPIPConfig> getLoadedPIPConfigs() {
-                return loadedPIPConfigs;
-        }
-        public void setLoadedPIPConfigs(Set<PDPPIPConfig> loadedPIPConfigs) {
-                this.loadedPIPConfigs = loadedPIPConfigs;
-        }
-        public Set<PDPPIPConfig> getFailedPIPConfigs() {
-                return failedPIPConfigs;
-        }
-        public void setFailedPIPConfigs(Set<PDPPIPConfig> failedPIPConfigs) {
-                this.failedPIPConfigs = failedPIPConfigs;
-        }
-        public Set<PDP> getUnknownPDPs() {
-                return unknownPDPs;
-        }
-        public void setUnknownPDPs(Set<PDP> unknownPDPs) {
-                this.unknownPDPs = unknownPDPs;
-        }
-        public void setLoadErrors(Set<String> loadErrors) {
-                this.loadErrors = loadErrors;
-        }
-        public void setLoadWarnings(Set<String> loadWarnings) {
-                this.loadWarnings = loadWarnings;
-        }
-        public void setLoadedPolicies(Set<PDPPolicy> loadedPolicies) {
-                this.loadedPolicies = loadedPolicies;
-        }
-        public void setFailedPolicies(Set<PDPPolicy> failedPolicies) {
-                this.failedPolicies = failedPolicies;
-        }
-        public void setInSynchPDPs(Set<PDP> inSynchPDPs) {
-                this.inSynchPDPs = inSynchPDPs;
-        }
-        public void setOutOfSynchPDPs(Set<PDP> outOfSynchPDPs) {
-                this.outOfSynchPDPs = outOfSynchPDPs;
-        }
-        public void setFailedPDPs(Set<PDP> failedPDPs) {
-                this.failedPDPs = failedPDPs;
-        }
-        public void setUpdatingPDPs(Set<PDP> updatingPDPs) {
-                this.updatingPDPs = updatingPDPs;
-        }
-        public void setLastUpdateFailedPDPs(Set<PDP> lastUpdateFailedPDPs) {
-                this.lastUpdateFailedPDPs = lastUpdateFailedPDPs;
-        }
-        
+    private Set<String>	loadErrors = new HashSet<String>();
 
-        @Override
-        public Status getStatus() {
-                return status;
-        }
+    private Set<String> loadWarnings = new HashSet<String>();
 
-        public void setStatus(Status status) {
-                this.status = status;
-        }
+    private Set<PDPPolicy> loadedPolicies = new HashSet<PDPPolicy>();
 
-        @Override
-        public Set<String> getLoadErrors() {
-                return Collections.unmodifiableSet(this.loadErrors);
-        }
+    private Set<PDPPolicy> failedPolicies = new HashSet<PDPPolicy>();
 
-        public void addLoadError(String error) {
-                this.loadErrors.add(error);
-        }
+    private Set<PDPPIPConfig>	loadedPIPConfigs = new HashSet<PDPPIPConfig>();
 
-        @Override
-        public Set<String> getLoadWarnings() {
-                return Collections.unmodifiableSet(this.loadWarnings);
-        }
+    private Set<PDPPIPConfig>	failedPIPConfigs = new HashSet<PDPPIPConfig>();
 
-        public void addLoadWarning(String warning) {
-                this.loadWarnings.add(warning);
-        }
+    private Set<PDP>			inSynchPDPs = new HashSet<PDP>();
 
-        @Override
-        public Set<PDPPolicy> getLoadedPolicies() {
-                return Collections.unmodifiableSet(this.loadedPolicies);
-        }
-        
-        public void addLoadedPolicy(PDPPolicy policy) {
-                this.loadedPolicies.add(policy);
-        }
+    private Set<PDP>			outOfSynchPDPs = new HashSet<PDP>();
 
-        @Override
-        public Set<PDPPolicy> getFailedPolicies() {
-                return Collections.unmodifiableSet(this.failedPolicies);
-        }
-        
-        public void addFailedPolicy(PDPPolicy policy) {
-                this.failedPolicies.add(policy);
-        }
+    private Set<PDP>			failedPDPs = new HashSet<PDP>();
 
-        @Override
-        public boolean policiesOK() {
-                if (this.failedPolicies.size() > 0) {
-                        return false;
-                }
-                return true;
-        }
+    private Set<PDP>			updatingPDPs = new HashSet<PDP>();
 
-        @Override
-        public Set<PDPPIPConfig> getLoadedPipConfigs() {
-                return Collections.unmodifiableSet(this.loadedPIPConfigs);
-        }
-        
-        public void addLoadedPipConfig(PDPPIPConfig config) {
-                this.loadedPIPConfigs.add(config);
-        }
+    private Set<PDP>			lastUpdateFailedPDPs = new HashSet<PDP>();
 
-        @Override
-        public Set<PDPPIPConfig> getFailedPipConfigs() {
-                return Collections.unmodifiableSet(this.failedPIPConfigs);
-        }
-        
-        public void addFailedPipConfig(PDPPIPConfig config) {
-                this.failedPIPConfigs.add(config);
-        }
+    private Set<PDP>			unknownPDPs = new HashSet<PDP>();
 
-        @Override
-        public boolean pipConfigOK() {
-                if (this.failedPIPConfigs.size() > 0) {
-                        return false;
-                }
-                return true;
-        }
 
-        @Override
-        public Set<PDP> getInSynchPDPs() {
-                return Collections.unmodifiableSet(this.inSynchPDPs);
-        }
+    // Constructor needed for JSON deserialization
+    public StdPDPGroupStatus() {
 
-        public void addInSynchPDP(PDP pdp) {
-                this.inSynchPDPs.add(pdp);
-        }
+    }
 
-        @Override
-        public Set<PDP> getOutOfSynchPDPs() {
-                return Collections.unmodifiableSet(this.outOfSynchPDPs);
-        }
+    public StdPDPGroupStatus(Status status) {
+        this.status = status;
+    }
 
-        public void addOutOfSynchPDP(PDP pdp) {
-                this.outOfSynchPDPs.add(pdp);
-        }
+    public StdPDPGroupStatus(PDPGroupStatus stat) {
+        this.status = stat.getStatus();
+        this.failedPDPs.clear();
+        this.failedPDPs.addAll(stat.getFailedPDPs());
+        this.failedPIPConfigs.clear();
+        this.failedPIPConfigs.addAll(stat.getFailedPipConfigs());
+        this.failedPolicies.clear();
+        this.failedPolicies.addAll(stat.getFailedPolicies());
+        this.inSynchPDPs.clear();
+        this.inSynchPDPs.addAll(stat.getInSynchPDPs());
+        this.lastUpdateFailedPDPs.clear();
+        this.lastUpdateFailedPDPs.addAll(stat.getLastUpdateFailedPDPs());
+        this.loadedPIPConfigs.clear();
+        this.loadedPIPConfigs.addAll(stat.getLoadedPipConfigs());
+        this.loadedPolicies.clear();
+        this.loadedPolicies.addAll(stat.getLoadedPolicies());
+        this.loadErrors.clear();
+        this.loadErrors.addAll(stat.getLoadErrors());
+        this.loadWarnings.clear();
+        this.loadWarnings.addAll(stat.getLoadWarnings());
+        this.outOfSynchPDPs.clear();
+        this.outOfSynchPDPs.addAll(stat.getOutOfSynchPDPs());
+        this.unknownPDPs.clear();
+        this.unknownPDPs.addAll(stat.getUpdatingPDPs());
+        this.updatingPDPs.clear();
+        this.updatingPDPs.addAll(stat.getUpdatingPDPs());
+    }
 
-        @Override
-        public Set<PDP> getFailedPDPs() {
-                return Collections.unmodifiableSet(this.failedPDPs);
-        }
+    public Set<PDPPIPConfig> getLoadedPIPConfigs() {
+        return loadedPIPConfigs;
+    }
+    public void setLoadedPIPConfigs(Set<PDPPIPConfig> loadedPIPConfigs) {
+        this.loadedPIPConfigs = loadedPIPConfigs;
+    }
+    public Set<PDPPIPConfig> getFailedPIPConfigs() {
+        return failedPIPConfigs;
+    }
+    public void setFailedPIPConfigs(Set<PDPPIPConfig> failedPIPConfigs) {
+        this.failedPIPConfigs = failedPIPConfigs;
+    }
+    public Set<PDP> getUnknownPDPs() {
+        return unknownPDPs;
+    }
+    public void setUnknownPDPs(Set<PDP> unknownPDPs) {
+        this.unknownPDPs = unknownPDPs;
+    }
+    public void setLoadErrors(Set<String> loadErrors) {
+        this.loadErrors = loadErrors;
+    }
+    public void setLoadWarnings(Set<String> loadWarnings) {
+        this.loadWarnings = loadWarnings;
+    }
+    public void setLoadedPolicies(Set<PDPPolicy> loadedPolicies) {
+        this.loadedPolicies = loadedPolicies;
+    }
+    public void setFailedPolicies(Set<PDPPolicy> failedPolicies) {
+        this.failedPolicies = failedPolicies;
+    }
+    public void setInSynchPDPs(Set<PDP> inSynchPDPs) {
+        this.inSynchPDPs = inSynchPDPs;
+    }
+    public void setOutOfSynchPDPs(Set<PDP> outOfSynchPDPs) {
+        this.outOfSynchPDPs = outOfSynchPDPs;
+    }
+    public void setFailedPDPs(Set<PDP> failedPDPs) {
+        this.failedPDPs = failedPDPs;
+    }
+    public void setUpdatingPDPs(Set<PDP> updatingPDPs) {
+        this.updatingPDPs = updatingPDPs;
+    }
+    public void setLastUpdateFailedPDPs(Set<PDP> lastUpdateFailedPDPs) {
+        this.lastUpdateFailedPDPs = lastUpdateFailedPDPs;
+    }
 
-        public void addFailedPDP(PDP pdp) {
-                this.failedPDPs.add(pdp);
-        }
 
-        @Override
-        public Set<PDP> getUpdatingPDPs() {
-                return Collections.unmodifiableSet(this.updatingPDPs);
-        }
+    @Override
+    public Status getStatus() {
+        return status;
+    }
 
-        public void addUpdatingPDP(PDP pdp) {
-                this.updatingPDPs.add(pdp);
-        }
+    public void setStatus(Status status) {
+        this.status = status;
+    }
 
-        @Override
-        public Set<PDP> getLastUpdateFailedPDPs() {
-                return Collections.unmodifiableSet(this.lastUpdateFailedPDPs);
-        }
+    @Override
+    public Set<String> getLoadErrors() {
+        return Collections.unmodifiableSet(this.loadErrors);
+    }
 
-        public void addLastUpdateFailedPDP(PDP pdp) {
-                this.lastUpdateFailedPDPs.add(pdp);
-        }
+    public void addLoadError(String error) {
+        this.loadErrors.add(error);
+    }
 
-        @Override
-        @JsonIgnore
-        public Set<PDP> getUnknownStatusPDPs() {
-                return Collections.unmodifiableSet(this.unknownPDPs);
-        }
+    @Override
+    public Set<String> getLoadWarnings() {
+        return Collections.unmodifiableSet(this.loadWarnings);
+    }
 
-        public void addUnknownPDP(PDP pdp) {
-                this.unknownPDPs.add(pdp);
-        }
+    public void addLoadWarning(String warning) {
+        this.loadWarnings.add(warning);
+    }
 
-        @Override
-        public boolean pdpsOK() {
-                if (this.outOfSynchPDPs.size() > 0) {
-                        return false;
-                }
-                if (this.failedPDPs.size() > 0) {
-                        return false;
-                }
-                if (this.lastUpdateFailedPDPs.size() > 0) {
-                        return false;
-                }
-                if (this.unknownPDPs.size() > 0) {
-                        return false;
-                }
-                return true;
-        }
+    @Override
+    public Set<PDPPolicy> getLoadedPolicies() {
+        return Collections.unmodifiableSet(this.loadedPolicies);
+    }
 
-        @Override
-        @JsonIgnore
-        public boolean isGroupOk() {
-                if (this.policiesOK() == false) {
-                        return false;
-                }
-                if (this.pipConfigOK() == false) {
-                        return false;
-                }
-                if (this.pdpsOK() == false) {
-                        return false;
-                }
-                if (this.loadErrors.isEmpty() == false) {
-                        return false;
-                }
-                return (this.status == Status.OK);
-        }
-        
-        public void reset() {
-                this.status = Status.OK;
-                
-                this.loadErrors.clear();
-                this.loadWarnings.clear();
-                this.loadedPolicies.clear();
-                this.failedPolicies.clear();
-                this.loadedPIPConfigs.clear();
-                this.failedPIPConfigs.clear();
-                this.inSynchPDPs.clear();
-                this.outOfSynchPDPs.clear();
-                this.failedPDPs.clear();
-                this.updatingPDPs.clear();
-                this.lastUpdateFailedPDPs.clear();
-                this.unknownPDPs.clear();
-        }
+    public void addLoadedPolicy(PDPPolicy policy) {
+        this.loadedPolicies.add(policy);
+    }
 
-        @Override
-        public int hashCode() {
-                final int prime = 31;
-                int result = 1;
-                result = prime * result
-                                + (failedPDPs.hashCode());
-                result = prime
-                                * result
-                                + (failedPIPConfigs.hashCode());
-                result = prime * result
-                                + (failedPolicies.hashCode());
-                result = prime * result
-                                + (inSynchPDPs.hashCode());
-                result = prime
-                                * result
-                                + (lastUpdateFailedPDPs.hashCode());
-                result = prime * result
-                                + (loadErrors.hashCode());
-                result = prime * result
-                                + (loadWarnings.hashCode());
-                result = prime
-                                * result
-                                + (loadedPIPConfigs.hashCode());
-                result = prime * result
-                                + (loadedPolicies.hashCode());
-                result = prime * result
-                                + (outOfSynchPDPs.hashCode());
-                result = prime * result + (status.hashCode());
-                result = prime * result
-                                + (unknownPDPs.hashCode());
-                result = prime * result
-                                + (updatingPDPs.hashCode());
-                return result;
-        }
+    @Override
+    public Set<PDPPolicy> getFailedPolicies() {
+        return Collections.unmodifiableSet(this.failedPolicies);
+    }
 
-        @Override
-        public boolean equals(Object obj) {
-                if (this == obj)
-                        return true;
-                if (obj == null)
-                        return false;
-                if (getClass() != obj.getClass())
-                        return false;
-                StdPDPGroupStatus other = (StdPDPGroupStatus) obj;
-                if (!failedPDPs.equals(other.failedPDPs))
-                        return false;
-                if (!failedPIPConfigs.equals(other.failedPIPConfigs))
-                        return false;
-                if (!failedPolicies.equals(other.failedPolicies))
-                        return false;
-                if (!inSynchPDPs.equals(other.inSynchPDPs))
-                        return false;
-                if (!lastUpdateFailedPDPs.equals(other.lastUpdateFailedPDPs))
-                        return false;
-                if (!loadErrors.equals(other.loadErrors))
-                        return false;
-                if (!loadWarnings.equals(other.loadWarnings))
-                        return false;
-                if (!loadedPIPConfigs.equals(other.loadedPIPConfigs))
-                        return false;
-                if (!loadedPolicies.equals(other.loadedPolicies))
-                        return false;
-                if (!outOfSynchPDPs.equals(other.outOfSynchPDPs))
-                        return false;
-                if (status != other.status)
-                        return false;
-                if (!unknownPDPs.equals(other.unknownPDPs))
-                        return false;
-                if (!updatingPDPs.equals(other.updatingPDPs))
-                        return false;
-                return true;
-        }
+    public void addFailedPolicy(PDPPolicy policy) {
+        this.failedPolicies.add(policy);
+    }
 
-        @Override
-        public String toString() {
-                return "StdPDPGroupStatus [status=" + status + ", loadErrors="
-                                + loadErrors + ", loadWarnings=" + loadWarnings
-                                + ", loadedPolicies=" + loadedPolicies + ", failedPolicies="
-                                + failedPolicies + ", loadedPIPConfigs=" + loadedPIPConfigs
-                                + ", failedPIPConfigs=" + failedPIPConfigs + ", inSynchPDPs="
-                                + inSynchPDPs + ", outOfSynchPDPs=" + outOfSynchPDPs
-                                + ", failedPDPs=" + failedPDPs + ", updatingPDPs="
-                                + updatingPDPs + ", lastUpdateFailedPDPs="
-                                + lastUpdateFailedPDPs + ", unknownPDPs=" + unknownPDPs + "]";
+    @Override
+    public boolean policiesOK() {
+        if (this.failedPolicies.size() > 0) {
+            return false;
         }
+        return true;
+    }
+
+    @Override
+    public Set<PDPPIPConfig> getLoadedPipConfigs() {
+        return Collections.unmodifiableSet(this.loadedPIPConfigs);
+    }
+
+    public void addLoadedPipConfig(PDPPIPConfig config) {
+        this.loadedPIPConfigs.add(config);
+    }
+
+    @Override
+    public Set<PDPPIPConfig> getFailedPipConfigs() {
+        return Collections.unmodifiableSet(this.failedPIPConfigs);
+    }
+
+    public void addFailedPipConfig(PDPPIPConfig config) {
+        this.failedPIPConfigs.add(config);
+    }
+
+    @Override
+    public boolean pipConfigOK() {
+        if (this.failedPIPConfigs.size() > 0) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public Set<PDP> getInSynchPDPs() {
+        return Collections.unmodifiableSet(this.inSynchPDPs);
+    }
+
+    public void addInSynchPDP(PDP pdp) {
+        this.inSynchPDPs.add(pdp);
+    }
+
+    @Override
+    public Set<PDP> getOutOfSynchPDPs() {
+        return Collections.unmodifiableSet(this.outOfSynchPDPs);
+    }
+
+    public void addOutOfSynchPDP(PDP pdp) {
+        this.outOfSynchPDPs.add(pdp);
+    }
+
+    @Override
+    public Set<PDP> getFailedPDPs() {
+        return Collections.unmodifiableSet(this.failedPDPs);
+    }
+
+    public void addFailedPDP(PDP pdp) {
+        this.failedPDPs.add(pdp);
+    }
+
+    @Override
+    public Set<PDP> getUpdatingPDPs() {
+        return Collections.unmodifiableSet(this.updatingPDPs);
+    }
+
+    public void addUpdatingPDP(PDP pdp) {
+        this.updatingPDPs.add(pdp);
+    }
+
+    @Override
+    public Set<PDP> getLastUpdateFailedPDPs() {
+        return Collections.unmodifiableSet(this.lastUpdateFailedPDPs);
+    }
+
+    public void addLastUpdateFailedPDP(PDP pdp) {
+        this.lastUpdateFailedPDPs.add(pdp);
+    }
+
+    @Override
+    @JsonIgnore
+    public Set<PDP> getUnknownStatusPDPs() {
+        return Collections.unmodifiableSet(this.unknownPDPs);
+    }
+
+    public void addUnknownPDP(PDP pdp) {
+        this.unknownPDPs.add(pdp);
+    }
+
+    @Override
+    public boolean pdpsOK() {
+        if (this.outOfSynchPDPs.size() > 0) {
+            return false;
+        }
+        if (this.failedPDPs.size() > 0) {
+            return false;
+        }
+        if (this.lastUpdateFailedPDPs.size() > 0) {
+            return false;
+        }
+        if (this.unknownPDPs.size() > 0) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    @JsonIgnore
+    public boolean isGroupOk() {
+        if (this.policiesOK() == false) {
+            return false;
+        }
+        if (this.pipConfigOK() == false) {
+            return false;
+        }
+        if (this.pdpsOK() == false) {
+            return false;
+        }
+        if (this.loadErrors.isEmpty() == false) {
+            return false;
+        }
+        return (this.status == Status.OK);
+    }
+
+    public void reset() {
+        this.status = Status.OK;
+
+        this.loadErrors.clear();
+        this.loadWarnings.clear();
+        this.loadedPolicies.clear();
+        this.failedPolicies.clear();
+        this.loadedPIPConfigs.clear();
+        this.failedPIPConfigs.clear();
+        this.inSynchPDPs.clear();
+        this.outOfSynchPDPs.clear();
+        this.failedPDPs.clear();
+        this.updatingPDPs.clear();
+        this.lastUpdateFailedPDPs.clear();
+        this.unknownPDPs.clear();
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                 + (failedPDPs.hashCode());
+        result = prime
+                 * result
+                 + (failedPIPConfigs.hashCode());
+        result = prime * result
+                 + (failedPolicies.hashCode());
+        result = prime * result
+                 + (inSynchPDPs.hashCode());
+        result = prime
+                 * result
+                 + (lastUpdateFailedPDPs.hashCode());
+        result = prime * result
+                 + (loadErrors.hashCode());
+        result = prime * result
+                 + (loadWarnings.hashCode());
+        result = prime
+                 * result
+                 + (loadedPIPConfigs.hashCode());
+        result = prime * result
+                 + (loadedPolicies.hashCode());
+        result = prime * result
+                 + (outOfSynchPDPs.hashCode());
+        result = prime * result + (status.hashCode());
+        result = prime * result
+                 + (unknownPDPs.hashCode());
+        result = prime * result
+                 + (updatingPDPs.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        StdPDPGroupStatus other = (StdPDPGroupStatus) obj;
+        if (!failedPDPs.equals(other.failedPDPs))
+            return false;
+        if (!failedPIPConfigs.equals(other.failedPIPConfigs))
+            return false;
+        if (!failedPolicies.equals(other.failedPolicies))
+            return false;
+        if (!inSynchPDPs.equals(other.inSynchPDPs))
+            return false;
+        if (!lastUpdateFailedPDPs.equals(other.lastUpdateFailedPDPs))
+            return false;
+        if (!loadErrors.equals(other.loadErrors))
+            return false;
+        if (!loadWarnings.equals(other.loadWarnings))
+            return false;
+        if (!loadedPIPConfigs.equals(other.loadedPIPConfigs))
+            return false;
+        if (!loadedPolicies.equals(other.loadedPolicies))
+            return false;
+        if (!outOfSynchPDPs.equals(other.outOfSynchPDPs))
+            return false;
+        if (status != other.status)
+            return false;
+        if (!unknownPDPs.equals(other.unknownPDPs))
+            return false;
+        if (!updatingPDPs.equals(other.updatingPDPs))
+            return false;
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "StdPDPGroupStatus [status=" + status + ", loadErrors="
+               + loadErrors + ", loadWarnings=" + loadWarnings
+               + ", loadedPolicies=" + loadedPolicies + ", failedPolicies="
+               + failedPolicies + ", loadedPIPConfigs=" + loadedPIPConfigs
+               + ", failedPIPConfigs=" + failedPIPConfigs + ", inSynchPDPs="
+               + inSynchPDPs + ", outOfSynchPDPs=" + outOfSynchPDPs
+               + ", failedPDPs=" + failedPDPs + ", updatingPDPs="
+               + updatingPDPs + ", lastUpdateFailedPDPs="
+               + lastUpdateFailedPDPs + ", unknownPDPs=" + unknownPDPs + "]";
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPItemSetChangeNotifier.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPItemSetChangeNotifier.java
index c47476e..762fa3b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPItemSetChangeNotifier.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPItemSetChangeNotifier.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,55 +37,55 @@
 import com.att.research.xacml.api.pap.PDPGroup;
 
 public class StdPDPItemSetChangeNotifier {
-        
-        private Collection<StdItemSetChangeListener> listeners = null;
-        
-        public interface StdItemSetChangeListener {
-                
-                public void changed();
-                
-                public void groupChanged(PDPGroup group);
-                
-                public void pdpChanged(PDP pdp);
-        }
-        
-        public void addItemSetChangeListener(StdItemSetChangeListener listener) {
-                if (this.listeners == null) {
-                        this.listeners = new LinkedList<StdItemSetChangeListener>();
-                }
-                this.listeners.add(listener);
-        }
-        
-        public void removeItemSetChangeListener(StdItemSetChangeListener listener) {
-                if (this.listeners != null) {
-                        this.listeners.remove(listener);
-                }
-        }
 
-        public void fireChanged() {
-                if (this.listeners == null) {
-                        return;
-                }
-                for (StdItemSetChangeListener l : this.listeners) {
-                        l.changed();
-                }		
-        }
+    private Collection<StdItemSetChangeListener> listeners = null;
 
-        public void firePDPGroupChanged(PDPGroup group) {
-                if (this.listeners == null) {
-                        return;
-                }
-                for (StdItemSetChangeListener l : this.listeners) {
-                        l.groupChanged(group);
-                }
-        }
+    public interface StdItemSetChangeListener {
 
-        public void firePDPChanged(PDP pdp) {
-                if (this.listeners == null) {
-                        return;
-                }
-                for (StdItemSetChangeListener l : this.listeners) {
-                        l.pdpChanged(pdp);
-                }
+        public void changed();
+
+        public void groupChanged(PDPGroup group);
+
+        public void pdpChanged(PDP pdp);
+    }
+
+    public void addItemSetChangeListener(StdItemSetChangeListener listener) {
+        if (this.listeners == null) {
+            this.listeners = new LinkedList<StdItemSetChangeListener>();
         }
+        this.listeners.add(listener);
+    }
+
+    public void removeItemSetChangeListener(StdItemSetChangeListener listener) {
+        if (this.listeners != null) {
+            this.listeners.remove(listener);
+        }
+    }
+
+    public void fireChanged() {
+        if (this.listeners == null) {
+            return;
+        }
+        for (StdItemSetChangeListener l : this.listeners) {
+            l.changed();
+        }
+    }
+
+    public void firePDPGroupChanged(PDPGroup group) {
+        if (this.listeners == null) {
+            return;
+        }
+        for (StdItemSetChangeListener l : this.listeners) {
+            l.groupChanged(group);
+        }
+    }
+
+    public void firePDPChanged(PDP pdp) {
+        if (this.listeners == null) {
+            return;
+        }
+        for (StdItemSetChangeListener l : this.listeners) {
+            l.pdpChanged(pdp);
+        }
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPPIPConfig.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPPIPConfig.java
index d6be9e0..d45acbb 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPPIPConfig.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPPIPConfig.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,187 +43,187 @@
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
 public class StdPDPPIPConfig implements PDPPIPConfig, Serializable {
-        private static final long serialVersionUID = 1L;
-        private static Log	logger	= LogFactory.getLog(StdPDPPIPConfig.class);
-        
-        private String id;
-        
-        private String name;
-        
-        private String description;
-        
-        private String classname;
-        
-        private Map<String,String> config = new HashMap<String, String>();
-        
-        public StdPDPPIPConfig() {
-                
-        }
+    private static final long serialVersionUID = 1L;
+    private static Log	logger	= LogFactory.getLog(StdPDPPIPConfig.class);
 
-        public StdPDPPIPConfig(String id) {
-                this.id = id;
-        }
-        
-        public StdPDPPIPConfig(String id, String name, String description) {
-                this(id);
-                this.name = name;
-                this.description = description;
-        }
+    private String id;
 
-        public StdPDPPIPConfig(String id, Properties properties) {
-                this(id);
-                if ( ! this.initialize(properties) ) {
-                        throw new IllegalArgumentException("PIP Engine '" + id + "' has no classname property in config");
+    private String name;
+
+    private String description;
+
+    private String classname;
+
+    private Map<String,String> config = new HashMap<String, String>();
+
+    public StdPDPPIPConfig() {
+
+    }
+
+    public StdPDPPIPConfig(String id) {
+        this.id = id;
+    }
+
+    public StdPDPPIPConfig(String id, String name, String description) {
+        this(id);
+        this.name = name;
+        this.description = description;
+    }
+
+    public StdPDPPIPConfig(String id, Properties properties) {
+        this(id);
+        if ( ! this.initialize(properties) ) {
+            throw new IllegalArgumentException("PIP Engine '" + id + "' has no classname property in config");
+        }
+    }
+
+    public boolean initialize(Properties properties) {
+        boolean classnameSeen = false;
+        for (Object key : properties.keySet()) {
+            if (key.toString().startsWith(this.id + ".")) {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Found: " + key);
                 }
-        }
-        
-        public boolean initialize(Properties properties) {
-                boolean classnameSeen = false;
-                for (Object key : properties.keySet()) {
-                        if (key.toString().startsWith(this.id + ".")) {
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("Found: " + key);
-                                }
-                                if (key.toString().equals(this.id + ".name")) {
-                                        this.name = properties.getProperty(key.toString());
-                                } else if (key.toString().equals(this.id + ".description")) {
-                                        this.description = properties.getProperty(key.toString());
-                                } else if (key.toString().equals(this.id + ".classname")) {
-                                        this.classname = properties.getProperty(key.toString());
-                                        classnameSeen = true;
-                                }
-                                // all properties, including the special ones located above, are included in the properties list
-                                this.config.put(key.toString(), properties.getProperty(key.toString()));
-                        }
+                if (key.toString().equals(this.id + ".name")) {
+                    this.name = properties.getProperty(key.toString());
+                } else if (key.toString().equals(this.id + ".description")) {
+                    this.description = properties.getProperty(key.toString());
+                } else if (key.toString().equals(this.id + ".classname")) {
+                    this.classname = properties.getProperty(key.toString());
+                    classnameSeen = true;
                 }
-                return classnameSeen;
+                // all properties, including the special ones located above, are included in the properties list
+                this.config.put(key.toString(), properties.getProperty(key.toString()));
+            }
         }
+        return classnameSeen;
+    }
 
-        @Override
-        public String getId() {
-                return this.id;
-        }
-        
-        public void setId(String id) {
-                this.id = id;
-        }
+    @Override
+    public String getId() {
+        return this.id;
+    }
 
-        @Override
-        public String getName() {
-                return name;
-        }
+    public void setId(String id) {
+        this.id = id;
+    }
 
-        public void setName(String name) {
-                this.name = name;
-        }
+    @Override
+    public String getName() {
+        return name;
+    }
 
-        @Override
-        public String getDescription() {
-                return this.description;
-        }
-        
-        public void setDescription(String description) {
-                this.description = description;
-        }
+    public void setName(String name) {
+        this.name = name;
+    }
 
-        @Override
-        public String getClassname() {
-                return classname;
-        }
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
 
-        public void setClassname(String classname) {
-                this.classname = classname;
-        }
+    public void setDescription(String description) {
+        this.description = description;
+    }
 
-        @Override
-        @JsonIgnore
-        public Map<String,String> getConfiguration() {
-                return Collections.unmodifiableMap(this.config);
-        }
+    @Override
+    public String getClassname() {
+        return classname;
+    }
 
-        public void setValues(Map<String,String> config) {
-                this.config = config;
-        }
+    public void setClassname(String classname) {
+        this.classname = classname;
+    }
 
-        @Override
-        @JsonIgnore
-        public boolean isConfigured() {
-                //
-                // TODO
-                // Also include this in the JSON I/O if it is a data field rather than calculated
-                //
-                return true;
-        }
+    @Override
+    @JsonIgnore
+    public Map<String,String> getConfiguration() {
+        return Collections.unmodifiableMap(this.config);
+    }
 
-        @Override
-        public int hashCode() {
-                final int prime = 31;
-                int result = 1;
-                result = prime * result
-                                + ((classname == null) ? 0 : classname.hashCode());
-                result = prime * result + ((config == null) ? 0 : config.hashCode());
-                result = prime * result
-                                + ((description == null) ? 0 : description.hashCode());
-                result = prime * result + ((id == null) ? 0 : id.hashCode());
-                result = prime * result + ((name == null) ? 0 : name.hashCode());
-                return result;
-        }
+    public void setValues(Map<String,String> config) {
+        this.config = config;
+    }
 
-        @Override
-        public boolean equals(Object obj) {
-                if (this == obj)
-                        return true;
-                if (obj == null)
-                        return false;
-                if (getClass() != obj.getClass())
-                        return false;
-                StdPDPPIPConfig other = (StdPDPPIPConfig) obj;
-                if (classname == null) {
-                        if (other.classname != null)
-                                return false;
-                } else if (!classname.equals(other.classname))
-                        return false;
-                if (config == null) {
-                        if (other.config != null)
-                                return false;
-                } else if (!config.equals(other.config))
-                        return false;
-                if (description == null) {
-                        if (other.description != null)
-                                return false;
-                } else if (!description.equals(other.description))
-                        return false;
-                if (id == null) {
-                        if (other.id != null)
-                                return false;
-                } else if (!id.equals(other.id))
-                        return false;
-                if (name == null) {
-                        if (other.name != null)
-                                return false;
-                } else if (!name.equals(other.name))
-                        return false;
-                return true;
-        }
-
-        @Override
-        public String toString() {
-                return "StdPDPPIPConfig [id=" + id + ", name=" + name
-                                + ", description=" + description + ", classname=" + classname
-                                + ", config=" + config + "]";
-        }
-
-        
-        
+    @Override
+    @JsonIgnore
+    public boolean isConfigured() {
         //
-        // Methods needed for JSON serialization/deserialization
+        // TODO
+        // Also include this in the JSON I/O if it is a data field rather than calculated
         //
+        return true;
+    }
 
-        public Map<String, String> getConfig() {
-                return config;
-        }
-        public void setConfig(Map<String, String> config) {
-                this.config = config;
-        }
-        
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result
+                 + ((classname == null) ? 0 : classname.hashCode());
+        result = prime * result + ((config == null) ? 0 : config.hashCode());
+        result = prime * result
+                 + ((description == null) ? 0 : description.hashCode());
+        result = prime * result + ((id == null) ? 0 : id.hashCode());
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        StdPDPPIPConfig other = (StdPDPPIPConfig) obj;
+        if (classname == null) {
+            if (other.classname != null)
+                return false;
+        } else if (!classname.equals(other.classname))
+            return false;
+        if (config == null) {
+            if (other.config != null)
+                return false;
+        } else if (!config.equals(other.config))
+            return false;
+        if (description == null) {
+            if (other.description != null)
+                return false;
+        } else if (!description.equals(other.description))
+            return false;
+        if (id == null) {
+            if (other.id != null)
+                return false;
+        } else if (!id.equals(other.id))
+            return false;
+        if (name == null) {
+            if (other.name != null)
+                return false;
+        } else if (!name.equals(other.name))
+            return false;
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "StdPDPPIPConfig [id=" + id + ", name=" + name
+               + ", description=" + description + ", classname=" + classname
+               + ", config=" + config + "]";
+    }
+
+
+
+    //
+    // Methods needed for JSON serialization/deserialization
+    //
+
+    public Map<String, String> getConfig() {
+        return config;
+    }
+    public void setConfig(Map<String, String> config) {
+        this.config = config;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPPolicy.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPPolicy.java
index a291b80..4757fc9 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPPolicy.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPPolicy.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -53,288 +53,287 @@
 import com.google.common.collect.Lists;
 
 public class StdPDPPolicy implements PDPPolicy, Serializable {
-        private static final long serialVersionUID = 1L;
-        private static Log	logger	= LogFactory.getLog(StdPDPPolicy.class);
-        
-        private String id = null;
-        
-        private String name = null;
+    private static final long serialVersionUID = 1L;
+    private static Log	logger	= LogFactory.getLog(StdPDPPolicy.class);
 
-        private String policyId = null;
-        
-        private String description = null;
-        
-        private int[]	version = null;
+    private String id = null;
 
-        private boolean isRoot = false;
-        
-        private boolean isValid = false;
-        
-        private URI location = null;
-        
+    private String name = null;
 
-        public StdPDPPolicy(String id, boolean isRoot) {
-                this.id = id;
-                this.isRoot = isRoot;
+    private String policyId = null;
+
+    private String description = null;
+
+    private int[]	version = null;
+
+    private boolean isRoot = false;
+
+    private boolean isValid = false;
+
+    private URI location = null;
+
+
+    public StdPDPPolicy(String id, boolean isRoot) {
+        this.id = id;
+        this.isRoot = isRoot;
+    }
+
+    public StdPDPPolicy(String id, boolean isRoot, String name) {
+        this(id, isRoot);
+        this.name = name;
+    }
+
+
+    public StdPDPPolicy(String id, boolean isRoot, String name, URI location) throws IOException {
+        this(id, isRoot);
+        this.name = name;
+        this.location = location;
+        //
+        // Read the policy data
+        //
+        String theID = this.readPolicyData();
+        if (this.id == null) {
+            this.id = theID;
         }
+    }
 
-        public StdPDPPolicy(String id, boolean isRoot, String name) {
-                this(id, isRoot);
-                this.name = name;
+    public StdPDPPolicy(String id, boolean isRoot, URI location, Properties properties) throws IOException {
+        this(id, isRoot);
+        this.location = location;
+        //
+        // Read the policy data
+        //
+        this.readPolicyData();
+        //
+        // See if there's a name
+        //
+        for (Object key : properties.keySet()) {
+            if (key.toString().equals(id + ".name")) {
+                this.name = properties.getProperty(key.toString());
+                break;
+            }
         }
+    }
 
-        
-        public StdPDPPolicy(String id, boolean isRoot, String name, URI location) throws IOException {
-                this(id, isRoot);
-                this.name = name;
-                this.location = location;
-                //
-                // Read the policy data
-                //
-                String theID = this.readPolicyData();
-                if (this.id == null) {
-                        this.id = theID;
-                }
-        }
 
-        public StdPDPPolicy(String id, boolean isRoot, URI location, Properties properties) throws IOException {
-                this(id, isRoot);
-                this.location = location;
-                //
-                // Read the policy data
-                //
-                this.readPolicyData();
-                //
-                // See if there's a name
-                //
-                for (Object key : properties.keySet()) {
-                        if (key.toString().equals(id + ".name")) {
-                                this.name = properties.getProperty(key.toString());
-                                break;
-                        }
-                }
+    private String readPolicyData() throws IOException {
+        //
+        // Extract XACML policy information
+        //
+        URL url = this.location.toURL();
+        Object rootElement = XACMLPolicyScanner.readPolicy(url.openStream());
+        if (rootElement == null ||
+                (
+                    ! (rootElement instanceof PolicySetType) &&
+                    ! (rootElement instanceof PolicyType)
+                )	) {
+            logger.warn("No root policy element in URI: " + this.location.toString() + " : " + rootElement);
+            this.isValid = false;
+        } else {
+            this.version = versionStringToArray(XACMLPolicyScanner.getVersion(rootElement));
+            if (rootElement instanceof PolicySetType) {
+                this.policyId = ((PolicySetType)rootElement).getPolicySetId();
+                this.description = ((PolicySetType)rootElement).getDescription();
+                this.isValid = true;
+                this.version = versionStringToArray(((PolicySetType)rootElement).getVersion());
+            } else if (rootElement instanceof PolicyType) {
+                this.policyId = ((PolicyType)rootElement).getPolicyId();
+                this.description = ((PolicyType)rootElement).getDescription();
+                this.version = versionStringToArray(((PolicyType)rootElement).getVersion());
+                this.isValid = true;
+            } else {
+                logger.error("Unknown root element: " + rootElement.getClass().getCanonicalName());
+            }
         }
-        
-        
-        private String readPolicyData() throws IOException {
-                //
-                // Extract XACML policy information
-                //
+        if (this.policyId != null) {
+            ArrayList<String> foo = Lists.newArrayList(Splitter.on(':').split(this.policyId));
+            if (foo.isEmpty() == false) {
+                return foo.get(foo.size() - 1);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    @Override
+    public String getName() {
+        return this.name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String getPolicyId() {
+        return this.policyId;
+    }
+
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
+
+    @Override
+    public String getVersion() {
+        return versionArrayToString(this.version);
+    }
+
+    @Override
+    @JsonIgnore
+    public int[] getVersionInts() {
+        return version;
+    }
+
+    @Override
+    public boolean isRoot() {
+        return this.isRoot;
+    }
+
+    @Override
+    public boolean isValid() {
+        return this.isValid;
+    }
+
+    @Override
+    @JsonIgnore
+    public InputStream getStream() throws PAPException, IOException {
+        try {
+            if (this.location != null) {
                 URL url = this.location.toURL();
-                Object rootElement = XACMLPolicyScanner.readPolicy(url.openStream());
-                if (rootElement == null ||
-                        (
-                                ! (rootElement instanceof PolicySetType) &&
-                                ! (rootElement instanceof PolicyType)
-                        )	) {
-                        logger.warn("No root policy element in URI: " + this.location.toString() + " : " + rootElement);
-                        this.isValid = false;
-                } else {
-                        this.version = versionStringToArray(XACMLPolicyScanner.getVersion(rootElement));
-                        if (rootElement instanceof PolicySetType) {
-                                this.policyId = ((PolicySetType)rootElement).getPolicySetId();
-                                this.description = ((PolicySetType)rootElement).getDescription();
-                                this.isValid = true;
-                                this.version = versionStringToArray(((PolicySetType)rootElement).getVersion());
-                        } else if (rootElement instanceof PolicyType) {
-                                this.policyId = ((PolicyType)rootElement).getPolicyId();
-                                this.description = ((PolicyType)rootElement).getDescription();
-                                this.version = versionStringToArray(((PolicyType)rootElement).getVersion());
-                                this.isValid = true;
-                        } else {
-                                logger.error("Unknown root element: " + rootElement.getClass().getCanonicalName());
-                        }
-                }
-                if (this.policyId != null) {
-                        ArrayList<String> foo = Lists.newArrayList(Splitter.on(':').split(this.policyId));
-                        if (foo.isEmpty() == false) {
-                                return foo.get(foo.size() - 1);
-                        }
-                }
-                return null;
+                return url.openStream();
+            }
+            return null;
+        } catch (FileNotFoundException e) {
+            throw new PAPException(e);
         }
-        
-        @Override
-        public String getId() {
-                return id;
-        }
+    }
 
-        public void setId(String id) {
-                this.id = id;
-        }
+    @Override
+    public URI getLocation() throws PAPException {
+        return this.location;
+    }
 
-        @Override
-        public String getName() {
-                return this.name;
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((id == null) ? 0 : id.hashCode());
+        result = prime * result
+                 + ((policyId == null) ? 0 : policyId.hashCode());
+        result = prime * result;
+        if (version != null) {
+            for (int i = 0; i < version.length; i++) {
+                result += version[i];
+            }
         }
-        
-        public void setName(String name) {
-                this.name = name;
-        }
+        return result;
+    }
 
-        @Override
-        public String getPolicyId() {
-                return this.policyId;
-        }
-        
-        @Override
-        public String getDescription() {
-                return this.description;
-        }
-        
-        @Override
-        public String getVersion() {
-                return versionArrayToString(this.version);
-        }
-        
-        @Override
-        @JsonIgnore
-        public int[] getVersionInts() {
-                return version;
-        }
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        StdPDPPolicy other = (StdPDPPolicy) obj;
+        if (id == null) {
+            if (other.id != null)
+                return false;
+        } else if (!id.equals(other.id))
+            return false;
+        if (policyId == null) {
+            if (other.policyId != null)
+                return false;
+        } else if (!policyId.equals(other.policyId))
+            return false;
+        if (version != other.version)
+            return false;
+        return true;
+    }
 
-        @Override
-        public boolean isRoot() {
-                return this.isRoot;
-        }
+    @Override
+    public String toString() {
+        return "StdPDPPolicy [id=" + id + ", name=" + name + ", policyId="
+               + policyId + ", description=" + description + ", version="
+               + this.getVersion() + ", isRoot=" + isRoot + ", isValid=" + isValid
+               + ", location=" + location + "]";
+    }
 
-        @Override
-        public boolean isValid()
-        {
-                return this.isValid;
-        }
 
-        @Override
-        @JsonIgnore
-        public InputStream getStream() throws PAPException, IOException {
-                try {
-                        if (this.location != null) {
-                                URL url = this.location.toURL();
-                                return url.openStream();
-                        }
-                        return null;
-                } catch (FileNotFoundException e) {
-                        throw new PAPException(e);
-                }
+    /**
+     * Given a version string consisting of integers with dots between them, convert it into an array of ints.
+     *
+     * @param version
+     * @return
+     * @throws NumberFormatException
+     */
+    public static int[] versionStringToArray(String version) throws NumberFormatException {
+        if (version == null || version.length() == 0) {
+            return new int[0];
         }
+        String[] stringArray = version.split("\\.");
+        int[] resultArray = new int[stringArray.length];
+        for (int i = 0; i < stringArray.length; i++) {
+            resultArray[i] = Integer.parseInt(stringArray[i]);
+        }
+        return resultArray;
+    }
 
-        @Override
-        public URI getLocation() throws PAPException {
-                return this.location;
+    /**
+     * Given an array representing a version, create the corresponding dot-separated string.
+     *
+     * @param array
+     * @return
+     */
+    public static String versionArrayToString(int[] array) {
+        if (array == null || array.length == 0) {
+            return "";
         }
+        String versionString = "";
+        if (array.length > 0) {
+            versionString = "" + array[0];
+            for (int i = 1; i < array.length; i++) {
+                versionString += "." + array[i];
+            }
+        }
+        return versionString;
+    }
 
-        @Override
-        public int hashCode() {
-                final int prime = 31;
-                int result = 1;
-                result = prime * result + ((id == null) ? 0 : id.hashCode());
-                result = prime * result
-                                + ((policyId == null) ? 0 : policyId.hashCode());
-                result = prime * result;
-                if (version != null) {
-                        for (int i = 0; i < version.length; i++) {
-                                result += version[i];
-                        }
-                }
-                return result;
-        }
 
-        @Override
-        public boolean equals(Object obj) {
-                if (this == obj)
-                        return true;
-                if (obj == null)
-                        return false;
-                if (getClass() != obj.getClass())
-                        return false;
-                StdPDPPolicy other = (StdPDPPolicy) obj;
-                if (id == null) {
-                        if (other.id != null)
-                                return false;
-                } else if (!id.equals(other.id))
-                        return false;
-                if (policyId == null) {
-                        if (other.policyId != null)
-                                return false;
-                } else if (!policyId.equals(other.policyId))
-                        return false;
-                if (version != other.version)
-                        return false;
-                return true;
-        }
 
-        @Override
-        public String toString() {
-                return "StdPDPPolicy [id=" + id + ", name=" + name + ", policyId="
-                                + policyId + ", description=" + description + ", version="
-                                + this.getVersion() + ", isRoot=" + isRoot + ", isValid=" + isValid
-                                + ", location=" + location + "]";
-        }
-        
-        
-        /**
-         * Given a version string consisting of integers with dots between them, convert it into an array of ints.
-         * 
-         * @param version
-         * @return
-         * @throws NumberFormatException
-         */
-        public static int[] versionStringToArray(String version) throws NumberFormatException {
-                if (version == null || version.length() == 0) {
-                        return new int[0];
-                }
-                String[] stringArray = version.split("\\.");
-                int[] resultArray = new int[stringArray.length];
-                for (int i = 0; i < stringArray.length; i++) {
-                        resultArray[i] = Integer.parseInt(stringArray[i]);
-                }
-                return resultArray;
-        }
-        
-        /**
-         * Given an array representing a version, create the corresponding dot-separated string.
-         * 
-         * @param array
-         * @return
-         */
-        public static String versionArrayToString(int[] array) {
-                if (array == null || array.length == 0) {
-                        return "";
-                }
-                String versionString = "";
-                if (array.length > 0) {
-                        versionString = "" + array[0];
-                        for (int i = 1; i < array.length; i++) {
-                                versionString += "." + array[i];
-                        }
-                }
-                return versionString;
-        }
-        
+    //
+    // Methods needed for JSON Deserialization
+    //
+    public StdPDPPolicy() {}
 
-        
-        //
-        // Methods needed for JSON Deserialization
-        //
-        public StdPDPPolicy() {}
-        
-        public void setPolicyId(String policyId) {
-                this.policyId = policyId;
-        }
-        public void setDescription(String description) {
-                this.description = description;
-        }
-        public void setVersion(String version) {
-                this.version = versionStringToArray(version);
-        }
-        public void setRoot(boolean isRoot) {
-                this.isRoot = isRoot;
-        }
-        public void setValid(boolean isValid) {
-                this.isValid = isValid;
-        }
-        public void setLocation(URI location) {
-                this.location = location;
-        }
-        
+    public void setPolicyId(String policyId) {
+        this.policyId = policyId;
+    }
+    public void setDescription(String description) {
+        this.description = description;
+    }
+    public void setVersion(String version) {
+        this.version = versionStringToArray(version);
+    }
+    public void setRoot(boolean isRoot) {
+        this.isRoot = isRoot;
+    }
+    public void setValid(boolean isValid) {
+        this.isValid = isValid;
+    }
+    public void setLocation(URI location) {
+        this.location = location;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPStatus.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPStatus.java
index 35c9623..53866ae 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPStatus.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/StdPDPStatus.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,236 +41,236 @@
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
 public class StdPDPStatus implements Serializable, PDPStatus {
-        private static final long serialVersionUID = 1L;
-        
-        private Status status = Status.UNKNOWN;
+    private static final long serialVersionUID = 1L;
 
-        private Set<String>	loadErrors = new HashSet<String>();
-        
-        private Set<String> loadWarnings = new HashSet<String>();
-        
-        private Set<PDPPolicy> loadedPolicies = new HashSet<PDPPolicy>();
-        
-        private Set<PDPPolicy> loadedRootPolicies = new HashSet<PDPPolicy>();
-        
-        private Set<PDPPolicy> failedPolicies = new HashSet<PDPPolicy>();
-        
-        private Set<PDPPIPConfig>	loadedPIPConfigs = new HashSet<PDPPIPConfig>();
-        
-        private Set<PDPPIPConfig>	failedPIPConfigs = new HashSet<PDPPIPConfig>();
-        
-        public StdPDPStatus() {
-        }
+    private Status status = Status.UNKNOWN;
 
-        public void set(StdPDPStatus newStatus) {
-                this.status				=	newStatus.status;
-                this.loadErrors.clear();
-                this.loadErrors.addAll(newStatus.getLoadErrors());
-                this.loadWarnings.clear();
-                this.loadWarnings.addAll(newStatus.getLoadWarnings());
-                this.loadedPolicies.clear();
-                this.loadedPolicies.addAll(newStatus.getLoadedPolicies());
-                this.loadedRootPolicies.clear();
-                this.loadedRootPolicies.addAll(newStatus.getLoadedRootPolicies());
-                this.failedPolicies.clear();
-                this.failedPolicies.addAll(newStatus.getFailedPolicies());
-                this.loadedPIPConfigs.clear();
-                this.loadedPIPConfigs.addAll(newStatus.getLoadedPipConfigs());
-                this.failedPIPConfigs.clear();
-                this.failedPIPConfigs.addAll(newStatus.getFailedPipConfigs());
-        }
-        
-        
+    private Set<String>	loadErrors = new HashSet<String>();
 
-        @Override
-        public Status getStatus() {
-                return this.status;
-        }
-        
-        public void setStatus(Status status) {
-                this.status = status;
-        }
-        
-        @Override
-        public Set<String> getLoadErrors() {
-                return Collections.unmodifiableSet(this.loadErrors);
-        }
+    private Set<String> loadWarnings = new HashSet<String>();
 
-        public void setLoadErrors(Set<String> errors) {
-                this.loadErrors = errors;
-        }
-        
-        public void addLoadError(String error) {
-                this.loadErrors.add(error);
-        }
+    private Set<PDPPolicy> loadedPolicies = new HashSet<PDPPolicy>();
 
-        @Override
-        public Set<String> getLoadWarnings() {
-                return Collections.unmodifiableSet(this.loadWarnings);
-        }
+    private Set<PDPPolicy> loadedRootPolicies = new HashSet<PDPPolicy>();
 
-        public void setLoadWarnings(Set<String> warnings) {
-                this.loadWarnings = warnings;
-        }
-        
-        public void addLoadWarning(String warning) {
-                this.loadWarnings.add(warning);
-        }
+    private Set<PDPPolicy> failedPolicies = new HashSet<PDPPolicy>();
 
-        @Override
-        public Set<PDPPolicy> getLoadedPolicies() {
-                return Collections.unmodifiableSet(this.loadedPolicies);
-        }
-        
-        public void setLoadedPolicies(Set<PDPPolicy> policies) {
-                this.loadedPolicies = policies;
-        }
-        
-        public void addLoadedPolicy(PDPPolicy policy) {
-                this.loadedPolicies.add(policy);
-        }
-        
-        @Override
-        public Set<PDPPolicy> getLoadedRootPolicies() {
-                return Collections.unmodifiableSet(this.loadedRootPolicies);
-        }
-        
-        public void setLoadedRootPolicies(Set<PDPPolicy> policies) {
-                this.loadedRootPolicies = policies;
-        }
-        
-        public void addRootPolicy(PDPPolicy policy) {
-                this.loadedRootPolicies.add(policy);
-        }
-        
-        public void addAllLoadedRootPolicies(Set<PDPPolicy> policies) {
-                this.loadedRootPolicies.addAll(policies);
-        }
-        
-        @Override
-        public Set<PDPPolicy> getFailedPolicies() {
-                return Collections.unmodifiableSet(this.failedPolicies);
-        }
-        
-        public void	setFailedPolicies(Set<PDPPolicy> policies) {
-                this.failedPolicies = policies;
-        }
-        
-        public void addFailedPolicy(PDPPolicy policy) {
-                this.failedPolicies.add(policy);
-        }
+    private Set<PDPPIPConfig>	loadedPIPConfigs = new HashSet<PDPPIPConfig>();
 
-        @Override
-        public boolean policiesOK() {
-                if (this.failedPolicies.size() > 0) {
-                        return false;
-                }
-                return true;
-        }
+    private Set<PDPPIPConfig>	failedPIPConfigs = new HashSet<PDPPIPConfig>();
 
-        @Override
-        public Set<PDPPIPConfig> getLoadedPipConfigs() {
-                return Collections.unmodifiableSet(this.loadedPIPConfigs);
-        }
-        
-        public void setLoadedPipConfigs(Set<PDPPIPConfig> configs) {
-                this.loadedPIPConfigs = configs;
-        }
-        
-        public void addLoadedPipConfig(PDPPIPConfig config) {
-                this.loadedPIPConfigs.add(config);
-        }
+    public StdPDPStatus() {
+    }
 
-        @Override
-        public Set<PDPPIPConfig> getFailedPipConfigs() {
-                return Collections.unmodifiableSet(this.failedPIPConfigs);
-        }
+    public void set(StdPDPStatus newStatus) {
+        this.status				=	newStatus.status;
+        this.loadErrors.clear();
+        this.loadErrors.addAll(newStatus.getLoadErrors());
+        this.loadWarnings.clear();
+        this.loadWarnings.addAll(newStatus.getLoadWarnings());
+        this.loadedPolicies.clear();
+        this.loadedPolicies.addAll(newStatus.getLoadedPolicies());
+        this.loadedRootPolicies.clear();
+        this.loadedRootPolicies.addAll(newStatus.getLoadedRootPolicies());
+        this.failedPolicies.clear();
+        this.failedPolicies.addAll(newStatus.getFailedPolicies());
+        this.loadedPIPConfigs.clear();
+        this.loadedPIPConfigs.addAll(newStatus.getLoadedPipConfigs());
+        this.failedPIPConfigs.clear();
+        this.failedPIPConfigs.addAll(newStatus.getFailedPipConfigs());
+    }
 
-        public void setFailedPipConfigs(Set<PDPPIPConfig> configs) {
-                this.failedPIPConfigs = configs;
-        }
-        
-        public void addFailedPipConfig(PDPPIPConfig config) {
-                this.failedPIPConfigs.add(config);
-        }
 
-        @Override
-        public boolean pipConfigOK() {
-                if (this.failedPIPConfigs.size() > 0) {
-                        return false;
-                }
-                return true;
-        }
 
-        @Override
-        @JsonIgnore
-        public boolean isOk() {
-                if (this.policiesOK() == false) {
-                        return false;
-                }
-                if (this.pipConfigOK() == false) {
-                        return false;
-                }
-                return (this.status == Status.UP_TO_DATE);
-        }
+    @Override
+    public Status getStatus() {
+        return this.status;
+    }
 
-        @Override
-        public int hashCode() {
-                final int prime = 31;
-                int result = 1;
-                result = prime
-                                * result
-                                + (failedPIPConfigs.hashCode());
-                result = prime * result
-                                + (failedPolicies.hashCode());
-                result = prime * result
-                                + (loadErrors.hashCode());
-                result = prime * result
-                                + (loadWarnings.hashCode());
-                result = prime
-                                * result
-                                + (loadedPIPConfigs.hashCode());
-                result = prime * result
-                                + (loadedPolicies.hashCode());
-                result = prime * result + (status.hashCode());
-                return result;
-        }
+    public void setStatus(Status status) {
+        this.status = status;
+    }
 
-        @Override
-        public boolean equals(Object obj) {
-                if (this == obj)
-                        return true;
-                if (obj == null)
-                        return false;
-                if (getClass() != obj.getClass())
-                        return false;
-                StdPDPStatus other = (StdPDPStatus) obj;
-                if (!failedPIPConfigs.equals(other.failedPIPConfigs))
-                        return false;
-                if (!failedPolicies.equals(other.failedPolicies))
-                        return false;
-                if (!loadErrors.equals(other.loadErrors))
-                        return false;
-                if (!loadWarnings.equals(other.loadWarnings))
-                        return false;
-                if (!loadedPIPConfigs.equals(other.loadedPIPConfigs))
-                        return false;
-                if (!loadedPolicies.equals(other.loadedPolicies))
-                        return false;
-                if (status != other.status)
-                        return false;
-                return true;
-        }
+    @Override
+    public Set<String> getLoadErrors() {
+        return Collections.unmodifiableSet(this.loadErrors);
+    }
 
-        @Override
-        public String toString() {
-                return "StdPDPStatus [status=" + status + ", loadErrors=" + loadErrors
-                                + ", loadWarnings=" + loadWarnings + ", loadedPolicies="
-                                + loadedPolicies + ", loadedRootPolicies=" + loadedRootPolicies 
-                                + ", failedPolicies=" + failedPolicies
-                                + ", loadedPIPConfigs=" + loadedPIPConfigs
-                                + ", failedPIPConfigs=" + failedPIPConfigs + "]";
+    public void setLoadErrors(Set<String> errors) {
+        this.loadErrors = errors;
+    }
+
+    public void addLoadError(String error) {
+        this.loadErrors.add(error);
+    }
+
+    @Override
+    public Set<String> getLoadWarnings() {
+        return Collections.unmodifiableSet(this.loadWarnings);
+    }
+
+    public void setLoadWarnings(Set<String> warnings) {
+        this.loadWarnings = warnings;
+    }
+
+    public void addLoadWarning(String warning) {
+        this.loadWarnings.add(warning);
+    }
+
+    @Override
+    public Set<PDPPolicy> getLoadedPolicies() {
+        return Collections.unmodifiableSet(this.loadedPolicies);
+    }
+
+    public void setLoadedPolicies(Set<PDPPolicy> policies) {
+        this.loadedPolicies = policies;
+    }
+
+    public void addLoadedPolicy(PDPPolicy policy) {
+        this.loadedPolicies.add(policy);
+    }
+
+    @Override
+    public Set<PDPPolicy> getLoadedRootPolicies() {
+        return Collections.unmodifiableSet(this.loadedRootPolicies);
+    }
+
+    public void setLoadedRootPolicies(Set<PDPPolicy> policies) {
+        this.loadedRootPolicies = policies;
+    }
+
+    public void addRootPolicy(PDPPolicy policy) {
+        this.loadedRootPolicies.add(policy);
+    }
+
+    public void addAllLoadedRootPolicies(Set<PDPPolicy> policies) {
+        this.loadedRootPolicies.addAll(policies);
+    }
+
+    @Override
+    public Set<PDPPolicy> getFailedPolicies() {
+        return Collections.unmodifiableSet(this.failedPolicies);
+    }
+
+    public void	setFailedPolicies(Set<PDPPolicy> policies) {
+        this.failedPolicies = policies;
+    }
+
+    public void addFailedPolicy(PDPPolicy policy) {
+        this.failedPolicies.add(policy);
+    }
+
+    @Override
+    public boolean policiesOK() {
+        if (this.failedPolicies.size() > 0) {
+            return false;
         }
+        return true;
+    }
+
+    @Override
+    public Set<PDPPIPConfig> getLoadedPipConfigs() {
+        return Collections.unmodifiableSet(this.loadedPIPConfigs);
+    }
+
+    public void setLoadedPipConfigs(Set<PDPPIPConfig> configs) {
+        this.loadedPIPConfigs = configs;
+    }
+
+    public void addLoadedPipConfig(PDPPIPConfig config) {
+        this.loadedPIPConfigs.add(config);
+    }
+
+    @Override
+    public Set<PDPPIPConfig> getFailedPipConfigs() {
+        return Collections.unmodifiableSet(this.failedPIPConfigs);
+    }
+
+    public void setFailedPipConfigs(Set<PDPPIPConfig> configs) {
+        this.failedPIPConfigs = configs;
+    }
+
+    public void addFailedPipConfig(PDPPIPConfig config) {
+        this.failedPIPConfigs.add(config);
+    }
+
+    @Override
+    public boolean pipConfigOK() {
+        if (this.failedPIPConfigs.size() > 0) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    @JsonIgnore
+    public boolean isOk() {
+        if (this.policiesOK() == false) {
+            return false;
+        }
+        if (this.pipConfigOK() == false) {
+            return false;
+        }
+        return (this.status == Status.UP_TO_DATE);
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime
+                 * result
+                 + (failedPIPConfigs.hashCode());
+        result = prime * result
+                 + (failedPolicies.hashCode());
+        result = prime * result
+                 + (loadErrors.hashCode());
+        result = prime * result
+                 + (loadWarnings.hashCode());
+        result = prime
+                 * result
+                 + (loadedPIPConfigs.hashCode());
+        result = prime * result
+                 + (loadedPolicies.hashCode());
+        result = prime * result + (status.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        StdPDPStatus other = (StdPDPStatus) obj;
+        if (!failedPIPConfigs.equals(other.failedPIPConfigs))
+            return false;
+        if (!failedPolicies.equals(other.failedPolicies))
+            return false;
+        if (!loadErrors.equals(other.loadErrors))
+            return false;
+        if (!loadWarnings.equals(other.loadWarnings))
+            return false;
+        if (!loadedPIPConfigs.equals(other.loadedPIPConfigs))
+            return false;
+        if (!loadedPolicies.equals(other.loadedPolicies))
+            return false;
+        if (status != other.status)
+            return false;
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "StdPDPStatus [status=" + status + ", loadErrors=" + loadErrors
+               + ", loadWarnings=" + loadWarnings + ", loadedPolicies="
+               + loadedPolicies + ", loadedRootPolicies=" + loadedRootPolicies
+               + ", failedPolicies=" + failedPolicies
+               + ", loadedPIPConfigs=" + loadedPIPConfigs
+               + ", failedPIPConfigs=" + failedPIPConfigs + "]";
+    }
 
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/package-info.java
index c8004a9..d95ec34 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pap/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -30,7 +30,7 @@
  */
 /**
  * contains the standard implementation of the PAP interface
- * 
+ *
  * @author pameladragosh
  *
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/StdEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/StdEngine.java
index 15b68dd..99db767 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/StdEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/StdEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,53 +48,53 @@
  * StdEngine implements the {@link com.att.research.xacml.api.pep.PEPEngine} interface by creating
  * an instance of the {@link com.att.research.xacml.api.pdp.PDPEngine} interface using the {@link com.att.research.xacml.api.pdp.PDPEngineFactory} and
  * passing requests through to that engine, forwarding the {@link com.att.research.xacml.api.Response} object back to the caller.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class StdEngine implements PEPEngine {
-        private Log	logger	= LogFactory.getLog(this.getClass());
-        
-        protected Properties properties = null;
-        
-        public StdEngine() {
-        }
+    private Log	logger	= LogFactory.getLog(this.getClass());
 
-        public StdEngine(Properties properties) {
-                this.properties = properties;
-        }
+    protected Properties properties = null;
 
-        @Override
-        public Response decide(Request pepRequest) throws PEPException {
-                /*
-                 * Get the PDP engine factory
-                 */
-                PDPEngineFactory pdpEngineFactory	= null;
-                try {
-                        pdpEngineFactory	= PDPEngineFactory.newInstance();
-                } catch (FactoryException ex) {
-                        this.logger.error("FactoryException creating the PDPEngineFactory", ex);
-                        throw new PEPException("FactoryException creating the PDPEngineFactory", ex);
-                }
-                assert(pdpEngineFactory != null);
-                
-                PDPEngine pdpEngine	= null;
-                try {
-                        pdpEngine	= pdpEngineFactory.newEngine();
-                } catch (FactoryException ex) {
-                        this.logger.error("PDPException creating the PDPEngine", ex);
-                        throw new PEPException("PDPException creating the PDPEngine", ex);
-                }
-                assert(pdpEngine != null);
-                
-                Response response	= null;
-                try {
-                        response	= pdpEngine.decide(pepRequest);
-                } catch (PDPException ex) {
-                        this.logger.error("PDPException deciding on Request", ex);
-                        throw new PEPException("PDPException deciding on Request", ex);
-                }
-                return response;
+    public StdEngine() {
+    }
+
+    public StdEngine(Properties properties) {
+        this.properties = properties;
+    }
+
+    @Override
+    public Response decide(Request pepRequest) throws PEPException {
+        /*
+         * Get the PDP engine factory
+         */
+        PDPEngineFactory pdpEngineFactory	= null;
+        try {
+            pdpEngineFactory	= PDPEngineFactory.newInstance();
+        } catch (FactoryException ex) {
+            this.logger.error("FactoryException creating the PDPEngineFactory", ex);
+            throw new PEPException("FactoryException creating the PDPEngineFactory", ex);
         }
+        assert(pdpEngineFactory != null);
+
+        PDPEngine pdpEngine	= null;
+        try {
+            pdpEngine	= pdpEngineFactory.newEngine();
+        } catch (FactoryException ex) {
+            this.logger.error("PDPException creating the PDPEngine", ex);
+            throw new PEPException("PDPException creating the PDPEngine", ex);
+        }
+        assert(pdpEngine != null);
+
+        Response response	= null;
+        try {
+            response	= pdpEngine.decide(pepRequest);
+        } catch (PDPException ex) {
+            this.logger.error("PDPException deciding on Request", ex);
+            throw new PEPException("PDPException deciding on Request", ex);
+        }
+        return response;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/StdEngineFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/StdEngineFactory.java
index cb8de86..f037282 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/StdEngineFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/StdEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,17 +38,17 @@
 
 public class StdEngineFactory extends PEPEngineFactory {
 
-        public StdEngineFactory() {
-        }
+    public StdEngineFactory() {
+    }
 
-        @Override
-        public PEPEngine newEngine() throws PEPException {
-                return new StdEngine();
-        }
+    @Override
+    public PEPEngine newEngine() throws PEPException {
+        return new StdEngine();
+    }
 
-        @Override
-        public PEPEngine newEngine(Properties properties) throws PEPException {
-                return new StdEngine(properties);
-        }
+    @Override
+    public PEPEngine newEngine(Properties properties) throws PEPException {
+        return new StdEngine(properties);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/package-info.java
index c4ab120..30815ae 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pep/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 
 /**
  * com.att.research.xacml.std.pep contains the standard implementation of the PEP interface
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdMutablePIPResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdMutablePIPResponse.java
index f0fc0d8..141643e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdMutablePIPResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdMutablePIPResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -43,135 +43,135 @@
 /**
  * Mutable implementation of the {@link com.att.research.xacml.api.pip.PIPResponse} interface with methods for
  * keeping a collection of {@link com.att.research.xacml.api.Attribute}s with a {@link com.att.research.xacml.api.Status}.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.2 $
  */
 public class StdMutablePIPResponse implements PIPResponse {
-        private static final List<Attribute> EMPTY_LIST			= Collections.unmodifiableList(new ArrayList<Attribute>());
-        
-        private List<Attribute> attributes	= EMPTY_LIST;
-        private Status status;
-        private boolean simple;
-        
-        /**
-         * Creates a new <code>StdMutablePIPResponse</code> with the given {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param statusIn the <code>Status</code> of the new <code>StdMutablePIPResponse</code>
-         */
-        public StdMutablePIPResponse(Status statusIn) {
-                this.status	= statusIn;
-                this.simple	= true;
-        }
-        
-        /**
-         * Creates a new <code>StdMutablePIPResponse</code> with an OK {@link com.att.research.xacml.api.Status} and the single
-         * given {@link com.att.research.xacml.api.Attribute}.
-         * 
-         * @param attribute the <code>Attribute</code> for the new <code>StdMutablePIPResponse</code>>
-         */
-        public StdMutablePIPResponse(Attribute attribute) {
-                this(StdStatus.STATUS_OK);
-                if (attribute != null) {
-                        this.addAttribute(attribute);
-                }
-        }
-        
-        /**
-         * Creates a new <code>StdMutablePIPResponse</code> with an OK {@link com.att.research.xacml.api.Status} and a copy of
-         * the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s.
-         * 
-         * @param attributesIn the <code>Collection</code> of <code>Attribute</code>s for the new <code>StdMutablePIPResponse</code>.
-         */
-        public StdMutablePIPResponse(Collection<Attribute> attributesIn) {
-                this(StdStatus.STATUS_OK);
-                if (attributesIn != null) {
-                        this.addAttributes(attributesIn);
-                }
-        }
-        
-        /**
-         * Creates a new <code>StdMutablePIPResponse</code> with an OK {@link com.att.research.xacml.api.Status}.
-         */
-        public StdMutablePIPResponse() {
-                this(StdStatus.STATUS_OK);
-        }
-        
+    private static final List<Attribute> EMPTY_LIST			= Collections.unmodifiableList(new ArrayList<Attribute>());
 
-        @Override
-        public Status getStatus() {
-                return this.status;
-        }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Status} for this <code>StdMutablePIPResponse</code>>
-         * 
-         * @param statusIn the <code>Status</code> for this <code>StdMutablePIPResponse</code>.
-         */
-        public void setStatus(Status statusIn) {
-                this.status	= statusIn;
-        }
-        
-        @Override
-        public boolean isSimple() {
-                return this.simple;
-        }
+    private List<Attribute> attributes	= EMPTY_LIST;
+    private Status status;
+    private boolean simple;
 
-        @Override
-        public Collection<Attribute> getAttributes() {
-                return (this.attributes == EMPTY_LIST ? this.attributes : Collections.unmodifiableCollection(this.attributes));
+    /**
+     * Creates a new <code>StdMutablePIPResponse</code> with the given {@link com.att.research.xacml.api.Status}.
+     *
+     * @param statusIn the <code>Status</code> of the new <code>StdMutablePIPResponse</code>
+     */
+    public StdMutablePIPResponse(Status statusIn) {
+        this.status	= statusIn;
+        this.simple	= true;
+    }
+
+    /**
+     * Creates a new <code>StdMutablePIPResponse</code> with an OK {@link com.att.research.xacml.api.Status} and the single
+     * given {@link com.att.research.xacml.api.Attribute}.
+     *
+     * @param attribute the <code>Attribute</code> for the new <code>StdMutablePIPResponse</code>>
+     */
+    public StdMutablePIPResponse(Attribute attribute) {
+        this(StdStatus.STATUS_OK);
+        if (attribute != null) {
+            this.addAttribute(attribute);
         }
-        
-        /**
-         * Adds a single {@link com.att.research.xacml.api.Attribute} to this <code>StdMutablePIPResponse</code>.
-         * 
-         * @param attributeIn the <code>Attribute</code> to add to this <code>StdMutablePIPResponse</code>.
+    }
+
+    /**
+     * Creates a new <code>StdMutablePIPResponse</code> with an OK {@link com.att.research.xacml.api.Status} and a copy of
+     * the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s.
+     *
+     * @param attributesIn the <code>Collection</code> of <code>Attribute</code>s for the new <code>StdMutablePIPResponse</code>.
+     */
+    public StdMutablePIPResponse(Collection<Attribute> attributesIn) {
+        this(StdStatus.STATUS_OK);
+        if (attributesIn != null) {
+            this.addAttributes(attributesIn);
+        }
+    }
+
+    /**
+     * Creates a new <code>StdMutablePIPResponse</code> with an OK {@link com.att.research.xacml.api.Status}.
+     */
+    public StdMutablePIPResponse() {
+        this(StdStatus.STATUS_OK);
+    }
+
+
+    @Override
+    public Status getStatus() {
+        return this.status;
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Status} for this <code>StdMutablePIPResponse</code>>
+     *
+     * @param statusIn the <code>Status</code> for this <code>StdMutablePIPResponse</code>.
+     */
+    public void setStatus(Status statusIn) {
+        this.status	= statusIn;
+    }
+
+    @Override
+    public boolean isSimple() {
+        return this.simple;
+    }
+
+    @Override
+    public Collection<Attribute> getAttributes() {
+        return (this.attributes == EMPTY_LIST ? this.attributes : Collections.unmodifiableCollection(this.attributes));
+    }
+
+    /**
+     * Adds a single {@link com.att.research.xacml.api.Attribute} to this <code>StdMutablePIPResponse</code>.
+     *
+     * @param attributeIn the <code>Attribute</code> to add to this <code>StdMutablePIPResponse</code>.
+     */
+    public void addAttribute(Attribute attributeIn) {
+        if (this.attributes == EMPTY_LIST) {
+            this.attributes	= new ArrayList<Attribute>();
+        }
+        /*
+         * Determine if the simple status should be changed or not
          */
-        public void addAttribute(Attribute attributeIn) {
-                if (this.attributes == EMPTY_LIST) {
-                        this.attributes	= new ArrayList<Attribute>();
-                }
-                /*
-                 * Determine if the simple status should be changed or not
-                 */
-                if (this.simple) {
-                        if (this.attributes.size() > 0) {
-                                this.simple	= false;
-                        }
-                }
-                this.attributes.add(attributeIn);
+        if (this.simple) {
+            if (this.attributes.size() > 0) {
+                this.simple	= false;
+            }
         }
-        
-        /**
-         * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s to this
-         * <code>StdMutablePIPResponse</code>.
-         * 
-         * @param attributesIn the <code>Collection</code> of <code>Attribute</code>s to add to this <code>StdMutablePIPResponse</code>.
-         */
-        public void addAttributes(Collection<Attribute> attributesIn) {
-                if (attributesIn != null && attributesIn.size() > 0) {
-                        if (this.attributes == EMPTY_LIST) {
-                                this.attributes	= new ArrayList<Attribute>();
-                        }
-                        if (this.simple) {
-                                if (this.attributes.size() > 0 || attributesIn.size() > 1) {
-                                        this.simple	= false;
-                                }
-                        }
-                        this.attributes.addAll(attributesIn);
+        this.attributes.add(attributeIn);
+    }
+
+    /**
+     * Adds a copy of the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s to this
+     * <code>StdMutablePIPResponse</code>.
+     *
+     * @param attributesIn the <code>Collection</code> of <code>Attribute</code>s to add to this <code>StdMutablePIPResponse</code>.
+     */
+    public void addAttributes(Collection<Attribute> attributesIn) {
+        if (attributesIn != null && attributesIn.size() > 0) {
+            if (this.attributes == EMPTY_LIST) {
+                this.attributes	= new ArrayList<Attribute>();
+            }
+            if (this.simple) {
+                if (this.attributes.size() > 0 || attributesIn.size() > 1) {
+                    this.simple	= false;
                 }
+            }
+            this.attributes.addAll(attributesIn);
         }
-        
-        /**
-         * Sets the {@link com.att.research.xacml.api.Attribute}s in this <code>StdMutablePIPResponse</code> to a copy of the
-         * given <code>Collection</code>.
-         * 
-         * @param attributesIn the <code>Collection</code> of <code>Attribute</code>s to set in this <code>StdMutablePIPResponse</code>.
-         */
-        public void setAttributes(Collection<Attribute> attributesIn) {
-                this.attributes	= EMPTY_LIST;
-                this.simple		= true;
-                this.addAttributes(attributesIn);
-        }
+    }
+
+    /**
+     * Sets the {@link com.att.research.xacml.api.Attribute}s in this <code>StdMutablePIPResponse</code> to a copy of the
+     * given <code>Collection</code>.
+     *
+     * @param attributesIn the <code>Collection</code> of <code>Attribute</code>s to set in this <code>StdMutablePIPResponse</code>.
+     */
+    public void setAttributes(Collection<Attribute> attributesIn) {
+        this.attributes	= EMPTY_LIST;
+        this.simple		= true;
+        this.addAttributes(attributesIn);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPFinderFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPFinderFactory.java
index d529d45..d32a557 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPFinderFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPFinderFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,48 +42,48 @@
 import com.att.research.xacml.util.XACMLProperties;
 
 public class StdPIPFinderFactory extends PIPFinderFactory {
-        private PIPFinder pipFinder;
-        
-        private Log logger	= LogFactory.getLog(this.getClass());
-        
-        public StdPIPFinderFactory() {
-        }
+    private PIPFinder pipFinder;
 
-        public StdPIPFinderFactory(Properties properties) {
-        }
+    private Log logger	= LogFactory.getLog(this.getClass());
 
-        @Override
-        public PIPFinder getFinder() throws PIPException {
+    public StdPIPFinderFactory() {
+    }
+
+    public StdPIPFinderFactory(Properties properties) {
+    }
+
+    @Override
+    public PIPFinder getFinder() throws PIPException {
+        if (pipFinder == null) {
+            synchronized(this) {
                 if (pipFinder == null) {
-                        synchronized(this) {
-                                if (pipFinder == null) {
-                                        pipFinder					= new ConfigurableEngineFinder();
-                                        Properties xacmlProperties	= null;
-                                        try {
-                                                xacmlProperties	= XACMLProperties.getProperties();
-                                        } catch (Exception ex) {
-                                                this.logger.error("Exception getting XACML properties: " + ex.getMessage(), ex);
-                                                return null;
-                                        }
-                                        if (xacmlProperties != null) {
-                                                ((ConfigurableEngineFinder)pipFinder).configure(xacmlProperties);
-                                        }
-                                }
-                        }
+                    pipFinder					= new ConfigurableEngineFinder();
+                    Properties xacmlProperties	= null;
+                    try {
+                        xacmlProperties	= XACMLProperties.getProperties();
+                    } catch (Exception ex) {
+                        this.logger.error("Exception getting XACML properties: " + ex.getMessage(), ex);
+                        return null;
+                    }
+                    if (xacmlProperties != null) {
+                        ((ConfigurableEngineFinder)pipFinder).configure(xacmlProperties);
+                    }
                 }
-                return pipFinder;
+            }
         }
+        return pipFinder;
+    }
 
-        @Override
-        public PIPFinder getFinder(Properties properties) throws PIPException {
+    @Override
+    public PIPFinder getFinder(Properties properties) throws PIPException {
+        if (pipFinder == null) {
+            synchronized(this) {
                 if (pipFinder == null) {
-                        synchronized(this) {
-                                if (pipFinder == null) {
-                                        pipFinder					= new ConfigurableEngineFinder();
-                                        ((ConfigurableEngineFinder)pipFinder).configure(properties);
-                                }
-                        }
+                    pipFinder					= new ConfigurableEngineFinder();
+                    ((ConfigurableEngineFinder)pipFinder).configure(properties);
                 }
-                return this.pipFinder;
+            }
         }
+        return this.pipFinder;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPRequest.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPRequest.java
index b54b31a..2ed2264 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPRequest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPRequest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -39,136 +39,136 @@
 import com.att.research.xacml.util.ObjUtil;
 
 public class StdPIPRequest implements PIPRequest {
-        private Identifier category;
-        private Identifier attributeId;
-        private Identifier dataTypeId;
-        private String issuer;
-        
-        private static Identifier getDataType(Attribute attribute) {
-                Collection<AttributeValue<?>> values	= attribute.getValues();
-                if (values != null && values.size() > 0) {
-                        return values.iterator().next().getDataTypeId();
-                } else {
-                        return null;
-                }
-        }
-        
-        public StdPIPRequest(Identifier identifierCategory, Identifier identifierAttribute, Identifier identifierDataType) {
-                this.category		= identifierCategory;
-                this.attributeId	= identifierAttribute;
-                this.dataTypeId		= identifierDataType;		
-        }
-        
-        public StdPIPRequest(Identifier identifierCategory, Identifier identifierAttribute, Identifier identifierDataType, String issuerIn) {
-                this(identifierCategory, identifierAttribute, identifierDataType);
-                this.issuer			= issuerIn;
-        }
-        
-        public StdPIPRequest(Attribute attribute, Identifier identifierDataType) {
-                this(attribute.getCategory(), attribute.getAttributeId(), identifierDataType, attribute.getIssuer());
-        }
-        
-        public StdPIPRequest(Attribute attribute) {
-                this(attribute, getDataType(attribute));
-        }
-        
-        public StdPIPRequest(PIPRequest req) {
-                this(req.getCategory(), req.getAttributeId(), req.getDataTypeId(), req.getIssuer());
-        }
+    private Identifier category;
+    private Identifier attributeId;
+    private Identifier dataTypeId;
+    private String issuer;
 
-        @Override
-        public Identifier getCategory() {
-                return this.category;
+    private static Identifier getDataType(Attribute attribute) {
+        Collection<AttributeValue<?>> values	= attribute.getValues();
+        if (values != null && values.size() > 0) {
+            return values.iterator().next().getDataTypeId();
+        } else {
+            return null;
         }
-        
-        @Override
-        public Identifier getAttributeId() {
-                return this.attributeId;
+    }
+
+    public StdPIPRequest(Identifier identifierCategory, Identifier identifierAttribute, Identifier identifierDataType) {
+        this.category		= identifierCategory;
+        this.attributeId	= identifierAttribute;
+        this.dataTypeId		= identifierDataType;
+    }
+
+    public StdPIPRequest(Identifier identifierCategory, Identifier identifierAttribute, Identifier identifierDataType, String issuerIn) {
+        this(identifierCategory, identifierAttribute, identifierDataType);
+        this.issuer			= issuerIn;
+    }
+
+    public StdPIPRequest(Attribute attribute, Identifier identifierDataType) {
+        this(attribute.getCategory(), attribute.getAttributeId(), identifierDataType, attribute.getIssuer());
+    }
+
+    public StdPIPRequest(Attribute attribute) {
+        this(attribute, getDataType(attribute));
+    }
+
+    public StdPIPRequest(PIPRequest req) {
+        this(req.getCategory(), req.getAttributeId(), req.getDataTypeId(), req.getIssuer());
+    }
+
+    @Override
+    public Identifier getCategory() {
+        return this.category;
+    }
+
+    @Override
+    public Identifier getAttributeId() {
+        return this.attributeId;
+    }
+
+    @Override
+    public Identifier getDataTypeId() {
+        return this.dataTypeId;
+    }
+
+    @Override
+    public String getIssuer() {
+        return this.issuer;
+    }
+
+    @Override
+    public int hashCode() {
+        Identifier identifier;
+        int hc		= 1;
+        if ((identifier = this.getCategory()) != null) {
+            hc	+= identifier.hashCode();
         }
-        
-        @Override
-        public Identifier getDataTypeId() {
-                return this.dataTypeId;
+        if ((identifier = this.getAttributeId()) != null) {
+            hc	+= identifier.hashCode();
         }
-        
-        @Override
-        public String getIssuer() {
-                return this.issuer;
+        if ((identifier = this.getDataTypeId()) != null) {
+            hc	+= identifier.hashCode();
         }
-        
-        @Override
-        public int hashCode() {
-                Identifier identifier;
-                int hc		= 1;
-                if ((identifier = this.getCategory()) != null) {
-                        hc	+= identifier.hashCode();
-                }
-                if ((identifier = this.getAttributeId()) != null) {
-                        hc	+= identifier.hashCode();
-                }
-                if ((identifier = this.getDataTypeId()) != null) {
-                        hc	+= identifier.hashCode();
-                }
-                String thisIssuer	= this.getIssuer();
-                if (thisIssuer != null) {
-                        hc	+= thisIssuer.hashCode();
-                }
-                return hc;
+        String thisIssuer	= this.getIssuer();
+        if (thisIssuer != null) {
+            hc	+= thisIssuer.hashCode();
         }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null || !(obj instanceof PIPRequest)) {
-                        return false;
-                } else {
-                        PIPRequest pipRequest	= (PIPRequest)obj;
-                        return ObjUtil.equalsAllowNull(this.getCategory(), pipRequest.getCategory()) &&
-                                   ObjUtil.equalsAllowNull(this.getAttributeId(), pipRequest.getAttributeId()) &&
-                                   ObjUtil.equalsAllowNull(this.getDataTypeId(), pipRequest.getDataTypeId()) &&
-                                   ObjUtil.equalsAllowNull(this.getIssuer(), pipRequest.getIssuer());
-                }
+        return hc;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null || !(obj instanceof PIPRequest)) {
+            return false;
+        } else {
+            PIPRequest pipRequest	= (PIPRequest)obj;
+            return ObjUtil.equalsAllowNull(this.getCategory(), pipRequest.getCategory()) &&
+                   ObjUtil.equalsAllowNull(this.getAttributeId(), pipRequest.getAttributeId()) &&
+                   ObjUtil.equalsAllowNull(this.getDataTypeId(), pipRequest.getDataTypeId()) &&
+                   ObjUtil.equalsAllowNull(this.getIssuer(), pipRequest.getIssuer());
         }
-        
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                boolean needsComma	= false;
-                Object objectToDump;
-                
-                if ((objectToDump = this.getCategory()) != null) {
-                        stringBuilder.append("category=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getAttributeId()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("attributeId=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getDataTypeId()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("dataTypeId=");
-                        stringBuilder.append(objectToDump.toString());
-                        needsComma	= true;
-                }
-                if ((objectToDump = this.getIssuer()) != null) {
-                        if (needsComma) {
-                                stringBuilder.append(',');
-                        }
-                        stringBuilder.append("issuer=");
-                        stringBuilder.append((String)objectToDump);
-                        needsComma	= true;
-                }
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        boolean needsComma	= false;
+        Object objectToDump;
+
+        if ((objectToDump = this.getCategory()) != null) {
+            stringBuilder.append("category=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
         }
+        if ((objectToDump = this.getAttributeId()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("attributeId=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        if ((objectToDump = this.getDataTypeId()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("dataTypeId=");
+            stringBuilder.append(objectToDump.toString());
+            needsComma	= true;
+        }
+        if ((objectToDump = this.getIssuer()) != null) {
+            if (needsComma) {
+                stringBuilder.append(',');
+            }
+            stringBuilder.append("issuer=");
+            stringBuilder.append((String)objectToDump);
+            needsComma	= true;
+        }
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPResponse.java
index c40fe9d..55b5d57 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdPIPResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -50,311 +50,311 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.pip.PIPResponse} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class StdPIPResponse extends Wrapper<PIPResponse> implements PIPResponse {
-        public static final PIPResponse	PIP_RESPONSE_EMPTY	= new StdPIPResponse(StdStatus.STATUS_OK);
-        
-        /**
-         * Creates a new immutable <code>StdPIPResponse</code> that wraps the given {@link com.att.research.xacml.api.pip.PIPResponse}.
-         * 
-         * @param wrappedObjectIn the <code>PIPResponse</code> to wrap.
-         */
-        public StdPIPResponse(PIPResponse wrappedObjectIn) {
-                super(wrappedObjectIn);
+    public static final PIPResponse	PIP_RESPONSE_EMPTY	= new StdPIPResponse(StdStatus.STATUS_OK);
+
+    /**
+     * Creates a new immutable <code>StdPIPResponse</code> that wraps the given {@link com.att.research.xacml.api.pip.PIPResponse}.
+     *
+     * @param wrappedObjectIn the <code>PIPResponse</code> to wrap.
+     */
+    public StdPIPResponse(PIPResponse wrappedObjectIn) {
+        super(wrappedObjectIn);
+    }
+
+    /**
+     * Creates a new <code>StdPIPResponse</code> with the given {@link com.att.research.xacml.api.Status}.
+     *
+     * @param status the <code>Status</code> for the new <code>StdPIPResponse</code>
+     */
+    public StdPIPResponse(Status status) {
+        this(new StdMutablePIPResponse(status));
+    }
+
+    /**
+     * Creates a new <code>StdPIPResponse</code> with an OK {@link com.att.research.xacml.api.Status} and a
+     * single {@link com.att.research.xacml.api.Attribute}.
+     *
+     * @param attribute the <code>Attribute</code> for the new <code>StdPIPResponse</code>.
+     */
+    public StdPIPResponse(Attribute attribute) {
+        this(new StdMutablePIPResponse(attribute));
+    }
+
+    /**
+     * Creates a new <code>StdPIPResponse</code> with an OK {@link com.att.research.xacml.api.Status} and a copy
+     * of the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s.
+     *
+     * @param attributes the <code>Attribute</code>s for the new <code>StdPIPResponse</code>.
+     */
+    public StdPIPResponse(Collection<Attribute> attributes) {
+        this(new StdMutablePIPResponse(attributes));
+    }
+
+    @Override
+    public Status getStatus() {
+        return this.getWrappedObject().getStatus();
+    }
+
+    @Override
+    public Collection<Attribute> getAttributes() {
+        return this.getWrappedObject().getAttributes();
+    }
+
+    /**
+     * Determines if the given {@link com.att.research.xacml.api.pip.PIPRequest} matches the given {@link com.att.research.xacml.api.Attribute} by
+     * comparing the category, attribute id, and if not null in the <code>PIPRequest</code>, the issuer.
+     *
+     * @param pipRequest the <code>PIPRequest</code> to compare against
+     * @param attribute the <code>Attribute</code> to compare to
+     * @return true if the <code>Attribute</code> matches the <code>PIPRequest</code> else false
+     */
+    public static boolean matches(PIPRequest pipRequest, Attribute attribute) {
+        if (!pipRequest.getCategory().equals(attribute.getCategory())) {
+            return false;
         }
-        
-        /**
-         * Creates a new <code>StdPIPResponse</code> with the given {@link com.att.research.xacml.api.Status}.
-         * 
-         * @param status the <code>Status</code> for the new <code>StdPIPResponse</code>
-         */
-        public StdPIPResponse(Status status) {
-                this(new StdMutablePIPResponse(status));
+        if (!pipRequest.getAttributeId().equals(attribute.getAttributeId())) {
+            return false;
         }
-        
-        /**
-         * Creates a new <code>StdPIPResponse</code> with an OK {@link com.att.research.xacml.api.Status} and a 
-         * single {@link com.att.research.xacml.api.Attribute}.
-         * 
-         * @param attribute the <code>Attribute</code> for the new <code>StdPIPResponse</code>.
-         */
-        public StdPIPResponse(Attribute attribute) {
-                this(new StdMutablePIPResponse(attribute));
+        if (pipRequest.getIssuer() != null && !pipRequest.getIssuer().equals(attribute.getIssuer())) {
+            return false;
         }
-        
-        /**
-         * Creates a new <code>StdPIPResponse</code> with an OK {@link com.att.research.xacml.api.Status} and a copy
-         * of the given <code>Collection</code> of {@link com.att.research.xacml.api.Attribute}s.
-         * 
-         * @param attributes the <code>Attribute</code>s for the new <code>StdPIPResponse</code>.
-         */
-        public StdPIPResponse(Collection<Attribute> attributes) {
-                this(new StdMutablePIPResponse(attributes));
+        return true;
+    }
+
+    /**
+     * Gets the subset of the {@link com.att.research.xacml.api.AttributeValue}s from the given <code>Collection</code> whose data type
+     * matches the data type in the given {@link com.att.research.xacml.api.pip.PIPRequest}.
+     *
+     * @param pipRequest the <code>PIPRequest</code> to compare against
+     * @param listAttributeValues the <code>Collection</code> of <code>AttributeValue</code>s to select from
+     * @return a <code>Collection</code> of matching <code>AttributeValue</code>s or null if there are no matches
+     */
+    public static Collection<AttributeValue<?>> matchingValues(PIPRequest pipRequest, Collection<AttributeValue<?>> listAttributeValues) {
+        if (listAttributeValues.size() == 0) {
+            return listAttributeValues;
         }
 
-        @Override
-        public Status getStatus() {
-                return this.getWrappedObject().getStatus();
+        /*
+         * See if all of the values match the requested data type
+         */
+        boolean allMatch	= true;
+        for (Iterator<AttributeValue<?>> iterAttributeValues = listAttributeValues.iterator() ; allMatch && iterAttributeValues.hasNext() ; ) {
+            AttributeValue<?> attributeValue	= iterAttributeValues.next();
+            allMatch	= attributeValue.getDataTypeId().equals(pipRequest.getDataTypeId());
+        }
+        if (allMatch) {
+            return listAttributeValues;
         }
 
-        @Override
-        public Collection<Attribute> getAttributes() {
-                return this.getWrappedObject().getAttributes();
-        }
-        
-        /**
-         * Determines if the given {@link com.att.research.xacml.api.pip.PIPRequest} matches the given {@link com.att.research.xacml.api.Attribute} by
-         * comparing the category, attribute id, and if not null in the <code>PIPRequest</code>, the issuer.
-         * 
-         * @param pipRequest the <code>PIPRequest</code> to compare against
-         * @param attribute the <code>Attribute</code> to compare to
-         * @return true if the <code>Attribute</code> matches the <code>PIPRequest</code> else false
+        /*
+         * If there was only one, return a null list
          */
-        public static boolean matches(PIPRequest pipRequest, Attribute attribute) {
-                if (!pipRequest.getCategory().equals(attribute.getCategory())) {
-                        return false;
-                }
-                if (!pipRequest.getAttributeId().equals(attribute.getAttributeId())) {
-                        return false;
-                }
-                if (pipRequest.getIssuer() != null && !pipRequest.getIssuer().equals(attribute.getIssuer())) {
-                        return false;
-                }
-                return true;
+        if (listAttributeValues.size() == 1) {
+            return null;
         }
-        
-        /**
-         * Gets the subset of the {@link com.att.research.xacml.api.AttributeValue}s from the given <code>Collection</code> whose data type
-         * matches the data type in the given {@link com.att.research.xacml.api.pip.PIPRequest}.
-         * 
-         * @param pipRequest the <code>PIPRequest</code> to compare against
-         * @param listAttributeValues the <code>Collection</code> of <code>AttributeValue</code>s to select from
-         * @return a <code>Collection</code> of matching <code>AttributeValue</code>s or null if there are no matches
+
+        List<AttributeValue<?>> listAttributeValuesMatching	= new ArrayList<AttributeValue<?>>();
+        for (Iterator<AttributeValue<?>> iterAttributeValues = listAttributeValues.iterator() ; iterAttributeValues.hasNext() ;) {
+            AttributeValue<?> attributeValue	= iterAttributeValues.next();
+            if (attributeValue.getDataTypeId().equals(pipRequest.getDataTypeId())) {
+                listAttributeValuesMatching.add(attributeValue);
+            }
+        }
+        if (listAttributeValuesMatching.size() == 0) {
+            return null;
+        } else {
+            return listAttributeValuesMatching;
+        }
+    }
+
+    /**
+     * Returns a {@link com.att.research.xacml.api.pip.PIPResponse} that only contains the {@link com.att.research.xacml.api.Attribute}s
+     * that match the given {@link com.att.research.xacml.api.pip.PIPRequest} with {@link com.att.research.xacml.api.AttributeValue}s that
+     * match the requested data type.
+     *
+     * @param pipRequest
+     * @param pipResponse
+     * @return
+     * @throws com.att.research.xacml.api.pip.PIPException
+     */
+    public static PIPResponse getMatchingResponse(PIPRequest pipRequest, PIPResponse pipResponse) throws PIPException {
+        /*
+         * Error responses should not contain any attributes, so just return the error response as is.  Likewise for empty responses
          */
-        public static Collection<AttributeValue<?>> matchingValues(PIPRequest pipRequest, Collection<AttributeValue<?>> listAttributeValues) {
-                if (listAttributeValues.size() == 0) {
-                        return listAttributeValues;
-                }
-                
-                /*
-                 * See if all of the values match the requested data type
-                 */
-                boolean allMatch	= true;
-                for (Iterator<AttributeValue<?>> iterAttributeValues = listAttributeValues.iterator() ; allMatch && iterAttributeValues.hasNext() ; ) {
-                        AttributeValue<?> attributeValue	= iterAttributeValues.next();
-                        allMatch	= attributeValue.getDataTypeId().equals(pipRequest.getDataTypeId());
-                }
-                if (allMatch) {
-                        return listAttributeValues;
-                }
-                
-                /*
-                 * If there was only one, return a null list
-                 */
-                if (listAttributeValues.size() == 1) {
-                        return null;
-                }
-                
-                List<AttributeValue<?>> listAttributeValuesMatching	= new ArrayList<AttributeValue<?>>();
-                for (Iterator<AttributeValue<?>> iterAttributeValues = listAttributeValues.iterator() ; iterAttributeValues.hasNext() ;) {
-                        AttributeValue<?> attributeValue	= iterAttributeValues.next();
-                        if (attributeValue.getDataTypeId().equals(pipRequest.getDataTypeId())) {
-                                listAttributeValuesMatching.add(attributeValue);
-                        }
-                }
-                if (listAttributeValuesMatching.size() == 0) {
-                        return null;
+        if (!pipResponse.getStatus().isOk() || pipResponse.getAttributes().size() == 0) {
+            return pipResponse;
+        }
+
+        /*
+         * See if the response is simple
+         */
+        if (pipResponse.isSimple()) {
+            /*
+             * Get the one Attribute and verify that it matches the request, and that the data type of its values matches the request
+             */
+            Attribute attributeResponse	= pipResponse.getAttributes().iterator().next();
+            if (matches(pipRequest, attributeResponse)) {
+                Collection<AttributeValue<?>> attributeValues	= attributeResponse.getValues();
+                if (attributeValues == null || attributeValues.size() == 0) {
+                    return pipResponse;
                 } else {
-                        return listAttributeValuesMatching;
-                }
-        }
-
-        /**
-         * Returns a {@link com.att.research.xacml.api.pip.PIPResponse} that only contains the {@link com.att.research.xacml.api.Attribute}s
-         * that match the given {@link com.att.research.xacml.api.pip.PIPRequest} with {@link com.att.research.xacml.api.AttributeValue}s that
-         * match the requested data type.
-         * 
-         * @param pipRequest
-         * @param pipResponse
-         * @return
-         * @throws com.att.research.xacml.api.pip.PIPException
-         */
-        public static PIPResponse getMatchingResponse(PIPRequest pipRequest, PIPResponse pipResponse) throws PIPException {
-                /*
-                 * Error responses should not contain any attributes, so just return the error response as is.  Likewise for empty responses
-                 */
-                if (!pipResponse.getStatus().isOk() || pipResponse.getAttributes().size() == 0) {
+                    AttributeValue<?> attributeValueResponse	= attributeResponse.getValues().iterator().next();
+                    if (attributeValueResponse.getDataTypeId().equals(pipRequest.getDataTypeId())) {
                         return pipResponse;
+                    } else {
+                        return PIP_RESPONSE_EMPTY;
+                    }
                 }
-                
-                /*
-                 * See if the response is simple
-                 */
-                if (pipResponse.isSimple()) {
-                        /*
-                         * Get the one Attribute and verify that it matches the request, and that the data type of its values matches the request
-                         */
-                        Attribute attributeResponse	= pipResponse.getAttributes().iterator().next();
-                        if (matches(pipRequest, attributeResponse)) {
-                                Collection<AttributeValue<?>> attributeValues	= attributeResponse.getValues();
-                                if (attributeValues == null || attributeValues.size() == 0) {
-                                        return pipResponse;
-                                } else {
-                                        AttributeValue<?> attributeValueResponse	= attributeResponse.getValues().iterator().next();
-                                        if (attributeValueResponse.getDataTypeId().equals(pipRequest.getDataTypeId())) {
-                                                return pipResponse;
-                                        } else {
-                                                return PIP_RESPONSE_EMPTY;
-                                        }
-                                }
-                        } else {
-                                return PIP_RESPONSE_EMPTY;
-                        }
-                } else {
-                        /*
-                         * Iterate over the Attributes and just get the ones that match and collapse any matching AttributeValues
-                         */
-                        StdMutableAttribute	attributeMatch	= null;
-                        Iterator<Attribute> iterAttributesResponse	= pipResponse.getAttributes().iterator();
-                        while (iterAttributesResponse.hasNext()) {
-                                Attribute attributeResponse	= iterAttributesResponse.next();
-                                if (matches(pipRequest, attributeResponse)) {
-                                        /*
-                                         * Get subset of the matching attribute values
-                                         */
-                                        Collection<AttributeValue<?>> listAttributeValuesMatch	= matchingValues(pipRequest, attributeResponse.getValues());
-                                        if (listAttributeValuesMatch != null && listAttributeValuesMatch.size() > 0) {
-                                                if (attributeMatch == null) {
-                                                        attributeMatch	= new StdMutableAttribute(pipRequest.getCategory(), pipRequest.getAttributeId(), listAttributeValuesMatch, pipRequest.getIssuer(), false);
-                                                } else {
-                                                        attributeMatch.addValues(listAttributeValuesMatch);
-                                                }
-                                        }
-                                }
-                        }
+            } else {
+                return PIP_RESPONSE_EMPTY;
+            }
+        } else {
+            /*
+             * Iterate over the Attributes and just get the ones that match and collapse any matching AttributeValues
+             */
+            StdMutableAttribute	attributeMatch	= null;
+            Iterator<Attribute> iterAttributesResponse	= pipResponse.getAttributes().iterator();
+            while (iterAttributesResponse.hasNext()) {
+                Attribute attributeResponse	= iterAttributesResponse.next();
+                if (matches(pipRequest, attributeResponse)) {
+                    /*
+                     * Get subset of the matching attribute values
+                     */
+                    Collection<AttributeValue<?>> listAttributeValuesMatch	= matchingValues(pipRequest, attributeResponse.getValues());
+                    if (listAttributeValuesMatch != null && listAttributeValuesMatch.size() > 0) {
                         if (attributeMatch == null) {
-                                return PIP_RESPONSE_EMPTY;
+                            attributeMatch	= new StdMutableAttribute(pipRequest.getCategory(), pipRequest.getAttributeId(), listAttributeValuesMatch, pipRequest.getIssuer(), false);
                         } else {
-                                return new StdPIPResponse(attributeMatch);
+                            attributeMatch.addValues(listAttributeValuesMatch);
                         }
+                    }
                 }
+            }
+            if (attributeMatch == null) {
+                return PIP_RESPONSE_EMPTY;
+            } else {
+                return new StdPIPResponse(attributeMatch);
+            }
         }
-        
-        /**
-         * Splits an Attribute that may contain multiple data types into a list of Attributes, each with only one data type
-         * @param attribute
-         * @return
-         */
-        private static List<Attribute> simplifyAttribute(Attribute attribute) {
-                List<Attribute> listAttributes	= new ArrayList<Attribute>();
-                if (attribute.getValues() == null || attribute.getValues().size() <= 1) {
-                        listAttributes.add(attribute);
-                } else {
-                        for (AttributeValue<?> attributeValue : attribute.getValues()) {
-                                listAttributes.add(new StdAttribute(attribute.getCategory(), attribute.getAttributeId(), attributeValue, attribute.getIssuer(), attribute.getIncludeInResults()));
-                        }
-                }
-                return listAttributes;
+    }
+
+    /**
+     * Splits an Attribute that may contain multiple data types into a list of Attributes, each with only one data type
+     * @param attribute
+     * @return
+     */
+    private static List<Attribute> simplifyAttribute(Attribute attribute) {
+        List<Attribute> listAttributes	= new ArrayList<Attribute>();
+        if (attribute.getValues() == null || attribute.getValues().size() <= 1) {
+            listAttributes.add(attribute);
+        } else {
+            for (AttributeValue<?> attributeValue : attribute.getValues()) {
+                listAttributes.add(new StdAttribute(attribute.getCategory(), attribute.getAttributeId(), attributeValue, attribute.getIssuer(), attribute.getIncludeInResults()));
+            }
         }
-        
-        /**
-         * Takes a list of simple Attributes and collapses attributes with the same category, id, value data type, and issuer into
-         * a single Attribute and returns the list of collapsed Attributes.
-         * 
-         * @param listAttributes
-         * @return
-         */
-        private static Collection<? extends Attribute> collapseAttributes(List<Attribute> listAttributes) {
-                if (listAttributes.size() <= 0) {
-                        return listAttributes;
-                }
-                Map<PIPRequest, StdMutableAttribute> map	= new HashMap<PIPRequest, StdMutableAttribute>();
-                for (Attribute attribute : listAttributes) {
-                        PIPRequest pipRequest	= new StdPIPRequest(attribute);
-                        if (map.containsKey(pipRequest)) {
-                                StdMutableAttribute mutableAttribute	= map.get(pipRequest);
-                                mutableAttribute.addValues(attribute.getValues());
-                        } else {
-                                map.put(pipRequest, new StdMutableAttribute(attribute));
-                        }
-                }
-                
-                if (map.size() == 0) {
-                        return null;
-                } else {
-                        return map.values();
-                }
+        return listAttributes;
+    }
+
+    /**
+     * Takes a list of simple Attributes and collapses attributes with the same category, id, value data type, and issuer into
+     * a single Attribute and returns the list of collapsed Attributes.
+     *
+     * @param listAttributes
+     * @return
+     */
+    private static Collection<? extends Attribute> collapseAttributes(List<Attribute> listAttributes) {
+        if (listAttributes.size() <= 0) {
+            return listAttributes;
         }
-        
-        /**
-         * Takes a {@link com.att.research.xacml.api.pip.PIPResponse} that may contain {@link com.att.research.xacml.api.Attribute}s, with multiple
-         * identifiers, each of which may contain multiple {@link com.att.research.xacml.api.AttributeValue}s with different data types and creates a collection of
-         * simple <code>PIPResponse</code>s that contain a single <code>Attribute</code> with <code>AttributeValue</code>s of one data type.
-         * 
-         * @param pipResponse the <code>PIPResponse</code> to split
-         * @return a <code>Collection</code> of simple <code>PIPResponse</code>s
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error splitting the response
-         */
-        public static Map<PIPRequest,PIPResponse> splitResponse(PIPResponse pipResponse) throws PIPException {
-                Map<PIPRequest,PIPResponse> map	= new HashMap<PIPRequest,PIPResponse>();
-                if (!pipResponse.getStatus().isOk() || pipResponse.isSimple()) {
-                        map.put(new StdPIPRequest(pipResponse.getAttributes().iterator().next()), pipResponse);
-                } else {
-                        List<Attribute> listAllAttributesSimple	= new ArrayList<Attribute>();
-                        for (Iterator<Attribute> iterAttributes = pipResponse.getAttributes().iterator() ; iterAttributes.hasNext() ; ) {
-                                Attribute attribute	= iterAttributes.next();
-                                List<Attribute> listAttributesSplit	= simplifyAttribute(attribute);
-                                if (listAttributesSplit != null && listAttributesSplit.size() > 0) {
-                                        listAllAttributesSimple.addAll(listAttributesSplit);
-                                }
-                        }
-                        if (listAllAttributesSimple.size() > 0) {
-                                Collection<? extends Attribute> listAttributesCollapsed	= collapseAttributes(listAllAttributesSimple);
-                                for (Attribute attributeCollapsed : listAttributesCollapsed) {
-                                        map.put(new StdPIPRequest(attributeCollapsed), new StdPIPResponse(attributeCollapsed));
-                                }
-                        }
-                }
-                return map;
+        Map<PIPRequest, StdMutableAttribute> map	= new HashMap<PIPRequest, StdMutableAttribute>();
+        for (Attribute attribute : listAttributes) {
+            PIPRequest pipRequest	= new StdPIPRequest(attribute);
+            if (map.containsKey(pipRequest)) {
+                StdMutableAttribute mutableAttribute	= map.get(pipRequest);
+                mutableAttribute.addValues(attribute.getValues());
+            } else {
+                map.put(pipRequest, new StdMutableAttribute(attribute));
+            }
         }
 
-        @Override
-        public boolean isSimple() {
-                return this.getWrappedObject().isSimple();
+        if (map.size() == 0) {
+            return null;
+        } else {
+            return map.values();
+        }
+    }
+
+    /**
+     * Takes a {@link com.att.research.xacml.api.pip.PIPResponse} that may contain {@link com.att.research.xacml.api.Attribute}s, with multiple
+     * identifiers, each of which may contain multiple {@link com.att.research.xacml.api.AttributeValue}s with different data types and creates a collection of
+     * simple <code>PIPResponse</code>s that contain a single <code>Attribute</code> with <code>AttributeValue</code>s of one data type.
+     *
+     * @param pipResponse the <code>PIPResponse</code> to split
+     * @return a <code>Collection</code> of simple <code>PIPResponse</code>s
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error splitting the response
+     */
+    public static Map<PIPRequest,PIPResponse> splitResponse(PIPResponse pipResponse) throws PIPException {
+        Map<PIPRequest,PIPResponse> map	= new HashMap<PIPRequest,PIPResponse>();
+        if (!pipResponse.getStatus().isOk() || pipResponse.isSimple()) {
+            map.put(new StdPIPRequest(pipResponse.getAttributes().iterator().next()), pipResponse);
+        } else {
+            List<Attribute> listAllAttributesSimple	= new ArrayList<Attribute>();
+            for (Iterator<Attribute> iterAttributes = pipResponse.getAttributes().iterator() ; iterAttributes.hasNext() ; ) {
+                Attribute attribute	= iterAttributes.next();
+                List<Attribute> listAttributesSplit	= simplifyAttribute(attribute);
+                if (listAttributesSplit != null && listAttributesSplit.size() > 0) {
+                    listAllAttributesSimple.addAll(listAttributesSplit);
+                }
+            }
+            if (listAllAttributesSimple.size() > 0) {
+                Collection<? extends Attribute> listAttributesCollapsed	= collapseAttributes(listAllAttributesSimple);
+                for (Attribute attributeCollapsed : listAttributesCollapsed) {
+                    map.put(new StdPIPRequest(attributeCollapsed), new StdPIPResponse(attributeCollapsed));
+                }
+            }
+        }
+        return map;
+    }
+
+    @Override
+    public boolean isSimple() {
+        return this.getWrappedObject().isSimple();
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder stringBuilder	= new StringBuilder("{");
+
+        boolean needsComma	= false;
+
+        if (this.getStatus() != null) {
+            stringBuilder.append(this.getStatus().toString());
+            needsComma = true;
+        }
+        if (this.getAttributes().isEmpty() == false) {
+            if (needsComma) {
+                stringBuilder.append(",");
+            }
+            needsComma = false;
         }
 
-        @Override
-        public String toString() {
-                StringBuilder stringBuilder	= new StringBuilder("{");
-                
-                boolean needsComma	= false;
-                
-                if (this.getStatus() != null) {
-                        stringBuilder.append(this.getStatus().toString());
-                        needsComma = true;
-                }
-                if (this.getAttributes().isEmpty() == false) {
-                        if (needsComma) {
-                                stringBuilder.append(",");
-                        }
-                        needsComma = false;
-                }
-                
-                stringBuilder.append("[");
-                for (Attribute attribute : this.getAttributes()) {
-                        if (needsComma) {
-                                stringBuilder.append(",");
-                        }
-                        stringBuilder.append(attribute.toString());
-                        needsComma = true;
-                }
-                stringBuilder.append("]");
-                
-                stringBuilder.append('}');
-                return stringBuilder.toString();
+        stringBuilder.append("[");
+        for (Attribute attribute : this.getAttributes()) {
+            if (needsComma) {
+                stringBuilder.append(",");
+            }
+            stringBuilder.append(attribute.toString());
+            needsComma = true;
         }
+        stringBuilder.append("]");
+
+        stringBuilder.append('}');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdSinglePIPResponse.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdSinglePIPResponse.java
index 7c72020..16fa7a1 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdSinglePIPResponse.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/StdSinglePIPResponse.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,19 +35,19 @@
 /**
  * StdSinglePIPResponse extends {@link com.att.research.xacml.std.pip.StdMutablePIPResponse} with methods for
  * retrieving a single {@link com.att.research.xacml.api.Attribute}.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class StdSinglePIPResponse extends StdMutablePIPResponse {
-        private Attribute singleAttribute;
-        
-        public StdSinglePIPResponse(Attribute attribute) {
-                super(attribute);
-                this.singleAttribute	= attribute;
-        }
-        
-        public Attribute getSingleAttribute() {
-                return this.singleAttribute;
-        }
+    private Attribute singleAttribute;
+
+    public StdSinglePIPResponse(Attribute attribute) {
+        super(attribute);
+        this.singleAttribute	= attribute;
+    }
+
+    public Attribute getSingleAttribute() {
+        return this.singleAttribute;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ConfigurableEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ConfigurableEngine.java
index 80a6cb4..b5bf0cf 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ConfigurableEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ConfigurableEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,17 +38,17 @@
 /**
  * ConfigurableEngine extends the {@link com.att.research.xacml.api.pip.PIPEngine} interface with methods
  * for configuring the engine from a <code>Properties</code> object.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public interface ConfigurableEngine extends PIPEngine {
-        /**
-         * Configures this <code>ConfigurableEngine</code> from the given <code>Properties</code>.
-         * 
-         * @param id the <code>String</code> name for this <code>ConfigurableEngine</code> used also to locate properties
-         * @param properties the <code>Properties</code> containing the configuration parameters for this <code>ConfigurableEngine</code>
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error configuring the <code>ConfigurableEngine</code>
-         */
-        public void configure(String id, Properties properties) throws PIPException;
+    /**
+     * Configures this <code>ConfigurableEngine</code> from the given <code>Properties</code>.
+     *
+     * @param id the <code>String</code> name for this <code>ConfigurableEngine</code> used also to locate properties
+     * @param properties the <code>Properties</code> containing the configuration parameters for this <code>ConfigurableEngine</code>
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error configuring the <code>ConfigurableEngine</code>
+     */
+    public void configure(String id, Properties properties) throws PIPException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ConfigurableResolver.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ConfigurableResolver.java
index 1a5984e..4ef5030 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ConfigurableResolver.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ConfigurableResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,28 +37,28 @@
 import com.att.research.xacml.api.pip.PIPRequest;
 
 public interface ConfigurableResolver {
-        /**
-         * Configures this <code>JDBCResolver</code> using the given <code>Properties</code>>
-         * 
-         * @param id the <code>String</code> identifier for locating properties for this <code>JDBCResolver</code>
-         * @param properties the <code>Properties</code> to search for properties
-         * @param defaultIssuer the default issuer value if none is defined specifically.
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error configuring this <code>JDBCResolver</code>
-         */
-        public void configure(String id, Properties properties, String defaultIssuer) throws PIPException;
+    /**
+     * Configures this <code>JDBCResolver</code> using the given <code>Properties</code>>
+     *
+     * @param id the <code>String</code> identifier for locating properties for this <code>JDBCResolver</code>
+     * @param properties the <code>Properties</code> to search for properties
+     * @param defaultIssuer the default issuer value if none is defined specifically.
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error configuring this <code>JDBCResolver</code>
+     */
+    public void configure(String id, Properties properties, String defaultIssuer) throws PIPException;
 
-        /**
-         * Adds attributes required by the resolver to return an attribute.
-         * 
-         * @param attributes - A modifiable collection
-         */
-        public void	attributesRequired(Collection<PIPRequest> attributes);
-        
-        /**
-         * Adds attributes provided by the resolver.
-         * 
-         * @param attributes - A modifiable collection
-         */
-        public void	attributesProvided(Collection<PIPRequest> attributes);
-        
+    /**
+     * Adds attributes required by the resolver to return an attribute.
+     *
+     * @param attributes - A modifiable collection
+     */
+    public void	attributesRequired(Collection<PIPRequest> attributes);
+
+    /**
+     * Adds attributes provided by the resolver.
+     *
+     * @param attributes - A modifiable collection
+     */
+    public void	attributesProvided(Collection<PIPRequest> attributes);
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/Configurables.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/Configurables.java
index 0ca9454..04e2bb6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/Configurables.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/Configurables.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -51,188 +51,180 @@
  * @version $Revision$
  */
 public class Configurables {
-        
-        public static final String PROP_ID				= "id";
-        public static final String PROP_DATATYPE		= "datatype";
-        public static final String PROP_CATEGORY		= "category";
-        public static final String PROP_ISSUER			= "issuer";
-        
-        private static Log logger		= LogFactory.getLog(Configurables.class);
 
-        public static List<PIPRequest> getPIPRequestList(String prefix, String name, Properties properties, String defaultIssuer) throws PIPException {
-                String idxProp = properties.getProperty(prefix + "." + name);
-                if (null == idxProp) {
-                        throw new PIPException("PIPRequest list definition not found (entry '" +
-                                                                        (prefix + "." + name) + "')");
-                }
-                ArrayList<PIPRequest> list = new ArrayList<PIPRequest>();
-                if (idxProp.length() == 0) {
-                        return list;
-                }
-                try (Scanner s = new Scanner(idxProp)) {
-                        s.useDelimiter("[,]");
-                        while (s.hasNextInt()) {
-                                int idx = s.nextInt();
-                                PIPRequest request =
-                                        getPIPRequest(prefix + "." + name + "." + idx, properties, defaultIssuer);
-                                if (null == request)
-                                        throw new PIPException("PIPRequest list defines element " + idx + " but element specification is missing");
-                                else {
-                                        //list.ensureCapacity(idx);
-                                        //list.set(idx-1, request);
-                                        list.add(request);
-                                }
-                        }
-                }
-                catch (InputMismatchException imx) {
-                        throw new PIPException("PIPRequest list specification contains non-readable position specification");
-                }
+    public static final String PROP_ID				= "id";
+    public static final String PROP_DATATYPE		= "datatype";
+    public static final String PROP_CATEGORY		= "category";
+    public static final String PROP_ISSUER			= "issuer";
 
-                return list;
+    private static Log logger		= LogFactory.getLog(Configurables.class);
+
+    public static List<PIPRequest> getPIPRequestList(String prefix, String name, Properties properties, String defaultIssuer) throws PIPException {
+        String idxProp = properties.getProperty(prefix + "." + name);
+        if (null == idxProp) {
+            throw new PIPException("PIPRequest list definition not found (entry '" +
+                                   (prefix + "." + name) + "')");
+        }
+        ArrayList<PIPRequest> list = new ArrayList<PIPRequest>();
+        if (idxProp.length() == 0) {
+            return list;
+        }
+        try (Scanner s = new Scanner(idxProp)) {
+            s.useDelimiter("[,]");
+            while (s.hasNextInt()) {
+                int idx = s.nextInt();
+                PIPRequest request =
+                    getPIPRequest(prefix + "." + name + "." + idx, properties, defaultIssuer);
+                if (null == request)
+                    throw new PIPException("PIPRequest list defines element " + idx + " but element specification is missing");
+                else {
+                    //list.ensureCapacity(idx);
+                    //list.set(idx-1, request);
+                    list.add(request);
+                }
+            }
+        } catch (InputMismatchException imx) {
+            throw new PIPException("PIPRequest list specification contains non-readable position specification");
         }
 
-        public static void setPIPRequestList(List<PIPRequest> list, String prefix, String name, Properties properties) throws PIPException {
-                StringBuilder spec = null;
-                int i = 1;
-                try {
-                        for (PIPRequest req: list) { 
-                                if (req != null) {
-                                        setPIPRequest(req, prefix + "." + name + "." + i, properties);
-                                        if (null == spec) {
-                                                spec = new StringBuilder().append(String.valueOf(i));
-                                        }
-                                        else {
-                                                spec.append(",").append(String.valueOf(i));
-                                        }
-                                }
-                                i++;
-                        }
-                }
-                catch(PIPException pipx) {
-                        throw new PIPException("Failed to set request " + list.get(i), pipx);
-                }
-                finally {
-                        if (spec != null) {
-                                properties.setProperty(prefix + "." + name, spec.toString());
-                        }
-                }
-        }
-        
-        public static Map<String, PIPRequest> getPIPRequestMap(String prefix, String name, Properties properties, String defaultIssuer) throws PIPException {
-                
-                String idxProp = properties.getProperty(prefix + "." + name);
-                if (null == idxProp) {
-                        throw new PIPException("PIPRequest map definition not found (entry '" +
-                                                                        (prefix + "." + name) + "')");
-                }
-                HashMap<String,PIPRequest> map = new HashMap<String,PIPRequest>();
-                if (idxProp.length() == 0) {
-                        return map;
-                }
-                try (Scanner s = new Scanner(idxProp)) {
-                        s.useDelimiter("[,]");
-                        while (s.hasNext()) {
-                                String key = s.next();
-                                PIPRequest request =
-                                        getPIPRequest(prefix + "." + name + "." + key, properties, defaultIssuer);
-                                if (null == request)
-                                        throw new PIPException("PIPRequest list defines element " + key + " but element specification is missing");
-                                else {
-                                        map.put(key, request);
-                                }
-                        }
-                }
-                catch (InputMismatchException imx) {
-                        throw new PIPException("PIPRequest list specification contains non-readable key specification");
-                }
+        return list;
+    }
 
-                return map;
+    public static void setPIPRequestList(List<PIPRequest> list, String prefix, String name, Properties properties) throws PIPException {
+        StringBuilder spec = null;
+        int i = 1;
+        try {
+            for (PIPRequest req: list) {
+                if (req != null) {
+                    setPIPRequest(req, prefix + "." + name + "." + i, properties);
+                    if (null == spec) {
+                        spec = new StringBuilder().append(String.valueOf(i));
+                    } else {
+                        spec.append(",").append(String.valueOf(i));
+                    }
+                }
+                i++;
+            }
+        } catch(PIPException pipx) {
+            throw new PIPException("Failed to set request " + list.get(i), pipx);
+        } finally {
+            if (spec != null) {
+                properties.setProperty(prefix + "." + name, spec.toString());
+            }
+        }
+    }
+
+    public static Map<String, PIPRequest> getPIPRequestMap(String prefix, String name, Properties properties, String defaultIssuer) throws PIPException {
+
+        String idxProp = properties.getProperty(prefix + "." + name);
+        if (null == idxProp) {
+            throw new PIPException("PIPRequest map definition not found (entry '" +
+                                   (prefix + "." + name) + "')");
+        }
+        HashMap<String,PIPRequest> map = new HashMap<String,PIPRequest>();
+        if (idxProp.length() == 0) {
+            return map;
+        }
+        try (Scanner s = new Scanner(idxProp)) {
+            s.useDelimiter("[,]");
+            while (s.hasNext()) {
+                String key = s.next();
+                PIPRequest request =
+                    getPIPRequest(prefix + "." + name + "." + key, properties, defaultIssuer);
+                if (null == request)
+                    throw new PIPException("PIPRequest list defines element " + key + " but element specification is missing");
+                else {
+                    map.put(key, request);
+                }
+            }
+        } catch (InputMismatchException imx) {
+            throw new PIPException("PIPRequest list specification contains non-readable key specification");
         }
 
-        public static void setPIPRequestMap(Map<String,PIPRequest> map,
-                                                                                                                         String prefix,
-                                                                                                                         String name,
-                                                                                                                         Properties properties) throws PIPException {
-                StringBuilder spec = null;
-                PIPRequest req = null;
-                try {
-                        for (Map.Entry<String,PIPRequest> entry: map.entrySet()) {
-                                setPIPRequest(entry.getValue(),
-                                                                                        prefix + "." + name + "." + entry.getKey(),
-                                                                                        properties);
-                                if (null == spec) {
-                                        spec = new StringBuilder().append(entry.getKey());
-                                }
-                                else {
-                                        spec.append(",").append(entry.getKey());
-                                }
-                        }
+        return map;
+    }
+
+    public static void setPIPRequestMap(Map<String,PIPRequest> map,
+                                        String prefix,
+                                        String name,
+                                        Properties properties) throws PIPException {
+        StringBuilder spec = null;
+        PIPRequest req = null;
+        try {
+            for (Map.Entry<String,PIPRequest> entry: map.entrySet()) {
+                setPIPRequest(entry.getValue(),
+                              prefix + "." + name + "." + entry.getKey(),
+                              properties);
+                if (null == spec) {
+                    spec = new StringBuilder().append(entry.getKey());
+                } else {
+                    spec.append(",").append(entry.getKey());
                 }
-                catch(PIPException pipx) {
-                        throw new PIPException("Failed to set request " + req, pipx);
-                }
-                finally {
-                        //keep the properties consistent even if we failed half-way ..
-                        if (null != spec) {
-                                properties.setProperty(prefix + "." + name, spec.toString());
-                        }
-                }
+            }
+        } catch(PIPException pipx) {
+            throw new PIPException("Failed to set request " + req, pipx);
+        } finally {
+            //keep the properties consistent even if we failed half-way ..
+            if (null != spec) {
+                properties.setProperty(prefix + "." + name, spec.toString());
+            }
         }
+    }
 
 
-        public static PIPRequest getPIPRequest(String idPrefix, Properties properties, String defaultIssuer) throws PIPException {
-                String stringProp	= idPrefix + "." + PROP_ID;
-                String attributeId	= properties.getProperty(stringProp);
-                stringProp			= idPrefix + "." + PROP_DATATYPE;
-                String dataTypeId	= properties.getProperty(stringProp);
-                stringProp			= idPrefix + "." + PROP_CATEGORY;
-                String categoryId	= properties.getProperty(stringProp);
-                stringProp			= idPrefix + "." + PROP_ISSUER;
-                String issuer		= properties.getProperty(stringProp);
-                
-                if (issuer == null) {
-                        issuer = defaultIssuer;
-                }
-                //
-                // if none of these properties are present there was no intent to define the
-                // given attribute.
-                //
-                if ( dataTypeId == null &&
-                                 attributeId == null &&
-                                 categoryId == null) {
-                        return null;
-                }
-                
-                //no that we know there was intent, check that mandatory information is
-                //present
-                if ( (attributeId == null || attributeId.length() == 0) ||
-                                 (dataTypeId == null || dataTypeId.length() == 0) || 
-                                 (categoryId == null || categoryId.length() == 0) ) {
-                        StringBuilder errMsg = new StringBuilder();
-                        errMsg.append("Incomplete PIPRequest specification, missing property (")
-                                                .append("attributeId=")
-                                                .append(attributeId)
-                                                .append(",")
-                                                .append("dataTypeId=")
-                                                .append(dataTypeId)
-                                                .append(",")
-                                                .append("categoryId=")
-                                                .append(categoryId)
-                                                .append(")");
-                        logger.error(errMsg.toString());
-                        throw new PIPException(errMsg.toString());						
-                }	
-                
-                return new StdPIPRequest(new IdentifierImpl(categoryId), new IdentifierImpl(attributeId), new IdentifierImpl(dataTypeId), issuer);
+    public static PIPRequest getPIPRequest(String idPrefix, Properties properties, String defaultIssuer) throws PIPException {
+        String stringProp	= idPrefix + "." + PROP_ID;
+        String attributeId	= properties.getProperty(stringProp);
+        stringProp			= idPrefix + "." + PROP_DATATYPE;
+        String dataTypeId	= properties.getProperty(stringProp);
+        stringProp			= idPrefix + "." + PROP_CATEGORY;
+        String categoryId	= properties.getProperty(stringProp);
+        stringProp			= idPrefix + "." + PROP_ISSUER;
+        String issuer		= properties.getProperty(stringProp);
+
+        if (issuer == null) {
+            issuer = defaultIssuer;
+        }
+        //
+        // if none of these properties are present there was no intent to define the
+        // given attribute.
+        //
+        if ( dataTypeId == null &&
+                attributeId == null &&
+                categoryId == null) {
+            return null;
         }
 
-        public static void setPIPRequest(PIPRequest pipRequest, String prefix, Properties properties) throws PIPException {
-                properties.setProperty(prefix + ".id", pipRequest.getAttributeId().stringValue());
-                properties.setProperty(prefix + ".datatype", pipRequest.getDataTypeId().stringValue());
-                properties.setProperty(prefix + ".category", pipRequest.getCategory().stringValue());
-                if (pipRequest.getIssuer() != null) {
-                        properties.setProperty(prefix + ".issuer", pipRequest.getIssuer());
-                }
+        //no that we know there was intent, check that mandatory information is
+        //present
+        if ( (attributeId == null || attributeId.length() == 0) ||
+                (dataTypeId == null || dataTypeId.length() == 0) ||
+                (categoryId == null || categoryId.length() == 0) ) {
+            StringBuilder errMsg = new StringBuilder();
+            errMsg.append("Incomplete PIPRequest specification, missing property (")
+            .append("attributeId=")
+            .append(attributeId)
+            .append(",")
+            .append("dataTypeId=")
+            .append(dataTypeId)
+            .append(",")
+            .append("categoryId=")
+            .append(categoryId)
+            .append(")");
+            logger.error(errMsg.toString());
+            throw new PIPException(errMsg.toString());
         }
 
+        return new StdPIPRequest(new IdentifierImpl(categoryId), new IdentifierImpl(attributeId), new IdentifierImpl(dataTypeId), issuer);
+    }
+
+    public static void setPIPRequest(PIPRequest pipRequest, String prefix, Properties properties) throws PIPException {
+        properties.setProperty(prefix + ".id", pipRequest.getAttributeId().stringValue());
+        properties.setProperty(prefix + ".datatype", pipRequest.getDataTypeId().stringValue());
+        properties.setProperty(prefix + ".category", pipRequest.getCategory().stringValue());
+        if (pipRequest.getIssuer() != null) {
+            properties.setProperty(prefix + ".issuer", pipRequest.getIssuer());
+        }
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/EnvironmentEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/EnvironmentEngine.java
index 5325a50..bb12ca1 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/EnvironmentEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/EnvironmentEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -54,123 +54,123 @@
 /**
  * EnvironmentEngine implements the {@link com.att.research.xacml.api.pip.PipEngine} interface to provide values
  * for standard environment attributes.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class EnvironmentEngine implements PIPEngine {
-        private Date contextTime;
-        
-        private StdSinglePIPResponse responseTime;
-        private StdSinglePIPResponse responseDate;
-        private StdSinglePIPResponse responseDateTime;
-        
-        protected StdSinglePIPResponse getResponseTime() throws DataTypeException {
-                if (this.responseTime == null) {
-                        this.responseTime	
-                                = new StdSinglePIPResponse(
-                                                new StdMutableAttribute(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT, 
-                                                                                 XACML3.ID_ENVIRONMENT_CURRENT_TIME, 
-                                                                                 DataTypes.DT_TIME.createAttributeValue(this.contextTime)));
-                }
-                return this.responseTime;
+    private Date contextTime;
+
+    private StdSinglePIPResponse responseTime;
+    private StdSinglePIPResponse responseDate;
+    private StdSinglePIPResponse responseDateTime;
+
+    protected StdSinglePIPResponse getResponseTime() throws DataTypeException {
+        if (this.responseTime == null) {
+            this.responseTime
+                = new StdSinglePIPResponse(
+                new StdMutableAttribute(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT,
+                                        XACML3.ID_ENVIRONMENT_CURRENT_TIME,
+                                        DataTypes.DT_TIME.createAttributeValue(this.contextTime)));
         }
-        
-        protected StdSinglePIPResponse getResponseDate() throws DataTypeException {
-                if (this.responseDate == null) {
-                        this.responseDate
-                                = new StdSinglePIPResponse(
-                                                new StdMutableAttribute(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT,
-                                                                                 XACML3.ID_ENVIRONMENT_CURRENT_DATE,
-                                                                                 DataTypes.DT_DATE.createAttributeValue(this.contextTime)));
-                }
-                return this.responseDate;
+        return this.responseTime;
+    }
+
+    protected StdSinglePIPResponse getResponseDate() throws DataTypeException {
+        if (this.responseDate == null) {
+            this.responseDate
+                = new StdSinglePIPResponse(
+                new StdMutableAttribute(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT,
+                                        XACML3.ID_ENVIRONMENT_CURRENT_DATE,
+                                        DataTypes.DT_DATE.createAttributeValue(this.contextTime)));
         }
-        
-        protected StdSinglePIPResponse getResponseDateTime() throws DataTypeException {
-                if (this.responseDateTime == null) {
-                        this.responseDateTime
-                        = new StdSinglePIPResponse(
-                                        new StdMutableAttribute(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT,
-                                                                         XACML3.ID_ENVIRONMENT_CURRENT_DATETIME,
-                                                                         DataTypes.DT_DATETIME.createAttributeValue(this.contextTime)));			
-                }
-                return this.responseDateTime;
+        return this.responseDate;
+    }
+
+    protected StdSinglePIPResponse getResponseDateTime() throws DataTypeException {
+        if (this.responseDateTime == null) {
+            this.responseDateTime
+                = new StdSinglePIPResponse(
+                new StdMutableAttribute(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT,
+                                        XACML3.ID_ENVIRONMENT_CURRENT_DATETIME,
+                                        DataTypes.DT_DATETIME.createAttributeValue(this.contextTime)));
         }
-        
-        public EnvironmentEngine(Date dateContextTimeIn) {
-                this.contextTime	= dateContextTimeIn;
+        return this.responseDateTime;
+    }
+
+    public EnvironmentEngine(Date dateContextTimeIn) {
+        this.contextTime	= dateContextTimeIn;
+    }
+
+    @Override
+    public String getName() {
+        return this.getClass().getName();
+    }
+
+    @Override
+    public String getDescription() {
+        return "Environment attribute PIP";
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesRequired() {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesProvided() {
+        List<PIPRequest> attributes = new ArrayList<PIPRequest>();
+        attributes.add(new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT,
+                                         XACML3.ID_ENVIRONMENT_CURRENT_DATE,
+                                         XACML3.ID_DATATYPE_DATE, null));
+        attributes.add(new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT,
+                                         XACML3.ID_ENVIRONMENT_CURRENT_TIME,
+                                         XACML3.ID_DATATYPE_TIME, null));
+        attributes.add(new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT,
+                                         XACML3.ID_ENVIRONMENT_CURRENT_DATETIME,
+                                         XACML3.ID_DATATYPE_DATETIME, null));
+        return attributes;
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
+        /*
+         * Make sure this is a request for an environment attribute and no issuer has been set
+         */
+        if (!XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT.equals(pipRequest.getCategory()) || (pipRequest.getIssuer() != null && pipRequest.getIssuer().length() > 0)) {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
         }
 
-        @Override
-        public String getName() {
-                return this.getClass().getName();
+        /*
+         * See which environment attribute is requested
+         */
+        Identifier attributeIdRequest		= pipRequest.getAttributeId();
+        StdSinglePIPResponse pipResponse	= null;
+        try {
+            if (XACML3.ID_ENVIRONMENT_CURRENT_DATE.equals(attributeIdRequest)) {
+                pipResponse	= this.getResponseDate();
+            } else if (XACML3.ID_ENVIRONMENT_CURRENT_TIME.equals(attributeIdRequest)) {
+                pipResponse	= this.getResponseTime();
+            } else if (XACML3.ID_ENVIRONMENT_CURRENT_DATETIME.equals(attributeIdRequest)) {
+                pipResponse	= this.getResponseDateTime();
+            }
+        } catch (DataTypeException ex) {
+            throw new PIPException("DataTypeException getting \"" + attributeIdRequest.stringValue() + "\"", ex);
         }
 
-        @Override
-        public String getDescription() {
-                return "Environment attribute PIP";
+        if (pipResponse == null) {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
         }
 
-        @Override
-        public Collection<PIPRequest> attributesRequired() {
-                return Collections.emptyList();
+        /*
+         * Ensure the data types match
+         */
+        AttributeValue<?> attributeValuePipResponse	= pipResponse.getSingleAttribute().getValues().iterator().next();
+        if (attributeValuePipResponse.getDataTypeId().equals(pipRequest.getDataTypeId())) {
+            return pipResponse;
+        } else {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
         }
-
-        @Override
-        public Collection<PIPRequest> attributesProvided() {
-                List<PIPRequest> attributes = new ArrayList<PIPRequest>();
-                attributes.add(new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT, 
-                                                                                XACML3.ID_ENVIRONMENT_CURRENT_DATE,
-                                                                                XACML3.ID_DATATYPE_DATE, null));
-                attributes.add(new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT, 
-                                                                                XACML3.ID_ENVIRONMENT_CURRENT_TIME,
-                                                                                XACML3.ID_DATATYPE_TIME, null));
-                attributes.add(new StdPIPRequest(XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT, 
-                                                                                XACML3.ID_ENVIRONMENT_CURRENT_DATETIME,
-                                                                                XACML3.ID_DATATYPE_DATETIME, null));		
-                return attributes;
-        }
-
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
-                /*
-                 * Make sure this is a request for an environment attribute and no issuer has been set
-                 */
-                if (!XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT.equals(pipRequest.getCategory()) || (pipRequest.getIssuer() != null && pipRequest.getIssuer().length() > 0)) {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                }
-                
-                /*
-                 * See which environment attribute is requested
-                 */
-                Identifier attributeIdRequest		= pipRequest.getAttributeId();
-                StdSinglePIPResponse pipResponse	= null;
-                try {
-                        if (XACML3.ID_ENVIRONMENT_CURRENT_DATE.equals(attributeIdRequest)) {
-                                pipResponse	= this.getResponseDate();
-                        } else if (XACML3.ID_ENVIRONMENT_CURRENT_TIME.equals(attributeIdRequest)) {
-                                pipResponse	= this.getResponseTime();
-                        } else if (XACML3.ID_ENVIRONMENT_CURRENT_DATETIME.equals(attributeIdRequest)) {
-                                pipResponse	= this.getResponseDateTime();
-                        }
-                } catch (DataTypeException ex) {
-                        throw new PIPException("DataTypeException getting \"" + attributeIdRequest.stringValue() + "\"", ex);
-                }
-                
-                if (pipResponse == null) {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                }
-                
-                /*
-                 * Ensure the data types match
-                 */
-                AttributeValue<?> attributeValuePipResponse	= pipResponse.getSingleAttribute().getValues().iterator().next();
-                if (attributeValuePipResponse.getDataTypeId().equals(pipRequest.getDataTypeId())) {
-                        return pipResponse;
-                } else {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                }
-        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/RequestEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/RequestEngine.java
index 2fff265..441d278 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/RequestEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/RequestEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -56,125 +56,125 @@
 /**
  * StdRequestEngine implements the {@link com.att.research.xacml.api.pip.PIPEngine} interface to retrieve
  * matching {@link com.att.reserach.xacml.api.Attribute}s from a {@link com.att.research.xacml.pip.Request} object.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class RequestEngine implements PIPEngine {
-        private Request request;
-        
-        protected Request getRequest() {
-                return this.request;
-        }
-        
-        /**
-         * Creates a <code>StdRequestEngine</code> for retrieving <code>Attribute</code>s from a <code>Request</code>.
-         * 
-         * @param requestIn the <code>Request</code> to search
-         */
-        public RequestEngine(Request requestIn) {
-                this.request	= requestIn;
+    private Request request;
+
+    protected Request getRequest() {
+        return this.request;
+    }
+
+    /**
+     * Creates a <code>StdRequestEngine</code> for retrieving <code>Attribute</code>s from a <code>Request</code>.
+     *
+     * @param requestIn the <code>Request</code> to search
+     */
+    public RequestEngine(Request requestIn) {
+        this.request	= requestIn;
+    }
+
+    @Override
+    public String getName() {
+        return this.getClass().getCanonicalName();
+    }
+
+    @Override
+    public String getDescription() {
+        return "PIPEngine for retrieving Attributes from the Request";
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
+        Request thisRequest	= this.getRequest();
+        if (thisRequest == null) {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
         }
 
-        @Override
-        public String getName() {
-                return this.getClass().getCanonicalName();
+        Iterator<RequestAttributes> iterRequestAttributes	= thisRequest.getRequestAttributes(pipRequest.getCategory());
+        if (iterRequestAttributes == null || !iterRequestAttributes.hasNext()) {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
         }
 
-        @Override
-        public String getDescription() {
-                return "PIPEngine for retrieving Attributes from the Request";
-        }
+        StdMutablePIPResponse pipResponse	= null;
 
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
-                Request thisRequest	= this.getRequest();
-                if (thisRequest == null) {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                }
-                
-                Iterator<RequestAttributes> iterRequestAttributes	= thisRequest.getRequestAttributes(pipRequest.getCategory());
-                if (iterRequestAttributes == null || !iterRequestAttributes.hasNext()) {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                }
-
-                StdMutablePIPResponse pipResponse	= null;
-                
-                while (iterRequestAttributes.hasNext()) {
-                        RequestAttributes requestAttributes	= iterRequestAttributes.next();
-                        Iterator<Attribute> iterAttributes	= requestAttributes.getAttributes(pipRequest.getAttributeId());
-                        while (iterAttributes.hasNext()) {
-                                Attribute attribute	= iterAttributes.next();
-                                if (attribute.getValues().size() > 0 && (pipRequest.getIssuer() == null || pipRequest.getIssuer().equals(attribute.getIssuer()))) {
-                                        /*
-                                         * If all of the attribute values in the given Attribute match the requested data type, we can just return
-                                         * the whole Attribute as part of the response.
-                                         */
-                                        boolean bAllMatch							= true;
-                                        for (AttributeValue<?> attributeValue: attribute.getValues()) {
-                                                if (!pipRequest.getDataTypeId().equals(attributeValue.getDataTypeId())) {
-                                                        bAllMatch	= false;
-                                                        break;
-                                                }
-                                        }
-                                        if (bAllMatch) {
-                                                if (pipResponse == null) {
-                                                        pipResponse	= new StdMutablePIPResponse(attribute);
-                                                } else {
-                                                        pipResponse.addAttribute(attribute);
-                                                }
-                                        } else {
-                                                /*
-                                                 * Only a subset of the values match, so we have to construct a new Attribute containing only the matching
-                                                 * values.
-                                                 */
-                                                List<AttributeValue<?>> listAttributeValues	= null;
-                                                for (AttributeValue<?> attributeValue: attribute.getValues()) {
-                                                        if (pipRequest.getDataTypeId().equals(attributeValue.getDataTypeId())) {
-                                                                if (listAttributeValues == null) {
-                                                                        listAttributeValues	= new ArrayList<AttributeValue<?>>();
-                                                                }
-                                                                listAttributeValues.add(attributeValue);
-                                                        }
-                                                }
-                                                if (listAttributeValues != null) {
-                                                        if (pipResponse == null) {
-                                                                pipResponse	= new StdMutablePIPResponse();
-                                                        }
-                                                        pipResponse.addAttribute(new StdMutableAttribute(attribute.getCategory(), attribute.getAttributeId(), listAttributeValues, attribute.getIssuer(), attribute.getIncludeInResults()));
-                                                }
-                                        }
-                                }
+        while (iterRequestAttributes.hasNext()) {
+            RequestAttributes requestAttributes	= iterRequestAttributes.next();
+            Iterator<Attribute> iterAttributes	= requestAttributes.getAttributes(pipRequest.getAttributeId());
+            while (iterAttributes.hasNext()) {
+                Attribute attribute	= iterAttributes.next();
+                if (attribute.getValues().size() > 0 && (pipRequest.getIssuer() == null || pipRequest.getIssuer().equals(attribute.getIssuer()))) {
+                    /*
+                     * If all of the attribute values in the given Attribute match the requested data type, we can just return
+                     * the whole Attribute as part of the response.
+                     */
+                    boolean bAllMatch							= true;
+                    for (AttributeValue<?> attributeValue: attribute.getValues()) {
+                        if (!pipRequest.getDataTypeId().equals(attributeValue.getDataTypeId())) {
+                            bAllMatch	= false;
+                            break;
                         }
-                }
-                
-                if (pipResponse == null) {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                } else {
-                        return pipResponse;
-                }
-        }
-
-        @Override
-        public Collection<PIPRequest> attributesRequired() {
-                return Collections.emptyList();
-        }
-
-        @Override
-        public Collection<PIPRequest> attributesProvided() {
-                Set<PIPRequest> providedAttributes = new HashSet<PIPRequest>();
-                for (RequestAttributes attributes : this.request.getRequestAttributes()) {
-                        for (Attribute attribute : attributes.getAttributes()) {
-                                Set<Identifier> datatypes = new HashSet<Identifier>();
-                                for (AttributeValue<?> value : attribute.getValues()) {
-                                        datatypes.add(value.getDataTypeId());
-                                }
-                                for (Identifier dt : datatypes) {
-                                        providedAttributes.add(new StdPIPRequest(attribute.getCategory(), attribute.getAttributeId(), dt, attribute.getIssuer()));
-                                }
+                    }
+                    if (bAllMatch) {
+                        if (pipResponse == null) {
+                            pipResponse	= new StdMutablePIPResponse(attribute);
+                        } else {
+                            pipResponse.addAttribute(attribute);
                         }
+                    } else {
+                        /*
+                         * Only a subset of the values match, so we have to construct a new Attribute containing only the matching
+                         * values.
+                         */
+                        List<AttributeValue<?>> listAttributeValues	= null;
+                        for (AttributeValue<?> attributeValue: attribute.getValues()) {
+                            if (pipRequest.getDataTypeId().equals(attributeValue.getDataTypeId())) {
+                                if (listAttributeValues == null) {
+                                    listAttributeValues	= new ArrayList<AttributeValue<?>>();
+                                }
+                                listAttributeValues.add(attributeValue);
+                            }
+                        }
+                        if (listAttributeValues != null) {
+                            if (pipResponse == null) {
+                                pipResponse	= new StdMutablePIPResponse();
+                            }
+                            pipResponse.addAttribute(new StdMutableAttribute(attribute.getCategory(), attribute.getAttributeId(), listAttributeValues, attribute.getIssuer(), attribute.getIncludeInResults()));
+                        }
+                    }
                 }
-                return providedAttributes;
+            }
         }
 
+        if (pipResponse == null) {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
+        } else {
+            return pipResponse;
+        }
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesRequired() {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesProvided() {
+        Set<PIPRequest> providedAttributes = new HashSet<PIPRequest>();
+        for (RequestAttributes attributes : this.request.getRequestAttributes()) {
+            for (Attribute attribute : attributes.getAttributes()) {
+                Set<Identifier> datatypes = new HashSet<Identifier>();
+                for (AttributeValue<?> value : attribute.getValues()) {
+                    datatypes.add(value.getDataTypeId());
+                }
+                for (Identifier dt : datatypes) {
+                    providedAttributes.add(new StdPIPRequest(attribute.getCategory(), attribute.getAttributeId(), dt, attribute.getIssuer()));
+                }
+            }
+        }
+        return providedAttributes;
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/StdConfigurableEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/StdConfigurableEngine.java
index d0e2e7a..7d7e67c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/StdConfigurableEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/StdConfigurableEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,69 +40,69 @@
 /**
  * StdConfigurableEngine implements the {@link ConfigurableEngine} interface to automatically
  * process the standard name, description, and issuer properties.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public abstract class StdConfigurableEngine implements ConfigurableEngine {
-        public static final String PROP_NAME			= "name";
-        public static final String PROP_DESCRIPTION		= "description";
-        public static final String PROP_ISSUER			= "issuer";
-        public static final String PROP_CACHESPEC		= "cacheSpec";
-        
-        private String name;
-        private String description;
-        private String issuer;
-        private Cache<String,PIPResponse> cache;
-        
-        public StdConfigurableEngine() {
-        }
+    public static final String PROP_NAME			= "name";
+    public static final String PROP_DESCRIPTION		= "description";
+    public static final String PROP_ISSUER			= "issuer";
+    public static final String PROP_CACHESPEC		= "cacheSpec";
 
-        @Override
-        public String getName() {
-                return this.name;
-        }
-        
-        public void setName(String nameIn) {
-                this.name	= nameIn;
-        }
+    private String name;
+    private String description;
+    private String issuer;
+    private Cache<String,PIPResponse> cache;
 
-        @Override
-        public String getDescription() {
-                return this.description;
-        }
-        
-        public void setDescription(String descriptionIn) {
-                this.description	= descriptionIn;
-        }
-        
-        public String getIssuer() {
-                return this.issuer;
-        }
-        
-        public void setIssuer(String issuerIn) {
-                this.issuer	= issuerIn;
-        }
+    public StdConfigurableEngine() {
+    }
 
-        public Cache<String, PIPResponse> getCache() {
-                return cache;
-        }
+    @Override
+    public String getName() {
+        return this.name;
+    }
 
-        public void setCache(Cache<String, PIPResponse> cache) {
-                this.cache = cache;
-        }
+    public void setName(String nameIn) {
+        this.name	= nameIn;
+    }
 
-        @Override
-        public void configure(String id, Properties properties) throws PIPException {
-                this.setName(properties.getProperty(id + "." + PROP_NAME, id));
-                this.setDescription(properties.getProperty(id + "." + PROP_DESCRIPTION));
-                this.setIssuer(properties.getProperty(id + "." + PROP_ISSUER));
-                /*
-                 * Configure the cache IF it is defined
-                 */
-                if (properties.getProperty(id + "." + PROP_CACHESPEC) != null) {
-                        this.cache	= CacheBuilder.from(properties.getProperty(id + "." + PROP_CACHESPEC)).build();
-                }
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
+
+    public void setDescription(String descriptionIn) {
+        this.description	= descriptionIn;
+    }
+
+    public String getIssuer() {
+        return this.issuer;
+    }
+
+    public void setIssuer(String issuerIn) {
+        this.issuer	= issuerIn;
+    }
+
+    public Cache<String, PIPResponse> getCache() {
+        return cache;
+    }
+
+    public void setCache(Cache<String, PIPResponse> cache) {
+        this.cache = cache;
+    }
+
+    @Override
+    public void configure(String id, Properties properties) throws PIPException {
+        this.setName(properties.getProperty(id + "." + PROP_NAME, id));
+        this.setDescription(properties.getProperty(id + "." + PROP_DESCRIPTION));
+        this.setIssuer(properties.getProperty(id + "." + PROP_ISSUER));
+        /*
+         * Configure the cache IF it is defined
+         */
+        if (properties.getProperty(id + "." + PROP_CACHESPEC) != null) {
+            this.cache	= CacheBuilder.from(properties.getProperty(id + "." + PROP_CACHESPEC)).build();
         }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/CSVEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/CSVEngine.java
index e606d95..092491f 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/CSVEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/CSVEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -66,423 +66,422 @@
 
 public class CSVEngine extends StdConfigurableEngine {
 
-        protected Log logger	= LogFactory.getLog(this.getClass());
-        /*
-         * Files that are smaller than this number are read into memory during startup.
-         * Larger files are read one line at a time as needed to avoid overloading the JVM memory limit.
-         */
-        public static final long	DEFAULT_MAX_FILE_SIZE_FOR_READALL = 100000000;
-        
-        public static final String PROP_CLASSNAME		= "classname";
+    protected Log logger	= LogFactory.getLog(this.getClass());
+    /*
+     * Files that are smaller than this number are read into memory during startup.
+     * Larger files are read one line at a time as needed to avoid overloading the JVM memory limit.
+     */
+    public static final long	DEFAULT_MAX_FILE_SIZE_FOR_READALL = 100000000;
 
-        public static final String PROP_MAXSIZE			= "maxsize";
-        public static final String PROP_SOURCE			= "source";
-        public static final String PROP_DELIMITER		= "delimiter";
-        public static final String PROP_QUOTE			= "quote";
-        public static final String PROP_SKIP			= "skip";
-        
-        public static final String PROP_RESOLVERS		= "resolvers";
-        public static final String PROP_RESOLVER		= "resolver";
+    public static final String PROP_CLASSNAME		= "classname";
 
-        private static DataTypeFactory dataTypeFactory		= null;
-        
-        static {
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                }
-                catch (FactoryException fx) {
-                        throw new RuntimeException(fx);
-                }
-        }
-        
-        //
-        // Values read from the properties file for use in managing the CSV file
-        //
-        private long	maximumSize = DEFAULT_MAX_FILE_SIZE_FOR_READALL;
-        private File	csvSourceFile;
-        private char	csvDelimiter;
-        private char	csvQuote;
-        private int		csvSkip;
-        //
-        // big files must be read one line at a time; small files are read in all at once
-        //
-        private boolean fileIsBig = false;
-        //
-        // small files get all lines read at once into this list
-        //
-        private List<String[]> allLines = null;
+    public static final String PROP_MAXSIZE			= "maxsize";
+    public static final String PROP_SOURCE			= "source";
+    public static final String PROP_DELIMITER		= "delimiter";
+    public static final String PROP_QUOTE			= "quote";
+    public static final String PROP_SKIP			= "skip";
 
-        //
-        // Our list of resolvers
-        //
-        private List<CSVResolver> csvResolvers = new ArrayList<CSVResolver>();
-        
-        public CSVEngine() {
-        }
-        
-        /**
-         * Helper to read the top-level propertied for the CSV file as-a-whole
-         * 
-         * @param id
-         * @param properties
-         * @throws com.att.research.xacml.api.pip.PIPException
-         */
-        private void readCSVFileConfiguration(String id, Properties properties) throws PIPException {
-                
-                String prefix = id + ".";
-                //
-                // Is there a max filesize to read into memory?
-                //
-                String maxSize = properties.getProperty(prefix + PROP_MAXSIZE, Long.toString(DEFAULT_MAX_FILE_SIZE_FOR_READALL));
-                try {
-                        this.maximumSize = Long.parseLong(maxSize);
-                } catch (NumberFormatException e) {
-                        String message = this.getName() + ": The maximum size specified is NOT parseable: " + e.getLocalizedMessage();
-                        this.logger.error(message);
-                        this.maximumSize = DEFAULT_MAX_FILE_SIZE_FOR_READALL;
-                }
-                //
-                // Get the file source
-                //
-                String sourcePathString = properties.getProperty(prefix + PROP_SOURCE);
-                if (sourcePathString == null || sourcePathString.length() == 0) {
-                        String message = this.getName() + ": No csv.source parameter given";
-                        logger.error(message);
-                        throw new PIPException(message);
-                }
-                //
-                // Now check the size of that file (and if it exists)
-                //
-                csvSourceFile = new File(sourcePathString);
-                if ( ! csvSourceFile.exists() || csvSourceFile.length() == 0) {
-                        String message = this.getName() + ": The csv.source '" + csvSourceFile.getAbsolutePath() + "' does not exist or has no content";
-                        logger.error(message);
-                        throw new PIPException(message);
-                }
-                if (csvSourceFile.length() > this.maximumSize) {
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("File size is greater than max allowed (" + this.maximumSize + "): " + csvSourceFile.length());
-                        }
-                        fileIsBig = true;
-                }
-                //
-                // Get the properties for CSVReader
-                //
-                String tmpString = properties.getProperty(prefix + PROP_DELIMITER);
-                if (tmpString == null || tmpString.length() != 1) {
-                        String message = this.getName() + ": The csv.delimiter must exist and be exactly 1 character";
-                        logger.error(message);
-                        throw new PIPException(message);
-                }
-                csvDelimiter = tmpString.charAt(0);
-                
-                tmpString = properties.getProperty(prefix + PROP_QUOTE);
-                if (tmpString == null || tmpString.length() != 1) {
-                        String message = this.getName() + ": The csv.quote must exist and be exactly 1 character";
-                        logger.error(message);
-                        throw new PIPException(message);
-                }
-                csvQuote = tmpString.charAt(0);
-                
-                tmpString = properties.getProperty(prefix + PROP_SKIP);
-                if (tmpString == null) {
-                        String message = this.getName() + ": The csv.skip must be set";
-                        logger.error(message);
-                        throw new PIPException(message);
-                }
-                try {
-                        csvSkip = Integer.parseInt(tmpString);
-                } catch (NumberFormatException e) {
-                        String message = this.getName() + ": The csv.skip value of '" + tmpString + "' cannot be converted to integer";
-                        logger.error(message);
-                        throw new PIPException(message);
-                }
-        }
-        
-        @Override
-        public void configure(String id, Properties properties) throws PIPException {
-                //
-                // Get our standard configurable properties
-                //
-                super.configure(id, properties);
-                //
-                // Get the properties this class cares about
-                //
-                this.readCSVFileConfiguration(id, properties);
-                //
-                // Get resolvers
-                //
-                String propResolverPrefix	= id + "." + PROP_RESOLVERS;
-                String stringProp = properties.getProperty(propResolverPrefix);
-                if (stringProp == null || stringProp.isEmpty()) {
-                        this.logger.error("No '" + propResolverPrefix + "' property");
-                        throw new PIPException("No '" + propResolverPrefix + "' property");
-                }
-                //
-                // Go through all our resolvers
-                //
-                for (String resolverId : Splitter.on(',').trimResults().omitEmptyStrings().split(stringProp)) {
-                        this.createResolver(id + "." + PROP_RESOLVER + "." + resolverId, properties);
-                }
-                //
-                // If the file is small, we read it fully into memory.
-                //
-                if ( ! this.fileIsBig) {
-                        try (CSVReader csvReader = new CSVReader(new FileReader(csvSourceFile), csvDelimiter, csvQuote, csvSkip)) {
-                                this.allLines = csvReader.readAll();
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug(id + ": All lines read from csv file, size="+allLines.size());
-                                }
-                        } catch (IOException e) {
-                                String message = id + ": CSVReader unable to read csv.source '" + csvSourceFile.getAbsolutePath() + "': " + e;
-                                logger.error(message, e);
-                                throw new PIPException(message);
-                        }
-                }
-        }
+    public static final String PROP_RESOLVERS		= "resolvers";
+    public static final String PROP_RESOLVER		= "resolver";
 
-        /**
-         * Creates a new {@link com.att.research.xacml.std.pip.engines.csv.CSVResolver} by looking up the "classname"
-         * property for the given <code>String</code> resolver ID and then calling its <code>configure</code> method.
-         * 
-         * @param resolverId the <code>String</code> identifier of the resolver to configure
-         * @param properties the <code>Properties</code> to search for the "classname" and any resolver-specific properties
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating the <code>CSVResolver</code>.
-         */
-        protected void createResolver(String resolverId, Properties properties) throws PIPException {
-                String propPrefix	= resolverId + ".";
-                String resolverClassName	= properties.getProperty(propPrefix + PROP_CLASSNAME);
-                if (resolverClassName == null || resolverClassName.length() == 0) {
-                        this.logger.error("No '" + propPrefix + PROP_CLASSNAME + "' property.");
-                        throw new PIPException("No '" + propPrefix + PROP_CLASSNAME + "' property.");
-                }
-                try {
-                        Class<?> resolverClass	= Class.forName(resolverClassName);
-                        if (!CSVResolver.class.isAssignableFrom(resolverClass)) {
-                                this.logger.error("CSVResolver class " + propPrefix + " does not implement " + CSVResolver.class.getCanonicalName());
-                                throw new PIPException("CSVResolver class " + propPrefix + " does not implement " + CSVResolver.class.getCanonicalName());
-                                
-                        }
-                        //
-                        // Try to create the resolver
-                        //
-                        CSVResolver csvResolver	= CSVResolver.class.cast(resolverClass.newInstance());
-                        //
-                        // Make sure it can configure itself
-                        //
-                        csvResolver.configure(resolverId, properties, this.getIssuer());
-                        //
-                        // Good
-                        //
-                        this.csvResolvers.add(csvResolver);
-                } catch (Exception ex) {
-                        this.logger.error("Exception creating CSVResolver: " + ex.getMessage(), ex);
-                        throw new PIPException("Exception creating CSVResolver", ex);
-                }		
-        }
+    private static DataTypeFactory dataTypeFactory		= null;
 
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
-                //
-                // Do we have any resolvers defined?
-                //
-                if (this.csvResolvers.size() == 0) {
-                        throw new IllegalStateException(this.getClass().getCanonicalName() + " is not configured");
+    static {
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+        } catch (FactoryException fx) {
+            throw new RuntimeException(fx);
+        }
+    }
+
+    //
+    // Values read from the properties file for use in managing the CSV file
+    //
+    private long	maximumSize = DEFAULT_MAX_FILE_SIZE_FOR_READALL;
+    private File	csvSourceFile;
+    private char	csvDelimiter;
+    private char	csvQuote;
+    private int		csvSkip;
+    //
+    // big files must be read one line at a time; small files are read in all at once
+    //
+    private boolean fileIsBig = false;
+    //
+    // small files get all lines read at once into this list
+    //
+    private List<String[]> allLines = null;
+
+    //
+    // Our list of resolvers
+    //
+    private List<CSVResolver> csvResolvers = new ArrayList<CSVResolver>();
+
+    public CSVEngine() {
+    }
+
+    /**
+     * Helper to read the top-level propertied for the CSV file as-a-whole
+     *
+     * @param id
+     * @param properties
+     * @throws com.att.research.xacml.api.pip.PIPException
+     */
+    private void readCSVFileConfiguration(String id, Properties properties) throws PIPException {
+
+        String prefix = id + ".";
+        //
+        // Is there a max filesize to read into memory?
+        //
+        String maxSize = properties.getProperty(prefix + PROP_MAXSIZE, Long.toString(DEFAULT_MAX_FILE_SIZE_FOR_READALL));
+        try {
+            this.maximumSize = Long.parseLong(maxSize);
+        } catch (NumberFormatException e) {
+            String message = this.getName() + ": The maximum size specified is NOT parseable: " + e.getLocalizedMessage();
+            this.logger.error(message);
+            this.maximumSize = DEFAULT_MAX_FILE_SIZE_FOR_READALL;
+        }
+        //
+        // Get the file source
+        //
+        String sourcePathString = properties.getProperty(prefix + PROP_SOURCE);
+        if (sourcePathString == null || sourcePathString.length() == 0) {
+            String message = this.getName() + ": No csv.source parameter given";
+            logger.error(message);
+            throw new PIPException(message);
+        }
+        //
+        // Now check the size of that file (and if it exists)
+        //
+        csvSourceFile = new File(sourcePathString);
+        if ( ! csvSourceFile.exists() || csvSourceFile.length() == 0) {
+            String message = this.getName() + ": The csv.source '" + csvSourceFile.getAbsolutePath() + "' does not exist or has no content";
+            logger.error(message);
+            throw new PIPException(message);
+        }
+        if (csvSourceFile.length() > this.maximumSize) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("File size is greater than max allowed (" + this.maximumSize + "): " + csvSourceFile.length());
+            }
+            fileIsBig = true;
+        }
+        //
+        // Get the properties for CSVReader
+        //
+        String tmpString = properties.getProperty(prefix + PROP_DELIMITER);
+        if (tmpString == null || tmpString.length() != 1) {
+            String message = this.getName() + ": The csv.delimiter must exist and be exactly 1 character";
+            logger.error(message);
+            throw new PIPException(message);
+        }
+        csvDelimiter = tmpString.charAt(0);
+
+        tmpString = properties.getProperty(prefix + PROP_QUOTE);
+        if (tmpString == null || tmpString.length() != 1) {
+            String message = this.getName() + ": The csv.quote must exist and be exactly 1 character";
+            logger.error(message);
+            throw new PIPException(message);
+        }
+        csvQuote = tmpString.charAt(0);
+
+        tmpString = properties.getProperty(prefix + PROP_SKIP);
+        if (tmpString == null) {
+            String message = this.getName() + ": The csv.skip must be set";
+            logger.error(message);
+            throw new PIPException(message);
+        }
+        try {
+            csvSkip = Integer.parseInt(tmpString);
+        } catch (NumberFormatException e) {
+            String message = this.getName() + ": The csv.skip value of '" + tmpString + "' cannot be converted to integer";
+            logger.error(message);
+            throw new PIPException(message);
+        }
+    }
+
+    @Override
+    public void configure(String id, Properties properties) throws PIPException {
+        //
+        // Get our standard configurable properties
+        //
+        super.configure(id, properties);
+        //
+        // Get the properties this class cares about
+        //
+        this.readCSVFileConfiguration(id, properties);
+        //
+        // Get resolvers
+        //
+        String propResolverPrefix	= id + "." + PROP_RESOLVERS;
+        String stringProp = properties.getProperty(propResolverPrefix);
+        if (stringProp == null || stringProp.isEmpty()) {
+            this.logger.error("No '" + propResolverPrefix + "' property");
+            throw new PIPException("No '" + propResolverPrefix + "' property");
+        }
+        //
+        // Go through all our resolvers
+        //
+        for (String resolverId : Splitter.on(',').trimResults().omitEmptyStrings().split(stringProp)) {
+            this.createResolver(id + "." + PROP_RESOLVER + "." + resolverId, properties);
+        }
+        //
+        // If the file is small, we read it fully into memory.
+        //
+        if ( ! this.fileIsBig) {
+            try (CSVReader csvReader = new CSVReader(new FileReader(csvSourceFile), csvDelimiter, csvQuote, csvSkip)) {
+                this.allLines = csvReader.readAll();
+                if (logger.isDebugEnabled()) {
+                    logger.debug(id + ": All lines read from csv file, size="+allLines.size());
+                }
+            } catch (IOException e) {
+                String message = id + ": CSVReader unable to read csv.source '" + csvSourceFile.getAbsolutePath() + "': " + e;
+                logger.error(message, e);
+                throw new PIPException(message);
+            }
+        }
+    }
+
+    /**
+     * Creates a new {@link com.att.research.xacml.std.pip.engines.csv.CSVResolver} by looking up the "classname"
+     * property for the given <code>String</code> resolver ID and then calling its <code>configure</code> method.
+     *
+     * @param resolverId the <code>String</code> identifier of the resolver to configure
+     * @param properties the <code>Properties</code> to search for the "classname" and any resolver-specific properties
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating the <code>CSVResolver</code>.
+     */
+    protected void createResolver(String resolverId, Properties properties) throws PIPException {
+        String propPrefix	= resolverId + ".";
+        String resolverClassName	= properties.getProperty(propPrefix + PROP_CLASSNAME);
+        if (resolverClassName == null || resolverClassName.length() == 0) {
+            this.logger.error("No '" + propPrefix + PROP_CLASSNAME + "' property.");
+            throw new PIPException("No '" + propPrefix + PROP_CLASSNAME + "' property.");
+        }
+        try {
+            Class<?> resolverClass	= Class.forName(resolverClassName);
+            if (!CSVResolver.class.isAssignableFrom(resolverClass)) {
+                this.logger.error("CSVResolver class " + propPrefix + " does not implement " + CSVResolver.class.getCanonicalName());
+                throw new PIPException("CSVResolver class " + propPrefix + " does not implement " + CSVResolver.class.getCanonicalName());
+
+            }
+            //
+            // Try to create the resolver
+            //
+            CSVResolver csvResolver	= CSVResolver.class.cast(resolverClass.newInstance());
+            //
+            // Make sure it can configure itself
+            //
+            csvResolver.configure(resolverId, properties, this.getIssuer());
+            //
+            // Good
+            //
+            this.csvResolvers.add(csvResolver);
+        } catch (Exception ex) {
+            this.logger.error("Exception creating CSVResolver: " + ex.getMessage(), ex);
+            throw new PIPException("Exception creating CSVResolver", ex);
+        }
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
+        //
+        // Do we have any resolvers defined?
+        //
+        if (this.csvResolvers.size() == 0) {
+            throw new IllegalStateException(this.getClass().getCanonicalName() + " is not configured");
+        }
+        //
+        // Do any of our resolvers support this?
+        //
+        List<CSVResolver> resolvers = new ArrayList<CSVResolver>();
+        for (CSVResolver resolver : this.csvResolvers) {
+            if (resolver.supportRequest(pipRequest)) {
+                resolvers.add(resolver);
+            }
+        }
+        if (resolvers.size() == 0) {
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("does not support this pip request: " + pipRequest);
+            }
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
+        }
+        if (this.logger.isDebugEnabled()) {
+            this.logger.debug("supports this pip request: " + pipRequest);
+        }
+        //
+        // We have at least one, have the resolvers prepare themselves.
+        //
+        List<Map<Integer, List<AttributeValue<?>>>> listParameters = new ArrayList<Map<Integer, List<AttributeValue<?>>>>();
+        for (CSVResolver resolver : resolvers) {
+            Map<Integer, List<AttributeValue<?>>> map = resolver.getColumnParameterValues(this, pipRequest, pipFinder);
+            //
+            // If the resolver cannot find all its parameter values, then we
+            //
+            if (map == null || map.isEmpty()) {
+                this.logger.warn("Resolver could not find parameters.");
+                return StdPIPResponse.PIP_RESPONSE_EMPTY;
+            }
+            listParameters.add(map);
+        }
+        //
+        // Look at each line of the file to see if it matches the (non-unique) criteria in the parameters
+        // and add the value in the associated column from the CSV file to the list of response Attributes.
+        //
+        StdMutablePIPResponse mutablePIPResponse	= new StdMutablePIPResponse();
+        //
+        // for smaller files, this is the index in the allLines List
+        //
+        int lineIndex = 0;
+        //
+        // for big files we need to read one line at a time from the CSVReader
+        //
+        CSVReader csvReader = null;
+
+        try {
+            if (this.fileIsBig) {
+                csvReader = new CSVReader(new FileReader(csvSourceFile), csvDelimiter, csvQuote, csvSkip);
+            }
+
+            while (true) {
+                String[] line = null;
+                if (this.fileIsBig) {
+                    line = csvReader.readNext();
+                    if (line == null) {
+                        // end of file
+                        break;
+                    }
+                } else {
+                    if (lineIndex < this.allLines.size()) {
+                        line = this.allLines.get(lineIndex);
+                        lineIndex++;
+                    } else {
+                        //
+                        // end of (previously-read) list
+                        //
+                        break;
+                    }
                 }
                 //
-                // Do any of our resolvers support this?
+                // Does the line match?
                 //
-                List<CSVResolver> resolvers = new ArrayList<CSVResolver>();
-                for (CSVResolver resolver : this.csvResolvers) {
-                        if (resolver.supportRequest(pipRequest)) {
-                                resolvers.add(resolver);
-                        }
-                }
-                if (resolvers.size() == 0) {
-                        if (this.logger.isDebugEnabled()) {
-                                this.logger.debug("does not support this pip request: " + pipRequest);
-                        }
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                }
-                if (this.logger.isDebugEnabled()) {
-                        this.logger.debug("supports this pip request: " + pipRequest);
+                if (this.doesLineMatch(line, listParameters) == false) {
+                    continue;
                 }
                 //
-                // We have at least one, have the resolvers prepare themselves.
+                // Ask each resolver to return any attributes from the line
                 //
-                List<Map<Integer, List<AttributeValue<?>>>> listParameters = new ArrayList<Map<Integer, List<AttributeValue<?>>>>();
                 for (CSVResolver resolver : resolvers) {
-                        Map<Integer, List<AttributeValue<?>>> map = resolver.getColumnParameterValues(this, pipRequest, pipFinder);
-                        //
-                        // If the resolver cannot find all its parameter values, then we
-                        //
-                        if (map == null || map.isEmpty()) {
-                                this.logger.warn("Resolver could not find parameters.");
-                                return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                        }
-                        listParameters.add(map);
-                }
-                //
-                // Look at each line of the file to see if it matches the (non-unique) criteria in the parameters
-                // and add the value in the associated column from the CSV file to the list of response Attributes.
-                //
-                StdMutablePIPResponse mutablePIPResponse	= new StdMutablePIPResponse();
-                //
-                // for smaller files, this is the index in the allLines List
-                //
-                int lineIndex = 0;
-                //
-                // for big files we need to read one line at a time from the CSVReader
-                //
-                CSVReader csvReader = null;
-                
-                try {
-                        if (this.fileIsBig) {
-                                csvReader = new CSVReader(new FileReader(csvSourceFile), csvDelimiter, csvQuote, csvSkip);
-                        } 
-                        
-                        while (true) {
-                                String[] line = null;
-                                if (this.fileIsBig) {
-                                        line = csvReader.readNext();
-                                        if (line == null) {
-                                                // end of file
-                                                break;
-                                        }
-                                } else {
-                                        if (lineIndex < this.allLines.size()) {
-                                                line = this.allLines.get(lineIndex);
-                                                lineIndex++;
-                                        } else {
-                                                //
-                                                // end of (previously-read) list
-                                                //
-                                                break;
-                                        }
-                                }
-                                //
-                                // Does the line match?
-                                //
-                                if (this.doesLineMatch(line, listParameters) == false) {
-                                        continue;
-                                }
-                                //
-                                // Ask each resolver to return any attributes from the line
-                                //
-                                for (CSVResolver resolver : resolvers) {
-                                        List<Attribute> attributes = resolver.decodeResult(line);
-                                        if (attributes != null && attributes.size() > 0) {
-                                                if (this.logger.isDebugEnabled()) {
-                                                        this.logger.debug("resolver returned " + attributes.size() + " attributes");
-                                                }
-                                                mutablePIPResponse.addAttributes(attributes);
-                                        }
-                                }
-                        }
-                        //
-                        // Done reading the file
-                        //
+                    List<Attribute> attributes = resolver.decodeResult(line);
+                    if (attributes != null && attributes.size() > 0) {
                         if (this.logger.isDebugEnabled()) {
-                                this.logger.debug("Returning " + mutablePIPResponse.getAttributes().size() + " attributes");
-                                for (Attribute attribute : mutablePIPResponse.getAttributes()) {
-                                        this.logger.debug(System.lineSeparator() + AttributeUtils.prettyPrint(attribute));
-                                }
+                            this.logger.debug("resolver returned " + attributes.size() + " attributes");
                         }
-                        return new StdPIPResponse(mutablePIPResponse);			
-                } catch (Exception e) {
-                        String message = this.getName() + ": Error processing line: " + e;
-                        logger.error(message, e);
-                        return new StdPIPResponse(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, e.getMessage()));
-                } finally {
-                        if (csvReader != null) {
-                                try {
-                                        csvReader.close();
-                                } catch (IOException e) {
-                                        this.logger.error("Close CSV Reader: " + e.getLocalizedMessage());
-                                }
-                        }
+                        mutablePIPResponse.addAttributes(attributes);
+                    }
                 }
+            }
+            //
+            // Done reading the file
+            //
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("Returning " + mutablePIPResponse.getAttributes().size() + " attributes");
+                for (Attribute attribute : mutablePIPResponse.getAttributes()) {
+                    this.logger.debug(System.lineSeparator() + AttributeUtils.prettyPrint(attribute));
+                }
+            }
+            return new StdPIPResponse(mutablePIPResponse);
+        } catch (Exception e) {
+            String message = this.getName() + ": Error processing line: " + e;
+            logger.error(message, e);
+            return new StdPIPResponse(new StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR, e.getMessage()));
+        } finally {
+            if (csvReader != null) {
+                try {
+                    csvReader.close();
+                } catch (IOException e) {
+                    this.logger.error("Close CSV Reader: " + e.getLocalizedMessage());
+                }
+            }
         }
+    }
 
-        protected boolean doesLineMatch(String[] line, List<Map<Integer, List<AttributeValue<?>>>> listParameters) {
-                for (Map<Integer, List<AttributeValue<?>>> map : listParameters) {
-                        for (Integer column : map.keySet()) {
-                                //
-                                // Sanity check, we should have the required number of columns
-                                //
-                                if (column >= line.length) {
-                                        return false;
-                                }
-                                //
-                                // Does it have a value?
-                                //
-                                String lineValue = line[column];
-                                if (lineValue.length() == 0) {
-                                        return false;
-                                }
-                                //
-                                // Now check the value
-                                //
-                                boolean foundMatch = false;
-                                for (AttributeValue<?> value : map.get(column)) {
-                                        DataType<?> dt = dataTypeFactory.getDataType(value.getDataTypeId());
-                                        try {
-                                                //
-                                                // Convert the value. NOTE: This may be time-consuming as opposed to
-                                                // converting the parameter value to a String once and then doing string
-                                                // comparisons. But, using a CSV is already a performance issue and should
-                                                // only be used for testing purposes or very small data sets. Use of a cache
-                                                // can help performance if the CSV file is necessary in a production environment.
-                                                //
-                                                Object convertedValue = dt.convert(lineValue);
-                                                if (convertedValue.equals(value.getValue())) {
-                                                        //
-                                                        // It matches
-                                                        //
-                                                        foundMatch = true;
-                                                        break;
-                                                }
-                                        } catch (DataTypeException e) {
-                                                String message = column + " could not convert lineValue to " + dt.getId();
-                                                this.logger.error(message);
-                                        }
-                                }
-                                //
-                                // Did a match happen?
-                                //
-                                if (foundMatch == false) {
-                                        /*
-                                        if (this.logger.isDebugEnabled()) {
-                                                this.logger.debug("Failed to find value for column " + column);
-                                        }
-                                        */
-                                        return false;
-                                }
-                        }
+    protected boolean doesLineMatch(String[] line, List<Map<Integer, List<AttributeValue<?>>>> listParameters) {
+        for (Map<Integer, List<AttributeValue<?>>> map : listParameters) {
+            for (Integer column : map.keySet()) {
+                //
+                // Sanity check, we should have the required number of columns
+                //
+                if (column >= line.length) {
+                    return false;
                 }
                 //
-                // If we get here, we found at least one match for all the
-                // parameters.
+                // Does it have a value?
                 //
-                return true;
-        }
-
-        @Override
-        public Collection<PIPRequest> attributesRequired() {
-                Set<PIPRequest> requiredAttributes = new HashSet<PIPRequest>();
-                for (CSVResolver resolver : this.csvResolvers) {
-                        resolver.attributesRequired(requiredAttributes);
+                String lineValue = line[column];
+                if (lineValue.length() == 0) {
+                    return false;
                 }
-                return requiredAttributes;
-        }
-
-        @Override
-        public Collection<PIPRequest> attributesProvided() {
-                Set<PIPRequest> attributes = new HashSet<PIPRequest>();
-                for (CSVResolver resolver : this.csvResolvers) {
-                        resolver.attributesProvided(attributes);
+                //
+                // Now check the value
+                //
+                boolean foundMatch = false;
+                for (AttributeValue<?> value : map.get(column)) {
+                    DataType<?> dt = dataTypeFactory.getDataType(value.getDataTypeId());
+                    try {
+                        //
+                        // Convert the value. NOTE: This may be time-consuming as opposed to
+                        // converting the parameter value to a String once and then doing string
+                        // comparisons. But, using a CSV is already a performance issue and should
+                        // only be used for testing purposes or very small data sets. Use of a cache
+                        // can help performance if the CSV file is necessary in a production environment.
+                        //
+                        Object convertedValue = dt.convert(lineValue);
+                        if (convertedValue.equals(value.getValue())) {
+                            //
+                            // It matches
+                            //
+                            foundMatch = true;
+                            break;
+                        }
+                    } catch (DataTypeException e) {
+                        String message = column + " could not convert lineValue to " + dt.getId();
+                        this.logger.error(message);
+                    }
                 }
-                return attributes;
+                //
+                // Did a match happen?
+                //
+                if (foundMatch == false) {
+                    /*
+                    if (this.logger.isDebugEnabled()) {
+                            this.logger.debug("Failed to find value for column " + column);
+                    }
+                    */
+                    return false;
+                }
+            }
         }
+        //
+        // If we get here, we found at least one match for all the
+        // parameters.
+        //
+        return true;
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesRequired() {
+        Set<PIPRequest> requiredAttributes = new HashSet<PIPRequest>();
+        for (CSVResolver resolver : this.csvResolvers) {
+            resolver.attributesRequired(requiredAttributes);
+        }
+        return requiredAttributes;
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesProvided() {
+        Set<PIPRequest> attributes = new HashSet<PIPRequest>();
+        for (CSVResolver resolver : this.csvResolvers) {
+            resolver.attributesProvided(attributes);
+        }
+        return attributes;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/CSVResolver.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/CSVResolver.java
index 049adf5..f8fd85e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/CSVResolver.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/CSVResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,40 +45,40 @@
  * CSVResolver is the interface used by the {@link CSVEngine} to
  * create list of column parameters to check for XACML attribute requests and convert the results
  * into XACML attributes.
- * 
+ *
  * @author pameladragosh
  *
  */
 public interface CSVResolver extends ConfigurableResolver {
 
-        /**
-         * Method to determine if resolver can support the PIPRequest
-         * 
-         * @param pipRequest
-         * @return true if the resolver can provide the PIPRequest attribute
-         */
-        boolean supportRequest(PIPRequest pipRequest);
+    /**
+     * Method to determine if resolver can support the PIPRequest
+     *
+     * @param pipRequest
+     * @return true if the resolver can provide the PIPRequest attribute
+     */
+    boolean supportRequest(PIPRequest pipRequest);
 
-        /**
-         * Returns a mapping of column's to a list of attribute values. The PIPEngine uses the map
-         * to determine if a line from a CSV file matches the given values. For columns with multiple
-         * possible values, only one value needs to match.
-         * 
-         * @param engine
-         * @param request
-         * @param finder
-         * @return
-         * @throws com.att.research.xacml.api.pip.PIPException
-         */
-        Map<Integer, List<AttributeValue<?>>>	getColumnParameterValues(PIPEngine engine, PIPRequest request, PIPFinder finder) throws PIPException;
+    /**
+     * Returns a mapping of column's to a list of attribute values. The PIPEngine uses the map
+     * to determine if a line from a CSV file matches the given values. For columns with multiple
+     * possible values, only one value needs to match.
+     *
+     * @param engine
+     * @param request
+     * @param finder
+     * @return
+     * @throws com.att.research.xacml.api.pip.PIPException
+     */
+    Map<Integer, List<AttributeValue<?>>>	getColumnParameterValues(PIPEngine engine, PIPRequest request, PIPFinder finder) throws PIPException;
 
-        /**
-         * Parses the CSV line and returns array of attributes.
-         * 
-         * @param line - line read from CSV file broken into fields.
-         * @return list of attributes 
-         * @throws com.att.research.xacml.api.pip.PIPException
-         */
-        List<Attribute>	decodeResult(String[] line)  throws PIPException;
+    /**
+     * Parses the CSV line and returns array of attributes.
+     *
+     * @param line - line read from CSV file broken into fields.
+     * @return list of attributes
+     * @throws com.att.research.xacml.api.pip.PIPException
+     */
+    List<Attribute>	decodeResult(String[] line)  throws PIPException;
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/ConfigurableCSVResolver.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/ConfigurableCSVResolver.java
index b10ed0d..2bbf13b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/ConfigurableCSVResolver.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/ConfigurableCSVResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -59,259 +59,258 @@
 
 public class ConfigurableCSVResolver implements CSVResolver {
 
-        public static final String PROP_PARAMETERS		= "parameters";
-        
-        public static final String PROP_ID				= "id";
-        public static final String PROP_DATATYPE		= "datatype";
-        public static final String PROP_CATEGORY		= "category";
-        public static final String PROP_ISSUER			= "issuer";
+    public static final String PROP_PARAMETERS		= "parameters";
 
-        public static final String PROP_COLUMN			= "column";
+    public static final String PROP_ID				= "id";
+    public static final String PROP_DATATYPE		= "datatype";
+    public static final String PROP_CATEGORY		= "category";
+    public static final String PROP_ISSUER			= "issuer";
 
-        private static DataTypeFactory dataTypeFactory		= null;
-        
-        static {
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                }
-                catch (FactoryException fx) {
-                        throw new RuntimeException(fx);
-                }
+    public static final String PROP_COLUMN			= "column";
+
+    private static DataTypeFactory dataTypeFactory		= null;
+
+    static {
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+        } catch (FactoryException fx) {
+            throw new RuntimeException(fx);
         }
-        
-        protected Log logger	= LogFactory.getLog(this.getClass());
+    }
 
-        private String id;
-        private String defaultIssuer;
-        
-        private Map<Integer, PIPRequest>	parameterMap = new HashMap<Integer, PIPRequest>();
-        private Map<Integer, PIPRequest>	fieldMap = new HashMap<Integer, PIPRequest>();	
+    protected Log logger	= LogFactory.getLog(this.getClass());
 
-        public ConfigurableCSVResolver() {
+    private String id;
+    private String defaultIssuer;
 
+    private Map<Integer, PIPRequest>	parameterMap = new HashMap<Integer, PIPRequest>();
+    private Map<Integer, PIPRequest>	fieldMap = new HashMap<Integer, PIPRequest>();
+
+    public ConfigurableCSVResolver() {
+
+    }
+
+    /**
+     * Helper to load the "parameters" that define the search criteria for the rows to find in the CSV file.
+     *
+     * @param id
+     * @param properties
+     * @throws com.att.research.xacml.api.pip.PIPException
+     */
+    private void readSearchParameters(String id, Properties properties) throws PIPException {
+        String parameterNamesString = properties.getProperty(id + "." + PROP_PARAMETERS);
+        if (parameterNamesString == null || parameterNamesString.length() == 0) {
+            String message = id + ".parameters must not be empty";
+            logger.error(message);
+            throw new PIPException(message);
         }
+        for (String parameterName : Splitter.on(',').omitEmptyStrings().trimResults().split(parameterNamesString)) {
+            String parameterIdPrefix = id + ".parameter." + parameterName;
+            String tmpString = properties.getProperty(parameterIdPrefix + "." + PROP_COLUMN);
+            if (tmpString == null || tmpString.length() == 0) {
+                String message = id + ": parameter " + parameterName + " missing number for '.column'";
+                logger.error(message);
+                throw new PIPException(message);
+            }
+            int column;
+            try {
+                column = Integer.parseInt(tmpString);
+            } catch (NumberFormatException e) {
+                String message = id + ": parameter " + parameterName + ".column is not a number in '" + tmpString + "'";
+                logger.error(message);
+                throw new PIPException(message);
+            }
 
-        /**
-         * Helper to load the "parameters" that define the search criteria for the rows to find in the CSV file.
-         * 
-         * @param id
-         * @param properties
-         * @throws com.att.research.xacml.api.pip.PIPException
-         */
-        private void readSearchParameters(String id, Properties properties) throws PIPException {
-                String parameterNamesString = properties.getProperty(id + "." + PROP_PARAMETERS);
-                if (parameterNamesString == null || parameterNamesString.length() == 0) {
-                        String message = id + ".parameters must not be empty";
-                        logger.error(message);
-                        throw new PIPException(message);
-                }
-                for (String parameterName : Splitter.on(',').omitEmptyStrings().trimResults().split(parameterNamesString)) {
-                        String parameterIdPrefix = id + ".parameter." + parameterName;
-                        String tmpString = properties.getProperty(parameterIdPrefix + "." + PROP_COLUMN);
-                        if (tmpString == null || tmpString.length() == 0) {
-                                String message = id + ": parameter " + parameterName + " missing number for '.column'";
-                                logger.error(message);
-                                throw new PIPException(message);
-                        }
-                        int column;
-                        try {
-                                column = Integer.parseInt(tmpString);
-                        } catch (NumberFormatException e) {
-                                String message = id + ": parameter " + parameterName + ".column is not a number in '" + tmpString + "'";
-                                logger.error(message);
-                                throw new PIPException(message);
-                        }
-                        
-                        PIPRequest request = Configurables.getPIPRequest(parameterIdPrefix, properties, null);
-                        if (request != null) {
-                                this.parameterMap.put(column, request);
-                        } else {
-                                String message = id + ": attribute not defined";
-                                this.logger.error(message);
-                                throw new PIPException(message);
-                        }
-                }
+            PIPRequest request = Configurables.getPIPRequest(parameterIdPrefix, properties, null);
+            if (request != null) {
+                this.parameterMap.put(column, request);
+            } else {
+                String message = id + ": attribute not defined";
+                this.logger.error(message);
+                throw new PIPException(message);
+            }
         }
+    }
 
-        /**
-         * Helper - read the definitions of the fields that can be returned from this PIP
-         * 
-         * @param id
-         * @param properties
-         * @throws com.att.research.xacml.api.pip.PIPException
-         */
-        private void readPIPRequestFieldDefinitions(String id, Properties properties) throws PIPException {
-                String fieldNamesString = properties.getProperty(id + ".fields");
-                if (fieldNamesString == null || fieldNamesString.length() == 0) {
-                        String message = id + ".fields must not be empty";
-                        logger.error(message);
-                        throw new PIPException(message);
-                }
-                for (String fieldName : Splitter.on(',').trimResults().omitEmptyStrings().split(fieldNamesString)) {
-                        String fieldIdPrefix = id + ".field." + fieldName;
-                        String tmpString = properties.getProperty(fieldIdPrefix + "." + "column");
-                        if (tmpString == null || tmpString.length() == 0) {
-                                String message = id + ": field " + fieldName + " missing number for '.column'";
-                                logger.error(message);
-                                throw new PIPException(message);
-                        }
-                        int column;
-                        try {
-                                column = Integer.parseInt(tmpString);
-                        } catch (NumberFormatException e) {
-                                String message = id + ": field " + fieldName + ".column is not a number in '" + tmpString + "'";
-                                logger.error(message);
-                                throw new PIPException(message);
-                        }
-                
-                        PIPRequest pipRequest = Configurables.getPIPRequest(fieldIdPrefix, properties, this.defaultIssuer);
-                        if (pipRequest != null) {
-                                this.fieldMap.put(column, pipRequest);
-                        } else {
-                                String message = id + ": attribute not defined column " + column;
-                                this.logger.error(message);
-                                throw new PIPException(message);
-                        }
-                }
+    /**
+     * Helper - read the definitions of the fields that can be returned from this PIP
+     *
+     * @param id
+     * @param properties
+     * @throws com.att.research.xacml.api.pip.PIPException
+     */
+    private void readPIPRequestFieldDefinitions(String id, Properties properties) throws PIPException {
+        String fieldNamesString = properties.getProperty(id + ".fields");
+        if (fieldNamesString == null || fieldNamesString.length() == 0) {
+            String message = id + ".fields must not be empty";
+            logger.error(message);
+            throw new PIPException(message);
         }
+        for (String fieldName : Splitter.on(',').trimResults().omitEmptyStrings().split(fieldNamesString)) {
+            String fieldIdPrefix = id + ".field." + fieldName;
+            String tmpString = properties.getProperty(fieldIdPrefix + "." + "column");
+            if (tmpString == null || tmpString.length() == 0) {
+                String message = id + ": field " + fieldName + " missing number for '.column'";
+                logger.error(message);
+                throw new PIPException(message);
+            }
+            int column;
+            try {
+                column = Integer.parseInt(tmpString);
+            } catch (NumberFormatException e) {
+                String message = id + ": field " + fieldName + ".column is not a number in '" + tmpString + "'";
+                logger.error(message);
+                throw new PIPException(message);
+            }
 
-        @Override
-        public void configure(String id, Properties properties, String defaultIssuer) throws PIPException {
-                //
-                // Save our ID (i.e. name)
-                //
-                this.id = id;
-                this.defaultIssuer = defaultIssuer;
-                //
-                // Get the "parameters", i.e. the fields to use for uniquely identifying a single row, from the properties
-                //
-                readSearchParameters(id, properties);
-                //
-                // Get the list of fields that the caller may ask for from a given row
-                //
-                readPIPRequestFieldDefinitions(id, properties);
+            PIPRequest pipRequest = Configurables.getPIPRequest(fieldIdPrefix, properties, this.defaultIssuer);
+            if (pipRequest != null) {
+                this.fieldMap.put(column, pipRequest);
+            } else {
+                String message = id + ": attribute not defined column " + column;
+                this.logger.error(message);
+                throw new PIPException(message);
+            }
         }
+    }
 
-        @Override
-        public void attributesRequired(Collection<PIPRequest> parameters) {
-                for (Integer key : this.parameterMap.keySet()) {
-                        parameters.add(new StdPIPRequest(this.parameterMap.get(key)));
-                }
+    @Override
+    public void configure(String id, Properties properties, String defaultIssuer) throws PIPException {
+        //
+        // Save our ID (i.e. name)
+        //
+        this.id = id;
+        this.defaultIssuer = defaultIssuer;
+        //
+        // Get the "parameters", i.e. the fields to use for uniquely identifying a single row, from the properties
+        //
+        readSearchParameters(id, properties);
+        //
+        // Get the list of fields that the caller may ask for from a given row
+        //
+        readPIPRequestFieldDefinitions(id, properties);
+    }
+
+    @Override
+    public void attributesRequired(Collection<PIPRequest> parameters) {
+        for (Integer key : this.parameterMap.keySet()) {
+            parameters.add(new StdPIPRequest(this.parameterMap.get(key)));
         }
+    }
 
-        @Override
-        public void attributesProvided(Collection<PIPRequest> attributes) {
-                for (Integer key : this.fieldMap.keySet()) {
-                        attributes.add(new StdPIPRequest(this.fieldMap.get(key)));
-                }
+    @Override
+    public void attributesProvided(Collection<PIPRequest> attributes) {
+        for (Integer key : this.fieldMap.keySet()) {
+            attributes.add(new StdPIPRequest(this.fieldMap.get(key)));
         }
+    }
 
-        @Override
-        public boolean supportRequest(PIPRequest pipRequest) {
-                for (Integer key : this.fieldMap.keySet()) {
-                        PIPRequest request = this.fieldMap.get(key);
-                        if (pipRequest == null) {
-                                return false;
-                        }
-                        if (request.equals(pipRequest)) {
-                                if (this.logger.isDebugEnabled()) {
-                                        this.logger.debug(this.id + " supports " + pipRequest);
-                                }
-                                return true;
-                        }
-                }
-                if (this.logger.isDebugEnabled()) {
-                        this.logger.debug(this.id + " does NOT support " + pipRequest);
-                }
+    @Override
+    public boolean supportRequest(PIPRequest pipRequest) {
+        for (Integer key : this.fieldMap.keySet()) {
+            PIPRequest request = this.fieldMap.get(key);
+            if (pipRequest == null) {
                 return false;
-        }
-
-        @Override
-        public Map<Integer, List<AttributeValue<?>>>	getColumnParameterValues(PIPEngine engine, PIPRequest request, PIPFinder finder) throws PIPException {
-                Map<Integer, List<AttributeValue<?>>> map = new HashMap<Integer, List<AttributeValue<?>>>();
-                for (Integer column : this.parameterMap.keySet()) {
-                        PIPRequest requestParameter = this.parameterMap.get(column);
-                        //
-                        // Get the parameter attributes
-                        //
-                        PIPResponse pipResponse = finder.getMatchingAttributes(requestParameter, null);
-                        if (pipResponse == null || ! pipResponse.getStatus().isOk() || pipResponse == StdPIPResponse.PIP_RESPONSE_EMPTY) {
-                                //
-                                // We must have at least one attribute value. If none exist, then return null
-                                //
-                                return null;
-                        }
-                        //
-                        // Accumulate the values
-                        //
-                        List<AttributeValue<?>> values = new ArrayList<AttributeValue<?>>();
-                        for (Attribute attr : pipResponse.getAttributes()) {
-                                values.addAll(attr.getValues());
-                        }
-                        //
-                        // Add it to our map
-                        //
-                        map.put(column, values);
+            }
+            if (request.equals(pipRequest)) {
+                if (this.logger.isDebugEnabled()) {
+                    this.logger.debug(this.id + " supports " + pipRequest);
                 }
-                return map;
+                return true;
+            }
         }
+        if (this.logger.isDebugEnabled()) {
+            this.logger.debug(this.id + " does NOT support " + pipRequest);
+        }
+        return false;
+    }
 
-        @Override
-        public List<Attribute> decodeResult(String[] line) throws PIPException {
+    @Override
+    public Map<Integer, List<AttributeValue<?>>>	getColumnParameterValues(PIPEngine engine, PIPRequest request, PIPFinder finder) throws PIPException {
+        Map<Integer, List<AttributeValue<?>>> map = new HashMap<Integer, List<AttributeValue<?>>>();
+        for (Integer column : this.parameterMap.keySet()) {
+            PIPRequest requestParameter = this.parameterMap.get(column);
+            //
+            // Get the parameter attributes
+            //
+            PIPResponse pipResponse = finder.getMatchingAttributes(requestParameter, null);
+            if (pipResponse == null || ! pipResponse.getStatus().isOk() || pipResponse == StdPIPResponse.PIP_RESPONSE_EMPTY) {
                 //
-                // Return all the fields
+                // We must have at least one attribute value. If none exist, then return null
                 //
-                List<Attribute> attributeList = new ArrayList<Attribute>();
-                for (Integer column : this.fieldMap.keySet()) {
-                        //
-                        // Sanity check, we should have the required number of columns
-                        //
-                        if (column >= line.length) {
-                                return null;
-                        }
-                        //
-                        // Does it have a value?
-                        //
-                        String value = line[column];
-                        if (value.length() == 0) {
-                                if (this.logger.isDebugEnabled()) {
-                                        this.logger.debug("Column " + column + " does not have a value.");
-                                }
-                                continue;
-                        }
-                        //
-                        // Convert it to appropriate data type
-                        //
-                        PIPRequest request = this.fieldMap.get(column);
-                        //
-                        // Does the attribute already exist?
-                        //
-                        StdMutableAttribute attribute = null;
-                        for (Attribute a : attributeList) {
-                                if (a.getCategory() == request.getCategory() && a.getAttributeId() == request.getAttributeId()) {
-                                        attribute = (StdMutableAttribute) a;
-                                }
-                        }
-                        if (attribute == null) {
-                                attribute = new StdMutableAttribute();
-                                attribute.setCategory(request.getCategory());
-                                attribute.setAttributeId(request.getAttributeId());
-                                attribute.setIssuer(request.getIssuer());
-                                attributeList.add(attribute);
-                        }
-                        //
-                        // Add it in
-                        //
-                        DataType<?> dt = dataTypeFactory.getDataType(request.getDataTypeId());
-                        try {
-                                attribute.addValue(dt.createAttributeValue(value));
-                        } catch (DataTypeException e) {
-                                String message = this.id + ": " + e.getLocalizedMessage();
-                                this.logger.error(message);
-                                return null;
-                        }
-                }
-                return attributeList;
+                return null;
+            }
+            //
+            // Accumulate the values
+            //
+            List<AttributeValue<?>> values = new ArrayList<AttributeValue<?>>();
+            for (Attribute attr : pipResponse.getAttributes()) {
+                values.addAll(attr.getValues());
+            }
+            //
+            // Add it to our map
+            //
+            map.put(column, values);
         }
+        return map;
+    }
+
+    @Override
+    public List<Attribute> decodeResult(String[] line) throws PIPException {
+        //
+        // Return all the fields
+        //
+        List<Attribute> attributeList = new ArrayList<Attribute>();
+        for (Integer column : this.fieldMap.keySet()) {
+            //
+            // Sanity check, we should have the required number of columns
+            //
+            if (column >= line.length) {
+                return null;
+            }
+            //
+            // Does it have a value?
+            //
+            String value = line[column];
+            if (value.length() == 0) {
+                if (this.logger.isDebugEnabled()) {
+                    this.logger.debug("Column " + column + " does not have a value.");
+                }
+                continue;
+            }
+            //
+            // Convert it to appropriate data type
+            //
+            PIPRequest request = this.fieldMap.get(column);
+            //
+            // Does the attribute already exist?
+            //
+            StdMutableAttribute attribute = null;
+            for (Attribute a : attributeList) {
+                if (a.getCategory() == request.getCategory() && a.getAttributeId() == request.getAttributeId()) {
+                    attribute = (StdMutableAttribute) a;
+                }
+            }
+            if (attribute == null) {
+                attribute = new StdMutableAttribute();
+                attribute.setCategory(request.getCategory());
+                attribute.setAttributeId(request.getAttributeId());
+                attribute.setIssuer(request.getIssuer());
+                attributeList.add(attribute);
+            }
+            //
+            // Add it in
+            //
+            DataType<?> dt = dataTypeFactory.getDataType(request.getDataTypeId());
+            try {
+                attribute.addValue(dt.createAttributeValue(value));
+            } catch (DataTypeException e) {
+                String message = this.id + ": " + e.getLocalizedMessage();
+                this.logger.error(message);
+                return null;
+            }
+        }
+        return attributeList;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/HyperCSVEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/HyperCSVEngine.java
index 73dd532..eebaab6 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/HyperCSVEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/HyperCSVEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,145 +42,140 @@
 import com.att.research.xacml.std.pip.engines.jdbc.JDBCEngine;
 
 public class HyperCSVEngine extends JDBCEngine {
-        
-        public static final String PROP_SOURCE	= "source";
-        public static final String PROP_TARGET	= "target";
-        public static final String PROP_DEFINITION	= "definition";
-                        
-        public static final String HYPER_DRIVER = "org.hsqldb.jdbcDriver";
-        public static final String HYPER_URL = "jdbc:hsqldb:mem:xacml";
-        public static final String HYPER_USER = "sa";
-        public static final String HYPER_PASS= "";
 
-        private static enum HyperInitState {
-                init,
-                completed,
-                failed
-        };
+    public static final String PROP_SOURCE	= "source";
+    public static final String PROP_TARGET	= "target";
+    public static final String PROP_DEFINITION	= "definition";
 
-        private String source,
-                                                                 target,
-                                                                 definition;
-        private HyperInitState hyperInitState = HyperInitState.init;
+    public static final String HYPER_DRIVER = "org.hsqldb.jdbcDriver";
+    public static final String HYPER_URL = "jdbc:hsqldb:mem:xacml";
+    public static final String HYPER_USER = "sa";
+    public static final String HYPER_PASS= "";
+
+    private static enum HyperInitState {
+        init,
+        completed,
+        failed
+    };
+
+    private String source,
+            target,
+            definition;
+    private HyperInitState hyperInitState = HyperInitState.init;
 
 
 
-        public HyperCSVEngine() {
+    public HyperCSVEngine() {
+    }
+
+    @Override
+    public void configure(String id, Properties properties) throws PIPException {
+        //hyper sql global option
+        System.getProperties().setProperty("textdb.allow_full_path", "true");
+
+        //JDBCEngine props that are fixed for a in-memory hypersql text db
+        String prop = null;
+        prop = id + "." + PROP_JDBC_DRIVER;
+        properties.setProperty(prop, HYPER_DRIVER);
+        prop = id + "." + PROP_JDBC_URL;
+        properties.setProperty(prop, HYPER_URL);
+        prop = id + "." + PROP_JDBC_CONN_USER;
+        properties.setProperty(prop, HYPER_USER);
+        prop = id + "." + PROP_JDBC_CONN_PASS;
+        properties.setProperty(prop, HYPER_PASS);
+
+        super.configure(id, properties);
+
+        prop = id + "." + PROP_DEFINITION;
+        if ((this.definition = properties.getProperty(prop)) == null) {
+            this.logger.error("Missing '" + prop + "' property");
+            throw new PIPException("Missing '" + prop + "' property");
         }
 
-        @Override
-        public void configure(String id, Properties properties) throws PIPException {
-                //hyper sql global option
-                System.getProperties().setProperty("textdb.allow_full_path", "true");
-        
-                //JDBCEngine props that are fixed for a in-memory hypersql text db
-                String prop = null;
-                prop = id + "." + PROP_JDBC_DRIVER;
-                properties.setProperty(prop, HYPER_DRIVER);
-                prop = id + "." + PROP_JDBC_URL;
-                properties.setProperty(prop, HYPER_URL);
-                prop = id + "." + PROP_JDBC_CONN_USER;
-                properties.setProperty(prop, HYPER_USER);
-                prop = id + "." + PROP_JDBC_CONN_PASS;
-                properties.setProperty(prop, HYPER_PASS);
-                
-                super.configure(id, properties);
-                
-                prop = id + "." + PROP_DEFINITION;
-                if ((this.definition = properties.getProperty(prop)) == null) {
-                        this.logger.error("Missing '" + prop + "' property");
-                        throw new PIPException("Missing '" + prop + "' property");
-                }
-
-                prop = id + "." + PROP_SOURCE;
-                if ((this.source = properties.getProperty(prop)) == null) {
-                        this.logger.error("Missing '" + prop + "' property");
-                        throw new PIPException("Missing '" + prop + "' property");
-                }
-                
-                prop = id + "." + PROP_TARGET;
-                if ((this.target = properties.getProperty(prop)) == null) {
-                        this.target = FileSystems.getDefault()
-                                                                                        .getPath(this.source).getFileName().toString();
-                        this.target = this.target.substring(0, this.target.indexOf('.'));
-                        this.logger.info("Target set to '" + this.target + "'");
-                }
-                //
-                // early initialization
-                //
-                try {
-                        getConnection().close();
-                }
-                catch(SQLException sqlx) {
-                        throw new PIPException("The HyperSQL initialization failed");
-                }
+        prop = id + "." + PROP_SOURCE;
+        if ((this.source = properties.getProperty(prop)) == null) {
+            this.logger.error("Missing '" + prop + "' property");
+            throw new PIPException("Missing '" + prop + "' property");
         }
 
-        /*
-         * Late initialization approach ..
-         */
-        @Override
-        protected Connection getConnection() throws PIPException {
-                switch(this.hyperInitState) {
-                        case init: 
-                                try {
-                                        hyperInit();
-                                        this.hyperInitState = HyperInitState.completed;
-                                }
-                                catch(PIPException pipx) {
-                                        this.hyperInitState = HyperInitState.failed;
-                                        throw pipx;
-                                }
-                        case completed:
-                                return super.getConnection();
-                        case failed:
-                                throw new PIPException("The HyperSQL initialization failed");
-                }
-                throw new PIPException("?? How did we get here");
+        prop = id + "." + PROP_TARGET;
+        if ((this.target = properties.getProperty(prop)) == null) {
+            this.target = FileSystems.getDefault()
+                          .getPath(this.source).getFileName().toString();
+            this.target = this.target.substring(0, this.target.indexOf('.'));
+            this.logger.info("Target set to '" + this.target + "'");
+        }
+        //
+        // early initialization
+        //
+        try {
+            getConnection().close();
+        } catch(SQLException sqlx) {
+            throw new PIPException("The HyperSQL initialization failed");
+        }
+    }
+
+    /*
+     * Late initialization approach ..
+     */
+    @Override
+    protected Connection getConnection() throws PIPException {
+        switch(this.hyperInitState) {
+        case init:
+            try {
+                hyperInit();
+                this.hyperInitState = HyperInitState.completed;
+            } catch(PIPException pipx) {
+                this.hyperInitState = HyperInitState.failed;
+                throw pipx;
+            }
+        case completed:
+            return super.getConnection();
+        case failed:
+            throw new PIPException("The HyperSQL initialization failed");
+        }
+        throw new PIPException("?? How did we get here");
+    }
+
+    public void hyperReset() {
+        this.hyperInitState = HyperInitState.init;
+    }
+
+    private void hyperInit() throws PIPException {
+        this.logger.info("Starting csv load from '" + this.source + "' in '" + this.target + "'");
+
+        StringBuilder createTable = new StringBuilder();
+        createTable.append("CREATE TEXT TABLE IF NOT EXISTS ")
+        .append(this.target)
+        .append("(")
+        .append(this.definition)
+        .append(")");
+
+        StringBuilder linkTable = new StringBuilder();
+        linkTable.append("SET TABLE ")
+        .append(this.target)
+        .append(" SOURCE ")
+        .append("\"")
+        .append(this.source)
+        .append(";ignore_first=true;all_quoted=true\"");
+
+        Connection conn = super.getConnection();
+        Statement stmt = null;
+        try {
+            stmt = conn.createStatement();
+            stmt.execute(createTable.toString());
+            stmt.execute(linkTable.toString());
+        } catch (SQLException sqlx) {
+            throw new PIPException("Failed to inititialize HyperSQL", sqlx);
+        } finally {
+            try {
+                if (stmt != null)
+                    stmt.close();
+                if (conn != null)
+                    conn.close();
+            } catch (SQLException sqlx) {}
         }
 
-        public void hyperReset() {
-                this.hyperInitState = HyperInitState.init;
-        }
-
-        private void hyperInit() throws PIPException {
-                this.logger.info("Starting csv load from '" + this.source + "' in '" + this.target + "'");
-
-                StringBuilder createTable = new StringBuilder();
-                createTable.append("CREATE TEXT TABLE IF NOT EXISTS ")
-                                                         .append(this.target)
-                                                         .append("(")
-                                                         .append(this.definition)
-                                                         .append(")");
-
-                StringBuilder linkTable = new StringBuilder();
-                linkTable.append("SET TABLE ")
-                                                 .append(this.target)
-                                                 .append(" SOURCE ")
-                                                 .append("\"")
-                                                 .append(this.source)
-                                                 .append(";ignore_first=true;all_quoted=true\"");
-
-                Connection conn = super.getConnection();
-                Statement stmt = null;
-                try {
-                        stmt = conn.createStatement();
-                        stmt.execute(createTable.toString());
-                        stmt.execute(linkTable.toString());
-                }
-                catch (SQLException sqlx) {
-                        throw new PIPException("Failed to inititialize HyperSQL", sqlx);
-                }
-                finally {
-                        try {
-                                if (stmt != null)
-                                        stmt.close();
-                                if (conn != null)
-                                        conn.close();
-                        }
-                        catch (SQLException sqlx) {}
-                }
-                        
-                this.logger.info("Loading '" + this.target + "' from '" + this.source + "' completed");
-        }
+        this.logger.info("Loading '" + this.target + "' from '" + this.source + "' completed");
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/XacmlCSVEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/XacmlCSVEngine.java
index b2b3b14..df55465 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/XacmlCSVEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/csv/XacmlCSVEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -69,181 +69,181 @@
  * CSVPIPEngine implements the {@link com.att.research.xacml.api.pip.PIPFinder} interface to find attributes
  * loaded from a text file containing the following fields:
  * 	category-id,attribute-id,datatype-id,issuer,value
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class XacmlCSVEngine implements ConfigurableEngine {
-        public static final String PROP_DESCRIPTION	= ".description";
-        public static final String PROP_FILE		= ".file";
-        
-        private static final Log logger	= LogFactory.getLog(XacmlCSVEngine.class);
-        
-        private String name;
-        private String description;
-        private Map<String,PIPResponse> cache	= new HashMap<String,PIPResponse>();
-        private List<Attribute> listAttributes	= new ArrayList<Attribute>();
-        private DataTypeFactory dataTypeFactory;
-        
-        protected DataTypeFactory getDataTypeFactory() throws FactoryException {
-                if (this.dataTypeFactory == null) {
-                        this.dataTypeFactory	= DataTypeFactory.newInstance();
-                }
-                return this.dataTypeFactory;
+    public static final String PROP_DESCRIPTION	= ".description";
+    public static final String PROP_FILE		= ".file";
+
+    private static final Log logger	= LogFactory.getLog(XacmlCSVEngine.class);
+
+    private String name;
+    private String description;
+    private Map<String,PIPResponse> cache	= new HashMap<String,PIPResponse>();
+    private List<Attribute> listAttributes	= new ArrayList<Attribute>();
+    private DataTypeFactory dataTypeFactory;
+
+    protected DataTypeFactory getDataTypeFactory() throws FactoryException {
+        if (this.dataTypeFactory == null) {
+            this.dataTypeFactory	= DataTypeFactory.newInstance();
         }
-        
-        protected static String generateKey(PIPRequest pipRequest) {
-                StringBuilder stringBuilder	= new StringBuilder(pipRequest.getCategory().toString());
-                stringBuilder.append('+');
-                stringBuilder.append(pipRequest.getAttributeId().toString());
-                stringBuilder.append('+');
-                stringBuilder.append(pipRequest.getDataTypeId().toString());
-                String issuer	= pipRequest.getIssuer();
-                if (issuer != null) {
-                        stringBuilder.append('+');
-                        stringBuilder.append(issuer);
-                }
-                return stringBuilder.toString();
+        return this.dataTypeFactory;
+    }
+
+    protected static String generateKey(PIPRequest pipRequest) {
+        StringBuilder stringBuilder	= new StringBuilder(pipRequest.getCategory().toString());
+        stringBuilder.append('+');
+        stringBuilder.append(pipRequest.getAttributeId().toString());
+        stringBuilder.append('+');
+        stringBuilder.append(pipRequest.getDataTypeId().toString());
+        String issuer	= pipRequest.getIssuer();
+        if (issuer != null) {
+            stringBuilder.append('+');
+            stringBuilder.append(issuer);
         }
-        
-        protected void store(String[] fields) throws FactoryException {
-                DataTypeFactory thisDataTypeFactory	= this.getDataTypeFactory();
-                Identifier identifierCategory		= new IdentifierImpl(fields[0]);
-                Identifier identifierAttribute		= new IdentifierImpl(fields[1]);
-                Identifier identifierDataType		= new IdentifierImpl(fields[2]);
-                String issuer						= (fields.length == 5 ? fields[3] : null);
-                String value						= fields[fields.length - 1];
-                
-                DataType<?> dataType				= thisDataTypeFactory.getDataType(identifierDataType);
-                if (dataType == null) {
-                        logger.error("Unknown data type " + identifierDataType.stringValue());
-                        return;
-                }
-                
-                AttributeValue<?> attributeValue	= null;
-                try {
-                        attributeValue	= dataType.createAttributeValue(value);
-                } catch (DataTypeException ex) {
-                        throw new FactoryException("DataTypeException creating AttributeValue", ex);
-                }
-                Attribute attribute					= new StdMutableAttribute(identifierCategory, identifierAttribute, attributeValue, issuer, false);
-                this.listAttributes.add(attribute);
+        return stringBuilder.toString();
+    }
+
+    protected void store(String[] fields) throws FactoryException {
+        DataTypeFactory thisDataTypeFactory	= this.getDataTypeFactory();
+        Identifier identifierCategory		= new IdentifierImpl(fields[0]);
+        Identifier identifierAttribute		= new IdentifierImpl(fields[1]);
+        Identifier identifierDataType		= new IdentifierImpl(fields[2]);
+        String issuer						= (fields.length == 5 ? fields[3] : null);
+        String value						= fields[fields.length - 1];
+
+        DataType<?> dataType				= thisDataTypeFactory.getDataType(identifierDataType);
+        if (dataType == null) {
+            logger.error("Unknown data type " + identifierDataType.stringValue());
+            return;
         }
-        
-        public XacmlCSVEngine() {
-                
+
+        AttributeValue<?> attributeValue	= null;
+        try {
+            attributeValue	= dataType.createAttributeValue(value);
+        } catch (DataTypeException ex) {
+            throw new FactoryException("DataTypeException creating AttributeValue", ex);
         }
-        
-        public void loadAttributes(File fileAttributes) throws IOException, ParseException, FactoryException {
-                if (fileAttributes != null) {
-                        if (!fileAttributes.exists()) {
-                                throw new FileNotFoundException("Attributes file " + fileAttributes.getAbsolutePath() + " not found.");
-                        } else if (!fileAttributes.canRead()) {
-                                throw new IOException("Attributes file " + fileAttributes.getAbsolutePath() + " is not readable.");
+        Attribute attribute					= new StdMutableAttribute(identifierCategory, identifierAttribute, attributeValue, issuer, false);
+        this.listAttributes.add(attribute);
+    }
+
+    public XacmlCSVEngine() {
+
+    }
+
+    public void loadAttributes(File fileAttributes) throws IOException, ParseException, FactoryException {
+        if (fileAttributes != null) {
+            if (!fileAttributes.exists()) {
+                throw new FileNotFoundException("Attributes file " + fileAttributes.getAbsolutePath() + " not found.");
+            } else if (!fileAttributes.canRead()) {
+                throw new IOException("Attributes file " + fileAttributes.getAbsolutePath() + " is not readable.");
+            }
+
+            try (BufferedReader bufferedReader	= new BufferedReader(new InputStreamReader(new FileInputStream(fileAttributes)))) {
+                String line;
+                while ((line = bufferedReader.readLine()) != null) {
+                    if (line.length() > 0) {
+                        String[] fields	= line.split("[|]",-1);
+                        if (fields.length < 4) {
+                            logger.warn("Not enough fields in record \"" + line + "\"");
+                            continue;
                         }
-                        
-                        try (BufferedReader bufferedReader	= new BufferedReader(new InputStreamReader(new FileInputStream(fileAttributes)))) {
-                                String line;
-                                while ((line = bufferedReader.readLine()) != null) {
-                                        if (line.length() > 0) {
-                                                String[] fields	= line.split("[|]",-1);
-                                                if (fields.length < 4) {
-                                                        logger.warn("Not enough fields in record \"" + line + "\"");
-                                                        continue;
-                                                }
-                                                this.store(fields);
-                                                
-                                        }
-                                }
-                        }
-                }
-        }
-        
-        protected Attribute findAttribute(PIPRequest pipRequest) {
-                Attribute attributeResult			= null;
-                Iterator<Attribute> iterAttributes	= this.listAttributes.iterator();
-                while ((attributeResult == null) && iterAttributes.hasNext()) {
-                        Attribute attributeTest	= iterAttributes.next();
-                        if (pipRequest.getCategory().equals(attributeTest.getCategory()) &&
-                                pipRequest.getAttributeId().equals(attributeTest.getAttributeId()) &&
-                                (pipRequest.getIssuer() == null || pipRequest.getIssuer().equals(attributeTest.getIssuer()))) {
-                                attributeResult	= attributeTest;
-                        }
-                }
-                return attributeResult;
-        }
+                        this.store(fields);
 
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
-                String pipRequestKey	= generateKey(pipRequest);
-                PIPResponse pipResponse	= this.cache.get(pipRequestKey);
-                if (pipResponse == null) {
-                        Attribute attributeMatch	= this.findAttribute(pipRequest);
-                        if (attributeMatch != null) {
-                                /*
-                                 * Iterate through the values and only return the ones that match the requested data type
-                                 */
-                                List<AttributeValue<?>> matchingValues	= new ArrayList<AttributeValue<?>>();
-                                Iterator<AttributeValue<?>> iterAttributeValues	= attributeMatch.getValues().iterator();
-                                while (iterAttributeValues.hasNext()) {
-                                        AttributeValue<?> attributeValue	= iterAttributeValues.next();
-                                        if (pipRequest.getDataTypeId().equals(attributeValue.getDataTypeId())) {
-                                                matchingValues.add(attributeValue);
-                                        }
-                                }
-                                if (matchingValues.size() > 0) {
-                                        Attribute attributeResponse	= new StdMutableAttribute(attributeMatch.getCategory(), attributeMatch.getAttributeId(), matchingValues, attributeMatch.getIssuer(), attributeMatch.getIncludeInResults());
-                                        pipResponse					= new StdPIPResponse(attributeResponse);
-                                        this.cache.put(pipRequestKey, pipResponse);
-                                }
-                        }
+                    }
                 }
-                if (pipResponse == null) {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                } else {
-                        return pipResponse;
+            }
+        }
+    }
+
+    protected Attribute findAttribute(PIPRequest pipRequest) {
+        Attribute attributeResult			= null;
+        Iterator<Attribute> iterAttributes	= this.listAttributes.iterator();
+        while ((attributeResult == null) && iterAttributes.hasNext()) {
+            Attribute attributeTest	= iterAttributes.next();
+            if (pipRequest.getCategory().equals(attributeTest.getCategory()) &&
+                    pipRequest.getAttributeId().equals(attributeTest.getAttributeId()) &&
+                    (pipRequest.getIssuer() == null || pipRequest.getIssuer().equals(attributeTest.getIssuer()))) {
+                attributeResult	= attributeTest;
+            }
+        }
+        return attributeResult;
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
+        String pipRequestKey	= generateKey(pipRequest);
+        PIPResponse pipResponse	= this.cache.get(pipRequestKey);
+        if (pipResponse == null) {
+            Attribute attributeMatch	= this.findAttribute(pipRequest);
+            if (attributeMatch != null) {
+                /*
+                 * Iterate through the values and only return the ones that match the requested data type
+                 */
+                List<AttributeValue<?>> matchingValues	= new ArrayList<AttributeValue<?>>();
+                Iterator<AttributeValue<?>> iterAttributeValues	= attributeMatch.getValues().iterator();
+                while (iterAttributeValues.hasNext()) {
+                    AttributeValue<?> attributeValue	= iterAttributeValues.next();
+                    if (pipRequest.getDataTypeId().equals(attributeValue.getDataTypeId())) {
+                        matchingValues.add(attributeValue);
+                    }
                 }
-        }
-
-        @Override
-        public String getName() {
-                return this.name;
-        }
-
-        @Override
-        public String getDescription() {
-                return this.description;
-        }
-
-        @Override
-        public void configure(String id, Properties properties) throws PIPException {
-                this.name	= id;
-                this.description	= properties.getProperty(id + PROP_DESCRIPTION);
-                if (this.description == null) {
-                        this.description	= "PIPEngine for the Conformance tests that loads attributes from a CSV file";
+                if (matchingValues.size() > 0) {
+                    Attribute attributeResponse	= new StdMutableAttribute(attributeMatch.getCategory(), attributeMatch.getAttributeId(), matchingValues, attributeMatch.getIssuer(), attributeMatch.getIncludeInResults());
+                    pipResponse					= new StdPIPResponse(attributeResponse);
+                    this.cache.put(pipRequestKey, pipResponse);
                 }
-                String pipFile		= properties.getProperty(id + PROP_FILE);
-                if (pipFile != null) {
-                        try {
-                                this.loadAttributes(new File(pipFile));
-                        } catch (Exception ex) {
-                                logger.error("Exception loading PIP file " + pipFile, ex);
-                                throw new PIPException("Exception loading PIP file " + pipFile, ex);
-                        }
-                }
+            }
         }
+        if (pipResponse == null) {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
+        } else {
+            return pipResponse;
+        }
+    }
 
-        @Override
-        public Collection<PIPRequest> attributesRequired() {
-                return Collections.emptyList();
-        }
+    @Override
+    public String getName() {
+        return this.name;
+    }
 
-        @Override
-        public Collection<PIPRequest> attributesProvided() {
-                //
-                // We could return the whole list of attributes
-                //
-                return Collections.emptyList();
+    @Override
+    public String getDescription() {
+        return this.description;
+    }
+
+    @Override
+    public void configure(String id, Properties properties) throws PIPException {
+        this.name	= id;
+        this.description	= properties.getProperty(id + PROP_DESCRIPTION);
+        if (this.description == null) {
+            this.description	= "PIPEngine for the Conformance tests that loads attributes from a CSV file";
         }
+        String pipFile		= properties.getProperty(id + PROP_FILE);
+        if (pipFile != null) {
+            try {
+                this.loadAttributes(new File(pipFile));
+            } catch (Exception ex) {
+                logger.error("Exception loading PIP file " + pipFile, ex);
+                throw new PIPException("Exception loading PIP file " + pipFile, ex);
+            }
+        }
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesRequired() {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public Collection<PIPRequest> attributesProvided() {
+        //
+        // We could return the whole list of attributes
+        //
+        return Collections.emptyList();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/ConfigurableJDBCResolver.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/ConfigurableJDBCResolver.java
index c346e65..fb95220 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/ConfigurableJDBCResolver.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/ConfigurableJDBCResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -69,417 +69,417 @@
 /**
  * Implements the {@link JDBCResolver} for SQL queries with parameters in
  * their prepared statements specified as XACML Attribute values.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class ConfigurableJDBCResolver implements JDBCResolver {
-        public static final String PROP_SELECT			= "select";
-        public static final String PROP_SELECT_FIELDS	= "fields";
-        public static final String PROP_SELECT_FIELD	= "field";
-        public static final String PROP_SELECT_PARAMETERS	= "parameters";
-        public static final String PROP_SELECT_PARAMETER	= "parameter";
-        
-        private Log logger									= LogFactory.getLog(this.getClass());
-        private String defaultIssuer;
-        private Set<PIPRequest> supportedRequests			= new HashSet<PIPRequest>();
-        private Set<PIPRequest> supportedRequestsNoIssuer	= new HashSet<PIPRequest>();
-        private Map<String,PIPRequest> mapFields			= new HashMap<String,PIPRequest>();
-        private String sqlQuery;
-        private List<PIPRequest> parameters					= new ArrayList<PIPRequest>();
-        private static DataTypeFactory dataTypeFactory		= null;
-        
-        static {
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                } catch (Exception ex) {
-                        LogFactory.getLog(ConfigurableJDBCResolver.class).error("Exception geting DataTypeFactory: " + ex.toString(), ex);
-                }
-        }
-        
-        /**
-         * Determines if the given {@link com.att.research.xacml.api.pip.PIPRequest} can be answered with this <code>ConfigurableJDBCResolver</code>.
-         * 
-         * @param pipRequest the <code>PIPRequest</code> to check
-         * @return true if the given <code>PIPRequest</code> is supported by this <code>ConfigurableJDBCResolver</code>, else false
-         */
-        protected boolean isSupported(PIPRequest pipRequest) {
-                if (pipRequest.getIssuer() == null) {
-                        return this.supportedRequestsNoIssuer.contains(pipRequest);
-                } else {
-                        return this.supportedRequests.contains(pipRequest);
-                }
-        }
-        
-        /**
-         * Creates a new <code>ConfigurableJDBCResolver</code> that can provide XACML Attributes for the given <code>Collection</code> of
-         * {@link com.att.research.xacml.api.pip.PIPRequests}s.  The mapping from database table field names to XACML Attributes is provided by the
-         * <code>fieldsIn</code> <code>Map</code>.  The SQL query <code>String</code> is provided by <code>sqlQueryIn</code>.  The query string may contain
-         * prepared statement parameter place-holders <code>('?')</code>.  The XACML Attributes whose values are used for those place-holders are provided 
-         * by the given <code>parametersIn</code> <code>List</code>.
-         * 
-         * @param supportedRequestsIn the <code>Collection</code> of <code>PIPRequest</code>s that are supported by the new <code>ConfiurableJDBCResolver</code>
-         * @param fieldsIn the <code>Map</code> from <code>String</code> field names to <code>PIPRequest</code>s in the database table
-         * @param sqlQueryIn the <code>String</code> SQL query that retrieves records that satisfy <code>PIPRequest</code>s
-         * @param parametersIn the <code>List</code> of <code>PIPRequest</code>s representing parameter values found in <code>sqlQueryIn</code>.
-         */
-        /*
-        public ConfigurableJDBCResolver(Collection<PIPRequest> supportedRequestsIn, Map<String,PIPRequest> fieldsIn, String sqlQueryIn, List<PIPRequest> parametersIn) {
-                this();
-                if (supportedRequestsIn != null) {
-                        this.supportedRequests.addAll(supportedRequestsIn);
-                        for (PIPRequest pipRequest : supportedRequestsIn) {
-                                if (pipRequest.getIssuer() != null) {
-                                        this.supportedRequestsNoIssuer.add(new StdPIPRequest(pipRequest.getCategory(), pipRequest.getAttributeId(), pipRequest.getDataTypeId()));
-                                } else {
-                                        this.supportedRequestsNoIssuer.add(pipRequest);
-                                }
-                        }
-                }
-                if (fieldsIn != null) {
-                        for (String field : fieldsIn.keySet()) {
-                                this.mapFields.put(field, fieldsIn.get(field));
-                        }
-                }
-                this.sqlQuery	= sqlQueryIn;
-                if (parametersIn != null) {
-                        this.parameters.addAll(parametersIn);
-                }
-        }
-        */
-        
-        public ConfigurableJDBCResolver() {
-                if (dataTypeFactory == null) {
-                        throw new IllegalStateException("No DataTypeFactory instance created");
-                }		
-        }
-        
-        public Map<String, PIPRequest> getMapFields() {
-                return mapFields;
-        }
+    public static final String PROP_SELECT			= "select";
+    public static final String PROP_SELECT_FIELDS	= "fields";
+    public static final String PROP_SELECT_FIELD	= "field";
+    public static final String PROP_SELECT_PARAMETERS	= "parameters";
+    public static final String PROP_SELECT_PARAMETER	= "parameter";
 
-        public List<PIPRequest> getParameters() {
-                return parameters;
+    private Log logger									= LogFactory.getLog(this.getClass());
+    private String defaultIssuer;
+    private Set<PIPRequest> supportedRequests			= new HashSet<PIPRequest>();
+    private Set<PIPRequest> supportedRequestsNoIssuer	= new HashSet<PIPRequest>();
+    private Map<String,PIPRequest> mapFields			= new HashMap<String,PIPRequest>();
+    private String sqlQuery;
+    private List<PIPRequest> parameters					= new ArrayList<PIPRequest>();
+    private static DataTypeFactory dataTypeFactory		= null;
+
+    static {
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+        } catch (Exception ex) {
+            LogFactory.getLog(ConfigurableJDBCResolver.class).error("Exception geting DataTypeFactory: " + ex.toString(), ex);
         }
-        
-        public Properties	generateProperties(String id, String select) {
-                return generateProperties(id, select, this.mapFields, this.parameters);
+    }
+
+    /**
+     * Determines if the given {@link com.att.research.xacml.api.pip.PIPRequest} can be answered with this <code>ConfigurableJDBCResolver</code>.
+     *
+     * @param pipRequest the <code>PIPRequest</code> to check
+     * @return true if the given <code>PIPRequest</code> is supported by this <code>ConfigurableJDBCResolver</code>, else false
+     */
+    protected boolean isSupported(PIPRequest pipRequest) {
+        if (pipRequest.getIssuer() == null) {
+            return this.supportedRequestsNoIssuer.contains(pipRequest);
+        } else {
+            return this.supportedRequests.contains(pipRequest);
         }
-        
-        public static Properties	generateProperties(String id, String select, Map<String, PIPRequest> mapFields, List<PIPRequest> parameters) {
-                Properties properties = new Properties();
-                //
-                // Set the select statement
-                //
-                properties.setProperty(Joiner.on('.').join(id, PROP_SELECT), select);
-                //
-                // Set the fields
-                //
-                if (mapFields.size() > 0) {
-                        properties.setProperty(Joiner.on('.').join(id, PROP_SELECT_FIELDS), Joiner.on(',').join(mapFields.keySet()));
-                        for (String field : mapFields.keySet()) {
-                                PIPRequest request = mapFields.get(field);
-                                String fieldPrefix = Joiner.on('.').join(id, PROP_SELECT_FIELD);
-                                properties.setProperty(fieldPrefix + ".id", request.getAttributeId().stringValue());
-                                properties.setProperty(fieldPrefix + ".datatype", request.getDataTypeId().stringValue());
-                                properties.setProperty(fieldPrefix + ".category", request.getCategory().stringValue());
-                                if (request.getIssuer() != null) {
-                                        properties.setProperty(fieldPrefix + ".issuer", request.getIssuer());
-                                }
-                        }
+    }
+
+    /**
+     * Creates a new <code>ConfigurableJDBCResolver</code> that can provide XACML Attributes for the given <code>Collection</code> of
+     * {@link com.att.research.xacml.api.pip.PIPRequests}s.  The mapping from database table field names to XACML Attributes is provided by the
+     * <code>fieldsIn</code> <code>Map</code>.  The SQL query <code>String</code> is provided by <code>sqlQueryIn</code>.  The query string may contain
+     * prepared statement parameter place-holders <code>('?')</code>.  The XACML Attributes whose values are used for those place-holders are provided
+     * by the given <code>parametersIn</code> <code>List</code>.
+     *
+     * @param supportedRequestsIn the <code>Collection</code> of <code>PIPRequest</code>s that are supported by the new <code>ConfiurableJDBCResolver</code>
+     * @param fieldsIn the <code>Map</code> from <code>String</code> field names to <code>PIPRequest</code>s in the database table
+     * @param sqlQueryIn the <code>String</code> SQL query that retrieves records that satisfy <code>PIPRequest</code>s
+     * @param parametersIn the <code>List</code> of <code>PIPRequest</code>s representing parameter values found in <code>sqlQueryIn</code>.
+     */
+    /*
+    public ConfigurableJDBCResolver(Collection<PIPRequest> supportedRequestsIn, Map<String,PIPRequest> fieldsIn, String sqlQueryIn, List<PIPRequest> parametersIn) {
+            this();
+            if (supportedRequestsIn != null) {
+                    this.supportedRequests.addAll(supportedRequestsIn);
+                    for (PIPRequest pipRequest : supportedRequestsIn) {
+                            if (pipRequest.getIssuer() != null) {
+                                    this.supportedRequestsNoIssuer.add(new StdPIPRequest(pipRequest.getCategory(), pipRequest.getAttributeId(), pipRequest.getDataTypeId()));
+                            } else {
+                                    this.supportedRequestsNoIssuer.add(pipRequest);
+                            }
+                    }
+            }
+            if (fieldsIn != null) {
+                    for (String field : fieldsIn.keySet()) {
+                            this.mapFields.put(field, fieldsIn.get(field));
+                    }
+            }
+            this.sqlQuery	= sqlQueryIn;
+            if (parametersIn != null) {
+                    this.parameters.addAll(parametersIn);
+            }
+    }
+    */
+
+    public ConfigurableJDBCResolver() {
+        if (dataTypeFactory == null) {
+            throw new IllegalStateException("No DataTypeFactory instance created");
+        }
+    }
+
+    public Map<String, PIPRequest> getMapFields() {
+        return mapFields;
+    }
+
+    public List<PIPRequest> getParameters() {
+        return parameters;
+    }
+
+    public Properties	generateProperties(String id, String select) {
+        return generateProperties(id, select, this.mapFields, this.parameters);
+    }
+
+    public static Properties	generateProperties(String id, String select, Map<String, PIPRequest> mapFields, List<PIPRequest> parameters) {
+        Properties properties = new Properties();
+        //
+        // Set the select statement
+        //
+        properties.setProperty(Joiner.on('.').join(id, PROP_SELECT), select);
+        //
+        // Set the fields
+        //
+        if (mapFields.size() > 0) {
+            properties.setProperty(Joiner.on('.').join(id, PROP_SELECT_FIELDS), Joiner.on(',').join(mapFields.keySet()));
+            for (String field : mapFields.keySet()) {
+                PIPRequest request = mapFields.get(field);
+                String fieldPrefix = Joiner.on('.').join(id, PROP_SELECT_FIELD);
+                properties.setProperty(fieldPrefix + ".id", request.getAttributeId().stringValue());
+                properties.setProperty(fieldPrefix + ".datatype", request.getDataTypeId().stringValue());
+                properties.setProperty(fieldPrefix + ".category", request.getCategory().stringValue());
+                if (request.getIssuer() != null) {
+                    properties.setProperty(fieldPrefix + ".issuer", request.getIssuer());
                 }
-                //
-                // Set the parameters
-                //
-                if (parameters.size() > 0) {
-                        String params = "1";
-                        for (int i = 2; i <= parameters.size(); i++) {
-                                params = params + "," + i; 
-                        }
-                        properties.setProperty(Joiner.on('.').join(id, PROP_SELECT_PARAMETERS), params);
-                        int position = 1;
-                        for (PIPRequest request : parameters) {
-                                String fieldPrefix = Joiner.on('.').join(id, PROP_SELECT_PARAMETER, position++);
-                                properties.setProperty(fieldPrefix + ".id", request.getAttributeId().stringValue());
-                                properties.setProperty(fieldPrefix + ".datatype", request.getDataTypeId().stringValue());
-                                properties.setProperty(fieldPrefix + ".category", request.getCategory().stringValue());
-                                if (request.getIssuer() != null) {
-                                        properties.setProperty(fieldPrefix + ".issuer", request.getIssuer());
-                                }
-                        }
+            }
+        }
+        //
+        // Set the parameters
+        //
+        if (parameters.size() > 0) {
+            String params = "1";
+            for (int i = 2; i <= parameters.size(); i++) {
+                params = params + "," + i;
+            }
+            properties.setProperty(Joiner.on('.').join(id, PROP_SELECT_PARAMETERS), params);
+            int position = 1;
+            for (PIPRequest request : parameters) {
+                String fieldPrefix = Joiner.on('.').join(id, PROP_SELECT_PARAMETER, position++);
+                properties.setProperty(fieldPrefix + ".id", request.getAttributeId().stringValue());
+                properties.setProperty(fieldPrefix + ".datatype", request.getDataTypeId().stringValue());
+                properties.setProperty(fieldPrefix + ".category", request.getCategory().stringValue());
+                if (request.getIssuer() != null) {
+                    properties.setProperty(fieldPrefix + ".issuer", request.getIssuer());
                 }
-                return properties;
+            }
+        }
+        return properties;
+    }
+
+    /*
+    protected PIPRequest getPIPRequest(String idPrefix, Properties properties) throws PIPException {
+            String stringProp	= idPrefix + PROP_ID;
+            String attributeId	= properties.getProperty(stringProp);
+            if (attributeId == null || attributeId.length() == 0) {
+                    this.logger.error("No '" + stringProp + "' property");
+                    throw new PIPException("No '" + stringProp + "' property");
+            }
+
+            stringProp			= idPrefix + PROP_DATATYPE;
+            String dataTypeId	= properties.getProperty(stringProp);
+            if (dataTypeId == null || dataTypeId.length() == 0) {
+                    this.logger.error("No '" + stringProp + "' property");
+                    throw new PIPException("No '" + stringProp + "' property");
+            }
+
+            stringProp			= idPrefix + PROP_CATEGORY;
+            String categoryId	= properties.getProperty(stringProp);
+            if (categoryId == null) {
+                    this.logger.error("No '" + stringProp + "' property");
+                    throw new PIPException("No '" + stringProp + "' property");
+            }
+
+            stringProp			= idPrefix + PROP_ISSUER;
+            String issuer		= properties.getProperty(stringProp);
+
+            return new StdPIPRequest(new IdentifierImpl(categoryId), new IdentifierImpl(attributeId), new IdentifierImpl(dataTypeId), issuer);
+    }
+    */
+
+    protected void configureField(String id, String fieldName, Properties properties) throws PIPException {
+        PIPRequest pipRequestField	= Configurables.getPIPRequest(id + "." + PROP_SELECT_FIELD + "." + fieldName, properties, this.defaultIssuer);
+        this.supportedRequests.add(pipRequestField);
+        this.supportedRequestsNoIssuer.add(new StdPIPRequest(pipRequestField.getCategory(), pipRequestField.getAttributeId(), pipRequestField.getDataTypeId()));
+        this.mapFields.put(fieldName, pipRequestField);
+    }
+
+    protected void configureParameter(String id, String parameterName, Properties properties) throws PIPException {
+        PIPRequest pipRequestParameter	= Configurables.getPIPRequest(id + "." + PROP_SELECT_PARAMETER + "." + parameterName, properties, null);
+        this.parameters.add(pipRequestParameter);
+    }
+
+    @Override
+    public void configure(String id, Properties properties, String defaultIssuer) throws PIPException {
+        /*
+         * Save our default issuer
+         */
+        this.defaultIssuer = defaultIssuer;
+        /*
+         * Get the SELECT statement to be used in the prepared statement
+         */
+        String idPrefix		= id + ".";
+        String stringProp	= idPrefix + PROP_SELECT;
+        this.sqlQuery		= properties.getProperty(stringProp);
+        if (this.sqlQuery == null || this.sqlQuery.length() == 0) {
+            this.logger.error("No '" + stringProp + "' property");
+            throw new PIPException("No '" + stringProp + "' property");
         }
 
         /*
-        protected PIPRequest getPIPRequest(String idPrefix, Properties properties) throws PIPException {
-                String stringProp	= idPrefix + PROP_ID;
-                String attributeId	= properties.getProperty(stringProp);
-                if (attributeId == null || attributeId.length() == 0) {
-                        this.logger.error("No '" + stringProp + "' property");
-                        throw new PIPException("No '" + stringProp + "' property");
-                }
-                
-                stringProp			= idPrefix + PROP_DATATYPE;
-                String dataTypeId	= properties.getProperty(stringProp);
-                if (dataTypeId == null || dataTypeId.length() == 0) {
-                        this.logger.error("No '" + stringProp + "' property");
-                        throw new PIPException("No '" + stringProp + "' property");			
-                }
-                
-                stringProp			= idPrefix + PROP_CATEGORY;
-                String categoryId	= properties.getProperty(stringProp);
-                if (categoryId == null) {
-                        this.logger.error("No '" + stringProp + "' property");
-                        throw new PIPException("No '" + stringProp + "' property");						
-                }
-                
-                stringProp			= idPrefix + PROP_ISSUER;
-                String issuer		= properties.getProperty(stringProp);
-                
-                return new StdPIPRequest(new IdentifierImpl(categoryId), new IdentifierImpl(attributeId), new IdentifierImpl(dataTypeId), issuer);
-        }
-*/
-
-        protected void configureField(String id, String fieldName, Properties properties) throws PIPException {
-                PIPRequest pipRequestField	= Configurables.getPIPRequest(id + "." + PROP_SELECT_FIELD + "." + fieldName, properties, this.defaultIssuer);
-                this.supportedRequests.add(pipRequestField);
-                this.supportedRequestsNoIssuer.add(new StdPIPRequest(pipRequestField.getCategory(), pipRequestField.getAttributeId(), pipRequestField.getDataTypeId()));
-                this.mapFields.put(fieldName, pipRequestField);
-        }
-        
-        protected void configureParameter(String id, String parameterName, Properties properties) throws PIPException {
-                PIPRequest pipRequestParameter	= Configurables.getPIPRequest(id + "." + PROP_SELECT_PARAMETER + "." + parameterName, properties, null);
-                this.parameters.add(pipRequestParameter);
-        }
-
-        @Override
-        public void configure(String id, Properties properties, String defaultIssuer) throws PIPException {
-                /*
-                 * Save our default issuer
-                 */
-                this.defaultIssuer = defaultIssuer;
-                /*
-                 * Get the SELECT statement to be used in the prepared statement
-                 */
-                String idPrefix		= id + ".";
-                String stringProp	= idPrefix + PROP_SELECT;
-                this.sqlQuery		= properties.getProperty(stringProp);
-                if (this.sqlQuery == null || this.sqlQuery.length() == 0) {
-                        this.logger.error("No '" + stringProp + "' property");
-                        throw new PIPException("No '" + stringProp + "' property");
-                }
-                
-                /*
-                 * Get the list of database columns returned by the query
-                 */
-                stringProp			= idPrefix + PROP_SELECT_FIELDS;
-                String fields		= properties.getProperty(stringProp);
-                if (fields == null || fields.length() == 0) {
-                        this.logger.error("No '" + stringProp + "' property");
-                        throw new PIPException("No '" + stringProp + "' property");
-                }
-                for (String field : Splitter.on(',').trimResults().omitEmptyStrings().split(fields)) {
-                        this.configureField(id, field, properties);
-                }
-                
-                /*
-                 * Get the list of query parameters.  This may be null
-                 */
-                stringProp			= idPrefix + PROP_SELECT_PARAMETERS;
-                String parameters	= properties.getProperty(stringProp);
-                if (parameters != null && parameters.length() > 0) {
-                        for (String parameter : Splitter.on(',').trimResults().omitEmptyStrings().split(parameters)) {
-                                this.configureParameter(id, parameter, properties);
-                        }
-                }
-        }
-
-        @Override
-        public PreparedStatement getPreparedStatement(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder, Connection connection) throws PIPException {
-                /*
-                 * Do we support the request?
-                 */
-                if (!this.isSupported(pipRequest)) {
-                        return null;
-                }
-                
-                PreparedStatement preparedStatement	= null;
-                try {
-                        preparedStatement	= connection.prepareStatement(this.sqlQuery);
-                } catch (SQLException ex) {
-                        this.logger.error("SQLException creating PreparedStatement: " + ex.toString(), ex);
-                        // TODO: throw the exception or return a null PreparedStatement?
-                        return null;
-                }
-
-                if (this.parameters.size() > 0) {
-                        /*
-                         * Gather all of the AttributeValues for parameters to the prepared statement.  For now, we assume a single value for each
-                         * parameter.  If there are multiple values we will log an error and return a null PreparedStatement.
-                         * 
-                         * TODO: Should the interface change to return a cross-product of PreparedStatements to deal with multiple values for parameters?
-                         * If not, should we just take the first value and use it as the parameter value?
-                         */
-                        for (int i = 0 ; i < this.parameters.size() ; i++) {
-                                PIPRequest pipRequestParameter	= this.parameters.get(i);
-                                PIPResponse pipResponse	= pipFinder.getMatchingAttributes(pipRequestParameter, null);
-                                if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
-                                        Collection<Attribute> listAttributes	= pipResponse.getAttributes();
-                                        if (listAttributes.size() > 0) {
-                                                if (listAttributes.size() > 1) {
-                                                        this.logger.error("PIPFinder returned more than one Attribute for " + pipRequestParameter.toString());
-                                                        throw new PIPException("PIPFinder returned more than one Attribute for " + pipRequestParameter.toString());
-                                                }
-                                                Collection<AttributeValue<?>> listAttributeValuesReturned	= listAttributes.iterator().next().getValues();
-                                                if (listAttributeValuesReturned.size() > 0) {
-                                                        if (listAttributeValuesReturned.size() > 1) {
-                                                                this.logger.warn("PIPFinder returned more than one AttributeValue for " + pipRequestParameter.toString());
-                                                                return null;
-                                                        }
-                                                        AttributeValue<?> attributeValue			= listAttributeValuesReturned.iterator().next();
-                                                        Identifier identifierAttributeValueDataType	= attributeValue.getDataTypeId();
-                                                        try {
-                                                                if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_INTEGER)) {
-                                                                        preparedStatement.setInt(i+1, DataTypes.DT_INTEGER.convert(attributeValue.getValue()).intValue());
-                                                                } else if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_DOUBLE)) {
-                                                                        preparedStatement.setDouble(i+1, DataTypes.DT_DOUBLE.convert(attributeValue.getValue()));
-                                                                } else if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_BOOLEAN)) {
-                                                                        preparedStatement.setBoolean(i+1, DataTypes.DT_BOOLEAN.convert(attributeValue.getValue()));
-                                                                } else if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_DATETIME)) {
-                                                                        ISO8601DateTime iso8601DateTime	= DataTypes.DT_DATETIME.convert(attributeValue.getValue());
-                                                                        java.sql.Date sqlDate			= new java.sql.Date(iso8601DateTime.getCalendar().getTimeInMillis());
-                                                                        preparedStatement.setDate(i+1, sqlDate, iso8601DateTime.getCalendar());
-                                                                } else if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_DATE)) {
-                                                                        ISO8601Date iso8601Date	= DataTypes.DT_DATE.convert(attributeValue.getValue());
-                                                                        java.sql.Date sqlDate			= new java.sql.Date(iso8601Date.getCalendar().getTimeInMillis());
-                                                                        preparedStatement.setDate(i+1, sqlDate, iso8601Date.getCalendar());
-                                                                } else {
-                                                                        preparedStatement.setString(i+1, DataTypes.DT_STRING.convert(attributeValue.getValue()));
-                                                                }
-                                                        } catch (Exception ex) {
-                                                                this.logger.error("Exception setting parameter " + (i+1) + " to " + attributeValue.toString() + ": " + ex.toString(), ex);
-                                                                return null;
-                                                        }
-                                                } else {
-                                                        this.logger.warn("No AttributeValues returned for parameter " + pipRequestParameter.toString());
-                                                        return null;
-                                                }
-                                        } else {
-                                                this.logger.warn("No Attributes returned for parameter " + pipRequestParameter.toString());
-                                                return null;
-                                        }
-                                } else {
-                                        this.logger.warn("PIPFinder returned status " + pipResponse.getStatus().toString());
-                                        return null;
-                                }
-                        }
-                }
-                
-                return preparedStatement;
-        }
-        
-        /**
-         * Creates an {@link com.att.research.xacml.api.Attribute} from the value associated with the field with the given <code>fieldName</code>.
-         * 
-         * @param resultSet the {@link java.sql.ResultSet} containing the current row from the database
-         * @param fieldName the <code>String</code> name of the field containing the attribute value
-         * @param pipRequestAttribute the {@link com.att.research.xacml.api.pip.PIPRequest} for the <code>Attribute</code> to create
-         * @return a new <code>Attribute</code> with the value of the given <code>fieldName</code>.
+         * Get the list of database columns returned by the query
          */
-        protected Attribute getAttributeFromResultSet(ResultSet resultSet, String fieldName, PIPRequest pipRequestAttribute) {
-                AttributeValue<?> attributeValue	= null;
-                Identifier identifierDataType		= pipRequestAttribute.getDataTypeId();
-                try {
-                        DataType<?> dataType				= dataTypeFactory.getDataType(identifierDataType);
-                        if (dataType == null) {
-                                this.logger.warn("Unknown data type " + pipRequestAttribute.getDataTypeId().stringValue());
+        stringProp			= idPrefix + PROP_SELECT_FIELDS;
+        String fields		= properties.getProperty(stringProp);
+        if (fields == null || fields.length() == 0) {
+            this.logger.error("No '" + stringProp + "' property");
+            throw new PIPException("No '" + stringProp + "' property");
+        }
+        for (String field : Splitter.on(',').trimResults().omitEmptyStrings().split(fields)) {
+            this.configureField(id, field, properties);
+        }
+
+        /*
+         * Get the list of query parameters.  This may be null
+         */
+        stringProp			= idPrefix + PROP_SELECT_PARAMETERS;
+        String parameters	= properties.getProperty(stringProp);
+        if (parameters != null && parameters.length() > 0) {
+            for (String parameter : Splitter.on(',').trimResults().omitEmptyStrings().split(parameters)) {
+                this.configureParameter(id, parameter, properties);
+            }
+        }
+    }
+
+    @Override
+    public PreparedStatement getPreparedStatement(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder, Connection connection) throws PIPException {
+        /*
+         * Do we support the request?
+         */
+        if (!this.isSupported(pipRequest)) {
+            return null;
+        }
+
+        PreparedStatement preparedStatement	= null;
+        try {
+            preparedStatement	= connection.prepareStatement(this.sqlQuery);
+        } catch (SQLException ex) {
+            this.logger.error("SQLException creating PreparedStatement: " + ex.toString(), ex);
+            // TODO: throw the exception or return a null PreparedStatement?
+            return null;
+        }
+
+        if (this.parameters.size() > 0) {
+            /*
+             * Gather all of the AttributeValues for parameters to the prepared statement.  For now, we assume a single value for each
+             * parameter.  If there are multiple values we will log an error and return a null PreparedStatement.
+             *
+             * TODO: Should the interface change to return a cross-product of PreparedStatements to deal with multiple values for parameters?
+             * If not, should we just take the first value and use it as the parameter value?
+             */
+            for (int i = 0 ; i < this.parameters.size() ; i++) {
+                PIPRequest pipRequestParameter	= this.parameters.get(i);
+                PIPResponse pipResponse	= pipFinder.getMatchingAttributes(pipRequestParameter, null);
+                if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
+                    Collection<Attribute> listAttributes	= pipResponse.getAttributes();
+                    if (listAttributes.size() > 0) {
+                        if (listAttributes.size() > 1) {
+                            this.logger.error("PIPFinder returned more than one Attribute for " + pipRequestParameter.toString());
+                            throw new PIPException("PIPFinder returned more than one Attribute for " + pipRequestParameter.toString());
+                        }
+                        Collection<AttributeValue<?>> listAttributeValuesReturned	= listAttributes.iterator().next().getValues();
+                        if (listAttributeValuesReturned.size() > 0) {
+                            if (listAttributeValuesReturned.size() > 1) {
+                                this.logger.warn("PIPFinder returned more than one AttributeValue for " + pipRequestParameter.toString());
                                 return null;
-                        }
-                        /*
-                         * Try to find the column index
-                         */
-                        
-                        int columnIndex = -1;
-                        
-                        try {
-                                columnIndex = resultSet.findColumn(fieldName);
-                        } catch (Exception e) {
-                                /*
-                                 * The field name could be an integer, let's try that
-                                 */
-                                try {
-                                        columnIndex = Integer.parseInt(fieldName);
-                                } catch (Exception e1) {
-                                        logger.error("Failed to find column with label " + fieldName);
+                            }
+                            AttributeValue<?> attributeValue			= listAttributeValuesReturned.iterator().next();
+                            Identifier identifierAttributeValueDataType	= attributeValue.getDataTypeId();
+                            try {
+                                if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_INTEGER)) {
+                                    preparedStatement.setInt(i+1, DataTypes.DT_INTEGER.convert(attributeValue.getValue()).intValue());
+                                } else if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_DOUBLE)) {
+                                    preparedStatement.setDouble(i+1, DataTypes.DT_DOUBLE.convert(attributeValue.getValue()));
+                                } else if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_BOOLEAN)) {
+                                    preparedStatement.setBoolean(i+1, DataTypes.DT_BOOLEAN.convert(attributeValue.getValue()));
+                                } else if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_DATETIME)) {
+                                    ISO8601DateTime iso8601DateTime	= DataTypes.DT_DATETIME.convert(attributeValue.getValue());
+                                    java.sql.Date sqlDate			= new java.sql.Date(iso8601DateTime.getCalendar().getTimeInMillis());
+                                    preparedStatement.setDate(i+1, sqlDate, iso8601DateTime.getCalendar());
+                                } else if (identifierAttributeValueDataType.equals(XACML3.ID_DATATYPE_DATE)) {
+                                    ISO8601Date iso8601Date	= DataTypes.DT_DATE.convert(attributeValue.getValue());
+                                    java.sql.Date sqlDate			= new java.sql.Date(iso8601Date.getCalendar().getTimeInMillis());
+                                    preparedStatement.setDate(i+1, sqlDate, iso8601Date.getCalendar());
+                                } else {
+                                    preparedStatement.setString(i+1, DataTypes.DT_STRING.convert(attributeValue.getValue()));
                                 }
-                        }
-                        if (this.logger.isDebugEnabled()) {
-                                this.logger.debug("Column " + fieldName + " maps to column index " + columnIndex);
-                        }
-                        
-                        /*
-                         * Catch special cases for database types
-                         */
-                        if (identifierDataType.equals(XACML3.ID_DATATYPE_BOOLEAN)) {
-                                attributeValue	= dataType.createAttributeValue(resultSet.getBoolean(columnIndex));
-                        } else if (identifierDataType.equals(XACML3.ID_DATATYPE_DATE) || identifierDataType.equals(XACML3.ID_DATATYPE_DATETIME)) {
-                                attributeValue	= dataType.createAttributeValue(resultSet.getDate(columnIndex));
-                        } else if (identifierDataType.equals(XACML3.ID_DATATYPE_DOUBLE)) {
-                                attributeValue	= dataType.createAttributeValue(resultSet.getDouble(columnIndex));
-                        } else if (identifierDataType.equals(XACML3.ID_DATATYPE_INTEGER)) {
-                                attributeValue	= dataType.createAttributeValue(resultSet.getInt(columnIndex));
+                            } catch (Exception ex) {
+                                this.logger.error("Exception setting parameter " + (i+1) + " to " + attributeValue.toString() + ": " + ex.toString(), ex);
+                                return null;
+                            }
                         } else {
-                                /*
-                                 * Default to convert the string value from the database to the requested data type
-                                 */
-                                String stringValue	= resultSet.getString(columnIndex);
-                                if (stringValue != null) {
-                                        attributeValue	= dataType.createAttributeValue(stringValue);
-                                }
+                            this.logger.warn("No AttributeValues returned for parameter " + pipRequestParameter.toString());
+                            return null;
                         }
-                } catch (Exception ex) {
-                        this.logger.error("Exception getting value for fieldName '" + fieldName + "' as a " + identifierDataType.stringValue() + ": " + ex.toString(), ex);
+                    } else {
+                        this.logger.warn("No Attributes returned for parameter " + pipRequestParameter.toString());
                         return null;
+                    }
+                } else {
+                    this.logger.warn("PIPFinder returned status " + pipResponse.getStatus().toString());
+                    return null;
                 }
-                String issuer = this.defaultIssuer;
-                if (pipRequestAttribute.getIssuer() != null) {
-                        issuer = pipRequestAttribute.getIssuer();
-                }
-                return new StdAttribute(pipRequestAttribute.getCategory(), pipRequestAttribute.getAttributeId(), attributeValue, issuer, false);
+            }
         }
 
-        @Override
-        public List<Attribute> decodeResult(ResultSet resultSet) throws PIPException {
-                List<Attribute> listAttributes	= new ArrayList<Attribute>();
-                for (String fieldName : this.mapFields.keySet()) {
-                        PIPRequest pipRequestField	= this.mapFields.get(fieldName);
-                        assert(pipRequestField != null);
-                        
-                        Attribute attribute	= this.getAttributeFromResultSet(resultSet, fieldName, pipRequestField);
-                        if (attribute != null) {
-                                listAttributes.add(attribute);
-                        }
-                }
-                return listAttributes;
-        }
+        return preparedStatement;
+    }
 
-        @Override
-        public void attributesRequired(Collection<PIPRequest> parameters) {
-                for (PIPRequest parameter : this.parameters) {
-                        parameters.add(new StdPIPRequest(parameter.getCategory(), parameter.getAttributeId(), parameter.getDataTypeId(), parameter.getIssuer()));
-                }
-        }
+    /**
+     * Creates an {@link com.att.research.xacml.api.Attribute} from the value associated with the field with the given <code>fieldName</code>.
+     *
+     * @param resultSet the {@link java.sql.ResultSet} containing the current row from the database
+     * @param fieldName the <code>String</code> name of the field containing the attribute value
+     * @param pipRequestAttribute the {@link com.att.research.xacml.api.pip.PIPRequest} for the <code>Attribute</code> to create
+     * @return a new <code>Attribute</code> with the value of the given <code>fieldName</code>.
+     */
+    protected Attribute getAttributeFromResultSet(ResultSet resultSet, String fieldName, PIPRequest pipRequestAttribute) {
+        AttributeValue<?> attributeValue	= null;
+        Identifier identifierDataType		= pipRequestAttribute.getDataTypeId();
+        try {
+            DataType<?> dataType				= dataTypeFactory.getDataType(identifierDataType);
+            if (dataType == null) {
+                this.logger.warn("Unknown data type " + pipRequestAttribute.getDataTypeId().stringValue());
+                return null;
+            }
+            /*
+             * Try to find the column index
+             */
 
-        @Override
-        public void attributesProvided(Collection<PIPRequest> attributes) {
-                for (String key : this.mapFields.keySet()) {
-                        PIPRequest attribute = this.mapFields.get(key);
-                        attributes.add(new StdPIPRequest(attribute.getCategory(), 
-                                                                                        attribute.getAttributeId(), 
-                                                                                        attribute.getDataTypeId(), 
-                                                                                        (attribute.getIssuer() != null ? attribute.getIssuer() : this.defaultIssuer)));
+            int columnIndex = -1;
+
+            try {
+                columnIndex = resultSet.findColumn(fieldName);
+            } catch (Exception e) {
+                /*
+                 * The field name could be an integer, let's try that
+                 */
+                try {
+                    columnIndex = Integer.parseInt(fieldName);
+                } catch (Exception e1) {
+                    logger.error("Failed to find column with label " + fieldName);
                 }
+            }
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("Column " + fieldName + " maps to column index " + columnIndex);
+            }
+
+            /*
+             * Catch special cases for database types
+             */
+            if (identifierDataType.equals(XACML3.ID_DATATYPE_BOOLEAN)) {
+                attributeValue	= dataType.createAttributeValue(resultSet.getBoolean(columnIndex));
+            } else if (identifierDataType.equals(XACML3.ID_DATATYPE_DATE) || identifierDataType.equals(XACML3.ID_DATATYPE_DATETIME)) {
+                attributeValue	= dataType.createAttributeValue(resultSet.getDate(columnIndex));
+            } else if (identifierDataType.equals(XACML3.ID_DATATYPE_DOUBLE)) {
+                attributeValue	= dataType.createAttributeValue(resultSet.getDouble(columnIndex));
+            } else if (identifierDataType.equals(XACML3.ID_DATATYPE_INTEGER)) {
+                attributeValue	= dataType.createAttributeValue(resultSet.getInt(columnIndex));
+            } else {
+                /*
+                 * Default to convert the string value from the database to the requested data type
+                 */
+                String stringValue	= resultSet.getString(columnIndex);
+                if (stringValue != null) {
+                    attributeValue	= dataType.createAttributeValue(stringValue);
+                }
+            }
+        } catch (Exception ex) {
+            this.logger.error("Exception getting value for fieldName '" + fieldName + "' as a " + identifierDataType.stringValue() + ": " + ex.toString(), ex);
+            return null;
         }
+        String issuer = this.defaultIssuer;
+        if (pipRequestAttribute.getIssuer() != null) {
+            issuer = pipRequestAttribute.getIssuer();
+        }
+        return new StdAttribute(pipRequestAttribute.getCategory(), pipRequestAttribute.getAttributeId(), attributeValue, issuer, false);
+    }
+
+    @Override
+    public List<Attribute> decodeResult(ResultSet resultSet) throws PIPException {
+        List<Attribute> listAttributes	= new ArrayList<Attribute>();
+        for (String fieldName : this.mapFields.keySet()) {
+            PIPRequest pipRequestField	= this.mapFields.get(fieldName);
+            assert(pipRequestField != null);
+
+            Attribute attribute	= this.getAttributeFromResultSet(resultSet, fieldName, pipRequestField);
+            if (attribute != null) {
+                listAttributes.add(attribute);
+            }
+        }
+        return listAttributes;
+    }
+
+    @Override
+    public void attributesRequired(Collection<PIPRequest> parameters) {
+        for (PIPRequest parameter : this.parameters) {
+            parameters.add(new StdPIPRequest(parameter.getCategory(), parameter.getAttributeId(), parameter.getDataTypeId(), parameter.getIssuer()));
+        }
+    }
+
+    @Override
+    public void attributesProvided(Collection<PIPRequest> attributes) {
+        for (String key : this.mapFields.keySet()) {
+            PIPRequest attribute = this.mapFields.get(key);
+            attributes.add(new StdPIPRequest(attribute.getCategory(),
+                                             attribute.getAttributeId(),
+                                             attribute.getDataTypeId(),
+                                             (attribute.getIssuer() != null ? attribute.getIssuer() : this.defaultIssuer)));
+        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/JDBCEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/JDBCEngine.java
index 5e030ee..3d455df 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/JDBCEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/JDBCEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -66,336 +66,336 @@
  * PIPEgineJDBC extends {@link com.att.research.xacml.std.pip.engines.StdConfigurableEngine} to implement a PIP that
  * retrieves XACML attributes from a database using JDBC.  This is a minimal implementation that does not do any caching of
  * results.  It does not perform JDBC connection pooling either.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class JDBCEngine extends StdConfigurableEngine {
-        public static final String PROP_TYPE			= "type";
-        public static final String PROP_JDBC_DRIVER		= "jdbc.driver";
-        public static final String PROP_JDBC_URL		= "jdbc.url";
-        public static final String PROP_JDBC_CONN		= "jdbc.conn";
-        public static final String PROP_JDBC_CONN_USER	= "jdbc.conn.user";
-        public static final String PROP_JDBC_CONN_PASS	= "jdbc.conn.password";
-        public static final String PROP_RESOLVERS		= "resolvers";
-        public static final String PROP_RESOLVER		= "resolver";
-        public static final String PROP_CLASSNAME		= "classname";
-        
-        public static final String TYPE_JDBC			= "jdbc";
-        public static final String TYPE_JNDI			= "jndi";
-        
-        protected Log logger	= LogFactory.getLog(this.getClass());
-        private String type;
-        private String jndiDataSource;
-        private String jdbcDriverClass;
-        private boolean jdbcDriverClassLoaded;
-        private String jdbcUrl;
-        private Properties jdbcConnProperties	= new Properties();
-        private List<JDBCResolver> jdbcResolvers	= new ArrayList<JDBCResolver>();
-        
-        /**
-         * If the JDBC driver <code>Class</code> has not been loaded yet, do so now.
-         * 
-         * @throws ClassNotFoundException
-         */
-        protected void loadDriverClass() throws ClassNotFoundException {
+    public static final String PROP_TYPE			= "type";
+    public static final String PROP_JDBC_DRIVER		= "jdbc.driver";
+    public static final String PROP_JDBC_URL		= "jdbc.url";
+    public static final String PROP_JDBC_CONN		= "jdbc.conn";
+    public static final String PROP_JDBC_CONN_USER	= "jdbc.conn.user";
+    public static final String PROP_JDBC_CONN_PASS	= "jdbc.conn.password";
+    public static final String PROP_RESOLVERS		= "resolvers";
+    public static final String PROP_RESOLVER		= "resolver";
+    public static final String PROP_CLASSNAME		= "classname";
+
+    public static final String TYPE_JDBC			= "jdbc";
+    public static final String TYPE_JNDI			= "jndi";
+
+    protected Log logger	= LogFactory.getLog(this.getClass());
+    private String type;
+    private String jndiDataSource;
+    private String jdbcDriverClass;
+    private boolean jdbcDriverClassLoaded;
+    private String jdbcUrl;
+    private Properties jdbcConnProperties	= new Properties();
+    private List<JDBCResolver> jdbcResolvers	= new ArrayList<JDBCResolver>();
+
+    /**
+     * If the JDBC driver <code>Class</code> has not been loaded yet, do so now.
+     *
+     * @throws ClassNotFoundException
+     */
+    protected void loadDriverClass() throws ClassNotFoundException {
+        if (!this.jdbcDriverClassLoaded) {
+            synchronized(this) {
                 if (!this.jdbcDriverClassLoaded) {
-                        synchronized(this) {
-                                if (!this.jdbcDriverClassLoaded) {
-                                        Class.forName(this.jdbcDriverClass);
-                                        this.jdbcDriverClassLoaded	= true;
-                                }
-                        }
+                    Class.forName(this.jdbcDriverClass);
+                    this.jdbcDriverClassLoaded	= true;
                 }
+            }
         }
-        
-        /**
-         * Creates a JDBC {@link java.sql.Connection} to the database.  Extensions to the <code>JDBCEngine</code> class can perform
-         * connection pooling or other connection reuse optimizations here.
-         * 
-         * @return a <code>Connection</code> to use to execute the query
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating the JDBC <code>Connection</code>.
+    }
+
+    /**
+     * Creates a JDBC {@link java.sql.Connection} to the database.  Extensions to the <code>JDBCEngine</code> class can perform
+     * connection pooling or other connection reuse optimizations here.
+     *
+     * @return a <code>Connection</code> to use to execute the query
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating the JDBC <code>Connection</code>.
+     */
+    protected Connection getConnection() throws PIPException {
+        /*
+         * Check what type we are
          */
-        protected Connection getConnection() throws PIPException {
-                /*
-                 * Check what type we are
-                 */
-                if (this.type.equals(TYPE_JDBC)) {
-                        return this.getJDBCConnection();
-                } else {
-                        return this.getJNDIConnection();
-                }
+        if (this.type.equals(TYPE_JDBC)) {
+            return this.getJDBCConnection();
+        } else {
+            return this.getJNDIConnection();
         }
-        
-        protected Connection getJDBCConnection() throws PIPException {
-                /*
-                 * Ensure the driver class is loaded
-                 */
-                try {
-                        this.loadDriverClass();
-                } catch (ClassNotFoundException ex) {
-                        this.logger.error("ClassNotFoundException loading JDBC driver class '" + this.jdbcDriverClass + "'", ex);
-                        throw new PIPException("ClassNotFoundException loading JDBC driver class '" + this.jdbcDriverClass + "'", ex);
-                }
-                
-                /*
-                 * Try to create a new Connection
-                 */
-                Connection connectionResult	= null;
-                try {
-                        connectionResult	= DriverManager.getConnection(this.jdbcUrl, this.jdbcConnProperties);
-                } catch (SQLException ex) {
-                        this.logger.error("SQLException creating Connection", ex);
-                        throw new PIPException("SQLException creating Connection", ex);
-                }
-                
-                return connectionResult;
-        }
-        
-        protected Connection getJNDIConnection() throws PIPException {
-                try {
-                        Context initialContext = new InitialContext();
-                        DataSource datasource = (DataSource) initialContext.lookup(this.jndiDataSource);
-                        if (datasource == null) {
-                                throw new PIPException("");
-                        }
-                        return datasource.getConnection();
-                } catch (NamingException | SQLException e) {
-                        this.logger.error("JNDIException creating Connection", e);
-                        throw new PIPException("JNDIException creating Connection", e);
-                }
-        }
-        
-        protected void getAttributes(PIPRequest pipRequest, PIPFinder pipFinder, JDBCResolver jdbcResolver, StdMutablePIPResponse pipResponse) throws PIPException {
-                /*
-                 * First we need to get a PreparedStatement
-                 */
-                Connection connection = this.getConnection();
-                PreparedStatement preparedStatement	= jdbcResolver.getPreparedStatement(this, pipRequest, pipFinder, connection);
-                if (preparedStatement == null) {
-                        this.logger.debug(this.getName() + " does not handle " + pipRequest.toString());
-                        try {
-                                if (connection != null) {
-                                        connection.close();
-                                }
-                        } catch (Exception e) {				
-                        }
-                        return;
-                }
-                
-                /*
-                 * Is it in the cache?
-                 */
-                this.logger.debug(preparedStatement.toString());
-                Cache<String, PIPResponse> cache = this.getCache();
-                if (cache != null) {
-                        // TODO - a cache key
-                }
-                
-                /*
-                 * Execute the prepared statement
-                 */
-                ResultSet resultSet		= null;
-                try {
-                        resultSet	= preparedStatement.executeQuery();
-                } catch (SQLException ex) {
-                        this.logger.error("SQLException executing query: " + ex.toString(), ex);
-                        // TODO: Should we re-throw the exception, or just return an empty response?
-                }
-                if (resultSet == null) {
-                        try {
-                                preparedStatement.close();
-                        } catch (SQLException e) {
-                                this.logger.error("SQLException closing preparedStatment: " + e.toString(), e);
-                        }
-                        try {
-                                if (connection != null) {
-                                        connection.close();
-                                }
-                        } catch (Exception e) {				
-                        }
-                        return;
-                }		
-                try {
-                        /*
-                         * Get all the results
-                         */
-                        while (resultSet.next()) {
-                                List<Attribute> listAttributes	= jdbcResolver.decodeResult(resultSet);
-                                if (listAttributes != null) {
-                                        pipResponse.addAttributes(listAttributes);
-                                }
-                        }
-                        /*
-                         * Save it in the cache
-                         */
-                        if (cache != null) {
-                                // TODO
-                        }
-                } catch (SQLException ex) {
-                        this.logger.error("SQLException decoding results: " + ex.toString());
-                        // TODO: Should we re-throw the exception or just continue
-                } finally {
-                        if (resultSet != null) {
-                                try {
-                                        resultSet.close();
-                                } catch (SQLException e) {
-                                        this.logger.error("SQLException closing resultSet: " + e.toString() + "  (May be memory leak)");
-                                }
-                        }
-                        try {
-                                preparedStatement.close();
-                        } catch (SQLException e) {
-                                this.logger.error("SQLException closing preparedStatement: " + e.toString() + "  (May be memory leak)");
-                        }
-                        try {
-                                connection.close();
-                        } catch (SQLException e) {
-                                this.logger.error("SQLException closing connection: " + e.toString() + "  (May be memory leak)");
-                        }
-                }
+    }
+
+    protected Connection getJDBCConnection() throws PIPException {
+        /*
+         * Ensure the driver class is loaded
+         */
+        try {
+            this.loadDriverClass();
+        } catch (ClassNotFoundException ex) {
+            this.logger.error("ClassNotFoundException loading JDBC driver class '" + this.jdbcDriverClass + "'", ex);
+            throw new PIPException("ClassNotFoundException loading JDBC driver class '" + this.jdbcDriverClass + "'", ex);
         }
 
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
-                if (this.jdbcResolvers.size() == 0) {
-                        throw new IllegalStateException(this.getClass().getCanonicalName() + " is not configured");
+        /*
+         * Try to create a new Connection
+         */
+        Connection connectionResult	= null;
+        try {
+            connectionResult	= DriverManager.getConnection(this.jdbcUrl, this.jdbcConnProperties);
+        } catch (SQLException ex) {
+            this.logger.error("SQLException creating Connection", ex);
+            throw new PIPException("SQLException creating Connection", ex);
+        }
+
+        return connectionResult;
+    }
+
+    protected Connection getJNDIConnection() throws PIPException {
+        try {
+            Context initialContext = new InitialContext();
+            DataSource datasource = (DataSource) initialContext.lookup(this.jndiDataSource);
+            if (datasource == null) {
+                throw new PIPException("");
+            }
+            return datasource.getConnection();
+        } catch (NamingException | SQLException e) {
+            this.logger.error("JNDIException creating Connection", e);
+            throw new PIPException("JNDIException creating Connection", e);
+        }
+    }
+
+    protected void getAttributes(PIPRequest pipRequest, PIPFinder pipFinder, JDBCResolver jdbcResolver, StdMutablePIPResponse pipResponse) throws PIPException {
+        /*
+         * First we need to get a PreparedStatement
+         */
+        Connection connection = this.getConnection();
+        PreparedStatement preparedStatement	= jdbcResolver.getPreparedStatement(this, pipRequest, pipFinder, connection);
+        if (preparedStatement == null) {
+            this.logger.debug(this.getName() + " does not handle " + pipRequest.toString());
+            try {
+                if (connection != null) {
+                    connection.close();
                 }
-                
-                StdMutablePIPResponse mutablePIPResponse	= new StdMutablePIPResponse();
-                for (JDBCResolver jdbcResolver : this.jdbcResolvers) {
-                        this.getAttributes(pipRequest, pipFinder, jdbcResolver, mutablePIPResponse);
+            } catch (Exception e) {
+            }
+            return;
+        }
+
+        /*
+         * Is it in the cache?
+         */
+        this.logger.debug(preparedStatement.toString());
+        Cache<String, PIPResponse> cache = this.getCache();
+        if (cache != null) {
+            // TODO - a cache key
+        }
+
+        /*
+         * Execute the prepared statement
+         */
+        ResultSet resultSet		= null;
+        try {
+            resultSet	= preparedStatement.executeQuery();
+        } catch (SQLException ex) {
+            this.logger.error("SQLException executing query: " + ex.toString(), ex);
+            // TODO: Should we re-throw the exception, or just return an empty response?
+        }
+        if (resultSet == null) {
+            try {
+                preparedStatement.close();
+            } catch (SQLException e) {
+                this.logger.error("SQLException closing preparedStatment: " + e.toString(), e);
+            }
+            try {
+                if (connection != null) {
+                    connection.close();
                 }
-                if (mutablePIPResponse.getAttributes().size() == 0) {
-                        if (this.logger.isDebugEnabled()) {
-                                this.logger.debug("returning empty response");
-                        }
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                } else {
-                        if (this.logger.isDebugEnabled()) {
-                                this.logger.trace("Returning " + mutablePIPResponse.getAttributes().size() + " attributes");
-                                for (Attribute attribute : mutablePIPResponse.getAttributes()) {
-                                        this.logger.debug(AttributeUtils.prettyPrint(attribute));
-                                }
-                        } else if (this.logger.isDebugEnabled()) {
+            } catch (Exception e) {
+            }
+            return;
+        }
+        try {
+            /*
+             * Get all the results
+             */
+            while (resultSet.next()) {
+                List<Attribute> listAttributes	= jdbcResolver.decodeResult(resultSet);
+                if (listAttributes != null) {
+                    pipResponse.addAttributes(listAttributes);
+                }
+            }
+            /*
+             * Save it in the cache
+             */
+            if (cache != null) {
+                // TODO
+            }
+        } catch (SQLException ex) {
+            this.logger.error("SQLException decoding results: " + ex.toString());
+            // TODO: Should we re-throw the exception or just continue
+        } finally {
+            if (resultSet != null) {
+                try {
+                    resultSet.close();
+                } catch (SQLException e) {
+                    this.logger.error("SQLException closing resultSet: " + e.toString() + "  (May be memory leak)");
+                }
+            }
+            try {
+                preparedStatement.close();
+            } catch (SQLException e) {
+                this.logger.error("SQLException closing preparedStatement: " + e.toString() + "  (May be memory leak)");
+            }
+            try {
+                connection.close();
+            } catch (SQLException e) {
+                this.logger.error("SQLException closing connection: " + e.toString() + "  (May be memory leak)");
+            }
+        }
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
+        if (this.jdbcResolvers.size() == 0) {
+            throw new IllegalStateException(this.getClass().getCanonicalName() + " is not configured");
+        }
+
+        StdMutablePIPResponse mutablePIPResponse	= new StdMutablePIPResponse();
+        for (JDBCResolver jdbcResolver : this.jdbcResolvers) {
+            this.getAttributes(pipRequest, pipFinder, jdbcResolver, mutablePIPResponse);
+        }
+        if (mutablePIPResponse.getAttributes().size() == 0) {
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("returning empty response");
+            }
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
+        } else {
+            if (this.logger.isDebugEnabled()) {
+                this.logger.trace("Returning " + mutablePIPResponse.getAttributes().size() + " attributes");
+                for (Attribute attribute : mutablePIPResponse.getAttributes()) {
+                    this.logger.debug(AttributeUtils.prettyPrint(attribute));
+                }
+            } else if (this.logger.isDebugEnabled()) {
 //				this.logger.debug("Returning " + mutablePIPResponse.getAttributes().size() + " attributes");
 //				this.logger.debug(mutablePIPResponse.getAttributes());
-                        }
-                        return new StdPIPResponse(mutablePIPResponse);
-                }
+            }
+            return new StdPIPResponse(mutablePIPResponse);
         }
-        
-        /**
-         * Creates a new {@link com.att.research.xacml.std.pip.engines.jdbc.JDBCResolver} by looking up the "classname"
-         * property for the given <code>String</code> resolver ID and then calling its <code>configure</code> method.
-         * 
-         * @param resolverId the <code>String</code> identifier of the resolver to configure
-         * @param properties the <code>Properties</code> to search for the "classname" and any resolver-specific properties
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating the <code>JDBCResolver</code>.
-         */
-        protected void createResolver(String resolverId, Properties properties) throws PIPException {
-                String propPrefix	= resolverId + ".";
-                String resolverClassName	= properties.getProperty(propPrefix + PROP_CLASSNAME);
-                if (resolverClassName == null || resolverClassName.length() == 0) {
-                        this.logger.error("No '" + propPrefix + PROP_CLASSNAME + "' property.");
-                        throw new PIPException("No '" + propPrefix + PROP_CLASSNAME + "' property.");
-                }
-                try {
-                        Class<?> resolverClass	= Class.forName(resolverClassName);
-                        if (!JDBCResolver.class.isAssignableFrom(resolverClass)) {
-                                this.logger.error("JDBCResolver class " + propPrefix + " does not implement " + JDBCResolver.class.getCanonicalName());
-                                throw new PIPException("JDBCResolver class " + propPrefix + " does not implement " + JDBCResolver.class.getCanonicalName());
-                                
-                        }
-                        JDBCResolver jdbcResolver	= JDBCResolver.class.cast(resolverClass.newInstance());
-                        jdbcResolver.configure(resolverId, properties, this.getIssuer());
-                        this.jdbcResolvers.add(jdbcResolver);
-                } catch (Exception ex) {
-                        this.logger.error("Exception creating JDBCResolver: " + ex.getMessage(), ex);
-                        throw new PIPException("Exception creating JDBCResolver", ex);
-                }		
+    }
+
+    /**
+     * Creates a new {@link com.att.research.xacml.std.pip.engines.jdbc.JDBCResolver} by looking up the "classname"
+     * property for the given <code>String</code> resolver ID and then calling its <code>configure</code> method.
+     *
+     * @param resolverId the <code>String</code> identifier of the resolver to configure
+     * @param properties the <code>Properties</code> to search for the "classname" and any resolver-specific properties
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating the <code>JDBCResolver</code>.
+     */
+    protected void createResolver(String resolverId, Properties properties) throws PIPException {
+        String propPrefix	= resolverId + ".";
+        String resolverClassName	= properties.getProperty(propPrefix + PROP_CLASSNAME);
+        if (resolverClassName == null || resolverClassName.length() == 0) {
+            this.logger.error("No '" + propPrefix + PROP_CLASSNAME + "' property.");
+            throw new PIPException("No '" + propPrefix + PROP_CLASSNAME + "' property.");
+        }
+        try {
+            Class<?> resolverClass	= Class.forName(resolverClassName);
+            if (!JDBCResolver.class.isAssignableFrom(resolverClass)) {
+                this.logger.error("JDBCResolver class " + propPrefix + " does not implement " + JDBCResolver.class.getCanonicalName());
+                throw new PIPException("JDBCResolver class " + propPrefix + " does not implement " + JDBCResolver.class.getCanonicalName());
+
+            }
+            JDBCResolver jdbcResolver	= JDBCResolver.class.cast(resolverClass.newInstance());
+            jdbcResolver.configure(resolverId, properties, this.getIssuer());
+            this.jdbcResolvers.add(jdbcResolver);
+        } catch (Exception ex) {
+            this.logger.error("Exception creating JDBCResolver: " + ex.getMessage(), ex);
+            throw new PIPException("Exception creating JDBCResolver", ex);
+        }
+    }
+
+    @Override
+    public void configure(String id, Properties properties) throws PIPException {
+        //
+        // Our configurable properties
+        //
+        super.configure(id, properties);
+        //
+        // Prefix
+        //
+        String propPrefix	= id + ".";
+        //
+        // What is our type?
+        //
+        this.type = properties.getProperty(propPrefix + PROP_TYPE, TYPE_JDBC);
+        //
+        // These are mandatory for our engine to work.
+        //
+        if ((this.jdbcDriverClass = properties.getProperty(propPrefix + PROP_JDBC_DRIVER)) == null) {
+            this.logger.error("No '" + propPrefix + PROP_JDBC_DRIVER + "' property");
+            throw new PIPException("No '" + propPrefix + PROP_JDBC_DRIVER + "' property");
+        }
+        try {
+            Class.forName(this.jdbcDriverClass);
+        } catch (Exception ex) {
+            this.logger.error("Exception instantiating JDBC driver class '" + this.jdbcDriverClass + "'", ex);
+            throw new PIPException("Exception instantiating JDBC driver class '" + this.jdbcDriverClass + "'", ex);
         }
 
-        @Override
-        public void configure(String id, Properties properties) throws PIPException {
-                //
-                // Our configurable properties
-                //
-                super.configure(id, properties);
-                //
-                // Prefix
-                //
-                String propPrefix	= id + ".";
-                //
-                // What is our type?
-                //
-                this.type = properties.getProperty(propPrefix + PROP_TYPE, TYPE_JDBC);
-                //
-                // These are mandatory for our engine to work.
-                //
-                if ((this.jdbcDriverClass = properties.getProperty(propPrefix + PROP_JDBC_DRIVER)) == null) {
-                        this.logger.error("No '" + propPrefix + PROP_JDBC_DRIVER + "' property");
-                        throw new PIPException("No '" + propPrefix + PROP_JDBC_DRIVER + "' property");
-                }
-                try {
-                        Class.forName(this.jdbcDriverClass);
-                } catch (Exception ex) {
-                        this.logger.error("Exception instantiating JDBC driver class '" + this.jdbcDriverClass + "'", ex);
-                        throw new PIPException("Exception instantiating JDBC driver class '" + this.jdbcDriverClass + "'", ex);
-                }
-                
-                if ((this.jdbcUrl = properties.getProperty(propPrefix + PROP_JDBC_URL)) == null) {
-                        this.logger.error("No '" + propPrefix + PROP_JDBC_URL + "' property");
-                        throw new PIPException("No '" + propPrefix + PROP_JDBC_URL + "' property");
-                }
-                //
-                // Go through all our resolvers
-                //
-                String propResolverPrefix	= propPrefix + PROP_RESOLVERS;
-                String stringProp = properties.getProperty(propResolverPrefix);
-                if (stringProp == null || stringProp.isEmpty()) {
-                        this.logger.error("No '" + propResolverPrefix + "' property");
-                        throw new PIPException("No '" + propResolverPrefix + "' property");
-                }
-                for (String resolverId : Splitter.on(',').trimResults().omitEmptyStrings().split(stringProp)) {
-                        this.createResolver(propPrefix + PROP_RESOLVER + "." + resolverId, properties);
-                }
-                //
-                // Check for these properties. They are not required.
-                //
-                if ((stringProp = properties.getProperty(propPrefix + PROP_JDBC_CONN_USER)) != null) {
-                        this.jdbcConnProperties.setProperty("user", stringProp);
-                }
-                if ((stringProp = properties.getProperty(propPrefix + PROP_JDBC_CONN_PASS)) != null) {
-                        this.jdbcConnProperties.setProperty("password", stringProp);
-                }
-                String jdbcConnPrefix	= propPrefix + PROP_JDBC_CONN;
-                if ((stringProp = properties.getProperty(jdbcConnPrefix)) != null) {
-                        jdbcConnPrefix	= jdbcConnPrefix + ".";
-                        String[] connProperties	= stringProp.split("[,]",0);
-                        for (String connProperty : connProperties) {
-                                if ((stringProp = properties.getProperty(jdbcConnPrefix + connProperty)) != null) {
-                                        this.jdbcConnProperties.setProperty(connProperty, stringProp);
-                                }
-                        }
-                }
+        if ((this.jdbcUrl = properties.getProperty(propPrefix + PROP_JDBC_URL)) == null) {
+            this.logger.error("No '" + propPrefix + PROP_JDBC_URL + "' property");
+            throw new PIPException("No '" + propPrefix + PROP_JDBC_URL + "' property");
         }
+        //
+        // Go through all our resolvers
+        //
+        String propResolverPrefix	= propPrefix + PROP_RESOLVERS;
+        String stringProp = properties.getProperty(propResolverPrefix);
+        if (stringProp == null || stringProp.isEmpty()) {
+            this.logger.error("No '" + propResolverPrefix + "' property");
+            throw new PIPException("No '" + propResolverPrefix + "' property");
+        }
+        for (String resolverId : Splitter.on(',').trimResults().omitEmptyStrings().split(stringProp)) {
+            this.createResolver(propPrefix + PROP_RESOLVER + "." + resolverId, properties);
+        }
+        //
+        // Check for these properties. They are not required.
+        //
+        if ((stringProp = properties.getProperty(propPrefix + PROP_JDBC_CONN_USER)) != null) {
+            this.jdbcConnProperties.setProperty("user", stringProp);
+        }
+        if ((stringProp = properties.getProperty(propPrefix + PROP_JDBC_CONN_PASS)) != null) {
+            this.jdbcConnProperties.setProperty("password", stringProp);
+        }
+        String jdbcConnPrefix	= propPrefix + PROP_JDBC_CONN;
+        if ((stringProp = properties.getProperty(jdbcConnPrefix)) != null) {
+            jdbcConnPrefix	= jdbcConnPrefix + ".";
+            String[] connProperties	= stringProp.split("[,]",0);
+            for (String connProperty : connProperties) {
+                if ((stringProp = properties.getProperty(jdbcConnPrefix + connProperty)) != null) {
+                    this.jdbcConnProperties.setProperty(connProperty, stringProp);
+                }
+            }
+        }
+    }
 
-        @Override
-        public Collection<PIPRequest> attributesRequired() {
-                Set<PIPRequest> attributes = new HashSet<PIPRequest>();
-                for (JDBCResolver jdbcResolver : this.jdbcResolvers) {
-                        jdbcResolver.attributesRequired(attributes);
-                }
-                return attributes;
+    @Override
+    public Collection<PIPRequest> attributesRequired() {
+        Set<PIPRequest> attributes = new HashSet<PIPRequest>();
+        for (JDBCResolver jdbcResolver : this.jdbcResolvers) {
+            jdbcResolver.attributesRequired(attributes);
         }
+        return attributes;
+    }
 
-        @Override
-        public Collection<PIPRequest> attributesProvided() {
-                Set<PIPRequest> attributes = new HashSet<PIPRequest>();
-                for (JDBCResolver jdbcResolver : this.jdbcResolvers) {
-                        jdbcResolver.attributesProvided(attributes);
-                }
-                return attributes;
+    @Override
+    public Collection<PIPRequest> attributesProvided() {
+        Set<PIPRequest> attributes = new HashSet<PIPRequest>();
+        for (JDBCResolver jdbcResolver : this.jdbcResolvers) {
+            jdbcResolver.attributesProvided(attributes);
         }
+        return attributes;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/JDBCResolver.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/JDBCResolver.java
index 41d8269..f1a9b86 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/JDBCResolver.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/JDBCResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -46,35 +46,35 @@
  * JDBCResolver is the interface used by the {@link JDBCEngine} to
  * create <code>PreparedStatement</code>s for XACML attribute requests and convert the <code>ResultSet</code>
  * into XACML attributes.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public interface JDBCResolver extends ConfigurableResolver {
 
-        /**
-         * Creates a {@link java.sql.PreparedStatement} for a SQL SELECT statement that will retrieve the data
-         * used to generate the XACML AttributeValues.
-         * 
-         * @param pipEngine the {@link com.att.research.xacml.api.pip.PIPEngine} making the request for XACML AttributeValues
-         * @param pipRequest the {@link com.att.research.xacml.api.pip.PIPRequest} with the requested XACML Attributes
-         * @param pipFinder the {@link com.att.research.xacml.api.pip.PIPFinder} for finding any other XACML AttributeValues required to build the query.
-         * @param connection the {@link java.sql.Connection} needed to create the <code>PreparedStatement</code>
-         * @return a <code>PreparedStatement</code> to query the database for the required XACML AttributeValues.
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating the <code>PreparedStatement</code>
-         */
-        public PreparedStatement getPreparedStatement(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder, Connection connection) throws PIPException;
-        
-        /**
-         * Creates a <code>List</code> of {@link com.att.research.xacml.api.Attribute}s from the given {@link java.sql.ResultSet}
-         * returned by a SQL SELECT statement.  The <code>ResultSet</code> should already be positioned at the first element to decode.
-         * The implementation may choose to decode multiple results before returning or may only decode the current result.  The implementation
-         * should leave the cursor on the last result decoded.
-         * 
-         * @param resultSet the <code>ResultSet</code> returned from a SQL SELECT statement.
-         * @return a new <code>List</code> of <code>Attribute</code>s generated by parsing the given <code>ResultSet</code> or an empty
-         * <code>List</code> if there are no results.
-         * @throws com.att.research.xacml.api.pip.PIPException
-         */
-        public List<Attribute> decodeResult(ResultSet resultSet) throws PIPException;
+    /**
+     * Creates a {@link java.sql.PreparedStatement} for a SQL SELECT statement that will retrieve the data
+     * used to generate the XACML AttributeValues.
+     *
+     * @param pipEngine the {@link com.att.research.xacml.api.pip.PIPEngine} making the request for XACML AttributeValues
+     * @param pipRequest the {@link com.att.research.xacml.api.pip.PIPRequest} with the requested XACML Attributes
+     * @param pipFinder the {@link com.att.research.xacml.api.pip.PIPFinder} for finding any other XACML AttributeValues required to build the query.
+     * @param connection the {@link java.sql.Connection} needed to create the <code>PreparedStatement</code>
+     * @return a <code>PreparedStatement</code> to query the database for the required XACML AttributeValues.
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating the <code>PreparedStatement</code>
+     */
+    public PreparedStatement getPreparedStatement(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder, Connection connection) throws PIPException;
+
+    /**
+     * Creates a <code>List</code> of {@link com.att.research.xacml.api.Attribute}s from the given {@link java.sql.ResultSet}
+     * returned by a SQL SELECT statement.  The <code>ResultSet</code> should already be positioned at the first element to decode.
+     * The implementation may choose to decode multiple results before returning or may only decode the current result.  The implementation
+     * should leave the cursor on the last result decoded.
+     *
+     * @param resultSet the <code>ResultSet</code> returned from a SQL SELECT statement.
+     * @return a new <code>List</code> of <code>Attribute</code>s generated by parsing the given <code>ResultSet</code> or an empty
+     * <code>List</code> if there are no results.
+     * @throws com.att.research.xacml.api.pip.PIPException
+     */
+    public List<Attribute> decodeResult(ResultSet resultSet) throws PIPException;
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/package-info.java
index 09180d2..3412b96 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/jdbc/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacml.std.pip.engines contains an implementation of the {@link com.att.research.xacml.api.pip.PIPEngine}
  * interface that uses a JDBC connection to a database to retrieve XACML AttributeValues.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/ConfigurableLDAPResolver.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/ConfigurableLDAPResolver.java
index 0cde002..eb8b803 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/ConfigurableLDAPResolver.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/ConfigurableLDAPResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -74,436 +74,419 @@
 
 public class ConfigurableLDAPResolver implements LDAPResolver {
 
-        private static DataTypeFactory dataTypeFactory		= null;
+    private static DataTypeFactory dataTypeFactory		= null;
 
-        static {
-                try {
-                        dataTypeFactory	= DataTypeFactory.newInstance();
-                }
-                catch (FactoryException fx) {
-                        throw new RuntimeException(fx);
-                }
-                Velocity.setProperty( "runtime.log.logsystem.log4j.logger", "MAIN_LOG" );
-                Velocity.init();
+    static {
+        try {
+            dataTypeFactory	= DataTypeFactory.newInstance();
+        } catch (FactoryException fx) {
+            throw new RuntimeException(fx);
         }
+        Velocity.setProperty( "runtime.log.logsystem.log4j.logger", "MAIN_LOG" );
+        Velocity.init();
+    }
 
 
-        private Log logger = LogFactory.getLog(this.getClass());
+    private Log logger = LogFactory.getLog(this.getClass());
 
-        private String defaultIssuer;
-        private String id;
-        private String base;
-        private String filter;
-        private Map<String,PIPRequest> baseParameters;
-        private Map<String,PIPRequest> filterParameters;
-        private Map<String,PIPRequest> filterView;
+    private String defaultIssuer;
+    private String id;
+    private String base;
+    private String filter;
+    private Map<String,PIPRequest> baseParameters;
+    private Map<String,PIPRequest> filterParameters;
+    private Map<String,PIPRequest> filterView;
 
 
-        public ConfigurableLDAPResolver() {
-        }
+    public ConfigurableLDAPResolver() {
+    }
 
-        @Override
-        public void configure(String id, Properties properties, String defaultIssuer) throws PIPException {
-                /*
-                 * Save these values
-                 */
-                this.id = id;
-                this.defaultIssuer = defaultIssuer;
-
-                this.base = properties.getProperty(id + ".base");
-                this.filter = properties.getProperty(id + ".filter");
-                Set<String> baseParametersNames = prepareVelocityTemplate(this.base);
-                Set<String> filterParametersNames = prepareVelocityTemplate(this.filter);
-
-                this.baseParameters = Configurables.getPIPRequestMap(id + ".base", "parameters", properties, null);
-
-                this.filterParameters = Configurables.getPIPRequestMap(id + ".filter", "parameters", properties, null);
-
-                //make sure we have all required parameters
-                if (!this.baseParameters.keySet().containsAll(baseParametersNames)) {
-                        throw new PIPException("The 'base' template contains parameters that were not specified in its map.");
-                }
-                if (!this.filterParameters.keySet().containsAll(filterParametersNames)) {
-                        throw new PIPException("The 'filter' template contains parameters that were not specified in its map.");
-                }
-                this.filterView = Configurables.getPIPRequestMap(id + ".filter", "view", properties, defaultIssuer);
-                if (this.logger.isTraceEnabled()) {
-                        this.logger.trace("(" + id + ") " +
-                                        "\nbase '" + this.base + "', parameters " + this.baseParameters +
-                                        "\nfilter '" + this.filter + "', parameters " + this.filterParameters + ", view " + this.filterView);
-                }
-        }
-
-        public void store(String id, Properties properties) throws PIPException {
-                properties.setProperty(id + ".base", this.base);
-                properties.setProperty(id + ".filter", this.filter);
-                Configurables.setPIPRequestMap(this.baseParameters,
-                                id + ".base", "parameters", properties);
-                Configurables.setPIPRequestMap(this.filterParameters,
-                                id + ".filter", "parameters", properties);
-                Configurables.setPIPRequestMap(this.filterView,
-                                id + ".filter", "view", properties);
-        }
-
+    @Override
+    public void configure(String id, Properties properties, String defaultIssuer) throws PIPException {
         /*
-         * @return the set of parameters names required by the given velocity template
+         * Save these values
          */
-        private Set<String> prepareVelocityTemplate(String template)
-                        throws PIPException {
-                VelocityContext vctx = new VelocityContext();
-                EventCartridge vec = new EventCartridge();
-                VelocityParameterReader reader = new VelocityParameterReader();
-                vec.addEventHandler(reader);
-                vec.attachToContext(vctx);
+        this.id = id;
+        this.defaultIssuer = defaultIssuer;
 
-                try {
-                        Velocity.evaluate(vctx, new StringWriter(),
-                                        "LdapResolver", template);
-                }
-                catch (ParseErrorException pex) {
-                        throw new PIPException(
-                                        "Velocity template preparation failed",pex);
-                }
-                catch (MethodInvocationException mix) {
-                        throw new PIPException(
-                                        "Velocity template preparation failed",mix);
-                }
-                catch (ResourceNotFoundException rnfx) {
-                        throw new PIPException(
-                                        "Velocity template preparation failed",rnfx);
-                }
-                if (this.logger.isTraceEnabled()) {
-                        this.logger.trace("(" + id + ") " + template + " with parameters " + reader.parameters);
-                }
+        this.base = properties.getProperty(id + ".base");
+        this.filter = properties.getProperty(id + ".filter");
+        Set<String> baseParametersNames = prepareVelocityTemplate(this.base);
+        Set<String> filterParametersNames = prepareVelocityTemplate(this.filter);
 
-                return reader.parameters;
+        this.baseParameters = Configurables.getPIPRequestMap(id + ".base", "parameters", properties, null);
+
+        this.filterParameters = Configurables.getPIPRequestMap(id + ".filter", "parameters", properties, null);
+
+        //make sure we have all required parameters
+        if (!this.baseParameters.keySet().containsAll(baseParametersNames)) {
+            throw new PIPException("The 'base' template contains parameters that were not specified in its map.");
+        }
+        if (!this.filterParameters.keySet().containsAll(filterParametersNames)) {
+            throw new PIPException("The 'filter' template contains parameters that were not specified in its map.");
+        }
+        this.filterView = Configurables.getPIPRequestMap(id + ".filter", "view", properties, defaultIssuer);
+        if (this.logger.isTraceEnabled()) {
+            this.logger.trace("(" + id + ") " +
+                              "\nbase '" + this.base + "', parameters " + this.baseParameters +
+                              "\nfilter '" + this.filter + "', parameters " + this.filterParameters + ", view " + this.filterView);
+        }
+    }
+
+    public void store(String id, Properties properties) throws PIPException {
+        properties.setProperty(id + ".base", this.base);
+        properties.setProperty(id + ".filter", this.filter);
+        Configurables.setPIPRequestMap(this.baseParameters,
+                                       id + ".base", "parameters", properties);
+        Configurables.setPIPRequestMap(this.filterParameters,
+                                       id + ".filter", "parameters", properties);
+        Configurables.setPIPRequestMap(this.filterView,
+                                       id + ".filter", "view", properties);
+    }
+
+    /*
+     * @return the set of parameters names required by the given velocity template
+     */
+    private Set<String> prepareVelocityTemplate(String template)
+    throws PIPException {
+        VelocityContext vctx = new VelocityContext();
+        EventCartridge vec = new EventCartridge();
+        VelocityParameterReader reader = new VelocityParameterReader();
+        vec.addEventHandler(reader);
+        vec.attachToContext(vctx);
+
+        try {
+            Velocity.evaluate(vctx, new StringWriter(),
+                              "LdapResolver", template);
+        } catch (ParseErrorException pex) {
+            throw new PIPException(
+                "Velocity template preparation failed",pex);
+        } catch (MethodInvocationException mix) {
+            throw new PIPException(
+                "Velocity template preparation failed",mix);
+        } catch (ResourceNotFoundException rnfx) {
+            throw new PIPException(
+                "Velocity template preparation failed",rnfx);
+        }
+        if (this.logger.isTraceEnabled()) {
+            this.logger.trace("(" + id + ") " + template + " with parameters " + reader.parameters);
         }
 
-        private String evaluateVelocityTemplate(String template,
-                        final Map<String,PIPRequest> templateParameters,
-                        final PIPEngine pipEngine,
-                        final PIPFinder pipFinder) 
-                                        throws PIPException {
-                StringWriter out = new StringWriter();
-                VelocityContext vctx = new VelocityContext();
-                EventCartridge vec = new EventCartridge();
-                VelocityParameterWriter writer = new VelocityParameterWriter(
-                                pipEngine, pipFinder, templateParameters);
-                vec.addEventHandler(writer);
-                vec.attachToContext(vctx);
+        return reader.parameters;
+    }
 
-                try {
-                        Velocity.evaluate(vctx, out,
-                                        "LdapResolver", template);
-                }
-                catch (ParseErrorException pex) {
-                        throw new PIPException(
-                                        "Velocity template evaluation failed",pex);
-                }
-                catch (MethodInvocationException mix) {
-                        throw new PIPException(
-                                        "Velocity template evaluation failed",mix);
-                }
-                catch (ResourceNotFoundException rnfx) {
-                        throw new PIPException(
-                                        "Velocity template evaluation failed",rnfx);
-                }
+    private String evaluateVelocityTemplate(String template,
+                                            final Map<String,PIPRequest> templateParameters,
+                                            final PIPEngine pipEngine,
+                                            final PIPFinder pipFinder)
+    throws PIPException {
+        StringWriter out = new StringWriter();
+        VelocityContext vctx = new VelocityContext();
+        EventCartridge vec = new EventCartridge();
+        VelocityParameterWriter writer = new VelocityParameterWriter(
+            pipEngine, pipFinder, templateParameters);
+        vec.addEventHandler(writer);
+        vec.attachToContext(vctx);
 
-                this.logger.warn("(" + id + ") " + " template yields " + out.toString());
-
-                return out.toString();
+        try {
+            Velocity.evaluate(vctx, out,
+                              "LdapResolver", template);
+        } catch (ParseErrorException pex) {
+            throw new PIPException(
+                "Velocity template evaluation failed",pex);
+        } catch (MethodInvocationException mix) {
+            throw new PIPException(
+                "Velocity template evaluation failed",mix);
+        } catch (ResourceNotFoundException rnfx) {
+            throw new PIPException(
+                "Velocity template evaluation failed",rnfx);
         }
 
-        private Object evaluatePIPRequest(PIPRequest pipRequest,
-                        PIPEngine pipEngine,
-                        PIPFinder pipFinder) 
-                                        throws PIPException {
-                if (this.logger.isTraceEnabled()) {
-                        this.logger.trace("(" + id + ") " + pipRequest);
+        this.logger.warn("(" + id + ") " + " template yields " + out.toString());
+
+        return out.toString();
+    }
+
+    private Object evaluatePIPRequest(PIPRequest pipRequest,
+                                      PIPEngine pipEngine,
+                                      PIPFinder pipFinder)
+    throws PIPException {
+        if (this.logger.isTraceEnabled()) {
+            this.logger.trace("(" + id + ") " + pipRequest);
+        }
+        PIPResponse pipResponse = pipFinder.getMatchingAttributes(pipRequest, null);
+        if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
+            Collection<Attribute> listAttributes  = pipResponse.getAttributes();
+            if (listAttributes.size() > 0) {
+                if (listAttributes.size() > 1) {
+                    if (this.logger.isTraceEnabled()) {
+                        this.logger.trace("(" + id + ") " + "PIPFinder returned more than one Attribute for " + pipRequest);
+                    }
+                    throw new PIPException("PIPFinder returned more than one Attribute for " + pipRequest.toString());
                 }
-                PIPResponse pipResponse = pipFinder.getMatchingAttributes(pipRequest, null);
-                if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
-                        Collection<Attribute> listAttributes  = pipResponse.getAttributes();
-                        if (listAttributes.size() > 0) {
-                                if (listAttributes.size() > 1) {
-                                        if (this.logger.isTraceEnabled()) {
-                                                this.logger.trace("(" + id + ") " + "PIPFinder returned more than one Attribute for " + pipRequest);
-                                        }
-                                        throw new PIPException("PIPFinder returned more than one Attribute for " + pipRequest.toString());
-                                }
-                                Collection<AttributeValue<?>> listAttributeValuesReturned = listAttributes.iterator().next().getValues();
-                                if (listAttributeValuesReturned.size() > 0) {
-                                        if (listAttributeValuesReturned.size() > 1) {
-                                                if (this.logger.isTraceEnabled()) {
-                                                        this.logger.trace("(" + id + ") " + "PIPFinder returned more than one AttributeValue for " + pipRequest);
-                                                }
-                                                return null;
-                                        }
-                                        AttributeValue<?> attributeValue = listAttributeValuesReturned.iterator().next();
-                                        //this is to hoping the string representation of the value is accurate
-                                        try {
-                                                return DataTypes.DT_STRING.convert(attributeValue.getValue());
-                                        }
-                                        catch (DataTypeException dtx) {
-                                                throw new PIPException("Fauiled to extract attribute value", dtx);
-                                        }
-                                }
+                Collection<AttributeValue<?>> listAttributeValuesReturned = listAttributes.iterator().next().getValues();
+                if (listAttributeValuesReturned.size() > 0) {
+                    if (listAttributeValuesReturned.size() > 1) {
+                        if (this.logger.isTraceEnabled()) {
+                            this.logger.trace("(" + id + ") " + "PIPFinder returned more than one AttributeValue for " + pipRequest);
                         }
+                        return null;
+                    }
+                    AttributeValue<?> attributeValue = listAttributeValuesReturned.iterator().next();
+                    //this is to hoping the string representation of the value is accurate
+                    try {
+                        return DataTypes.DT_STRING.convert(attributeValue.getValue());
+                    } catch (DataTypeException dtx) {
+                        throw new PIPException("Fauiled to extract attribute value", dtx);
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public String getBase(PIPEngine pipEngine,
+                          PIPRequest pipRequest,
+                          PIPFinder pipFinder) throws PIPException {
+
+        if (!filterView.containsValue(pipRequest)) {
+            if (this.logger.isTraceEnabled()) {
+                this.logger.trace("(" + id + ") " + pipRequest + " not in " + filterView);
+            }
+            return null;
+        }
+
+        if (this.logger.isTraceEnabled()) {
+            this.logger.trace("(" + id + ") " + pipRequest);
+        }
+        return evaluateVelocityTemplate(this.base, this.baseParameters,
+                                        pipEngine, pipFinder);
+    }
+
+    public void setBase(String base) throws PIPException {
+        Set<String> baseParametersNames = prepareVelocityTemplate(base);
+        //make sure we have all required parameters
+        if (!this.baseParameters.keySet().containsAll(baseParametersNames)) {
+            throw new PIPException("The 'base' template contains parameters that were not specified in its map.");
+        }
+        this.base = base;
+    }
+
+    @Override
+    public String getFilterString(PIPEngine pipEngine, PIPRequest pipRequest,
+                                  PIPFinder pipFinder) throws PIPException {
+
+        if (this.logger.isTraceEnabled()) {
+            this.logger.trace("(" + id + ") " + pipRequest);
+        }
+
+        if (!filterView.containsValue(pipRequest)) {
+            if (this.logger.isTraceEnabled()) {
+                this.logger.trace("(" + id + ") " + "request " + pipRequest + " not in " + filterView);
+            }
+            return null;
+        }
+
+        return evaluateVelocityTemplate(this.filter, this.filterParameters,
+                                        pipEngine, pipFinder);
+    }
+
+    public void setFilterString(String filter) throws PIPException {
+        Set<String> filterParametersNames = prepareVelocityTemplate(filter);
+        //make sure we have all required parameters
+        if (!this.filterParameters.keySet().containsAll(filterParametersNames)) {
+            throw new PIPException("The 'filter' template contains parameters that were not specified in its map.");
+        }
+        this.filter = filter;
+    }
+
+    private Attribute decodeResultValue(SearchResult searchResult,
+                                        String view,
+                                        PIPRequest viewRequest) {
+        AttributeValue<?> attributeValue	= null;
+        Collection<AttributeValue<?>> attributeMultiValue = null;
+        DataType<?> dataType = null;
+
+        this.logger.warn("(" + id + ") " + "SearchResult attributes: " + searchResult.getAttributes());
+        try {
+            dataType = dataTypeFactory.getDataType(
+                           viewRequest.getDataTypeId());
+            if (dataType == null) {
+                if (this.logger.isTraceEnabled()) {
+                    this.logger.trace("(" + id + ") " + "Unknown data type in " + viewRequest);
                 }
                 return null;
-        }
+            }
 
-        @Override
-        public String getBase(PIPEngine pipEngine,
-                        PIPRequest pipRequest,
-                        PIPFinder pipFinder) throws PIPException {
-
-                if (!filterView.containsValue(pipRequest)) {
+            if ("dn".equalsIgnoreCase(view)) {
+                attributeValue	= dataType.createAttributeValue(
+                                      searchResult.getNameInNamespace());
+            } else {
+                javax.naming.directory.Attribute dirAttr =
+                    searchResult.getAttributes().get(view);
+                if (dirAttr != null) {
+                    if (this.logger.isTraceEnabled()) {
+                        this.logger.trace("(" + id + ") " + "directory attribute '" + view + "' value is '" + dirAttr + "'");
+                    }
+                    //we could guide this more elaborately by object class ..
+                    if (dirAttr.size() == 1) {
+                        attributeValue	= dataType.createAttributeValue(
+                                              dirAttr.get().toString());
+                    } else {
                         if (this.logger.isTraceEnabled()) {
-                                this.logger.trace("(" + id + ") " + pipRequest + " not in " + filterView);
+                            this.logger.trace("(" + id + ") " + "SearchResult yields a multi-valued '" + view+ "'");
                         }
+                        attributeMultiValue = new HashSet<AttributeValue<?>>();
+                        //we should
+                        for (int i = 0; i < dirAttr.size(); i++) {
+                            attributeMultiValue.add(
+                                dataType.createAttributeValue(
+                                    dirAttr.get().toString()));
+                        }
+                    }
+                } else {
+                    this.logger.warn("(" + id + ") " + "SearchResult did not provide a value for '" + view+ "'");
+                    return null;
+                }
+            }
+        } catch (DataTypeException dtx) {
+            this.logger.error("(" + id + ") " + "Failed to decode search result", dtx);
+            return null;
+        } catch (NamingException nx) {
+            this.logger.error("(" + id + ") " + "Failed to decode search result", nx);
+            return null;
+        }
+
+        Attribute attr = null;
+        if (attributeMultiValue == null) {
+            attr = new StdAttribute(viewRequest.getCategory(),
+                                    viewRequest.getAttributeId(),
+                                    attributeValue,
+                                    viewRequest.getIssuer(),
+                                    false);
+        } else {
+            attr = new StdAttribute(viewRequest.getCategory(),
+                                    viewRequest.getAttributeId(),
+                                    attributeMultiValue,
+                                    viewRequest.getIssuer(),
+                                    false);
+        }
+        this.logger.warn("(" + id + ") " + " providing attribute " + attr);
+        return attr;
+    }
+
+    @Override
+    public List<Attribute> decodeResult(SearchResult searchResult)
+    throws PIPException {
+        List<Attribute> attributes	= new ArrayList<Attribute>();
+        for (Map.Entry<String,PIPRequest> viewEntry: this.filterView.entrySet()) {
+            Attribute attribute	= this.decodeResultValue(searchResult, viewEntry.getKey(), viewEntry.getValue());
+            if (attribute != null) {
+                attributes.add(attribute);
+            }
+        }
+        return attributes;
+    }
+
+    private class VelocityParameterHandler implements ReferenceInsertionEventHandler {
+
+        /* velocity parameter pattern: we're just trying to extract the name */
+        private Pattern vpp = Pattern.compile("\\{(\\w)+\\}");
+
+        public Object referenceInsert(String theReference, Object theValue) {
+            /* unfortunately Velocity does not give us simply the variable name
+            but it's whole template representation, i.e. ${var_name} or derivatives.
+            We look for whatever is between { and } */
+            Matcher vvm = vpp.matcher(theReference);
+            String param = null;
+            // Check all occurance
+            if (vvm.find()) {
+                String vv = vvm.group();
+                param = vv.substring(1,vv.length()-1);
+            } else {
+                //variable name pattern not right?
+                param = "";
+            }
+            if (ConfigurableLDAPResolver.this.logger.isTraceEnabled()) {
+                ConfigurableLDAPResolver.this.logger.trace("(" + id + ") " + "Velocity parameter: " + param);
+            }
+            return param;
+        }
+    }
+
+    /* */
+    private class VelocityParameterReader extends VelocityParameterHandler {
+
+        private Set<String> parameters = new HashSet<String>();
+
+        public Object referenceInsert(String theReference,
+                                      Object theValue) {
+            String param = (String)super.referenceInsert(theReference, theValue);
+            parameters.add(param);
+            return "";
+        }
+    }
+
+    private class VelocityParameterWriter extends VelocityParameterHandler {
+
+        private PIPEngine	engine;
+        private PIPFinder finder;
+        private Map<String,PIPRequest> parameters;
+
+        public VelocityParameterWriter(PIPEngine engine,
+                                       PIPFinder finder,
+                                       Map<String,PIPRequest> parameters) {
+            this.engine = engine;
+            this.finder = finder;
+            this.parameters = parameters;
+        }
+
+        public Object referenceInsert(String theReference,
+                                      Object theValue) {
+
+            String param = (String)super.referenceInsert(theReference, theValue);
+            try {
+                PIPRequest request =	parameters.get(param);
+                if (ConfigurableLDAPResolver.this.logger.isTraceEnabled()) {
+                    ConfigurableLDAPResolver.this.logger.trace("(" + id + ") " + "Velocity parameter: " + param + " requests " + request);
+                }
+                if (null == request)
+                    throw new RuntimeException("Parameter '" + param + "' is not available");
+                Object val = ConfigurableLDAPResolver.this.evaluatePIPRequest(
+                                 request, this.engine, this.finder);
+
+                if (null != val) {
+                    return val;
+                } else {
+                    if (param.startsWith("_")) {
+                        return "*";
+                    } else {
                         return null;
+                    }
                 }
-
-                if (this.logger.isTraceEnabled()) {
-                        this.logger.trace("(" + id + ") " + pipRequest);
-                }
-                return evaluateVelocityTemplate(this.base, this.baseParameters,
-                                pipEngine, pipFinder);
+            } catch (PIPException pipx) {
+                throw new RuntimeException(pipx);
+            }
         }
+    }
 
-        public void setBase(String base) throws PIPException {
-                Set<String> baseParametersNames = prepareVelocityTemplate(base);
-                //make sure we have all required parameters
-                if (!this.baseParameters.keySet().containsAll(baseParametersNames)) {
-                        throw new PIPException("The 'base' template contains parameters that were not specified in its map.");
-                }
-                this.base = base;
+    @Override
+    public void attributesRequired(Collection<PIPRequest> attributes) {
+        for (String key : this.filterView.keySet()) {
+            attributes.add(new StdPIPRequest(this.filterView.get(key)));
         }
+    }
 
-        @Override
-        public String getFilterString(PIPEngine pipEngine, PIPRequest pipRequest,
-                        PIPFinder pipFinder) throws PIPException {
-
-                if (this.logger.isTraceEnabled()) {
-                        this.logger.trace("(" + id + ") " + pipRequest);
-                }
-
-                if (!filterView.containsValue(pipRequest)) {
-                        if (this.logger.isTraceEnabled()) {
-                                this.logger.trace("(" + id + ") " + "request " + pipRequest + " not in " + filterView);
-                        }
-                        return null;
-                }
-
-                return evaluateVelocityTemplate(this.filter, this.filterParameters,
-                                pipEngine, pipFinder);
+    @Override
+    public void attributesProvided(Collection<PIPRequest> attributes) {
+        for (String key : this.filterParameters.keySet()) {
+            PIPRequest attribute = this.filterParameters.get(key);
+            attributes.add(new StdPIPRequest(attribute.getCategory(),
+                                             attribute.getAttributeId(),
+                                             attribute.getDataTypeId(),
+                                             (attribute.getIssuer() != null ? attribute.getIssuer() : this.defaultIssuer)));
         }
-
-        public void setFilterString(String filter) throws PIPException {
-                Set<String> filterParametersNames = prepareVelocityTemplate(filter);
-                //make sure we have all required parameters
-                if (!this.filterParameters.keySet().containsAll(filterParametersNames)) {
-                        throw new PIPException("The 'filter' template contains parameters that were not specified in its map.");
-                }
-                this.filter = filter;
-        }
-
-        private Attribute decodeResultValue(SearchResult searchResult,
-                        String view,
-                        PIPRequest viewRequest) {
-                AttributeValue<?> attributeValue	= null;
-                Collection<AttributeValue<?>> attributeMultiValue = null;
-                DataType<?> dataType = null;
-
-                this.logger.warn("(" + id + ") " + "SearchResult attributes: " + searchResult.getAttributes());
-                try {
-                        dataType = dataTypeFactory.getDataType(
-                                        viewRequest.getDataTypeId());
-                        if (dataType == null) {
-                                if (this.logger.isTraceEnabled()) {
-                                        this.logger.trace("(" + id + ") " + "Unknown data type in " + viewRequest);
-                                }
-                                return null;
-                        }
-
-                        if ("dn".equalsIgnoreCase(view)) {
-                                attributeValue	= dataType.createAttributeValue(	
-                                                searchResult.getNameInNamespace());
-                        }
-                        else {
-                                javax.naming.directory.Attribute dirAttr =
-                                                searchResult.getAttributes().get(view);
-                                if (dirAttr != null) {
-                                        if (this.logger.isTraceEnabled()) {
-                                                this.logger.trace("(" + id + ") " + "directory attribute '" + view + "' value is '" + dirAttr + "'");
-                                        }
-                                        //we could guide this more elaborately by object class ..
-                                        if (dirAttr.size() == 1) {
-                                                attributeValue	= dataType.createAttributeValue(	
-                                                                dirAttr.get().toString());
-                                        } else {
-                                                if (this.logger.isTraceEnabled()) {
-                                                        this.logger.trace("(" + id + ") " + "SearchResult yields a multi-valued '" + view+ "'");
-                                                }
-                                                attributeMultiValue = new HashSet<AttributeValue<?>>();
-                                                //we should 
-                                                for (int i = 0; i < dirAttr.size(); i++) {
-                                                        attributeMultiValue.add(
-                                                                        dataType.createAttributeValue(
-                                                                                        dirAttr.get().toString()));
-                                                }
-                                        }
-                                }
-                                else {
-                                        this.logger.warn("(" + id + ") " + "SearchResult did not provide a value for '" + view+ "'");
-                                        return null;
-                                }
-                        }
-                }
-                catch (DataTypeException dtx) {
-                        this.logger.error("(" + id + ") " + "Failed to decode search result", dtx);
-                        return null;
-                }
-                catch (NamingException nx) {
-                        this.logger.error("(" + id + ") " + "Failed to decode search result", nx);
-                        return null;
-                }
-
-                Attribute attr = null;
-                if (attributeMultiValue == null) {
-                        attr = new StdAttribute(viewRequest.getCategory(),
-                                        viewRequest.getAttributeId(),
-                                        attributeValue,
-                                        viewRequest.getIssuer(),
-                                        false);
-                }
-                else {
-                        attr = new StdAttribute(viewRequest.getCategory(),
-                                        viewRequest.getAttributeId(),
-                                        attributeMultiValue,
-                                        viewRequest.getIssuer(),
-                                        false);
-                }
-                this.logger.warn("(" + id + ") " + " providing attribute " + attr);
-                return attr;
-        }
-
-        @Override
-        public List<Attribute> decodeResult(SearchResult searchResult)
-                        throws PIPException {
-                List<Attribute> attributes	= new ArrayList<Attribute>();
-                for (Map.Entry<String,PIPRequest> viewEntry: this.filterView.entrySet()) {
-                        Attribute attribute	= this.decodeResultValue(searchResult, viewEntry.getKey(), viewEntry.getValue());
-                        if (attribute != null) {
-                                attributes.add(attribute);
-                        }
-                }
-                return attributes;
-        }
-
-        private class VelocityParameterHandler implements ReferenceInsertionEventHandler {
-
-                /* velocity parameter pattern: we're just trying to extract the name */
-                private Pattern vpp = Pattern.compile("\\{(\\w)+\\}");
-
-                public Object referenceInsert(String theReference, Object theValue) {
-                        /* unfortunately Velocity does not give us simply the variable name
-                        but it's whole template representation, i.e. ${var_name} or derivatives.
-                        We look for whatever is between { and } */
-                        Matcher vvm = vpp.matcher(theReference);
-                        String param = null;
-                        // Check all occurance
-                        if (vvm.find()) {
-                                String vv = vvm.group();
-                                param = vv.substring(1,vv.length()-1);
-                        }
-                        else {
-                                //variable name pattern not right?
-                                param = "";
-                        }
-                        if (ConfigurableLDAPResolver.this.logger.isTraceEnabled()) {
-                                ConfigurableLDAPResolver.this.logger.trace("(" + id + ") " + "Velocity parameter: " + param);
-                        }
-                        return param;
-                }
-        }
-
-        /* */
-        private class VelocityParameterReader extends VelocityParameterHandler {
-
-                private Set<String> parameters = new HashSet<String>();
-
-                public Object referenceInsert(String theReference,
-                                Object theValue) {
-                        String param = (String)super.referenceInsert(theReference, theValue);
-                        parameters.add(param);
-                        return "";
-                }
-        }
-
-        private class VelocityParameterWriter extends VelocityParameterHandler {
-
-                private PIPEngine	engine;
-                private PIPFinder finder;
-                private Map<String,PIPRequest> parameters;
-
-                public VelocityParameterWriter(PIPEngine engine,
-                                PIPFinder finder,
-                                Map<String,PIPRequest> parameters) {
-                        this.engine = engine;
-                        this.finder = finder;
-                        this.parameters = parameters;
-                }
-
-                public Object referenceInsert(String theReference,
-                                Object theValue) {
-
-                        String param = (String)super.referenceInsert(theReference, theValue);
-                        try {
-                                PIPRequest request =	parameters.get(param);
-                                if (ConfigurableLDAPResolver.this.logger.isTraceEnabled()) {
-                                        ConfigurableLDAPResolver.this.logger.trace("(" + id + ") " + "Velocity parameter: " + param + " requests " + request);
-                                }
-                                if (null == request)
-                                        throw new RuntimeException("Parameter '" + param + "' is not available");
-                                Object val = ConfigurableLDAPResolver.this.evaluatePIPRequest(
-                                                request, this.engine, this.finder);
-
-                                if (null != val) {
-                                        return val;
-                                }
-                                else {
-                                        if (param.startsWith("_")) {
-                                                return "*";
-                                        }
-                                        else {
-                                                return null;
-                                        }
-                                }
-                        }
-                        catch (PIPException pipx) {
-                                throw new RuntimeException(pipx);
-                        }
-                }
-        }
-
-        @Override
-        public void attributesRequired(Collection<PIPRequest> attributes) {
-                for (String key : this.filterView.keySet()) {
-                        attributes.add(new StdPIPRequest(this.filterView.get(key)));
-                }
-        }
-
-        @Override
-        public void attributesProvided(Collection<PIPRequest> attributes) {
-                for (String key : this.filterParameters.keySet()) {
-                        PIPRequest attribute = this.filterParameters.get(key);
-                        attributes.add(new StdPIPRequest(attribute.getCategory(), 
-                                        attribute.getAttributeId(), 
-                                        attribute.getDataTypeId(), 
-                                        (attribute.getIssuer() != null ? attribute.getIssuer() : this.defaultIssuer)));
-                }
-        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/LDAPEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/LDAPEngine.java
index 497c5d9..ae8fff9 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/LDAPEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/LDAPEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -63,277 +63,277 @@
 /**
  * LDAPEngine extends {@link com.att.research.xacml.std.pip.engines.StdConfigurableEngine} to implement a generic PIP for accessing
  * data from and LDAP server, including a configurable cache to avoid repeat queries.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class LDAPEngine extends StdConfigurableEngine {
-        public static final String PROP_RESOLVERS			= "resolvers";
-        public static final String PROP_RESOLVER			= "resolver";
-        public static final String PROP_LDAP_SCOPE			= "scope";
-        
-        private static final String LDAP_SCOPE_SUBTREE		= "subtree";
-        private static final String LDAP_SCOPE_OBJECT		= "object";
-        private static final String LDAP_SCOPE_ONELEVEL		= "onelevel";
-        private static final String DEFAULT_CONTEXT_FACTORY	= "com.sun.jndi.ldap.LdapCtxFactory";
-        private static final String DEFAULT_SCOPE			= LDAP_SCOPE_SUBTREE;
+    public static final String PROP_RESOLVERS			= "resolvers";
+    public static final String PROP_RESOLVER			= "resolver";
+    public static final String PROP_LDAP_SCOPE			= "scope";
 
-        private Log logger									= LogFactory.getLog(this.getClass());	
-        private Hashtable<Object,Object> ldapEnvironment	= new Hashtable<Object,Object>();
-        private List<LDAPResolver> ldapResolvers 			= new ArrayList<LDAPResolver>();
-        private int ldapScope;
-        
+    private static final String LDAP_SCOPE_SUBTREE		= "subtree";
+    private static final String LDAP_SCOPE_OBJECT		= "object";
+    private static final String LDAP_SCOPE_ONELEVEL		= "onelevel";
+    private static final String DEFAULT_CONTEXT_FACTORY	= "com.sun.jndi.ldap.LdapCtxFactory";
+    private static final String DEFAULT_SCOPE			= LDAP_SCOPE_SUBTREE;
+
+    private Log logger									= LogFactory.getLog(this.getClass());
+    private Hashtable<Object,Object> ldapEnvironment	= new Hashtable<Object,Object>();
+    private List<LDAPResolver> ldapResolvers 			= new ArrayList<LDAPResolver>();
+    private int ldapScope;
+
+    /*
+     * In addition, we pull the following standard LDAP properties from the configuration
+     * 	Context.AUTHORITATIVE: boolean
+     *  Context.BATCHSIZE: integer
+     *  Context.DNSURL: String
+     *  Context.INITIAL_CONTEXT_FACTORY: String
+     *  Context.LANGUAGE: String
+     *  Context.OBJECT_FACTORIES: String
+     *  Context.PROVIDER_URL: String
+     *  Context.REFERRAL: String
+     *  Context.SECURITY_AUTHENTICATION: String
+     *  Context.SECURITY_CREDENTIALS: String
+     *  Context.SECURITY_PRINCIPAL: String
+     *  Context.SECURITY_PROTOCOL: String
+     *  Context.STATE_FACTORIES: String
+     *  Context.URL_PKG_PREFIXES: String
+     */
+
+    public LDAPEngine() {
+    }
+
+    private boolean configureStringProperty(String propertyPrefix, String property, Properties properties, String defaultValue) {
+        String propertyValue	= properties.getProperty(propertyPrefix + property, defaultValue);
+        if (propertyValue != null) {
+            this.ldapEnvironment.put(property, propertyValue);
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private boolean configureIntegerProperty(String propertyPrefix, String property, Properties properties, Integer defaultValue) {
+        String propertyValue	= properties.getProperty(propertyPrefix + property);
+        if (propertyValue == null) {
+            if (defaultValue != null) {
+                this.ldapEnvironment.put(property, defaultValue);
+                return true;
+            } else {
+                return false;
+            }
+        } else {
+            try {
+                this.ldapEnvironment.put(property, Integer.parseInt(propertyValue));
+                return true;
+            } catch (NumberFormatException ex) {
+                this.logger.error("Invalid Integer '" + propertyValue + "' for '" + property + "' property");
+                return false;
+            }
+        }
+    }
+
+    @Override
+    public void configure(String id, Properties properties) throws PIPException {
         /*
-         * In addition, we pull the following standard LDAP properties from the configuration
-         * 	Context.AUTHORITATIVE: boolean
-         *  Context.BATCHSIZE: integer
-         *  Context.DNSURL: String
-         *  Context.INITIAL_CONTEXT_FACTORY: String
-         *  Context.LANGUAGE: String
-         *  Context.OBJECT_FACTORIES: String
-         *  Context.PROVIDER_URL: String
-         *  Context.REFERRAL: String
-         *  Context.SECURITY_AUTHENTICATION: String
-         *  Context.SECURITY_CREDENTIALS: String
-         *  Context.SECURITY_PRINCIPAL: String
-         *  Context.SECURITY_PROTOCOL: String
-         *  Context.STATE_FACTORIES: String
-         *  Context.URL_PKG_PREFIXES: String
+         * Handle the standard properties
          */
+        super.configure(id, properties);
+        String propertyPrefix	= id + ".";
 
-        public LDAPEngine() {
+        /*
+         * Configure the LDAP environment: I think the only required property is the provider_url
+         */
+        if (!this.configureStringProperty(propertyPrefix, Context.PROVIDER_URL, properties, null)) {
+            throw new PIPException("Invalid configuration for " + this.getClass().getName() + ": No " + propertyPrefix + Context.PROVIDER_URL);
         }
-        
-        private boolean configureStringProperty(String propertyPrefix, String property, Properties properties, String defaultValue) {
-                String propertyValue	= properties.getProperty(propertyPrefix + property, defaultValue);
-                if (propertyValue != null) {
-                        this.ldapEnvironment.put(property, propertyValue);
-                        return true;
-                } else {
-                        return false;
-                }
-        }
-        
-        private boolean configureIntegerProperty(String propertyPrefix, String property, Properties properties, Integer defaultValue) {
-                String propertyValue	= properties.getProperty(propertyPrefix + property);
-                if (propertyValue == null) {
-                        if (defaultValue != null) {
-                                this.ldapEnvironment.put(property, defaultValue);
-                                return true;
-                        } else {
-                                return false;
-                        }
-                } else {
-                        try {
-                                this.ldapEnvironment.put(property, Integer.parseInt(propertyValue));
-                                return true;
-                        } catch (NumberFormatException ex) {
-                                this.logger.error("Invalid Integer '" + propertyValue + "' for '" + property + "' property");
-                                return false;
-                        }
-                }
-        }
-        
-        @Override
-        public void configure(String id, Properties properties) throws PIPException {
-                /*
-                 * Handle the standard properties
-                 */
-                super.configure(id, properties);
-                String propertyPrefix	= id + ".";
-                
-                /*
-                 * Configure the LDAP environment: I think the only required property is the provider_url
-                 */
-                if (!this.configureStringProperty(propertyPrefix, Context.PROVIDER_URL, properties, null)) {
-                        throw new PIPException("Invalid configuration for " + this.getClass().getName() + ": No " + propertyPrefix + Context.PROVIDER_URL);			
-                }
-                this.configureStringProperty(propertyPrefix, Context.AUTHORITATIVE, properties, null);
-                this.configureIntegerProperty(propertyPrefix, Context.BATCHSIZE, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.DNS_URL, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.INITIAL_CONTEXT_FACTORY, properties, DEFAULT_CONTEXT_FACTORY);
-                this.configureStringProperty(propertyPrefix, Context.LANGUAGE, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.OBJECT_FACTORIES, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.REFERRAL, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.SECURITY_AUTHENTICATION, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.SECURITY_CREDENTIALS, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.SECURITY_PRINCIPAL, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.SECURITY_PROTOCOL, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.STATE_FACTORIES, properties, null);
-                this.configureStringProperty(propertyPrefix, Context.URL_PKG_PREFIXES, properties, null);
-                
-                String ldapScopeValue	= properties.getProperty(propertyPrefix + PROP_LDAP_SCOPE, DEFAULT_SCOPE);
-                if (LDAP_SCOPE_SUBTREE.equals(ldapScopeValue)) {
-                        this.ldapScope	= SearchControls.SUBTREE_SCOPE;
-                } else if (LDAP_SCOPE_OBJECT.equals(ldapScopeValue)) {
-                        this.ldapScope	= SearchControls.OBJECT_SCOPE;
-                } else if (LDAP_SCOPE_ONELEVEL.equals(ldapScopeValue)) {
-                        this.ldapScope	= SearchControls.ONELEVEL_SCOPE;
-                } else {
-                        this.logger.warn("Invalid LDAP Scope value '" + ldapScopeValue + "'; using " + DEFAULT_SCOPE);
-                        this.ldapScope	= SearchControls.SUBTREE_SCOPE;
-                }
-                
-                /*
-                 * Get list of resolvers defined for this LDAP Engine
-                 */
-                String resolversList = properties.getProperty(propertyPrefix + PROP_RESOLVERS);
-                if (resolversList == null || resolversList.isEmpty()) {
-                        throw new PIPException("Invalid configuration for " + this.getClass().getName() + ": No " + propertyPrefix + PROP_RESOLVERS);
-                }
+        this.configureStringProperty(propertyPrefix, Context.AUTHORITATIVE, properties, null);
+        this.configureIntegerProperty(propertyPrefix, Context.BATCHSIZE, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.DNS_URL, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.INITIAL_CONTEXT_FACTORY, properties, DEFAULT_CONTEXT_FACTORY);
+        this.configureStringProperty(propertyPrefix, Context.LANGUAGE, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.OBJECT_FACTORIES, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.REFERRAL, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.SECURITY_AUTHENTICATION, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.SECURITY_CREDENTIALS, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.SECURITY_PRINCIPAL, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.SECURITY_PROTOCOL, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.STATE_FACTORIES, properties, null);
+        this.configureStringProperty(propertyPrefix, Context.URL_PKG_PREFIXES, properties, null);
 
-                /*
-                 * Iterate the resolvers
-                 */
-                for (String resolver : Splitter.on(',').trimResults().omitEmptyStrings().split(resolversList)) {
-                        /*
-                         * Get the LDAPResolver for this LDAPEngine
-                         */
-                        String resolverClassName	= properties.getProperty(propertyPrefix + PROP_RESOLVER + "." + resolver + ".classname");
-                        if (resolverClassName == null) {
-                                throw new PIPException("Invalid configuration for " + this.getClass().getName() + ": No " + propertyPrefix + PROP_RESOLVER + "." + resolver + ".classname");
-                        }
-                        
-                        LDAPResolver ldapResolverNew	= null;
-                        try {
-                                Class<?> classResolver	= Class.forName(resolverClassName);
-                                if (!LDAPResolver.class.isAssignableFrom(classResolver)) {
-                                        this.logger.error("LDAPResolver class " + resolverClassName + " does not implement " + LDAPResolver.class.getCanonicalName());
-                                        throw new PIPException("LDAPResolver class " + resolverClassName + " does not implement " + LDAPResolver.class.getCanonicalName());
-                                }
-                                ldapResolverNew	= LDAPResolver.class.cast(classResolver.newInstance());
-                        } catch (Exception ex) {
-                                this.logger.error("Exception instantiating LDAPResolver for class '" + resolverClassName + "': " + ex.getMessage(), ex);
-                                throw new PIPException("Exception instantiating LDAPResolver for class '" + resolverClassName + "'", ex);
-                        }
-                        assert(ldapResolverNew != null);
-                        ldapResolverNew.configure(propertyPrefix + PROP_RESOLVER + "." + resolver, properties, this.getIssuer());
-                        
-                        this.ldapResolvers.add(ldapResolverNew);
-                }			
-                
+        String ldapScopeValue	= properties.getProperty(propertyPrefix + PROP_LDAP_SCOPE, DEFAULT_SCOPE);
+        if (LDAP_SCOPE_SUBTREE.equals(ldapScopeValue)) {
+            this.ldapScope	= SearchControls.SUBTREE_SCOPE;
+        } else if (LDAP_SCOPE_OBJECT.equals(ldapScopeValue)) {
+            this.ldapScope	= SearchControls.OBJECT_SCOPE;
+        } else if (LDAP_SCOPE_ONELEVEL.equals(ldapScopeValue)) {
+            this.ldapScope	= SearchControls.ONELEVEL_SCOPE;
+        } else {
+            this.logger.warn("Invalid LDAP Scope value '" + ldapScopeValue + "'; using " + DEFAULT_SCOPE);
+            this.ldapScope	= SearchControls.SUBTREE_SCOPE;
         }
-        
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
-                /*
-                 * Make sure we have at least one resolver.
-                 */
-                if (this.ldapResolvers.size() == 0) {
-                        throw new IllegalStateException(this.getClass().getCanonicalName() + " is not configured");
-                }
-                
-                StdMutablePIPResponse mutablePIPResponse	= new StdMutablePIPResponse();
-                for (LDAPResolver ldapResolver : this.ldapResolvers) {
-                        this.getAttributes(pipRequest, pipFinder, mutablePIPResponse, ldapResolver);
-                }
-                if (mutablePIPResponse.getAttributes().size() == 0) {
-                        if (this.logger.isDebugEnabled()) {
-                                this.logger.debug("returning empty response");
-                        }
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                } else {
-                        if (this.logger.isDebugEnabled()) {
-                                this.logger.debug("Returning " + mutablePIPResponse.getAttributes().size() + " attributes");
-                                this.logger.debug(mutablePIPResponse.getAttributes());
-                        }
-                        return new StdPIPResponse(mutablePIPResponse);
-                }
+
+        /*
+         * Get list of resolvers defined for this LDAP Engine
+         */
+        String resolversList = properties.getProperty(propertyPrefix + PROP_RESOLVERS);
+        if (resolversList == null || resolversList.isEmpty()) {
+            throw new PIPException("Invalid configuration for " + this.getClass().getName() + ": No " + propertyPrefix + PROP_RESOLVERS);
         }
-        
-        public void getAttributes(PIPRequest pipRequest, PIPFinder pipFinder, StdMutablePIPResponse mutablePIPResponse, LDAPResolver ldapResolver) throws PIPException {
-                /*
-                 * Check with the resolver to get the base string
-                 */
-                String stringBase	= ldapResolver.getBase(this, pipRequest, pipFinder);
-                if (stringBase == null) {
-                        this.logger.warn(this.getName() + " does not handle " + pipRequest.toString());
-                        return;
+
+        /*
+         * Iterate the resolvers
+         */
+        for (String resolver : Splitter.on(',').trimResults().omitEmptyStrings().split(resolversList)) {
+            /*
+             * Get the LDAPResolver for this LDAPEngine
+             */
+            String resolverClassName	= properties.getProperty(propertyPrefix + PROP_RESOLVER + "." + resolver + ".classname");
+            if (resolverClassName == null) {
+                throw new PIPException("Invalid configuration for " + this.getClass().getName() + ": No " + propertyPrefix + PROP_RESOLVER + "." + resolver + ".classname");
+            }
+
+            LDAPResolver ldapResolverNew	= null;
+            try {
+                Class<?> classResolver	= Class.forName(resolverClassName);
+                if (!LDAPResolver.class.isAssignableFrom(classResolver)) {
+                    this.logger.error("LDAPResolver class " + resolverClassName + " does not implement " + LDAPResolver.class.getCanonicalName());
+                    throw new PIPException("LDAPResolver class " + resolverClassName + " does not implement " + LDAPResolver.class.getCanonicalName());
                 }
-                
-                /*
-                 * Get the filter string
-                 */
-                String stringFilter	= ldapResolver.getFilterString(this, pipRequest, pipFinder);
-                
-                /*
-                 * Check the cache
-                 */
-                Cache<String, PIPResponse> cache = this.getCache();
-                String cacheKey		= stringBase + "::" + (stringFilter == null ? "" : stringFilter);
-                if (cache != null) {
-                        PIPResponse pipResponse	= cache.getIfPresent(cacheKey);
-                        if (pipResponse != null) {
-                                if (this.logger.isDebugEnabled()) {
-                                        this.logger.debug("Returning cached response: " + pipResponse);
-                                }
-                                mutablePIPResponse.addAttributes(pipResponse.getAttributes());
-                                return;
-                        }
-                }		
-                /*
-                 * Not in the cache, so set up the LDAP query session
-                 */
-                DirContext dirContext	= null;
-                PIPResponse pipResponse = null;
+                ldapResolverNew	= LDAPResolver.class.cast(classResolver.newInstance());
+            } catch (Exception ex) {
+                this.logger.error("Exception instantiating LDAPResolver for class '" + resolverClassName + "': " + ex.getMessage(), ex);
+                throw new PIPException("Exception instantiating LDAPResolver for class '" + resolverClassName + "'", ex);
+            }
+            assert(ldapResolverNew != null);
+            ldapResolverNew.configure(propertyPrefix + PROP_RESOLVER + "." + resolver, properties, this.getIssuer());
+
+            this.ldapResolvers.add(ldapResolverNew);
+        }
+
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException {
+        /*
+         * Make sure we have at least one resolver.
+         */
+        if (this.ldapResolvers.size() == 0) {
+            throw new IllegalStateException(this.getClass().getCanonicalName() + " is not configured");
+        }
+
+        StdMutablePIPResponse mutablePIPResponse	= new StdMutablePIPResponse();
+        for (LDAPResolver ldapResolver : this.ldapResolvers) {
+            this.getAttributes(pipRequest, pipFinder, mutablePIPResponse, ldapResolver);
+        }
+        if (mutablePIPResponse.getAttributes().size() == 0) {
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("returning empty response");
+            }
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
+        } else {
+            if (this.logger.isDebugEnabled()) {
+                this.logger.debug("Returning " + mutablePIPResponse.getAttributes().size() + " attributes");
+                this.logger.debug(mutablePIPResponse.getAttributes());
+            }
+            return new StdPIPResponse(mutablePIPResponse);
+        }
+    }
+
+    public void getAttributes(PIPRequest pipRequest, PIPFinder pipFinder, StdMutablePIPResponse mutablePIPResponse, LDAPResolver ldapResolver) throws PIPException {
+        /*
+         * Check with the resolver to get the base string
+         */
+        String stringBase	= ldapResolver.getBase(this, pipRequest, pipFinder);
+        if (stringBase == null) {
+            this.logger.warn(this.getName() + " does not handle " + pipRequest.toString());
+            return;
+        }
+
+        /*
+         * Get the filter string
+         */
+        String stringFilter	= ldapResolver.getFilterString(this, pipRequest, pipFinder);
+
+        /*
+         * Check the cache
+         */
+        Cache<String, PIPResponse> cache = this.getCache();
+        String cacheKey		= stringBase + "::" + (stringFilter == null ? "" : stringFilter);
+        if (cache != null) {
+            PIPResponse pipResponse	= cache.getIfPresent(cacheKey);
+            if (pipResponse != null) {
+                if (this.logger.isDebugEnabled()) {
+                    this.logger.debug("Returning cached response: " + pipResponse);
+                }
+                mutablePIPResponse.addAttributes(pipResponse.getAttributes());
+                return;
+            }
+        }
+        /*
+         * Not in the cache, so set up the LDAP query session
+         */
+        DirContext dirContext	= null;
+        PIPResponse pipResponse = null;
+        try {
+            /*
+             * Create the DirContext
+             */
+            dirContext	= new InitialDirContext(this.ldapEnvironment);
+
+            /*
+             * Set up the search controls
+             */
+            SearchControls searchControls	= new SearchControls();
+            searchControls.setSearchScope(this.ldapScope);
+
+            /*
+             * Do the search
+             */
+            NamingEnumeration<SearchResult> namingEnumeration	= dirContext.search(stringBase, stringFilter, searchControls);
+            if (namingEnumeration != null && namingEnumeration.hasMore()) {
+                while (namingEnumeration.hasMore()) {
+                    List<Attribute> listAttributes	= ldapResolver.decodeResult(namingEnumeration.next());
+                    if (listAttributes != null && listAttributes.size() > 0) {
+                        mutablePIPResponse.addAttributes(listAttributes);
+                    }
+                }
+            }
+            /*
+             * Put in the cache
+             */
+            if (cache != null) {
+                cache.put(cacheKey, pipResponse);
+            }
+        } catch (NamingException ex) {
+            this.logger.error("NamingException creating the DirContext: " + ex.getMessage(), ex);
+        } finally {
+            if (dirContext != null) {
                 try {
-                        /*
-                         * Create the DirContext
-                         */
-                        dirContext	= new InitialDirContext(this.ldapEnvironment);
-                        
-                        /*
-                         * Set up the search controls
-                         */
-                        SearchControls searchControls	= new SearchControls();
-                        searchControls.setSearchScope(this.ldapScope);
-                        
-                        /*
-                         * Do the search
-                         */
-                        NamingEnumeration<SearchResult> namingEnumeration	= dirContext.search(stringBase, stringFilter, searchControls);
-                        if (namingEnumeration != null && namingEnumeration.hasMore()) {
-                                while (namingEnumeration.hasMore()) {
-                                        List<Attribute> listAttributes	= ldapResolver.decodeResult(namingEnumeration.next());
-                                        if (listAttributes != null && listAttributes.size() > 0) {
-                                                mutablePIPResponse.addAttributes(listAttributes);
-                                        }
-                                }
-                        }
-                        /*
-                         * Put in the cache
-                         */
-                        if (cache != null) {
-                                cache.put(cacheKey, pipResponse);
-                        }
-                } catch (NamingException ex) {
-                        this.logger.error("NamingException creating the DirContext: " + ex.getMessage(), ex);
-                } finally {
-                        if (dirContext != null) {
-                                try {
-                                        dirContext.close();
-                                } catch (Exception ex) {
-                                        this.logger.warn("Exception closing DirContext: " + ex.getMessage(), ex);
-                                }
-                        }
+                    dirContext.close();
+                } catch (Exception ex) {
+                    this.logger.warn("Exception closing DirContext: " + ex.getMessage(), ex);
                 }
+            }
         }
+    }
 
-        @Override
-        public Collection<PIPRequest> attributesRequired() {
-                Set<PIPRequest> requiredAttributes = new HashSet<PIPRequest>();
-                for (LDAPResolver resolver : this.ldapResolvers) {
-                        resolver.attributesRequired(requiredAttributes);
-                }
-                return requiredAttributes;
+    @Override
+    public Collection<PIPRequest> attributesRequired() {
+        Set<PIPRequest> requiredAttributes = new HashSet<PIPRequest>();
+        for (LDAPResolver resolver : this.ldapResolvers) {
+            resolver.attributesRequired(requiredAttributes);
         }
+        return requiredAttributes;
+    }
 
-        @Override
-        public Collection<PIPRequest> attributesProvided() {
-                Set<PIPRequest> providedAttributes = new HashSet<PIPRequest>();
-                for (LDAPResolver resolver : this.ldapResolvers) {
-                        resolver.attributesProvided(providedAttributes);
-                }
-                return providedAttributes;
+    @Override
+    public Collection<PIPRequest> attributesProvided() {
+        Set<PIPRequest> providedAttributes = new HashSet<PIPRequest>();
+        for (LDAPResolver resolver : this.ldapResolvers) {
+            resolver.attributesProvided(providedAttributes);
         }
+        return providedAttributes;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/LDAPResolver.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/LDAPResolver.java
index 8e28890..6fb9ee5 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/LDAPResolver.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/LDAPResolver.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -45,40 +45,40 @@
  * LDAPResolver is the interface used by the {@link LDAPEngine} to convert
  * a request for a XACML attribute into an LDAP query string, including retrieving any required attributes needed to construct
  * the query string, and convert the response into a collection of {@link com.att.research.xacml.api.Attribute}s.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public interface LDAPResolver extends ConfigurableResolver {
-        /**
-         * Gets the base <code>String</code> to be used in the <code>search</code> method of a {@link javax.naming.directory.DirectoryContext}.
-         * 
-         * @param pipEngine the {@link com.att.research.xacml.api.pip.PIPEngine} making the request
-         * @param pipRequest the <code>PIPRequest</code> to convert
-         * @param pipFinder the {@link com.att.research.xacml.api.pip.PIPFinder} to use when resolving required attributes
-         * @return the base <code>String</code> or null if the <code>PIPRequest</code> cannot be satisfied by this <code>LDAPResolver</code>
-         */
-        public String getBase(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException;
-        
-        /**
-         * Converts the given <code>PIPRequest</code> into an LDAP filter string to use
-         * in the <code>search</code> method of a {@link javax.naming.directory.DirectoryContext}.
-         * 
-         * @param pipEngine the <code>PIPEngine</code> making the request
-         * @param pipRequest the <code>PIPRequest</code> to convert
-         * @param pipFinder the <code>PIPFinder</code> to use when resolving required attributes
-         * @return the filter string to use or null if the given <code>PIPRequest</code> cannot be satisfied by this <code>LDAPResolver</code>
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error retrieving any required attributes
-         */
-        public String getFilterString(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException;
-        
-        /**
-         * Converts a {@link javax.naming.directory.SearchResult} into a <code>List</code> of {@link com.att.research.xacml.api.Attribute}s.
-         * 
-         * @param searchResult the <code>SearchResult</code> to convert
-         * @return a <code>List</code> of <code>Attribute</code>s or null if the <code>SearchResult</code> connot be converted.
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error decoding the <code>SearchResult</code>
-         */
-        public List<Attribute> decodeResult(SearchResult searchResult) throws PIPException;
-        
+    /**
+     * Gets the base <code>String</code> to be used in the <code>search</code> method of a {@link javax.naming.directory.DirectoryContext}.
+     *
+     * @param pipEngine the {@link com.att.research.xacml.api.pip.PIPEngine} making the request
+     * @param pipRequest the <code>PIPRequest</code> to convert
+     * @param pipFinder the {@link com.att.research.xacml.api.pip.PIPFinder} to use when resolving required attributes
+     * @return the base <code>String</code> or null if the <code>PIPRequest</code> cannot be satisfied by this <code>LDAPResolver</code>
+     */
+    public String getBase(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException;
+
+    /**
+     * Converts the given <code>PIPRequest</code> into an LDAP filter string to use
+     * in the <code>search</code> method of a {@link javax.naming.directory.DirectoryContext}.
+     *
+     * @param pipEngine the <code>PIPEngine</code> making the request
+     * @param pipRequest the <code>PIPRequest</code> to convert
+     * @param pipFinder the <code>PIPFinder</code> to use when resolving required attributes
+     * @return the filter string to use or null if the given <code>PIPRequest</code> cannot be satisfied by this <code>LDAPResolver</code>
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error retrieving any required attributes
+     */
+    public String getFilterString(PIPEngine pipEngine, PIPRequest pipRequest, PIPFinder pipFinder) throws PIPException;
+
+    /**
+     * Converts a {@link javax.naming.directory.SearchResult} into a <code>List</code> of {@link com.att.research.xacml.api.Attribute}s.
+     *
+     * @param searchResult the <code>SearchResult</code> to convert
+     * @return a <code>List</code> of <code>Attribute</code>s or null if the <code>SearchResult</code> connot be converted.
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error decoding the <code>SearchResult</code>
+     */
+    public List<Attribute> decodeResult(SearchResult searchResult) throws PIPException;
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/package-info.java
index 2df782b..c8ff941 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/ldap/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,7 +34,7 @@
 /**
  * com.att.research.xacml.std.pip.engines.ldap contains an implementation of the {@link com.att.research.xacml.api.pip.PIPEngine}
  * interface that can access an LDAP server to retrieve XACML AttributeValues.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/package-info.java
index 534a4a6..048f850 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/engines/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 
 /**
  * com.att.research.xacml.std.pip.engines contains the standard implementation of the PIPEngine interface
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/ConfigurableEngineFinder.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/ConfigurableEngineFinder.java
index 67c0fb8..fc5ea71 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/ConfigurableEngineFinder.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/ConfigurableEngineFinder.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,109 +44,109 @@
 /**
  * ConfigurableEngineFinder extends {@link EngineFinder} with a method for configuring
  * it from a <code>Properties</code> object.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ConfigurableEngineFinder extends EngineFinder {
-        private static final String	PROP_PIP_ENGINES	= "xacml.pip.engines";
-        private static final String	CLASSNAME			= ".classname";
-        
-        private Log logger	= LogFactory.getLog(this.getClass());
-        
-        /**
-         * Creates an instance of the given <code>String</code> className for an object implementing the
-         * <code>ConfigurableEngine</code> interface.
-         * 
-         * @param className the <code>String</code> class name of the engine
-         * @return an instance of the given class name
-         * @throws com.att.research.xacml.api.pip.PIPException
+    private static final String	PROP_PIP_ENGINES	= "xacml.pip.engines";
+    private static final String	CLASSNAME			= ".classname";
+
+    private Log logger	= LogFactory.getLog(this.getClass());
+
+    /**
+     * Creates an instance of the given <code>String</code> className for an object implementing the
+     * <code>ConfigurableEngine</code> interface.
+     *
+     * @param className the <code>String</code> class name of the engine
+     * @return an instance of the given class name
+     * @throws com.att.research.xacml.api.pip.PIPException
+     */
+    protected ConfigurableEngine newEngine(String className) throws PIPException {
+        Class<?> classForEngine	= null;
+        try {
+            classForEngine	= Class.forName(className);
+            if (!ConfigurableEngine.class.isAssignableFrom(classForEngine)) {
+                throw new ClassNotFoundException("Engine class \"" + className + "\" does not implement ConfigurableEngine");
+            }
+            return ConfigurableEngine.class.cast(classForEngine.newInstance());
+        } catch (Exception ex) {
+            throw new PIPException("Exception getting Class for \"" + className + "\"" + ex.getLocalizedMessage());
+        }
+    }
+
+    protected void configureEngine(String engineId, Properties properties) throws PIPException {
+        /*
+         * Get the class name for the engine
          */
-        protected ConfigurableEngine newEngine(String className) throws PIPException {
-                Class<?> classForEngine	= null;
-                try {
-                        classForEngine	= Class.forName(className);
-                        if (!ConfigurableEngine.class.isAssignableFrom(classForEngine)) {
-                                throw new ClassNotFoundException("Engine class \"" + className + "\" does not implement ConfigurableEngine");
-                        }
-                        return ConfigurableEngine.class.cast(classForEngine.newInstance());
-                } catch (Exception ex) {
-                        throw new PIPException("Exception getting Class for \"" + className + "\"" + ex.getLocalizedMessage());
-                }
+        String engineClassName	= properties.getProperty(engineId + CLASSNAME);
+        if (engineClassName == null) {
+            throw new PIPException("No " + CLASSNAME + " property for PIP engine \"" + engineId + "\"");
         }
-        
-        protected void configureEngine(String engineId, Properties properties) throws PIPException {
-                /*
-                 * Get the class name for the engine
-                 */
-                String engineClassName	= properties.getProperty(engineId + CLASSNAME);
-                if (engineClassName == null) {
-                        throw new PIPException("No " + CLASSNAME + " property for PIP engine \"" + engineId + "\"");
-                }
-                
-                /*
-                 * Get an instance of the engine
-                 */
-                ConfigurableEngine configurableEngine	= newEngine(engineClassName);
-                
-                /*
-                 * Configure the engine
-                 */
-                configurableEngine.configure(engineId, properties);
-                
-                if (this.logger.isDebugEnabled()) {
-                        this.logger.debug("Engine " + engineId + " Provides: ");
-                        Collection<PIPRequest> attributes = configurableEngine.attributesProvided();
-                        for (PIPRequest attribute : attributes) {
-                                this.logger.debug(System.lineSeparator() + AttributeUtils.prettyPrint(attribute));				
-                        }
-                        this.logger.debug("Engine " + engineId + " Requires: ");
-                        attributes = configurableEngine.attributesRequired();
-                        for (PIPRequest attribute : attributes) {
-                                this.logger.debug(System.lineSeparator() + AttributeUtils.prettyPrint(attribute));				
-                        }
-                }
-                
-                /*
-                 * Register the engine
-                 */
-                this.register(configurableEngine);
-        }
-        
-        public ConfigurableEngineFinder() {
-        }
-        
-        /**
-         * Gets the "com.att.research.xacml.pip.engines" property from the given <code>Properties</code> to find
-         * the list of PIP engines that should be created, configured, and registered.
-         * 
-         * @param properties the <code>Properties</code> containing the engine configurations
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating and configuring the engines
+
+        /*
+         * Get an instance of the engine
          */
-        public void configure(Properties properties) throws PIPException {
-                String engineIds	= properties.getProperty(PROP_PIP_ENGINES);
-                if (engineIds == null || engineIds.length() == 0) {
-                        return;
-                }
-                
-                /*
-                 * Split the engines by comma
-                 */
-                String[] engineIdArray	= engineIds.split("[,]",0);
-                if (engineIdArray == null || engineIdArray.length == 0) {
-                        return;
-                }
-                
-                /*
-                 * For each engine ID, configure the engine and register it
-                 */
-                for (String engineId : engineIdArray) {
-                        try {
-                                this.configureEngine(engineId, properties);
-                        } catch (PIPException ex) {
-                                this.logger.error("Exception configuring engine with id \"" + engineId + "\"", ex);
-                        }
-                }
+        ConfigurableEngine configurableEngine	= newEngine(engineClassName);
+
+        /*
+         * Configure the engine
+         */
+        configurableEngine.configure(engineId, properties);
+
+        if (this.logger.isDebugEnabled()) {
+            this.logger.debug("Engine " + engineId + " Provides: ");
+            Collection<PIPRequest> attributes = configurableEngine.attributesProvided();
+            for (PIPRequest attribute : attributes) {
+                this.logger.debug(System.lineSeparator() + AttributeUtils.prettyPrint(attribute));
+            }
+            this.logger.debug("Engine " + engineId + " Requires: ");
+            attributes = configurableEngine.attributesRequired();
+            for (PIPRequest attribute : attributes) {
+                this.logger.debug(System.lineSeparator() + AttributeUtils.prettyPrint(attribute));
+            }
         }
-        
+
+        /*
+         * Register the engine
+         */
+        this.register(configurableEngine);
+    }
+
+    public ConfigurableEngineFinder() {
+    }
+
+    /**
+     * Gets the "com.att.research.xacml.pip.engines" property from the given <code>Properties</code> to find
+     * the list of PIP engines that should be created, configured, and registered.
+     *
+     * @param properties the <code>Properties</code> containing the engine configurations
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error creating and configuring the engines
+     */
+    public void configure(Properties properties) throws PIPException {
+        String engineIds	= properties.getProperty(PROP_PIP_ENGINES);
+        if (engineIds == null || engineIds.length() == 0) {
+            return;
+        }
+
+        /*
+         * Split the engines by comma
+         */
+        String[] engineIdArray	= engineIds.split("[,]",0);
+        if (engineIdArray == null || engineIdArray.length == 0) {
+            return;
+        }
+
+        /*
+         * For each engine ID, configure the engine and register it
+         */
+        for (String engineId : engineIdArray) {
+            try {
+                this.configureEngine(engineId, properties);
+            } catch (PIPException ex) {
+                this.logger.error("Exception configuring engine with id \"" + engineId + "\"", ex);
+            }
+        }
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/EngineFinder.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/EngineFinder.java
index 56f8b2c..4c499a8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/EngineFinder.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/EngineFinder.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -52,91 +52,91 @@
 /**
  * EngineFinder implements the {@link com.att.research.xacml.api.pip.PIPFinder} interface by maintaining a simple list of
  * registered {@link com.att.research.xacml.api.pip.PIPEngine} objects.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class EngineFinder implements PIPFinder {
-        private Map<String,List<PIPEngine>> pipEngines	= new HashMap<String,List<PIPEngine>>();
+    private Map<String,List<PIPEngine>> pipEngines	= new HashMap<String,List<PIPEngine>>();
 
-        /**
-         * Creates an empty <code>EngineFinder</code>
-         */
-        public EngineFinder() {
+    /**
+     * Creates an empty <code>EngineFinder</code>
+     */
+    public EngineFinder() {
+    }
+
+    /**
+     * Registers a new <code>PIPEngine</code> with this <code>EngineFinder</code>.
+     *
+     * @param pipEngine the <code>PIPEngine</code> to register
+     */
+    public void register(PIPEngine pipEngine) {
+        if (pipEngine != null) {
+            List<PIPEngine> pipEnginesForName	= this.pipEngines.get(pipEngine.getName());
+            if (pipEnginesForName == null) {
+                pipEnginesForName	= new ArrayList<PIPEngine>();
+                this.pipEngines.put(pipEngine.getName(), pipEnginesForName);
+            }
+            pipEnginesForName.add(pipEngine);
         }
-        
-        /**
-         * Registers a new <code>PIPEngine</code> with this <code>EngineFinder</code>.
-         * 
-         * @param pipEngine the <code>PIPEngine</code> to register
-         */
-        public void register(PIPEngine pipEngine) {
-                if (pipEngine != null) {
-                        List<PIPEngine> pipEnginesForName	= this.pipEngines.get(pipEngine.getName());
-                        if (pipEnginesForName == null) {
-                                pipEnginesForName	= new ArrayList<PIPEngine>();
-                                this.pipEngines.put(pipEngine.getName(), pipEnginesForName);
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
+        StdMutablePIPResponse pipResponse	= new StdMutablePIPResponse();
+        Status firstErrorStatus	= null;
+        Iterator<List<PIPEngine>> iterPIPEngineLists	= this.pipEngines.values().iterator();
+        while (iterPIPEngineLists.hasNext()) {
+            List<PIPEngine> listPIPEngines	= iterPIPEngineLists.next();
+            for (PIPEngine pipEngine : listPIPEngines) {
+                if (pipEngine != exclude) {
+                    PIPResponse pipResponseEngine = null;
+                    try {
+                        pipResponseEngine = pipEngine.getAttributes(pipRequest, pipFinderParent);
+                    } catch (Exception e) {
+                        pipResponseEngine = new StdPIPResponse(new
+                                                               StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR));
+                    }
+                    if (pipResponseEngine != null) {
+                        if (pipResponseEngine.getStatus() == null || pipResponseEngine.getStatus().isOk()) {
+                            pipResponse.addAttributes(pipResponseEngine.getAttributes());
+                        } else if (firstErrorStatus == null) {
+                            firstErrorStatus = pipResponseEngine.getStatus();
                         }
-                        pipEnginesForName.add(pipEngine);
+                    }
                 }
+            }
         }
-        
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
-                StdMutablePIPResponse pipResponse	= new StdMutablePIPResponse();
-                Status firstErrorStatus	= null;
-                Iterator<List<PIPEngine>> iterPIPEngineLists	= this.pipEngines.values().iterator();
-                while (iterPIPEngineLists.hasNext()) {
-                        List<PIPEngine> listPIPEngines	= iterPIPEngineLists.next();
-                        for (PIPEngine pipEngine : listPIPEngines) {
-                                if (pipEngine != exclude) {
-                                        PIPResponse pipResponseEngine = null;
-                                        try {
-                                                pipResponseEngine = pipEngine.getAttributes(pipRequest, pipFinderParent);
-                                        } catch (Exception e) {
-                                                pipResponseEngine = new StdPIPResponse(new
-                                                                StdStatus(StdStatusCode.STATUS_CODE_PROCESSING_ERROR));
-                                        }
-                                        if (pipResponseEngine != null) {
-                                                if (pipResponseEngine.getStatus() == null || pipResponseEngine.getStatus().isOk()) {
-                                                        pipResponse.addAttributes(pipResponseEngine.getAttributes());
-                                                } else if (firstErrorStatus == null) {
-                                                        firstErrorStatus = pipResponseEngine.getStatus();
-                                                }
-                                        }
-                                }
-                        }
-                }
-                if (pipResponse.getAttributes().size() == 0 && firstErrorStatus != null) {
-                        pipResponse.setStatus(firstErrorStatus);
-                }
-                
-                return new StdPIPResponse(pipResponse);
-        }
-        
-        @Override
-        public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
-                return StdPIPResponse.getMatchingResponse(pipRequest, this.getAttributes(pipRequest, exclude, pipFinderParent));
-        }
-        
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
-                return this.getAttributes(pipRequest, exclude, this);
-        }
-        
-        @Override
-        public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
-                return StdPIPResponse.getMatchingResponse(pipRequest, this.getAttributes(pipRequest, exclude));
+        if (pipResponse.getAttributes().size() == 0 && firstErrorStatus != null) {
+            pipResponse.setStatus(firstErrorStatus);
         }
 
-        @Override
-        public Collection<PIPEngine> getPIPEngines() {
-                List<PIPEngine> engines = new ArrayList<PIPEngine>();
-                for (List<PIPEngine> list : this.pipEngines.values()) {
-                        for (PIPEngine engine : list) {
-                                engines.add(engine);
-                        }
-                }
-                return Collections.unmodifiableList(engines);
+        return new StdPIPResponse(pipResponse);
+    }
+
+    @Override
+    public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
+        return StdPIPResponse.getMatchingResponse(pipRequest, this.getAttributes(pipRequest, exclude, pipFinderParent));
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
+        return this.getAttributes(pipRequest, exclude, this);
+    }
+
+    @Override
+    public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
+        return StdPIPResponse.getMatchingResponse(pipRequest, this.getAttributes(pipRequest, exclude));
+    }
+
+    @Override
+    public Collection<PIPEngine> getPIPEngines() {
+        List<PIPEngine> engines = new ArrayList<PIPEngine>();
+        for (List<PIPEngine> list : this.pipEngines.values()) {
+            for (PIPEngine engine : list) {
+                engines.add(engine);
+            }
         }
+        return Collections.unmodifiableList(engines);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/RequestFinder.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/RequestFinder.java
index e0e80bc..a0ca7bd 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/RequestFinder.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/RequestFinder.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -54,138 +54,138 @@
  * <code>PIPFinder</code> a {@link com.att.research.xacml.std.pip.engines.RequestEngine} and a {@link com.att.research.xacml.std.pip.engines.EnvironmentEngine}.
  * When attributes are requested, the
  * <code>RequestEngine</code> is searched first, followed by the <code>EnvironmentEngine</code> and if no results are found, the wrapped <code>PIPFinder</code> is searched.
- * 
+ *
  * @author car
  * @version $Revision: 1.3 $
  */
 public class RequestFinder extends WrappingFinder {
-        private RequestEngine requestEngine;
-        private EnvironmentEngine environmentEngine;
-        private Map<PIPRequest, PIPResponse>	mapCache	= new HashMap<PIPRequest,PIPResponse>();
-        
-        protected RequestEngine getRequestEngine() {
-                return this.requestEngine;
-        }
-        
-        protected EnvironmentEngine getEnvironmentEngine() {
-                return this.environmentEngine;
-        }
-        
-        public RequestFinder(PIPFinder pipFinder, RequestEngine requestEngineIn) {
-                super(pipFinder);
-                this.requestEngine	= requestEngineIn;
-                this.environmentEngine	= new EnvironmentEngine(new Date());
-        }
-        
-        @Override
-        protected PIPResponse getAttributesInternal(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderRoot) throws PIPException {
-                //long tStart = 0, tEnd = 0;
-                try {
-                /*
-                 * First try the RequestEngine
-                 */
-                PIPResponse pipResponse				= null;
-                RequestEngine thisRequestEngine		= this.getRequestEngine();
-                Status status						= null;
-                if (thisRequestEngine != null && thisRequestEngine != exclude) {
-                        //tStart	= System.nanoTime();
-                        pipResponse	= thisRequestEngine.getAttributes(pipRequest, (pipFinderRoot == null ? this : pipFinderRoot));
-                        //tEnd	= System.nanoTime();
-                        if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
-                                /*
-                                 * We know how the RequestEngine works.  It does not return multiple results
-                                 * and all of the results should match the request.
-                                 */
-                                if (pipResponse.getAttributes().size() > 0) {
-                                        return pipResponse;
-                                }
-                        } else {
-                                status	= pipResponse.getStatus();
-                        }
-                }
-                
-                /*
-                 * Next try the EnvironmentEngine if no issuer has been specified
-                 */
-                if (XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT.equals(pipRequest.getCategory()) && (pipRequest.getIssuer() == null || pipRequest.getIssuer().length() == 0)) {
-                        EnvironmentEngine thisEnvironmentEngine	= this.getEnvironmentEngine();
-                        pipResponse	= thisEnvironmentEngine.getAttributes(pipRequest, this);
-                        if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
-                                /*
-                                 * We know how the EnvironmentEngine works.  It does not return multiple results
-                                 * and all of the results should match the request.
-                                 */
-                                if (pipResponse.getAttributes().size() > 0) {
-                                        return pipResponse;
-                                }
-                        } else {
-                                if (status == null) {
-                                        status	= pipResponse.getStatus();
-                                }
-                        }
-                }
-                
-                /*
-                 * Try the cache
-                 */
-                if (this.mapCache.containsKey(pipRequest)) {
-                        return this.mapCache.get(pipRequest);
-                }
-                
-                /*
-                 * Delegate to the wrapped Finder
-                 */
-                PIPFinder thisWrappedFinder	= this.getWrappedFinder();
-                if (thisWrappedFinder != null) {
-                        pipResponse	= thisWrappedFinder.getAttributes(pipRequest, exclude, (pipFinderRoot == null ? this : pipFinderRoot));
-                        if (pipResponse != null) {
-                                if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
-                                        if (pipResponse.getAttributes().size() > 0) {
-                                                /*
-                                                 * Cache all of the returned attributes
-                                                 */
-                                                Map<PIPRequest,PIPResponse> mapResponses	= StdPIPResponse.splitResponse(pipResponse);
-                                                if (mapResponses != null && mapResponses.size() > 0) {
-                                                        for (PIPRequest pipRequestSplit : mapResponses.keySet()) {
-                                                                this.mapCache.put(pipRequestSplit, mapResponses.get(pipRequestSplit));
-                                                        }
-                                                }
-                                                return pipResponse;
-                                        }
-                                } else if (status == null || status.isOk()) {
-                                        status	= pipResponse.getStatus();
-                                }
-                        }
-                }
-                
-                /*
-                 * We did not get a valid, non-empty response back from either the Request or the
-                 * wrapped PIPFinder.  If there was an error using the RequestEngine, use that
-                 * as the status of the response, otherwise return an empty response.
-                 */
-                if (status != null && !status.isOk()) {
-                        return new StdPIPResponse(status);
-                } else {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                }
-                } finally {
-                        //System.out.println("RequestFinder.getAttributesInternal() = " + (tEnd - tStart));
-                }
-        }
+    private RequestEngine requestEngine;
+    private EnvironmentEngine environmentEngine;
+    private Map<PIPRequest, PIPResponse>	mapCache	= new HashMap<PIPRequest,PIPResponse>();
 
-        @Override
-        public Collection<PIPEngine> getPIPEngines() {
-                List<PIPEngine>	engines = new ArrayList<PIPEngine>();
-                if (this.requestEngine != null) {
-                        engines.add(this.requestEngine);
+    protected RequestEngine getRequestEngine() {
+        return this.requestEngine;
+    }
+
+    protected EnvironmentEngine getEnvironmentEngine() {
+        return this.environmentEngine;
+    }
+
+    public RequestFinder(PIPFinder pipFinder, RequestEngine requestEngineIn) {
+        super(pipFinder);
+        this.requestEngine	= requestEngineIn;
+        this.environmentEngine	= new EnvironmentEngine(new Date());
+    }
+
+    @Override
+    protected PIPResponse getAttributesInternal(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderRoot) throws PIPException {
+        //long tStart = 0, tEnd = 0;
+        try {
+            /*
+             * First try the RequestEngine
+             */
+            PIPResponse pipResponse				= null;
+            RequestEngine thisRequestEngine		= this.getRequestEngine();
+            Status status						= null;
+            if (thisRequestEngine != null && thisRequestEngine != exclude) {
+                //tStart	= System.nanoTime();
+                pipResponse	= thisRequestEngine.getAttributes(pipRequest, (pipFinderRoot == null ? this : pipFinderRoot));
+                //tEnd	= System.nanoTime();
+                if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
+                    /*
+                     * We know how the RequestEngine works.  It does not return multiple results
+                     * and all of the results should match the request.
+                     */
+                    if (pipResponse.getAttributes().size() > 0) {
+                        return pipResponse;
+                    }
+                } else {
+                    status	= pipResponse.getStatus();
                 }
-                if (this.environmentEngine != null) {
-                        engines.add(this.environmentEngine);
+            }
+
+            /*
+             * Next try the EnvironmentEngine if no issuer has been specified
+             */
+            if (XACML3.ID_ATTRIBUTE_CATEGORY_ENVIRONMENT.equals(pipRequest.getCategory()) && (pipRequest.getIssuer() == null || pipRequest.getIssuer().length() == 0)) {
+                EnvironmentEngine thisEnvironmentEngine	= this.getEnvironmentEngine();
+                pipResponse	= thisEnvironmentEngine.getAttributes(pipRequest, this);
+                if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
+                    /*
+                     * We know how the EnvironmentEngine works.  It does not return multiple results
+                     * and all of the results should match the request.
+                     */
+                    if (pipResponse.getAttributes().size() > 0) {
+                        return pipResponse;
+                    }
+                } else {
+                    if (status == null) {
+                        status	= pipResponse.getStatus();
+                    }
                 }
-                PIPFinder wrappedFinder = this.getWrappedFinder();
-                if (wrappedFinder != null) {
-                        engines.addAll(wrappedFinder.getPIPEngines());
+            }
+
+            /*
+             * Try the cache
+             */
+            if (this.mapCache.containsKey(pipRequest)) {
+                return this.mapCache.get(pipRequest);
+            }
+
+            /*
+             * Delegate to the wrapped Finder
+             */
+            PIPFinder thisWrappedFinder	= this.getWrappedFinder();
+            if (thisWrappedFinder != null) {
+                pipResponse	= thisWrappedFinder.getAttributes(pipRequest, exclude, (pipFinderRoot == null ? this : pipFinderRoot));
+                if (pipResponse != null) {
+                    if (pipResponse.getStatus() == null || pipResponse.getStatus().isOk()) {
+                        if (pipResponse.getAttributes().size() > 0) {
+                            /*
+                             * Cache all of the returned attributes
+                             */
+                            Map<PIPRequest,PIPResponse> mapResponses	= StdPIPResponse.splitResponse(pipResponse);
+                            if (mapResponses != null && mapResponses.size() > 0) {
+                                for (PIPRequest pipRequestSplit : mapResponses.keySet()) {
+                                    this.mapCache.put(pipRequestSplit, mapResponses.get(pipRequestSplit));
+                                }
+                            }
+                            return pipResponse;
+                        }
+                    } else if (status == null || status.isOk()) {
+                        status	= pipResponse.getStatus();
+                    }
                 }
-                return Collections.unmodifiableList(engines);
+            }
+
+            /*
+             * We did not get a valid, non-empty response back from either the Request or the
+             * wrapped PIPFinder.  If there was an error using the RequestEngine, use that
+             * as the status of the response, otherwise return an empty response.
+             */
+            if (status != null && !status.isOk()) {
+                return new StdPIPResponse(status);
+            } else {
+                return StdPIPResponse.PIP_RESPONSE_EMPTY;
+            }
+        } finally {
+            //System.out.println("RequestFinder.getAttributesInternal() = " + (tEnd - tStart));
         }
+    }
+
+    @Override
+    public Collection<PIPEngine> getPIPEngines() {
+        List<PIPEngine>	engines = new ArrayList<PIPEngine>();
+        if (this.requestEngine != null) {
+            engines.add(this.requestEngine);
+        }
+        if (this.environmentEngine != null) {
+            engines.add(this.environmentEngine);
+        }
+        PIPFinder wrappedFinder = this.getWrappedFinder();
+        if (wrappedFinder != null) {
+            engines.addAll(wrappedFinder.getPIPEngines());
+        }
+        return Collections.unmodifiableList(engines);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/WrappingFinder.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/WrappingFinder.java
index 8116655..aa3c56c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/WrappingFinder.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/WrappingFinder.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -41,60 +41,60 @@
  * WrappingFinder implements {@link com.att.research.xacml.api.pip.PIPFinder} by wrapping another
  * <code>PIPFinder</code> to intercept calls to <code>getAttributes</code> and do some other processing
  * before calling it on the wrapped <code>PIPFinder</code>.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public abstract class WrappingFinder implements PIPFinder {
-        private PIPFinder wrappedFinder;
-        
-        protected PIPFinder getWrappedFinder() {
-                return this.wrappedFinder;
-        }
-        
-        public WrappingFinder(PIPFinder wrappedFinderIn) {
-                this.wrappedFinder	= wrappedFinderIn;
-        }
-        
-        /**
-         * Gets the {@link com.att.research.xacml.api.pip.PIPResponse} from the <code>getAttributes</code> call on the wrapped
-         * <code>PIPFinder</code>, using the given <code>PIPFinder</code> as the root for recursive calls.
-         * 
-         * @param pipRequest the <code>PIPRequest</code>
-         * @param exclude the <code>PIPEngine</code> to exclude from recursive calls
-         * @param pipFinderParent the <code>PIPFinder</code> to start from for recursive calls
-         * @return the <code>PIPResponse</code> from the wrapped <code>PIPFinder</code> or the empty <code>PIPResponse</code> if there is no wrapped <code>PIPFinder</code>
-         * @throws com.att.research.xacml.api.pip.PIPException if there is an error getting attributes from the wrapped <code>PIPFinder</code>
-         */
-        protected PIPResponse getAttributesWrapped(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
-                PIPFinder thisWrappedFinder	= this.getWrappedFinder();
-                if (thisWrappedFinder == null) {
-                        return StdPIPResponse.PIP_RESPONSE_EMPTY;
-                } else {
-                        return thisWrappedFinder.getAttributes(pipRequest, exclude, pipFinderParent);
-                }
-        }
-        
-        protected abstract PIPResponse getAttributesInternal(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException;
+    private PIPFinder wrappedFinder;
 
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
-                return this.getAttributesInternal(pipRequest, exclude, this);
-        }
-        
-        @Override
-        public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
-                return StdPIPResponse.getMatchingResponse(pipRequest, this.getAttributes(pipRequest, exclude));
-        }
+    protected PIPFinder getWrappedFinder() {
+        return this.wrappedFinder;
+    }
 
-        @Override
-        public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
-                return this.getAttributesInternal(pipRequest, exclude, pipFinderParent);
+    public WrappingFinder(PIPFinder wrappedFinderIn) {
+        this.wrappedFinder	= wrappedFinderIn;
+    }
+
+    /**
+     * Gets the {@link com.att.research.xacml.api.pip.PIPResponse} from the <code>getAttributes</code> call on the wrapped
+     * <code>PIPFinder</code>, using the given <code>PIPFinder</code> as the root for recursive calls.
+     *
+     * @param pipRequest the <code>PIPRequest</code>
+     * @param exclude the <code>PIPEngine</code> to exclude from recursive calls
+     * @param pipFinderParent the <code>PIPFinder</code> to start from for recursive calls
+     * @return the <code>PIPResponse</code> from the wrapped <code>PIPFinder</code> or the empty <code>PIPResponse</code> if there is no wrapped <code>PIPFinder</code>
+     * @throws com.att.research.xacml.api.pip.PIPException if there is an error getting attributes from the wrapped <code>PIPFinder</code>
+     */
+    protected PIPResponse getAttributesWrapped(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
+        PIPFinder thisWrappedFinder	= this.getWrappedFinder();
+        if (thisWrappedFinder == null) {
+            return StdPIPResponse.PIP_RESPONSE_EMPTY;
+        } else {
+            return thisWrappedFinder.getAttributes(pipRequest, exclude, pipFinderParent);
         }
-        
-        @Override
-        public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
-                return StdPIPResponse.getMatchingResponse(pipRequest, this.getAttributesInternal(pipRequest, exclude, pipFinderParent));
-        }
+    }
+
+    protected abstract PIPResponse getAttributesInternal(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException;
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
+        return this.getAttributesInternal(pipRequest, exclude, this);
+    }
+
+    @Override
+    public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude) throws PIPException {
+        return StdPIPResponse.getMatchingResponse(pipRequest, this.getAttributes(pipRequest, exclude));
+    }
+
+    @Override
+    public PIPResponse getAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
+        return this.getAttributesInternal(pipRequest, exclude, pipFinderParent);
+    }
+
+    @Override
+    public PIPResponse getMatchingAttributes(PIPRequest pipRequest, PIPEngine exclude, PIPFinder pipFinderParent) throws PIPException {
+        return StdPIPResponse.getMatchingResponse(pipRequest, this.getAttributesInternal(pipRequest, exclude, pipFinderParent));
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/package-info.java
index 1e11475..c88a07b 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/finders/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 
 /**
  * com.att.research.xacml.std.pip.finders contains the standard implementation of the PIPFinder interface
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/package-info.java
index 2946384..d9ab672 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/pip/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,7 +33,7 @@
 
 /**
  * com.att.research.xacml.std.pip contains the standard implementation of the PIP interface
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/LoggingTraceEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/LoggingTraceEngine.java
index 1936d44..46a556f 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/LoggingTraceEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/LoggingTraceEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -42,57 +42,57 @@
 /**
  * Implements the {@link com.att.research.xacml.api.trace.TraceEngine} interface to log {@link com.att.research.xacml.api.trace.TraceEvent}s
  * using the Apache Commons logging system with debug messages.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class LoggingTraceEngine implements TraceEngine {
-        private static final LoggingTraceEngine loggingTraceEngine	= new LoggingTraceEngine();
-        
-        private Log logger	= LogFactory.getLog(this.getClass());
-        
-        protected LoggingTraceEngine() {
-        }
-        
-        protected LoggingTraceEngine(Properties properties) {
-        }
-        
-        /**
-         * Gets the single instance of the <code>LoggingTraceEngine</code>.
-         * 
-         * @return the single instance of the <code>LoggingTraceEngine</code>.
-         */
-        public static LoggingTraceEngine newInstance() {
-                return loggingTraceEngine;
-        }
+    private static final LoggingTraceEngine loggingTraceEngine	= new LoggingTraceEngine();
 
-        /**
-         * Gets the single instance of the <code>LoggingTraceEngine</code>.
-         * 
-         * @return the single instance of the <code>LoggingTraceEngine</code>.
-         */
-        public static LoggingTraceEngine newInstance(Properties properties) {
-                return loggingTraceEngine;
-        }
+    private Log logger	= LogFactory.getLog(this.getClass());
 
-        @Override
-        public void trace(TraceEvent<?> traceEvent) {
-                String message	= traceEvent.getMessage();
-                Traceable cause	= traceEvent.getCause();
-                this.logger.debug(
-                                traceEvent.getTimestamp().toString() + ": " +
-                                "\"" + (message == null ? "" : message) + "\"" +
-                                (cause == null ? "" : " from \"" + cause.getTraceId() + "\"")
-                                );
-                Object traceObject	= traceEvent.getValue();
-                if (traceObject != null) {
-                        this.logger.debug(traceObject);
-                }
-        }
+    protected LoggingTraceEngine() {
+    }
 
-        @Override
-        public boolean isTracing() {
-                return this.logger.isDebugEnabled();
+    protected LoggingTraceEngine(Properties properties) {
+    }
+
+    /**
+     * Gets the single instance of the <code>LoggingTraceEngine</code>.
+     *
+     * @return the single instance of the <code>LoggingTraceEngine</code>.
+     */
+    public static LoggingTraceEngine newInstance() {
+        return loggingTraceEngine;
+    }
+
+    /**
+     * Gets the single instance of the <code>LoggingTraceEngine</code>.
+     *
+     * @return the single instance of the <code>LoggingTraceEngine</code>.
+     */
+    public static LoggingTraceEngine newInstance(Properties properties) {
+        return loggingTraceEngine;
+    }
+
+    @Override
+    public void trace(TraceEvent<?> traceEvent) {
+        String message	= traceEvent.getMessage();
+        Traceable cause	= traceEvent.getCause();
+        this.logger.debug(
+            traceEvent.getTimestamp().toString() + ": " +
+            "\"" + (message == null ? "" : message) + "\"" +
+            (cause == null ? "" : " from \"" + cause.getTraceId() + "\"")
+        );
+        Object traceObject	= traceEvent.getValue();
+        if (traceObject != null) {
+            this.logger.debug(traceObject);
         }
+    }
+
+    @Override
+    public boolean isTracing() {
+        return this.logger.isDebugEnabled();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/LoggingTraceEngineFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/LoggingTraceEngineFactory.java
index a120eb3..bfd642d 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/LoggingTraceEngineFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/LoggingTraceEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,31 +38,31 @@
 /**
  * Extends the {@link com.att.research.xacml.api.trace.TraceEngineFactory} class to implement the <code>getTraceEngine</code> method to return
  * an instance of the {@link LoggingTraceEngine} class.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class LoggingTraceEngineFactory extends TraceEngineFactory {
-        /**
-         * Creates a new <code>LoggingTraceEngineFactory</code>
-         */
-        public LoggingTraceEngineFactory() {
-        }
+    /**
+     * Creates a new <code>LoggingTraceEngineFactory</code>
+     */
+    public LoggingTraceEngineFactory() {
+    }
 
-        /**
-         * Creates a new <code>LoggingTraceEngineFactory</code>
-         */
-        public LoggingTraceEngineFactory(Properties properties) {
-        }
+    /**
+     * Creates a new <code>LoggingTraceEngineFactory</code>
+     */
+    public LoggingTraceEngineFactory(Properties properties) {
+    }
 
-        @Override
-        public TraceEngine getTraceEngine() {
-                return LoggingTraceEngine.newInstance();
-        }
+    @Override
+    public TraceEngine getTraceEngine() {
+        return LoggingTraceEngine.newInstance();
+    }
 
-        @Override
-        public TraceEngine getTraceEngine(Properties properties) {
-                return LoggingTraceEngine.newInstance(properties);
-        }
+    @Override
+    public TraceEngine getTraceEngine(Properties properties) {
+        return LoggingTraceEngine.newInstance(properties);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/NullTraceEngine.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/NullTraceEngine.java
index d9a34f1..00d41f8 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/NullTraceEngine.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/NullTraceEngine.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,44 +38,44 @@
 /**
  * Implements the {@link com.att.research.xacml.api.trace.TraceEngine} interface to just ignore {@link com.att.research.xacml.api.trace.TraceEvent}s.
  * This is the default implementation, returned by the default {@link com.att.research.xacml.api.trace.TraceEngineFactory}.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class NullTraceEngine implements TraceEngine {
-        private static final NullTraceEngine nullTraceEngine	= new NullTraceEngine();
-        
-        protected NullTraceEngine() {
-        }
-        
-        protected NullTraceEngine(Properties properties) {
-        }
-        
-        /**
-         * Gets the single instance of the <code>NullTraceEngine</code> class.
-         * 
-         * @return the single instance of the <code>NullTraceEngine</code> class.
-         */
-        public static NullTraceEngine newInstance() {
-                return nullTraceEngine;
-        }
+    private static final NullTraceEngine nullTraceEngine	= new NullTraceEngine();
 
-        /**
-         * Gets the single instance of the <code>NullTraceEngine</code> class.
-         * 
-         * @return the single instance of the <code>NullTraceEngine</code> class.
-         */
-        public static NullTraceEngine newInstance(Properties properties) {
-                return nullTraceEngine;
-        }
+    protected NullTraceEngine() {
+    }
 
-        @Override
-        public void trace(TraceEvent<?> traceEvent) {
-        }
+    protected NullTraceEngine(Properties properties) {
+    }
 
-        @Override
-        public boolean isTracing() {
-                return false;
-        }
+    /**
+     * Gets the single instance of the <code>NullTraceEngine</code> class.
+     *
+     * @return the single instance of the <code>NullTraceEngine</code> class.
+     */
+    public static NullTraceEngine newInstance() {
+        return nullTraceEngine;
+    }
+
+    /**
+     * Gets the single instance of the <code>NullTraceEngine</code> class.
+     *
+     * @return the single instance of the <code>NullTraceEngine</code> class.
+     */
+    public static NullTraceEngine newInstance(Properties properties) {
+        return nullTraceEngine;
+    }
+
+    @Override
+    public void trace(TraceEvent<?> traceEvent) {
+    }
+
+    @Override
+    public boolean isTracing() {
+        return false;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/NullTraceEngineFactory.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/NullTraceEngineFactory.java
index b33f09d..25b2021 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/NullTraceEngineFactory.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/NullTraceEngineFactory.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,30 +38,30 @@
 /**
  * Extends the {@link com.att.research.xacml.api.trace.TraceEngineFactory} class to implement the <code>getTraceEngine</code> method to return
  * an instance of the {@link NullTraceEngine} class.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
 public class NullTraceEngineFactory extends TraceEngineFactory {
-        /**
-         * Creates a new <code>NullTraceEngineFactory</code>
-         */
-        public NullTraceEngineFactory() {
-        }
+    /**
+     * Creates a new <code>NullTraceEngineFactory</code>
+     */
+    public NullTraceEngineFactory() {
+    }
 
-        /**
-         * Creates a new <code>NullTraceEngineFactory</code>
-         */
-        public NullTraceEngineFactory(Properties properties) {
-        }
+    /**
+     * Creates a new <code>NullTraceEngineFactory</code>
+     */
+    public NullTraceEngineFactory(Properties properties) {
+    }
 
-        @Override
-        public TraceEngine getTraceEngine() {
-                return NullTraceEngine.newInstance();
-        }
+    @Override
+    public TraceEngine getTraceEngine() {
+        return NullTraceEngine.newInstance();
+    }
 
-        @Override
-        public TraceEngine getTraceEngine(Properties properties) {
-                return NullTraceEngine.newInstance(properties);
-        }
+    @Override
+    public TraceEngine getTraceEngine(Properties properties) {
+        return NullTraceEngine.newInstance(properties);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/StdTraceEvent.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/StdTraceEvent.java
index 3421bda..e3471b0 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/StdTraceEvent.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/StdTraceEvent.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -37,59 +37,59 @@
 
 /**
  * Immutable implementation of the {@link com.att.research.xacml.api.trace.TraceEvent} interface.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
- * 
+ *
  * @param <T>
  */
 public class StdTraceEvent<T> implements TraceEvent<T> {
-        private Date	timestamp;
-        private String	message;
-        private Traceable cause;
-        private T value;
-        
-        public StdTraceEvent(Date timestampIn, String messageIn, Traceable causeIn, T valueIn) {
-                this.timestamp	= timestampIn;
-                this.message	= messageIn;
-                this.cause		= causeIn;
-                this.value		= valueIn;
-        }
-        
-        public StdTraceEvent(String messageIn, Traceable causeIn, T valueIn) {
-                this(new Date(), messageIn, causeIn, valueIn);
-        }
-        
-        public StdTraceEvent(Date timestampIn, String messageIn, T valueIn) {
-                this(timestampIn, messageIn, null, valueIn);
-        }
-        
-        public StdTraceEvent(String messageIn, T valueIn) {
-                this(new Date(), messageIn, null, valueIn);
-        }
-        
-        public StdTraceEvent() {
-                this(new Date(), null, null, null);
-        }
+    private Date	timestamp;
+    private String	message;
+    private Traceable cause;
+    private T value;
 
-        @Override
-        public Date getTimestamp() {
-                return this.timestamp;
-        }
+    public StdTraceEvent(Date timestampIn, String messageIn, Traceable causeIn, T valueIn) {
+        this.timestamp	= timestampIn;
+        this.message	= messageIn;
+        this.cause		= causeIn;
+        this.value		= valueIn;
+    }
 
-        @Override
-        public String getMessage() {
-                return this.message;
-        }
+    public StdTraceEvent(String messageIn, Traceable causeIn, T valueIn) {
+        this(new Date(), messageIn, causeIn, valueIn);
+    }
 
-        @Override
-        public Traceable getCause() {
-                return this.cause;
-        }
+    public StdTraceEvent(Date timestampIn, String messageIn, T valueIn) {
+        this(timestampIn, messageIn, null, valueIn);
+    }
 
-        @Override
-        public T getValue() {
-                return this.value;
-        }
+    public StdTraceEvent(String messageIn, T valueIn) {
+        this(new Date(), messageIn, null, valueIn);
+    }
+
+    public StdTraceEvent() {
+        this(new Date(), null, null, null);
+    }
+
+    @Override
+    public Date getTimestamp() {
+        return this.timestamp;
+    }
+
+    @Override
+    public String getMessage() {
+        return this.message;
+    }
+
+    @Override
+    public Traceable getCause() {
+        return this.cause;
+    }
+
+    @Override
+    public T getValue() {
+        return this.value;
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/package-info.java b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/package-info.java
index 167bf3e..e1d3a85 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/package-info.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/std/trace/package-info.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -31,7 +31,7 @@
 
 /**
  * Provides standard implementations of the interfaces defined in the {@link com.att.research.xacml.api.trace} package.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
  */
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/AttributeUtils.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/AttributeUtils.java
index 94ec11c..06af475 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/AttributeUtils.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/AttributeUtils.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -40,63 +40,63 @@
 
 public class AttributeUtils {
 
-        public static String	prettyPrint(Attribute attribute) {
-                String tab = "\t";
-                StringBuilder builder = new StringBuilder();
-                builder.append(attribute.getAttributeId());
-                builder.append(System.lineSeparator());
-                builder.append(tab + attribute.getCategory());
-                builder.append(System.lineSeparator());
-                builder.append(tab + attribute.getIssuer());
-                builder.append(System.lineSeparator());
-                tab = tab + "\t";
-                for (AttributeValue<?> value : attribute.getValues()) {
-                        builder.append(tab + value.getDataTypeId());
-                        builder.append(tab + value.getValue().toString());
-                }
-                return builder.toString();
+    public static String	prettyPrint(Attribute attribute) {
+        String tab = "\t";
+        StringBuilder builder = new StringBuilder();
+        builder.append(attribute.getAttributeId());
+        builder.append(System.lineSeparator());
+        builder.append(tab + attribute.getCategory());
+        builder.append(System.lineSeparator());
+        builder.append(tab + attribute.getIssuer());
+        builder.append(System.lineSeparator());
+        tab = tab + "\t";
+        for (AttributeValue<?> value : attribute.getValues()) {
+            builder.append(tab + value.getDataTypeId());
+            builder.append(tab + value.getValue().toString());
         }
-        
-        public static String	prettyPrint(PIPRequest request) {
-                StringBuilder builder = new StringBuilder();
-                builder.append(request.getCategory());
+        return builder.toString();
+    }
+
+    public static String	prettyPrint(PIPRequest request) {
+        StringBuilder builder = new StringBuilder();
+        builder.append(request.getCategory());
+        builder.append(System.lineSeparator());
+        builder.append(request.getAttributeId());
+        builder.append(System.lineSeparator());
+        builder.append(request.getDataTypeId());
+        builder.append(System.lineSeparator());
+        builder.append(request.getIssuer());
+        return builder.toString();
+    }
+
+    public static String	prettyPrint(Request request) {
+        StringBuilder builder = new StringBuilder();
+        String tab = "\t";
+        builder.append("Combined Decision=" + request.getCombinedDecision() + " returnPolicyIdList=" + request.getReturnPolicyIdList());
+        builder.append(System.lineSeparator());
+        for (RequestAttributes attribute : request.getRequestAttributes()) {
+            builder.append(attribute.getCategory());
+            builder.append(System.lineSeparator());
+            for (Attribute a : attribute.getAttributes()) {
+                builder.append(tab + a.getAttributeId() + " issuer=" + a.getIssuer());
                 builder.append(System.lineSeparator());
-                builder.append(request.getAttributeId());
-                builder.append(System.lineSeparator());
-                builder.append(request.getDataTypeId());
-                builder.append(System.lineSeparator());
-                builder.append(request.getIssuer());
-                return builder.toString();
+                for (AttributeValue<?> value : a.getValues()) {
+                    builder.append(tab + tab + value.getDataTypeId() + " " + value.getValue().toString());
+                    builder.append(System.lineSeparator());
+                }
+            }
         }
-        
-        public static String	prettyPrint(Request request) {
-                StringBuilder builder = new StringBuilder();
-                String tab = "\t";
-                builder.append("Combined Decision=" + request.getCombinedDecision() + " returnPolicyIdList=" + request.getReturnPolicyIdList());
-                builder.append(System.lineSeparator());
-                for (RequestAttributes attribute : request.getRequestAttributes()) {
-                        builder.append(attribute.getCategory());
-                        builder.append(System.lineSeparator());
-                        for (Attribute a : attribute.getAttributes()) {
-                                builder.append(tab + a.getAttributeId() + " issuer=" + a.getIssuer());
-                                builder.append(System.lineSeparator());
-                                for (AttributeValue<?> value : a.getValues()) {
-                                        builder.append(tab + tab + value.getDataTypeId() + " " + value.getValue().toString());
-                                        builder.append(System.lineSeparator());
-                                }
-                        }
-                }
-                for (RequestReference ref : request.getMultiRequests()) {
-                        builder.append(System.lineSeparator());
-                        builder.append("Reference=" + ref);
-                }
-                
-                RequestDefaults defs = request.getRequestDefaults();
-                if (defs != null) {
-                        builder.append(System.lineSeparator());
-                        builder.append("Defaults=" + defs.getXPathVersion());
-                }
-                
-                return builder.toString();
+        for (RequestReference ref : request.getMultiRequests()) {
+            builder.append(System.lineSeparator());
+            builder.append("Reference=" + ref);
         }
+
+        RequestDefaults defs = request.getRequestDefaults();
+        if (defs != null) {
+            builder.append(System.lineSeparator());
+            builder.append("Defaults=" + defs.getXPathVersion());
+        }
+
+        return builder.toString();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/CalendarTest.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/CalendarTest.java
index f92bca1..61ff31e 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/CalendarTest.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/CalendarTest.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 package com.att.research.xacml.util;
@@ -25,176 +25,176 @@
 
 public class CalendarTest {
 
-        public CalendarTest() {
-        }
-        
-        private static class CField {
-                private String fieldName;
-                private int calId;
-                
-                public CField(String fieldNameIn, int calIdIn) {
-                        this.fieldName	= fieldNameIn;
-                        this.calId		= calIdIn;
-                }
-                
-                public String getFieldName() {
-                        return this.fieldName;
-                }
-                
-                public int getCalId() {
-                        return this.calId;
-                }
-        }
-        
-        private static CField[] calFields	= {
-                new CField("Era", Calendar.ERA),
-                new CField("TimeZone", Calendar.ZONE_OFFSET),
-                new CField("Year", Calendar.YEAR),
-                new CField("Month", Calendar.MONTH),
-                new CField("Day", Calendar.DATE),
-                new CField("Hour", Calendar.HOUR_OF_DAY),
-                new CField("Minute", Calendar.MINUTE),
-                new CField("Second", Calendar.SECOND),
-                new CField("Millisecond", Calendar.MILLISECOND)
-        };
-        
-        private static void dumpCalendar(Calendar calendar) {
-                System.out.println("Current timestamp=" + calendar.getTimeInMillis());
-                System.out.println("Current Date=" + calendar.getTime());
-                System.out.println("Current TimeZone=" + calendar.getTimeZone());
-                System.out.print("Fields=");
-                boolean needsComma	= false;
-                for (CField cfield: calFields) {
-                        if (needsComma) {
-                                System.out.print(",");
-                        }
-                        System.out.print(cfield.getFieldName() + "=" + calendar.get(cfield.getCalId()));
-                        needsComma	= true;
-                }
-                System.out.println();
-                
+    public CalendarTest() {
+    }
+
+    private static class CField {
+        private String fieldName;
+        private int calId;
+
+        public CField(String fieldNameIn, int calIdIn) {
+            this.fieldName	= fieldNameIn;
+            this.calId		= calIdIn;
         }
 
-        public static void main(String[] args) {
-                Calendar calendar	= Calendar.getInstance();
-                calendar.setLenient(false);
-
-                System.out.println("Current Time");
-                dumpCalendar(calendar);
-                
-                /*
-                 * Change the timezone to GMT
-                 */
-                try {
-                        calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
-                        System.out.println("GMT Time");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception using timezone GMT: " + ex);
-                }
-                
-                /*
-                 * Change the timezone to GMT-06:00
-                 */
-                try {
-                        calendar.setTimeZone(TimeZone.getTimeZone("GMT-06:00"));
-                        System.out.println("GMT Time-06:00");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception using timezone GMT: " + ex);
-                }
-                
-                /*
-                 * Change the timezone to GMT-06:10
-                 */
-                try {
-                        calendar.setTimeZone(TimeZone.getTimeZone("GMT-06:10"));
-                        System.out.println("GMT Time-06:10");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception using timezone GMT: " + ex);
-                }	
-                
-                /*
-                 * Try setting the year to 10012
-                 */
-                try {
-                        calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
-                        calendar.set(Calendar.YEAR, 10012);
-                        System.out.println("GMT Time in 10012");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception setting year to 10012 " + ex);
-                }
-                                
-                /*
-                 * Try setting the year to 1812
-                 */
-                try {
-                        calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
-                        calendar.set(Calendar.YEAR, 1812);
-                        System.out.println("GMT Time in 1812");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception setting year to 1812 " + ex);
-                }
-                
-                /*
-                 * Try adding 60 days
-                 */
-                try {
-                        calendar.add(Calendar.DAY_OF_YEAR, 60);
-                        System.out.println("GMT Time in 1812 + 60 days");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception adding 60 days " + ex);
-                }
-                
-                /*
-                 * Try subtracting 900 days
-                 */
-                try {
-                        calendar.add(Calendar.DAY_OF_YEAR, -900);
-                        System.out.println("GMT Time in 1812 -900 days");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception subtracting 900 days " + ex);
-                }
-                
-                /*
-                 * Try adding 11 months
-                 */
-                try {
-                        calendar.add(Calendar.MONTH, 11);
-                        System.out.println("GMT Time in 1812 + 11 months");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception adding 11 months " + ex);
-                }
-                
-                
-                /*
-                 * Try setting month/day to November 31 in 1812
-                 */
-                try {
-                        calendar.set(Calendar.MONTH, 10);
-                        calendar.set(Calendar.DATE, 31);
-                        System.out.println("GMT Time for Nov 31, 1812");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception setting year to 1812 " + ex);
-                }
-                
-                /*
-                 * Try setting the time-in-millis to a negative number
-                 */
-                try {
-                        calendar.setTimeInMillis(-8888888888L);
-                        System.out.println("GMT Time for -8888888888");
-                        dumpCalendar(calendar);
-                } catch (Exception ex) {
-                        System.err.println("Exception setting time-in-millis to -8888888888 " + ex);
-                }
+        public String getFieldName() {
+            return this.fieldName;
         }
 
+        public int getCalId() {
+            return this.calId;
+        }
+    }
+
+    private static CField[] calFields	= {
+        new CField("Era", Calendar.ERA),
+        new CField("TimeZone", Calendar.ZONE_OFFSET),
+        new CField("Year", Calendar.YEAR),
+        new CField("Month", Calendar.MONTH),
+        new CField("Day", Calendar.DATE),
+        new CField("Hour", Calendar.HOUR_OF_DAY),
+        new CField("Minute", Calendar.MINUTE),
+        new CField("Second", Calendar.SECOND),
+        new CField("Millisecond", Calendar.MILLISECOND)
+    };
+
+    private static void dumpCalendar(Calendar calendar) {
+        System.out.println("Current timestamp=" + calendar.getTimeInMillis());
+        System.out.println("Current Date=" + calendar.getTime());
+        System.out.println("Current TimeZone=" + calendar.getTimeZone());
+        System.out.print("Fields=");
+        boolean needsComma	= false;
+        for (CField cfield: calFields) {
+            if (needsComma) {
+                System.out.print(",");
+            }
+            System.out.print(cfield.getFieldName() + "=" + calendar.get(cfield.getCalId()));
+            needsComma	= true;
+        }
+        System.out.println();
+
+    }
+
+    public static void main(String[] args) {
+        Calendar calendar	= Calendar.getInstance();
+        calendar.setLenient(false);
+
+        System.out.println("Current Time");
+        dumpCalendar(calendar);
+
+        /*
+         * Change the timezone to GMT
+         */
+        try {
+            calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
+            System.out.println("GMT Time");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception using timezone GMT: " + ex);
+        }
+
+        /*
+         * Change the timezone to GMT-06:00
+         */
+        try {
+            calendar.setTimeZone(TimeZone.getTimeZone("GMT-06:00"));
+            System.out.println("GMT Time-06:00");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception using timezone GMT: " + ex);
+        }
+
+        /*
+         * Change the timezone to GMT-06:10
+         */
+        try {
+            calendar.setTimeZone(TimeZone.getTimeZone("GMT-06:10"));
+            System.out.println("GMT Time-06:10");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception using timezone GMT: " + ex);
+        }
+
+        /*
+         * Try setting the year to 10012
+         */
+        try {
+            calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
+            calendar.set(Calendar.YEAR, 10012);
+            System.out.println("GMT Time in 10012");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception setting year to 10012 " + ex);
+        }
+
+        /*
+         * Try setting the year to 1812
+         */
+        try {
+            calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
+            calendar.set(Calendar.YEAR, 1812);
+            System.out.println("GMT Time in 1812");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception setting year to 1812 " + ex);
+        }
+
+        /*
+         * Try adding 60 days
+         */
+        try {
+            calendar.add(Calendar.DAY_OF_YEAR, 60);
+            System.out.println("GMT Time in 1812 + 60 days");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception adding 60 days " + ex);
+        }
+
+        /*
+         * Try subtracting 900 days
+         */
+        try {
+            calendar.add(Calendar.DAY_OF_YEAR, -900);
+            System.out.println("GMT Time in 1812 -900 days");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception subtracting 900 days " + ex);
+        }
+
+        /*
+         * Try adding 11 months
+         */
+        try {
+            calendar.add(Calendar.MONTH, 11);
+            System.out.println("GMT Time in 1812 + 11 months");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception adding 11 months " + ex);
+        }
+
+
+        /*
+         * Try setting month/day to November 31 in 1812
+         */
+        try {
+            calendar.set(Calendar.MONTH, 10);
+            calendar.set(Calendar.DATE, 31);
+            System.out.println("GMT Time for Nov 31, 1812");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception setting year to 1812 " + ex);
+        }
+
+        /*
+         * Try setting the time-in-millis to a negative number
+         */
+        try {
+            calendar.setTimeInMillis(-8888888888L);
+            System.out.println("GMT Time for -8888888888");
+            dumpCalendar(calendar);
+        } catch (Exception ex) {
+            System.err.println("Exception setting time-in-millis to -8888888888 " + ex);
+        }
+    }
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/FactoryException.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/FactoryException.java
index 05c3a4f..1eb57ec 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/FactoryException.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/FactoryException.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -31,25 +31,25 @@
 package com.att.research.xacml.util;
 
 public class FactoryException extends Exception {
-        private static final long serialVersionUID = -6575223164395937720L;
+    private static final long serialVersionUID = -6575223164395937720L;
 
-        public FactoryException() {
-        }
+    public FactoryException() {
+    }
 
-        public FactoryException(String message) {
-                super(message);
-        }
+    public FactoryException(String message) {
+        super(message);
+    }
 
-        public FactoryException(Throwable cause) {
-                super(cause);
-        }
+    public FactoryException(Throwable cause) {
+        super(cause);
+    }
 
-        public FactoryException(String message, Throwable cause) {
-                super(message, cause);
-        }
+    public FactoryException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-        public FactoryException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-                super(message, cause, enableSuppression, writableStackTrace);
-        }
+    public FactoryException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/FactoryFinder.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/FactoryFinder.java
index afd72fb..3ef8474 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/FactoryFinder.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/FactoryFinder.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -44,231 +44,231 @@
 /**
  * FactoryFinder is a utility for finding various XACML Factory objects using a common search procedure:
  * 	1.  Look in the jav.home/lib/xacml.properties file for the name of a Class to serve as the Factory instance
- *  2.  
+ *  2.
  * @author car
  *
  */
 public class FactoryFinder {
-        private static final Log logger				= LogFactory.getLog(FactoryFinder.class);
-        
-        private FactoryFinder() {
-        }
-        
-        /**
-         * Attempts to load a class using the given <code>ClassLoader</code>.  If that fails and fallback is enabled, the
-         * current <code>ClassLoader</code> is tried.  If the <code>ClassLoader</code> is null, use the context <code>ClassLoader</code>
-         * followed by the current <code>ClassLoader</code>.
-         * 
-         * @param className the <code>String</code> name of the <code>Class</code> to load
-         * @param cl the <code>ClassLoader</code> to use
-         * @param doFallback if true, fall back to the current <code>ClassLoader</code> if the given <code>ClassLoader</code> fails
-         * @return the <code>Class</code> for the given class name
-         * @throws ClassNotFoundException if the <code>Class</code> cannot be found
-         */
-        private static Class<?> getProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException {
-                try {
-                        if (cl == null) {
-                                cl	= Thread.class.getClassLoader();
-                                if (cl == null) {
-                                        cl = FactoryFinder.class.getClassLoader();
-                                        if (cl == null) {
-                                                throw new ClassNotFoundException("No ClassLoader() in current context");
-                                        } else {
-                                                return cl.loadClass(className);
-                                        }
-                                } else {
-                                        return cl.loadClass(className);
-                                }
-                        } else {
-                                return cl.loadClass(className);
-                        }
-                } catch (ClassNotFoundException ex) {
-                        if (doFallback) {
-                                return Class.forName(className, true, FactoryFinder.class.getClassLoader());
-                        } else {
-                                throw ex;
-                        }
-                }
-        }
-        
-        /**
-         * Attempts to load a class using the Jar Service Provider Mechanism
-         * 
-         * @param factoryId the <code>String</code> factory id of the object to load
-         * @param classExtends the <code>Class</code> the object must extend
-         * @return an instance of the <code>Class</code> referenced by the factory ID
-         * @throws FactoryException
-         */
-        private static <T> T findJarServiceProvider(String factoryId, Class<T> classExtends, Properties xacmlProperties) throws FactoryException {
-                String serviceId	= "META-INF/services/" + factoryId;
-                InputStream is		= null;
-                
-                /*
-                 * First try using the Context ClassLoader
-                 */
-                ClassLoader cl	= Thread.currentThread().getContextClassLoader();
-                if (cl != null) {
-                        is	= cl.getResourceAsStream(serviceId);
-                        if (is == null) {
-                                /*
-                                 * Fall back to the current ClassLoader
-                                 */
-                                cl	= FactoryFinder.class.getClassLoader();
-                                is	= cl.getResourceAsStream(serviceId);
-                        }
+    private static final Log logger				= LogFactory.getLog(FactoryFinder.class);
+
+    private FactoryFinder() {
+    }
+
+    /**
+     * Attempts to load a class using the given <code>ClassLoader</code>.  If that fails and fallback is enabled, the
+     * current <code>ClassLoader</code> is tried.  If the <code>ClassLoader</code> is null, use the context <code>ClassLoader</code>
+     * followed by the current <code>ClassLoader</code>.
+     *
+     * @param className the <code>String</code> name of the <code>Class</code> to load
+     * @param cl the <code>ClassLoader</code> to use
+     * @param doFallback if true, fall back to the current <code>ClassLoader</code> if the given <code>ClassLoader</code> fails
+     * @return the <code>Class</code> for the given class name
+     * @throws ClassNotFoundException if the <code>Class</code> cannot be found
+     */
+    private static Class<?> getProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException {
+        try {
+            if (cl == null) {
+                cl	= Thread.class.getClassLoader();
+                if (cl == null) {
+                    cl = FactoryFinder.class.getClassLoader();
+                    if (cl == null) {
+                        throw new ClassNotFoundException("No ClassLoader() in current context");
+                    } else {
+                        return cl.loadClass(className);
+                    }
                 } else {
-                        /*
-                         *  No Context ClassLoader, try the current ClassLoader
-                         */
-                        cl	= FactoryFinder.class.getClassLoader();
-                        is	= cl.getResourceAsStream(serviceId);
+                    return cl.loadClass(className);
                 }
-                
-                if (is == null) {
-                        /*
-                         * No resource provider found
-                         */
-                        return null;
-                }
-                
-                if (logger.isDebugEnabled()) {
-                        logger.debug("Found jar resource=" + serviceId + " using ClassLoader: " + cl);
-                }
-                
+            } else {
+                return cl.loadClass(className);
+            }
+        } catch (ClassNotFoundException ex) {
+            if (doFallback) {
+                return Class.forName(className, true, FactoryFinder.class.getClassLoader());
+            } else {
+                throw ex;
+            }
+        }
+    }
+
+    /**
+     * Attempts to load a class using the Jar Service Provider Mechanism
+     *
+     * @param factoryId the <code>String</code> factory id of the object to load
+     * @param classExtends the <code>Class</code> the object must extend
+     * @return an instance of the <code>Class</code> referenced by the factory ID
+     * @throws FactoryException
+     */
+    private static <T> T findJarServiceProvider(String factoryId, Class<T> classExtends, Properties xacmlProperties) throws FactoryException {
+        String serviceId	= "META-INF/services/" + factoryId;
+        InputStream is		= null;
+
+        /*
+         * First try using the Context ClassLoader
+         */
+        ClassLoader cl	= Thread.currentThread().getContextClassLoader();
+        if (cl != null) {
+            is	= cl.getResourceAsStream(serviceId);
+            if (is == null) {
                 /*
-                 * Read from the stream
+                 * Fall back to the current ClassLoader
                  */
-                BufferedReader rd;
-                try {
-                        rd	= new BufferedReader(new InputStreamReader(is, "UTF-8"));
-                } catch (UnsupportedEncodingException ex) {
-                        rd	= new BufferedReader(new InputStreamReader(is));
-                }
-                
-                String factoryClassName	= null;
-                try {
-                        factoryClassName	= rd.readLine();
-                } catch (IOException ex) {
-                        logger.error("IOException reading resource stream: " + ex.getMessage(), ex);
-                        return null;
-                } finally {
-                        try {
-                                if (rd != null) {
-                                        rd.close();
-                                }
-                        } catch (IOException e) {
-                                // nothing we can do with this
-                                logger.error("Unable to close stream: " + e, e);
-                        }
-                }
-                
-                if (factoryClassName != null && !"".equals(factoryClassName)) {
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Found in resource, value=" + factoryClassName);
-                        }
-                        return newInstance(factoryClassName, classExtends, cl, false, xacmlProperties);
-                }
-                
-                return null;
+                cl	= FactoryFinder.class.getClassLoader();
+                is	= cl.getResourceAsStream(serviceId);
+            }
+        } else {
+            /*
+             *  No Context ClassLoader, try the current ClassLoader
+             */
+            cl	= FactoryFinder.class.getClassLoader();
+            is	= cl.getResourceAsStream(serviceId);
         }
 
-        public static <T> T newInstance(String className, Class<T> classExtends, ClassLoader cl, boolean doFallback) throws FactoryException {
-                return FactoryFinder.newInstance(className, classExtends, cl, doFallback, null);
-        }
-        
-        public static <T> T newInstance(String className, Class<T> classExtends, ClassLoader cl, boolean doFallback, Properties xacmlProperties) throws FactoryException {
-                try {
-                        Class<?> providerClass	= getProviderClass(className, cl, doFallback);
-                        if (classExtends.isAssignableFrom(providerClass)) {
-                                Object instance = null;
-                                if (xacmlProperties == null) {
-                                        instance	= providerClass.newInstance();
-                                } else {
-                                        //
-                                        // Search for a constructor that takes Properties
-                                        //
-                                        for (Constructor<?> constructor : providerClass.getDeclaredConstructors()) {
-                                                Class<?>[] params = constructor.getParameterTypes();
-                                                if (params.length == 1 && params[0].isAssignableFrom(Properties.class)) {
-                                                        instance = constructor.newInstance(xacmlProperties);
-                                                }
-                                        }
-                                        if (instance == null) {
-                                                throw new Exception("No constructor that takes a Properties object.");
-                                        }
-                                }
-                                if (logger.isTraceEnabled()) {
-                                        logger.trace("Created new instance of " + providerClass + " using ClassLoader: " + cl);
-                                }
-                                return classExtends.cast(instance);
-                        } else {
-                                throw new ClassNotFoundException("Provider " + className + " does not extend " + classExtends.getCanonicalName());
-                        }
-                } catch (ClassNotFoundException ex) {
-                        throw new FactoryException("Provider " + className + " not found", ex);
-                } catch (Exception ex) {
-                        throw new FactoryException("Provider " + className + " could not be instantiated: " + ex.getMessage(), ex);
-                }
+        if (is == null) {
+            /*
+             * No resource provider found
+             */
+            return null;
         }
 
-        public static <T> T find(String factoryId, String fallbackClassName, Class<T> classExtends) throws FactoryException {
-                return FactoryFinder.find(factoryId, fallbackClassName, classExtends, null);
-        }	
-        
-        public static <T> T find(String factoryId, String fallbackClassName, Class<T> classExtends, Properties xacmlProperties) throws FactoryException {
+        if (logger.isDebugEnabled()) {
+            logger.debug("Found jar resource=" + serviceId + " using ClassLoader: " + cl);
+        }
+
+        /*
+         * Read from the stream
+         */
+        BufferedReader rd;
+        try {
+            rd	= new BufferedReader(new InputStreamReader(is, "UTF-8"));
+        } catch (UnsupportedEncodingException ex) {
+            rd	= new BufferedReader(new InputStreamReader(is));
+        }
+
+        String factoryClassName	= null;
+        try {
+            factoryClassName	= rd.readLine();
+        } catch (IOException ex) {
+            logger.error("IOException reading resource stream: " + ex.getMessage(), ex);
+            return null;
+        } finally {
+            try {
+                if (rd != null) {
+                    rd.close();
+                }
+            } catch (IOException e) {
+                // nothing we can do with this
+                logger.error("Unable to close stream: " + e, e);
+            }
+        }
+
+        if (factoryClassName != null && !"".equals(factoryClassName)) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("Found in resource, value=" + factoryClassName);
+            }
+            return newInstance(factoryClassName, classExtends, cl, false, xacmlProperties);
+        }
+
+        return null;
+    }
+
+    public static <T> T newInstance(String className, Class<T> classExtends, ClassLoader cl, boolean doFallback) throws FactoryException {
+        return FactoryFinder.newInstance(className, classExtends, cl, doFallback, null);
+    }
+
+    public static <T> T newInstance(String className, Class<T> classExtends, ClassLoader cl, boolean doFallback, Properties xacmlProperties) throws FactoryException {
+        try {
+            Class<?> providerClass	= getProviderClass(className, cl, doFallback);
+            if (classExtends.isAssignableFrom(providerClass)) {
+                Object instance = null;
+                if (xacmlProperties == null) {
+                    instance	= providerClass.newInstance();
+                } else {
+                    //
+                    // Search for a constructor that takes Properties
+                    //
+                    for (Constructor<?> constructor : providerClass.getDeclaredConstructors()) {
+                        Class<?>[] params = constructor.getParameterTypes();
+                        if (params.length == 1 && params[0].isAssignableFrom(Properties.class)) {
+                            instance = constructor.newInstance(xacmlProperties);
+                        }
+                    }
+                    if (instance == null) {
+                        throw new Exception("No constructor that takes a Properties object.");
+                    }
+                }
                 if (logger.isTraceEnabled()) {
-                        logger.trace("Find factoryId=" + factoryId);
+                    logger.trace("Created new instance of " + providerClass + " using ClassLoader: " + cl);
                 }
-                /*
-                 * Check the system property first
-                 */
-                String systemProp	= System.getProperty(factoryId);
-                if (systemProp != null) {
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Found system property, value=" + systemProp);
-                        }
-                        return newInstance(systemProp, classExtends, null, true, xacmlProperties);
-                }
-                
-                /*
-                 * Check the java.home/lib/xacml.properties - path to that properties
-                 * can be changed via System variable.
-                 */
-                try {
-                        String factoryClassName		= null;
-                        if (xacmlProperties == null) {
-                                factoryClassName	= XACMLProperties.getProperty(factoryId);
-                        } else {
-                                factoryClassName	= xacmlProperties.getProperty(factoryId);
-                        }
-                        if (factoryClassName != null) {
-                                if (logger.isTraceEnabled()) {
-                                        logger.trace("Found factoryId xacml.properties, value=" + factoryClassName);
-                                }
-                                return newInstance(factoryClassName, classExtends, null, true, xacmlProperties);
-                        }
-                } catch (Exception ex) {
-                        logger.error("Exception reading xacml.properties", ex);
-                }
-                
-                /*
-                 * Try the Jar Service Provider Mechanism
-                 */
-                T provider	= findJarServiceProvider(factoryId, classExtends, xacmlProperties);
-                if (provider != null) {
-                        return provider;
-                }
-                
-                /*
-                 * Try the fallback class
-                 */
-                if (fallbackClassName == null) {
-                        throw new FactoryException("Provider for " + factoryId + " cannot be found", null);
-                }
-                if (logger.isDebugEnabled()) {
-                        logger.debug("Loaded from fallback value: " + fallbackClassName);
-                }
-                return newInstance(fallbackClassName, classExtends, null, true, xacmlProperties);
+                return classExtends.cast(instance);
+            } else {
+                throw new ClassNotFoundException("Provider " + className + " does not extend " + classExtends.getCanonicalName());
+            }
+        } catch (ClassNotFoundException ex) {
+            throw new FactoryException("Provider " + className + " not found", ex);
+        } catch (Exception ex) {
+            throw new FactoryException("Provider " + className + " could not be instantiated: " + ex.getMessage(), ex);
         }
+    }
+
+    public static <T> T find(String factoryId, String fallbackClassName, Class<T> classExtends) throws FactoryException {
+        return FactoryFinder.find(factoryId, fallbackClassName, classExtends, null);
+    }
+
+    public static <T> T find(String factoryId, String fallbackClassName, Class<T> classExtends, Properties xacmlProperties) throws FactoryException {
+        if (logger.isTraceEnabled()) {
+            logger.trace("Find factoryId=" + factoryId);
+        }
+        /*
+         * Check the system property first
+         */
+        String systemProp	= System.getProperty(factoryId);
+        if (systemProp != null) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("Found system property, value=" + systemProp);
+            }
+            return newInstance(systemProp, classExtends, null, true, xacmlProperties);
+        }
+
+        /*
+         * Check the java.home/lib/xacml.properties - path to that properties
+         * can be changed via System variable.
+         */
+        try {
+            String factoryClassName		= null;
+            if (xacmlProperties == null) {
+                factoryClassName	= XACMLProperties.getProperty(factoryId);
+            } else {
+                factoryClassName	= xacmlProperties.getProperty(factoryId);
+            }
+            if (factoryClassName != null) {
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Found factoryId xacml.properties, value=" + factoryClassName);
+                }
+                return newInstance(factoryClassName, classExtends, null, true, xacmlProperties);
+            }
+        } catch (Exception ex) {
+            logger.error("Exception reading xacml.properties", ex);
+        }
+
+        /*
+         * Try the Jar Service Provider Mechanism
+         */
+        T provider	= findJarServiceProvider(factoryId, classExtends, xacmlProperties);
+        if (provider != null) {
+            return provider;
+        }
+
+        /*
+         * Try the fallback class
+         */
+        if (fallbackClassName == null) {
+            throw new FactoryException("Provider for " + factoryId + " cannot be found", null);
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug("Loaded from fallback value: " + fallbackClassName);
+        }
+        return newInstance(fallbackClassName, classExtends, null, true, xacmlProperties);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/ListUtil.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/ListUtil.java
index 0d1be8e..98de850 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/ListUtil.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/ListUtil.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -35,78 +35,78 @@
 
 /**
  * ListUtil contains a number of useful utilities on java <code>Collection</code> objects.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class ListUtil {
 
-        protected ListUtil() {
-        }
-        
-        /**
-         * If the given <code>Iterator</code> is not null, iterate over all <code>T</code> elements
-         * in it and add them to the given <code>Collection</code>.
-         * 
-         * @param iteratorFrom the <code>Iterator</code> to copy from
-         * @param collectionTo the <code>Collection</code> to copy to
-         */
-        public static <T> void addAll(Iterator<T> iteratorFrom, Collection<T> collectionTo) {
-                if (iteratorFrom != null) {
-                        while (iteratorFrom.hasNext()) {
-                                collectionTo.add(iteratorFrom.next());
-                        }
-                }
-        }
-        
-        public static <T> boolean equalsAllowNulls(Iterator<T> iterator1, Iterator<T> iterator2) {
-                if (iterator1 == null || !iterator1.hasNext()) {
-                        return (iterator2 == null || !iterator2.hasNext());
-                } else if (iterator2 == null || !iterator2.hasNext()) {
-                        return false;
-                } else {
-                        boolean result	= true;
-                        while (result && iterator1.hasNext() && iterator2.hasNext()) {
-                                result	= ObjUtil.equalsAllowNull(iterator1.next(), iterator2.next());
-                        }
-                        return result && !iterator1.hasNext() && !iterator2.hasNext();
-                }
-        }
+    protected ListUtil() {
+    }
 
-        public static <T> boolean equalsAllowNulls(Collection<T> collection1, Collection<T> collection2) {
-                if (collection1 == collection2) {
-                        return true;
-                } else if (collection1 == null || collection2 == null) {
-                        return false;
-                } else if (collection1.size() != collection2.size()) {
-                        return false;
-                } else {
-                        for (Iterator<T> i1 = collection1.iterator(), i2 = collection2.iterator() ; i1.hasNext() ; ) {
-                                if (!ObjUtil.equalsAllowNull(i1.next(), i2.next())) {
-                                        return false;
-                                }
-                        }
-                        return true;
-                }
+    /**
+     * If the given <code>Iterator</code> is not null, iterate over all <code>T</code> elements
+     * in it and add them to the given <code>Collection</code>.
+     *
+     * @param iteratorFrom the <code>Iterator</code> to copy from
+     * @param collectionTo the <code>Collection</code> to copy to
+     */
+    public static <T> void addAll(Iterator<T> iteratorFrom, Collection<T> collectionTo) {
+        if (iteratorFrom != null) {
+            while (iteratorFrom.hasNext()) {
+                collectionTo.add(iteratorFrom.next());
+            }
         }
-        
-        public static <T> String toString(Collection<T> collection) {
-                StringBuilder stringBuilder	= new StringBuilder("[");
-                boolean first				= true;
-                for (T t : collection) {
-                        if (!first) {
-                                stringBuilder.append(',');
-                        } else {
-                                first	= true;
-                        }
-                        if (t == null) {
-                                stringBuilder.append("null");
-                        } else {
-                                stringBuilder.append(t.toString());
-                        }
-                }
-                stringBuilder.append(']');
-                return stringBuilder.toString();
+    }
+
+    public static <T> boolean equalsAllowNulls(Iterator<T> iterator1, Iterator<T> iterator2) {
+        if (iterator1 == null || !iterator1.hasNext()) {
+            return (iterator2 == null || !iterator2.hasNext());
+        } else if (iterator2 == null || !iterator2.hasNext()) {
+            return false;
+        } else {
+            boolean result	= true;
+            while (result && iterator1.hasNext() && iterator2.hasNext()) {
+                result	= ObjUtil.equalsAllowNull(iterator1.next(), iterator2.next());
+            }
+            return result && !iterator1.hasNext() && !iterator2.hasNext();
         }
+    }
+
+    public static <T> boolean equalsAllowNulls(Collection<T> collection1, Collection<T> collection2) {
+        if (collection1 == collection2) {
+            return true;
+        } else if (collection1 == null || collection2 == null) {
+            return false;
+        } else if (collection1.size() != collection2.size()) {
+            return false;
+        } else {
+            for (Iterator<T> i1 = collection1.iterator(), i2 = collection2.iterator() ; i1.hasNext() ; ) {
+                if (!ObjUtil.equalsAllowNull(i1.next(), i2.next())) {
+                    return false;
+                }
+            }
+            return true;
+        }
+    }
+
+    public static <T> String toString(Collection<T> collection) {
+        StringBuilder stringBuilder	= new StringBuilder("[");
+        boolean first				= true;
+        for (T t : collection) {
+            if (!first) {
+                stringBuilder.append(',');
+            } else {
+                first	= true;
+            }
+            if (t == null) {
+                stringBuilder.append("null");
+            } else {
+                stringBuilder.append(t.toString());
+            }
+        }
+        stringBuilder.append(']');
+        return stringBuilder.toString();
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/ObjUtil.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/ObjUtil.java
index 3846e73..8399621 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/ObjUtil.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/ObjUtil.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -38,189 +38,189 @@
 
 /**
  * ObjUtil provides utilities for comparing objects in various circumstances.
- * 
+ *
  * @author car
  * @version $Revision$
  */
 public class ObjUtil {
-        
-        private static final Log logger	= LogFactory.getLog(ObjUtil.class);
 
-        
-        protected ObjUtil() {
+    private static final Log logger	= LogFactory.getLog(ObjUtil.class);
+
+
+    protected ObjUtil() {
+    }
+
+    /**
+     * Determines if two objects of the same class are equivalent, including the case where
+     * both are <code>null</code>.
+     *
+     * @param obj1 the first object to compare
+     * @param obj2 the second object to compare
+     * @return true if both objects are null, or the first is non-null and <code>equals</code> the second.
+     */
+    public static <T> boolean equalsAllowNull(T obj1, T obj2) {
+        if (obj1 == null) {
+            return (obj2 == null);
+        } else {
+            return obj1.equals(obj2);
+        }
+    }
+
+
+    /**
+     * Determines if two XML Nodes are equivalent, including the case where
+     * both are <code>null</code>.
+     * For XML Nodes the .equals() method does not work (the objects must actually be the same Node).
+     * In this project we want to allow XML with different textual layout (newlines and spaces) to be equal
+     * because the text formatting is not significant to the meaning of the content.  Therefore the (Node).isEqualNode() method is not appropriate either.
+     *
+     * This method looks at the Node elements and each of their children:
+     * 	- ignoring empty text nodes
+     * 	- ignoring comment nodes
+     * 	- checking that all attributes on the nodes are the same
+     * 	- checking that each non-empty-text child is in the same order
+     *
+     * @param node1 the first Node object to compare
+     * @param node2 the second Node object to compare
+     * @return true if both objects are null, or the first is non-null and <code>equals</code> the second as described in the method description.
+     */
+    public static boolean xmlEqualsAllowNull(Node node1, Node node2) {
+        if (node1 == null) {
+            return (node2 == null);
+        } else if (node2 == null) {
+            return false;
         }
 
-        /**
-         * Determines if two objects of the same class are equivalent, including the case where
-         * both are <code>null</code>.
-         * 
-         * @param obj1 the first object to compare
-         * @param obj2 the second object to compare
-         * @return true if both objects are null, or the first is non-null and <code>equals</code> the second.
-         */
-        public static <T> boolean equalsAllowNull(T obj1, T obj2) {
-                if (obj1 == null) {
-                        return (obj2 == null);
-                } else {
-                        return obj1.equals(obj2);
+        // create deep copies of the nodes so we can manipulate them before testing
+        Node clone1 = node1.cloneNode(true);
+        cleanXMLNode(clone1);
+        Node clone2 = node2.cloneNode(true);
+        cleanXMLNode(clone2);
+
+        boolean compareReturn = compareXML(clone1,clone2);
+        return compareReturn;
+    }
+
+
+
+    /**
+     * Recursively clean up this node and all its children,
+     * where "clean" means
+     * 	- remove comments
+     * 	- remove empty nodes
+     * 	- remove xmlns (Namespace) attributes
+     *
+     * @param node
+     */
+    private static void cleanXMLNode(Node node) {
+
+        //
+        // The loops in this method run from back to front because they are removing items from the lists
+        //
+
+        // remove xmlns (Namespace) attributes
+        NamedNodeMap attributes = node.getAttributes();
+
+        if (attributes != null) {
+            for (int i = attributes.getLength() - 1; i >= 0; i--) {
+                Node a = attributes.item(i);
+                if (a.getNodeName().startsWith("xmlns")) {
+                    attributes.removeNamedItem(a.getNodeName());
                 }
+            }
         }
-        
-        
-        /**
-         * Determines if two XML Nodes are equivalent, including the case where
-         * both are <code>null</code>.
-         * For XML Nodes the .equals() method does not work (the objects must actually be the same Node).
-         * In this project we want to allow XML with different textual layout (newlines and spaces) to be equal
-         * because the text formatting is not significant to the meaning of the content.  Therefore the (Node).isEqualNode() method is not appropriate either.
-         * 
-         * This method looks at the Node elements and each of their children:
-         * 	- ignoring empty text nodes
-         * 	- ignoring comment nodes
-         * 	- checking that all attributes on the nodes are the same
-         * 	- checking that each non-empty-text child is in the same order
-         * 
-         * @param node1 the first Node object to compare
-         * @param node2 the second Node object to compare
-         * @return true if both objects are null, or the first is non-null and <code>equals</code> the second as described in the method description.
-         */
-        public static boolean xmlEqualsAllowNull(Node node1, Node node2) {
-                if (node1 == null) {
-                        return (node2 == null);
-                } else if (node2 == null) {
-                        return false;
-                }
-                
-                // create deep copies of the nodes so we can manipulate them before testing
-                Node clone1 = node1.cloneNode(true);
-                cleanXMLNode(clone1);
-                Node clone2 = node2.cloneNode(true);
-                cleanXMLNode(clone2);
-                                
-                boolean compareReturn = compareXML(clone1,clone2);
-                return compareReturn;
+
+        NodeList childNodes = node.getChildNodes();
+
+        for (int i = childNodes.getLength() - 1; i >= 0; i--) {
+            Node child = childNodes.item(i);
+
+            short type = child.getNodeType();
+
+            // remove comments
+            if (type == 8) {
+                node.removeChild(child);
+                continue;
+            }
+
+            // node is not text, so clean it too
+            cleanXMLNode(child);
         }
-        
-        
 
-        /**
-         * Recursively clean up this node and all its children,
-         * where "clean" means
-         * 	- remove comments
-         * 	- remove empty nodes
-         * 	- remove xmlns (Namespace) attributes
-         * 
-         * @param node
-         */
-        private static void cleanXMLNode(Node node) {
-                
-                //
-                // The loops in this method run from back to front because they are removing items from the lists
-                //
-                
-                // remove xmlns (Namespace) attributes
-                NamedNodeMap attributes = node.getAttributes();
-                
-                if (attributes != null) {
-                        for (int i = attributes.getLength() - 1; i >= 0; i--) {
-                                Node a = attributes.item(i);
-                                if (a.getNodeName().startsWith("xmlns")) {
-                                        attributes.removeNamedItem(a.getNodeName());
-                                }
-                        }
-                }
-                
-                NodeList childNodes = node.getChildNodes();
-                
-                for (int i = childNodes.getLength() - 1; i >= 0; i--) {
-                        Node child = childNodes.item(i);
-                        
-                        short type = child.getNodeType();
-                
-                        // remove comments
-                        if (type == 8) {
-                                node.removeChild(child);
-                                continue;
-                        }
 
-                        // node is not text, so clean it too
-                        cleanXMLNode(child);
-                }
-                
+    }
 
+
+    /**
+     * Recursively compare these two nodes and then compare their children.
+     *
+     * @param node1
+     * @param node2
+     * @return
+     */
+    private static boolean compareXML(Node node1, Node node2) {
+        // compare the nodes
+        if (equalsAllowNull(node1.getNodeName(), node2.getNodeName()) == false ||
+                equalsAllowNull(node1.getNodeValue(), node2.getNodeValue()) == false ||
+                node1.getNodeType() != node2.getNodeType()) {
+            // these two nodes to not match their basic information
+            logger.info("Node1 '" + node1.getNodeName() + "' type: " + node1.getNodeType() + "  != Node2 '" + node2.getNodeName()+"' type: " + node2.getNodeType() );
+            return false;
         }
-        
-        
-        /**
-         * Recursively compare these two nodes and then compare their children.
-         * 
-         * @param node1
-         * @param node2
-         * @return
-         */
-        private static boolean compareXML(Node node1, Node node2) {
-                // compare the nodes
-                if (equalsAllowNull(node1.getNodeName(), node2.getNodeName()) == false ||
-                                equalsAllowNull(node1.getNodeValue(), node2.getNodeValue()) == false ||
-                                node1.getNodeType() != node2.getNodeType()) {
-                        // these two nodes to not match their basic information
-                        logger.info("Node1 '" + node1.getNodeName() + "' type: " + node1.getNodeType() + "  != Node2 '" + node2.getNodeName()+"' type: " + node2.getNodeType() );
-                        return false;
-                }
-                
-                // compare the attributes of the two nodes
-                NamedNodeMap node1Attributes = node1.getAttributes();
-                NamedNodeMap node2Attributes = node2.getAttributes();
-                
-                // null attributes == attributes with length 0
-                if (node1Attributes == null) {
-                        if (node2Attributes != null && node2Attributes.getLength() > 0) {
-                                logger.info("Node1 '" + node1.getNodeName() + "' attrs null != Node2 '" + node2.getNodeName()+"' attrs non-null");
-                                return false;
-                        }
-                } else {
-                        // node1 Attributes is not null
-                        if (node2Attributes == null || node2Attributes.getLength() != node1Attributes.getLength()) {
-                                logger.info("Node1 '" + node1.getNodeName() + "' attrs non-null  != Node2 '" + node2.getNodeName()+"' attrs null or length not same");
-                                return false;
-                        }
-                        
-                        // both attrs exist and are same length
-                        // check that all of list 1 is in list 2
-                        // no need to check attr from node2 exist in node 1 because the lists are the same length,
-                        // and since all attrs from node 1 exist in node 2 there cannot be any extra in node2
-                        for (int i = 0; i < node1Attributes.getLength(); i++) {
-                                if (node2Attributes.getNamedItem(node1Attributes.item(i).getNodeName()) == null) {
-                                        // attribute in node 1 does not exist in node 2
-                                        logger.info("Node1 '" + node1.getNodeName() + "' attr: '" +node1Attributes.item(i).getNodeName() + "'  != Node2 '" + node2.getNodeName()+"' (missing attr)");
-                                        return false;
-                                }
-                        }
-                }
 
+        // compare the attributes of the two nodes
+        NamedNodeMap node1Attributes = node1.getAttributes();
+        NamedNodeMap node2Attributes = node2.getAttributes();
 
-                
-                // compare the children of the nodes
-                NodeList children1 = node1.getChildNodes();
-                NodeList children2 = node2.getChildNodes();
-                
-                if (children1.getLength() != children2.getLength()) {
-                        // they cannot be the same because the length is different
-                        logger.info("Node1 '" + node1.getNodeName() + "' children: " + children1.getLength() + " != Node2 '" + node2.getNodeName()+"' children: " + children2.getLength());
-                        return false;
+        // null attributes == attributes with length 0
+        if (node1Attributes == null) {
+            if (node2Attributes != null && node2Attributes.getLength() > 0) {
+                logger.info("Node1 '" + node1.getNodeName() + "' attrs null != Node2 '" + node2.getNodeName()+"' attrs non-null");
+                return false;
+            }
+        } else {
+            // node1 Attributes is not null
+            if (node2Attributes == null || node2Attributes.getLength() != node1Attributes.getLength()) {
+                logger.info("Node1 '" + node1.getNodeName() + "' attrs non-null  != Node2 '" + node2.getNodeName()+"' attrs null or length not same");
+                return false;
+            }
+
+            // both attrs exist and are same length
+            // check that all of list 1 is in list 2
+            // no need to check attr from node2 exist in node 1 because the lists are the same length,
+            // and since all attrs from node 1 exist in node 2 there cannot be any extra in node2
+            for (int i = 0; i < node1Attributes.getLength(); i++) {
+                if (node2Attributes.getNamedItem(node1Attributes.item(i).getNodeName()) == null) {
+                    // attribute in node 1 does not exist in node 2
+                    logger.info("Node1 '" + node1.getNodeName() + "' attr: '" +node1Attributes.item(i).getNodeName() + "'  != Node2 '" + node2.getNodeName()+"' (missing attr)");
+                    return false;
                 }
-                
-                // children are supposed to be in the same order
-                for (int index1 = 0; index1 < children1.getLength(); index1++) {
-                        if (compareXML(children1.item(index1), children2.item(index1)) == false) {
-                                logger.info("Node1 '" + node1.getNodeName() + "' != Node2 '" + node2.getNodeName()+"'");
-                                return false;
-                        }
-                }
-                
-                return true;
+            }
         }
-        
-        
-        
+
+
+
+        // compare the children of the nodes
+        NodeList children1 = node1.getChildNodes();
+        NodeList children2 = node2.getChildNodes();
+
+        if (children1.getLength() != children2.getLength()) {
+            // they cannot be the same because the length is different
+            logger.info("Node1 '" + node1.getNodeName() + "' children: " + children1.getLength() + " != Node2 '" + node2.getNodeName()+"' children: " + children2.getLength());
+            return false;
+        }
+
+        // children are supposed to be in the same order
+        for (int index1 = 0; index1 < children1.getLength(); index1++) {
+            if (compareXML(children1.item(index1), children2.item(index1)) == false) {
+                logger.info("Node1 '" + node1.getNodeName() + "' != Node2 '" + node2.getNodeName()+"'");
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+
+
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/StringUtils.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/StringUtils.java
index 1a8fefc..ef998ca 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/StringUtils.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/StringUtils.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -34,176 +34,176 @@
 
 /**
  * StringUtils provides utilities for converting various general classes of objects to strings.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class StringUtils {
 
-        protected StringUtils() {
-        }
+    protected StringUtils() {
+    }
 
-        /**
-         * Generates a <code>String</code> value from the given <code>Iterator</code> of the form:
-         * '[' object.toString() ',' object.toString() ',' ... ']'
-         * 
-         * @param iterObjects the <code>Iterator</code> to dump into a <code>String</code>
-         * @param allowEmptyLists if true, show empty lists as "[]" otherwise return null
-         * @return the <code>String</code> representation of the <code>Iterator</code> or null if the <code>Iterator</code> is null 
-         * (or empty if allowEmptyLists is false)
-         */
-        public static String toString(Iterator<?> iterObjects, boolean allowEmptyLists) {
-                if (iterObjects == null || (!allowEmptyLists && !iterObjects.hasNext())) {
-                        return null;
+    /**
+     * Generates a <code>String</code> value from the given <code>Iterator</code> of the form:
+     * '[' object.toString() ',' object.toString() ',' ... ']'
+     *
+     * @param iterObjects the <code>Iterator</code> to dump into a <code>String</code>
+     * @param allowEmptyLists if true, show empty lists as "[]" otherwise return null
+     * @return the <code>String</code> representation of the <code>Iterator</code> or null if the <code>Iterator</code> is null
+     * (or empty if allowEmptyLists is false)
+     */
+    public static String toString(Iterator<?> iterObjects, boolean allowEmptyLists) {
+        if (iterObjects == null || (!allowEmptyLists && !iterObjects.hasNext())) {
+            return null;
+        } else {
+            StringBuilder stringBuilder	= new StringBuilder("[");
+            if (iterObjects.hasNext()) {
+                stringBuilder.append(iterObjects.next().toString());
+                while (iterObjects.hasNext()) {
+                    stringBuilder.append(',');
+                    stringBuilder.append(iterObjects.next().toString());
+                }
+            }
+            stringBuilder.append(']');
+            return stringBuilder.toString();
+        }
+    }
+
+    public static String toString(short[] a) {
+        StringBuilder stringBuilder	= new StringBuilder("[");
+        if (a != null && a.length > 0) {
+            stringBuilder.append(a[0]);
+            for (int i = 1 ; i < a.length ; i++) {
+                stringBuilder.append(',');
+                stringBuilder.append(a[i]);
+            }
+        }
+        stringBuilder.append(']');
+        return stringBuilder.toString();
+    }
+
+    public static String toString(byte[] a) {
+        StringBuilder stringBuilder	= new StringBuilder("[");
+        if (a != null && a.length > 0) {
+            stringBuilder.append(a[0]);
+            for (int i = 1 ; i < a.length ; i++) {
+                stringBuilder.append(',');
+                stringBuilder.append(a[i]);
+            }
+        }
+        stringBuilder.append(']');
+        return stringBuilder.toString();
+    }
+
+    public static String toString(Iterator<?> iterObjects) {
+        return toString(iterObjects, false);
+    }
+
+    protected static void indent(StringBuilder stringBuilder, int spaces) {
+        for (int i = 0 ; i < spaces ; i++) {
+            stringBuilder.append(' ');
+        }
+    }
+
+    public static String prettyPrint(String string, int indentSize) {
+        if (string == null) {
+            return "null";
+        }
+        StringBuilder stringBuilder	= new StringBuilder();
+        int stringLen	= string.length();
+        int curIndent	= 0;
+        boolean bstart	= false;
+        for (int i = 0 ; i < stringLen ; ) {
+            char charAt	= string.charAt(i);
+            switch(charAt) {
+            case '{':
+                if (i+1 < stringLen) {
+                    if (string.charAt(i+1) == '}') {
+                        stringBuilder.append("{}");
+                        i	+= 2;
+                    } else {
+                        if (i > 0) {
+                            stringBuilder.append('\n');
+                            curIndent++;
+                            indent(stringBuilder,curIndent*indentSize);
+                            stringBuilder.append(charAt);
+                        } else {
+                            stringBuilder.append(charAt);
+                        }
+                        i++;
+                    }
                 } else {
-                        StringBuilder stringBuilder	= new StringBuilder("[");
-                        if (iterObjects.hasNext()) {
-                                stringBuilder.append(iterObjects.next().toString());
-                                while (iterObjects.hasNext()) {
-                                        stringBuilder.append(',');
-                                        stringBuilder.append(iterObjects.next().toString());
-                                }
-                        }
-                        stringBuilder.append(']');
-                        return stringBuilder.toString();
+                    stringBuilder.append(charAt);
+                    i++;
                 }
-        }
-        
-        public static String toString(short[] a) {
-                StringBuilder stringBuilder	= new StringBuilder("[");
-                if (a != null && a.length > 0) {
-                        stringBuilder.append(a[0]);
-                        for (int i = 1 ; i < a.length ; i++) {
-                                stringBuilder.append(',');
-                                stringBuilder.append(a[i]);
-                        }
+                bstart	= true;
+                break;
+            case '}':
+                stringBuilder.append('\n');
+                indent(stringBuilder, curIndent*indentSize);
+                stringBuilder.append('}');
+                if (curIndent > 0) {
+                    curIndent--;
                 }
+                i++;
+                bstart	= true;
+                break;
+            case '[':
+                if (i+1 < stringLen) {
+                    if (string.charAt(i+1) == ']') {
+                        stringBuilder.append("[]");
+                        i	+= 2;
+                    } else {
+                        if (i > 0) {
+                            stringBuilder.append('\n');
+                            curIndent++;
+                            indent(stringBuilder,curIndent*indentSize);
+                            stringBuilder.append(charAt);
+                        } else {
+                            stringBuilder.append(charAt);
+                        }
+                        i++;
+                    }
+                } else {
+                    stringBuilder.append(charAt);
+                    i++;
+                }
+                bstart	= true;
+                break;
+            case ']':
+                stringBuilder.append('\n');
+                indent(stringBuilder, curIndent*indentSize);
                 stringBuilder.append(']');
-                return stringBuilder.toString();
-        }
-        
-        public static String toString(byte[] a) {
-                StringBuilder stringBuilder	= new StringBuilder("[");
-                if (a != null && a.length > 0) {
-                        stringBuilder.append(a[0]);
-                        for (int i = 1 ; i < a.length ; i++) {
-                                stringBuilder.append(',');
-                                stringBuilder.append(a[i]);
-                        }
+                if (curIndent > 0) {
+                    curIndent--;
                 }
-                stringBuilder.append(']');
-                return stringBuilder.toString();
-        }
-        
-        public static String toString(Iterator<?> iterObjects) {
-                return toString(iterObjects, false);
-        }
-        
-        protected static void indent(StringBuilder stringBuilder, int spaces) {
-                for (int i = 0 ; i < spaces ; i++) {
-                        stringBuilder.append(' ');
+                i++;
+                bstart	= true;
+                break;
+            case ',':
+                stringBuilder.append(charAt);
+                i++;
+                break;
+            case '\n':
+                stringBuilder.append(charAt);
+                indent(stringBuilder, curIndent*indentSize);
+                i++;
+                break;
+            default:
+                if (bstart) {
+                    stringBuilder.append('\n');
+                    indent(stringBuilder, (curIndent+1)*indentSize);
+                    bstart	= false;
                 }
+                stringBuilder.append(charAt);
+                i++;
+                break;
+            }
         }
-        
-        public static String prettyPrint(String string, int indentSize) {
-                if (string == null) {
-                        return "null";
-                }
-                StringBuilder stringBuilder	= new StringBuilder();
-                int stringLen	= string.length();
-                int curIndent	= 0;
-                boolean bstart	= false;
-                for (int i = 0 ; i < stringLen ; ) {
-                        char charAt	= string.charAt(i);
-                        switch(charAt) {
-                        case '{':
-                                if (i+1 < stringLen) {
-                                        if (string.charAt(i+1) == '}') {
-                                                stringBuilder.append("{}");
-                                                i	+= 2;
-                                        } else {
-                                                if (i > 0) {
-                                                        stringBuilder.append('\n');
-                                                        curIndent++;
-                                                        indent(stringBuilder,curIndent*indentSize);
-                                                        stringBuilder.append(charAt);
-                                                } else {
-                                                        stringBuilder.append(charAt);
-                                                }
-                                                i++;
-                                        }
-                                } else {
-                                        stringBuilder.append(charAt);
-                                        i++;
-                                }
-                                bstart	= true;
-                                break;
-                        case '}':
-                                stringBuilder.append('\n');
-                                indent(stringBuilder, curIndent*indentSize);
-                                stringBuilder.append('}');
-                                if (curIndent > 0) {
-                                        curIndent--;
-                                }
-                                i++;
-                                bstart	= true;
-                                break;
-                        case '[':
-                                if (i+1 < stringLen) {
-                                        if (string.charAt(i+1) == ']') {
-                                                stringBuilder.append("[]");
-                                                i	+= 2;
-                                        } else {
-                                                if (i > 0) {
-                                                        stringBuilder.append('\n');
-                                                        curIndent++;
-                                                        indent(stringBuilder,curIndent*indentSize);
-                                                        stringBuilder.append(charAt);
-                                                } else {
-                                                        stringBuilder.append(charAt);
-                                                }
-                                                i++;
-                                        }
-                                } else {
-                                        stringBuilder.append(charAt);
-                                        i++;
-                                }
-                                bstart	= true;
-                                break;
-                        case ']':
-                                stringBuilder.append('\n');
-                                indent(stringBuilder, curIndent*indentSize);
-                                stringBuilder.append(']');
-                                if (curIndent > 0) {
-                                        curIndent--;
-                                }
-                                i++;
-                                bstart	= true;
-                                break;
-                        case ',':
-                                stringBuilder.append(charAt);
-                                i++;
-                                break;
-                        case '\n':
-                                stringBuilder.append(charAt);
-                                indent(stringBuilder, curIndent*indentSize);
-                                i++;
-                                break;
-                        default:
-                                if (bstart) {
-                                        stringBuilder.append('\n');
-                                        indent(stringBuilder, (curIndent+1)*indentSize);
-                                        bstart	= false;
-                                }
-                                stringBuilder.append(charAt);
-                                i++;
-                                break;
-                        }
-                }
-                return stringBuilder.toString();		
-        }
-        
-        public static String prettyPrint(String string) {
-                return prettyPrint(string, 3);
-        }
+        return stringBuilder.toString();
+    }
+
+    public static String prettyPrint(String string) {
+        return prettyPrint(string, 3);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/Wrapper.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/Wrapper.java
index 0d69422..b2d2552 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/Wrapper.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/Wrapper.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -33,51 +33,51 @@
 /**
  * Defines an object that delegates its <code>equals</code>, <code>hashCode</code> and <code>toString</code> methods to
  * a wrapped object.
- * 
+ *
  * @author Christopher A. Rath
  * @version $Revision$
- * 
+ *
  * @param <T> the Class of the wrapped object
  */
 public class Wrapper<T> {
-        private T	wrappedObject;
-        
-        /**
-         * Gets the <code>T</code> wrapped object.
-         * 
-         * @return the <code>T</code> wrapped object.
-         */
-        protected T getWrappedObject() {
-                return this.wrappedObject;
+    private T	wrappedObject;
+
+    /**
+     * Gets the <code>T</code> wrapped object.
+     *
+     * @return the <code>T</code> wrapped object.
+     */
+    protected T getWrappedObject() {
+        return this.wrappedObject;
+    }
+
+    /**
+     * Creates a new <code>Wrapper</code> around the given <code>T</code> object.
+     *
+     * @param wrappedObjectIn the <code>T</code> wrapped object.
+     */
+    public Wrapper(T wrappedObjectIn) {
+        this.wrappedObject	= wrappedObjectIn;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
+            return true;
+        } else if (obj == null) {
+            return false;
+        } else {
+            return this.wrappedObject.equals(obj);
         }
-        
-        /**
-         * Creates a new <code>Wrapper</code> around the given <code>T</code> object.
-         * 
-         * @param wrappedObjectIn the <code>T</code> wrapped object.
-         */
-        public Wrapper(T wrappedObjectIn) {
-                this.wrappedObject	= wrappedObjectIn;
-        }
-        
-        @Override
-        public boolean equals(Object obj) {
-                if (obj == this) {
-                        return true;
-                } else if (obj == null) {
-                        return false;
-                } else {
-                        return this.wrappedObject.equals(obj);
-                }
-        }
-        
-        @Override
-        public int hashCode() {
-                return this.wrappedObject.hashCode();
-        }
-        
-        @Override
-        public String toString() {
-                return this.wrappedObject.toString();
-        }
+    }
+
+    @Override
+    public int hashCode() {
+        return this.wrappedObject.hashCode();
+    }
+
+    @Override
+    public String toString() {
+        return this.wrappedObject.toString();
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLObjectCopy.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLObjectCopy.java
index d2573b8..276f14c 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLObjectCopy.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLObjectCopy.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -86,240 +86,240 @@
 import oasis.names.tc.xacml._3_0.core.schema.wd_17.VariableReferenceType;
 
 public class XACMLObjectCopy {
-        
-        public static PolicySetType	copy(PolicySetType policySet) {
-                return deepCopy(policySet);
-        }
-        
-        public static PolicyIssuerType	copy(PolicyIssuerType issuer) {
-                return deepCopy(issuer);
-        }
-        
-        public static TargetType	copy(TargetType target) {
-                return deepCopy(target);
-        }
-        
-        public static AnyOfType		copy(AnyOfType anyOf) {
-                return deepCopy(anyOf);
-        }
-        
-        public static AllOfType		copy(AllOfType allOf) {
-                return deepCopy(allOf);
-        }
-        
-        public static MatchType		copy(MatchType match) {
-                return deepCopy(match);
-        }
-        
-        public static IdReferenceType	copy(IdReferenceType ref) {
-                return deepCopy(ref);
-        }
-        
-        public static PolicyType		copy(PolicyType policy) {
-                return deepCopy(policy);
-        }
-        
-        public static CombinerParametersType	copy(CombinerParametersType params) {
-                return deepCopy(params);
-        }
-        
-        public static CombinerParameterType	copy(CombinerParameterType param) {
-                return deepCopy(param);
-        }
-        
-        public static RuleCombinerParametersType	copy(RuleCombinerParametersType params) {
-                return deepCopy(params);
-        }
-        
-        public static PolicyCombinerParametersType	copy(PolicyCombinerParametersType params) {
-                return deepCopy(params);
-        }
-        
-        public static PolicySetCombinerParametersType	copy(PolicySetCombinerParametersType params) {
-                return deepCopy(params);
-        }
-        
-        public static RuleType copy(RuleType rule) {
-                return deepCopy(rule);
-        }
-        
-        public static VariableDefinitionType copy(VariableDefinitionType value) {
-                return deepCopy(value);
-        }
 
-        public static VariableReferenceType copy(VariableReferenceType value) {
-                return deepCopy(value);
-        }
-        
-        public static JAXBElement<?>	copy(JAXBElement<?> element) {
-                return deepCopy(element);
-        }
+    public static PolicySetType	copy(PolicySetType policySet) {
+        return deepCopy(policySet);
+    }
 
-        public static ConditionType copy(ConditionType condition) {
-                return deepCopy(condition);
-        }
-        
-        public static ApplyType copy(ApplyType value) {
-                return deepCopy(value);
-        }
+    public static PolicyIssuerType	copy(PolicyIssuerType issuer) {
+        return deepCopy(issuer);
+    }
 
-        public static FunctionType copy(FunctionType value) {
-                return deepCopy(value);
-        }
+    public static TargetType	copy(TargetType target) {
+        return deepCopy(target);
+    }
 
-        public static AttributeDesignatorType copy(AttributeDesignatorType value) {
-                return deepCopy(value);
-        }
+    public static AnyOfType		copy(AnyOfType anyOf) {
+        return deepCopy(anyOf);
+    }
 
-        public static AttributeSelectorType copy(AttributeSelectorType value) {
-                return deepCopy(value);
-        }
+    public static AllOfType		copy(AllOfType allOf) {
+        return deepCopy(allOf);
+    }
 
-        public static AttributeValueType copy(AttributeValueType attributeValue) {
-                return deepCopy(attributeValue);
-        }
-        
-        public static ObligationsType	copy(ObligationsType ob) {
-                return deepCopy(ob);
-        }
-        
-        public static AssociatedAdviceType		copy(AssociatedAdviceType advice) {
-                return deepCopy(advice);
-        }
+    public static MatchType		copy(MatchType match) {
+        return deepCopy(match);
+    }
 
-        public static ObligationType	copy(ObligationType ob) {
-                return deepCopy(ob);
-        }
-        
-        public static AdviceType		copy(AdviceType advice) {
-                return deepCopy(advice);
-        }
-        
-        public static AttributeAssignmentType	copy(AttributeAssignmentType assign) {
-                return deepCopy(assign);
-        }
-        
-        public static ObligationExpressionsType	copy(ObligationExpressionsType expressions) {
-                return deepCopy(expressions);
-        }
+    public static IdReferenceType	copy(IdReferenceType ref) {
+        return deepCopy(ref);
+    }
 
-        public static AdviceExpressionsType	copy(AdviceExpressionsType expressions) {
-                return deepCopy(expressions);
-        }
+    public static PolicyType		copy(PolicyType policy) {
+        return deepCopy(policy);
+    }
 
-        public static ObligationExpressionType	copy(ObligationExpressionType expression) {
-                return deepCopy(expression);
-        }
+    public static CombinerParametersType	copy(CombinerParametersType params) {
+        return deepCopy(params);
+    }
 
-        public static AdviceExpressionType	copy(AdviceExpressionType expressions) {
-                return deepCopy(expressions);
-        }
-        
-        public static AttributeAssignmentExpressionType	copy(AttributeAssignmentExpressionType expression) {
-                return deepCopy(expression);
-        }
+    public static CombinerParameterType	copy(CombinerParameterType param) {
+        return deepCopy(param);
+    }
 
-        public static RequestType copy(RequestType request) {
-                return deepCopy(request);
-        }
+    public static RuleCombinerParametersType	copy(RuleCombinerParametersType params) {
+        return deepCopy(params);
+    }
 
-        public static RequestDefaultsType copy(RequestDefaultsType requestDefaults) {
-                return deepCopy(requestDefaults);
-        }
-        
-        public static AttributesType copy(AttributesType type) {
-                return deepCopy(type);
-        }
+    public static PolicyCombinerParametersType	copy(PolicyCombinerParametersType params) {
+        return deepCopy(params);
+    }
 
-        public static List<AttributesType> copyAttributes(List<AttributesType> attributes) {
-                return deepCopy(attributes);
-        }
+    public static PolicySetCombinerParametersType	copy(PolicySetCombinerParametersType params) {
+        return deepCopy(params);
+    }
 
-        public static List<AttributeType> copyAttribute(List<AttributeType> attributeList) {
-                return deepCopy(attributeList);
-        }
+    public static RuleType copy(RuleType rule) {
+        return deepCopy(rule);
+    }
 
-        public static ContentType copy(ContentType content) {
-                return deepCopy(content);
-        }
+    public static VariableDefinitionType copy(VariableDefinitionType value) {
+        return deepCopy(value);
+    }
 
-        public static List<Object> copyContent(List<Object> content) {
-                return deepCopy(content);
-        }
-        
-        public static String	getContent(List<Object> content) {
-                StringBuffer buffer = new StringBuffer();
-                for (Object obj : content) {
-                        buffer.append(obj.toString());
-                }
-                return buffer.toString();
-        }
-        
-        public static AttributeType copy(AttributeType type) {
-                return deepCopy(type);
-        }
+    public static VariableReferenceType copy(VariableReferenceType value) {
+        return deepCopy(value);
+    }
 
-        public static ResponseType	copy(ResponseType response) {
-                return deepCopy(response);
-        }
+    public static JAXBElement<?>	copy(JAXBElement<?> element) {
+        return deepCopy(element);
+    }
 
-        public static ResultType	copy(ResultType result) {
-                return deepCopy(result);
-        }
-        
-        public static PolicyIdentifierListType	copy(PolicyIdentifierListType list) {
-                return deepCopy(list);
-        }
+    public static ConditionType copy(ConditionType condition) {
+        return deepCopy(condition);
+    }
 
-        public static MultiRequestsType copy(MultiRequestsType multiRequests) {
-                return deepCopy(multiRequests);
-        }
+    public static ApplyType copy(ApplyType value) {
+        return deepCopy(value);
+    }
 
-        public static List<RequestReferenceType> copyMultiRequest(List<RequestReferenceType> requestReference) {
-                return deepCopy(requestReference);
-        }
+    public static FunctionType copy(FunctionType value) {
+        return deepCopy(value);
+    }
 
-        public static RequestReferenceType copy(RequestReferenceType type) {
-                return deepCopy(type);
-        }
+    public static AttributeDesignatorType copy(AttributeDesignatorType value) {
+        return deepCopy(value);
+    }
 
-        public static List<AttributesReferenceType> copyAttributeReferences(List<AttributesReferenceType> attributesReference) {
-                return deepCopy(attributesReference);
-        }
+    public static AttributeSelectorType copy(AttributeSelectorType value) {
+        return deepCopy(value);
+    }
 
-        public static AttributesReferenceType copy(AttributesReferenceType type) {
-                return deepCopy(type);
-        }
-        
-        public static StatusType copy(StatusType status) {
-                return deepCopy(status);
-        }
-        
-        public static MissingAttributeDetailType	copy(MissingAttributeDetailType detail) {
-                return deepCopy(detail);
-        }
+    public static AttributeValueType copy(AttributeValueType attributeValue) {
+        return deepCopy(attributeValue);
+    }
 
-        public static List<AttributeValueType> copy(List<AttributeValueType> attributeValue) {
-                return deepCopy(attributeValue);
+    public static ObligationsType	copy(ObligationsType ob) {
+        return deepCopy(ob);
+    }
+
+    public static AssociatedAdviceType		copy(AssociatedAdviceType advice) {
+        return deepCopy(advice);
+    }
+
+    public static ObligationType	copy(ObligationType ob) {
+        return deepCopy(ob);
+    }
+
+    public static AdviceType		copy(AdviceType advice) {
+        return deepCopy(advice);
+    }
+
+    public static AttributeAssignmentType	copy(AttributeAssignmentType assign) {
+        return deepCopy(assign);
+    }
+
+    public static ObligationExpressionsType	copy(ObligationExpressionsType expressions) {
+        return deepCopy(expressions);
+    }
+
+    public static AdviceExpressionsType	copy(AdviceExpressionsType expressions) {
+        return deepCopy(expressions);
+    }
+
+    public static ObligationExpressionType	copy(ObligationExpressionType expression) {
+        return deepCopy(expression);
+    }
+
+    public static AdviceExpressionType	copy(AdviceExpressionType expressions) {
+        return deepCopy(expressions);
+    }
+
+    public static AttributeAssignmentExpressionType	copy(AttributeAssignmentExpressionType expression) {
+        return deepCopy(expression);
+    }
+
+    public static RequestType copy(RequestType request) {
+        return deepCopy(request);
+    }
+
+    public static RequestDefaultsType copy(RequestDefaultsType requestDefaults) {
+        return deepCopy(requestDefaults);
+    }
+
+    public static AttributesType copy(AttributesType type) {
+        return deepCopy(type);
+    }
+
+    public static List<AttributesType> copyAttributes(List<AttributesType> attributes) {
+        return deepCopy(attributes);
+    }
+
+    public static List<AttributeType> copyAttribute(List<AttributeType> attributeList) {
+        return deepCopy(attributeList);
+    }
+
+    public static ContentType copy(ContentType content) {
+        return deepCopy(content);
+    }
+
+    public static List<Object> copyContent(List<Object> content) {
+        return deepCopy(content);
+    }
+
+    public static String	getContent(List<Object> content) {
+        StringBuffer buffer = new StringBuffer();
+        for (Object obj : content) {
+            buffer.append(obj.toString());
         }
-        
-        public static Map<? extends QName, ? extends String> copy(Map<QName, String> otherAttributes) {
-                return deepCopy(otherAttributes);
+        return buffer.toString();
+    }
+
+    public static AttributeType copy(AttributeType type) {
+        return deepCopy(type);
+    }
+
+    public static ResponseType	copy(ResponseType response) {
+        return deepCopy(response);
+    }
+
+    public static ResultType	copy(ResultType result) {
+        return deepCopy(result);
+    }
+
+    public static PolicyIdentifierListType	copy(PolicyIdentifierListType list) {
+        return deepCopy(list);
+    }
+
+    public static MultiRequestsType copy(MultiRequestsType multiRequests) {
+        return deepCopy(multiRequests);
+    }
+
+    public static List<RequestReferenceType> copyMultiRequest(List<RequestReferenceType> requestReference) {
+        return deepCopy(requestReference);
+    }
+
+    public static RequestReferenceType copy(RequestReferenceType type) {
+        return deepCopy(type);
+    }
+
+    public static List<AttributesReferenceType> copyAttributeReferences(List<AttributesReferenceType> attributesReference) {
+        return deepCopy(attributesReference);
+    }
+
+    public static AttributesReferenceType copy(AttributesReferenceType type) {
+        return deepCopy(type);
+    }
+
+    public static StatusType copy(StatusType status) {
+        return deepCopy(status);
+    }
+
+    public static MissingAttributeDetailType	copy(MissingAttributeDetailType detail) {
+        return deepCopy(detail);
+    }
+
+    public static List<AttributeValueType> copy(List<AttributeValueType> attributeValue) {
+        return deepCopy(attributeValue);
+    }
+
+    public static Map<? extends QName, ? extends String> copy(Map<QName, String> otherAttributes) {
+        return deepCopy(otherAttributes);
+    }
+
+    static public <T> T deepCopy(T object) {
+        if (object == null) return null;
+
+        try {
+            @SuppressWarnings("unchecked")
+            Class<T> clazz = (Class<T>)object.getClass();
+            JAXBContext context = JAXBContext.newInstance(clazz);
+            JAXBElement<T> contentObject = new JAXBElement<T>(new QName(clazz.getSimpleName()), clazz, object);
+            JAXBSource source = new JAXBSource(context, contentObject);
+            return context.createUnmarshaller().unmarshal(source, clazz).getValue();
+        } catch (JAXBException e) {
+            throw new RuntimeException(e);
         }
-        
-        static public <T> T deepCopy(T object) {
-                if (object == null) return null;
-                
-                try {
-                        @SuppressWarnings("unchecked")
-                        Class<T> clazz = (Class<T>)object.getClass();
-                        JAXBContext context = JAXBContext.newInstance(clazz);
-                        JAXBElement<T> contentObject = new JAXBElement<T>(new QName(clazz.getSimpleName()), clazz, object);
-                        JAXBSource source = new JAXBSource(context, contentObject);
-                        return context.createUnmarshaller().unmarshal(source, clazz).getValue();
-                } catch (JAXBException e) {
-                        throw new RuntimeException(e);
-                }
-        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyAggregator.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyAggregator.java
index 7b62d89..38270c1 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyAggregator.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyAggregator.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -71,287 +71,287 @@
 
 /**
  * This class extends the SimpleCallback class and aggregates specific data items in a policy.
- * 
- * It will map all the Attribute Designator and Attribute Selector elements found within the policy. 
+ *
+ * It will map all the Attribute Designator and Attribute Selector elements found within the policy.
  * If there are associated Attribute Values for the designator/selector elements, then those values are also aggregated.
- * 
+ *
  * The attribute data is stored in a hierarchical map:
- * 
+ *
  * Map<CATEGORY, MAP<DATATYPE, MAP<ATTRIBUTEID, SET<VALUES>>>
- * 
+ *
  * It also aggregates obligations and advice identifiers into a map. Each key has a list of Obligation
  * or Advice objects.
- * 
+ *
  * Map<OBLIGATION or ADVICE ID, List<Obligation>>
- * 
+ *
  * It also aggregates variable definitions into a map. Each entry is the Policy mapping to its list
  * of Variable Definitions. Useful for policy editing.
- * 
+ *
  * Map<PolicyType, List<VariableDefinitionType>>
- * 
+ *
  * The map is useful for building policy simulation tools, policy editing, importing data into the
  * dictionaries, as well as for testing and exercising a policy.
- * 
+ *
  * @author pameladragosh
  *
  */
 public class XACMLPolicyAggregator extends SimpleCallback  {
-        private static Log logger	= LogFactory.getLog(XACMLPolicyAggregator.class);
-        //
-        // This holds all the attributes found within the policy
-        // Map<CATEGORY, MAP<DATATYPE, MAP<ATTRIBUTEID, SET<VALUES>>>
-        //
-        protected Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> attributeMap;
-        protected Map<Identifier, Map<EffectType, List<Obligation>>> obligationMap;
-        protected Map<Identifier, Map<EffectType, List<Advice>>> adviceMap;
-        protected Map<PolicyType, List<VariableDefinitionType>> variableDefinitionMap;
-        protected List<VariableReferenceType> variableReferences;
+    private static Log logger	= LogFactory.getLog(XACMLPolicyAggregator.class);
+    //
+    // This holds all the attributes found within the policy
+    // Map<CATEGORY, MAP<DATATYPE, MAP<ATTRIBUTEID, SET<VALUES>>>
+    //
+    protected Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> attributeMap;
+    protected Map<Identifier, Map<EffectType, List<Obligation>>> obligationMap;
+    protected Map<Identifier, Map<EffectType, List<Advice>>> adviceMap;
+    protected Map<PolicyType, List<VariableDefinitionType>> variableDefinitionMap;
+    protected List<VariableReferenceType> variableReferences;
 
 //	@SuppressWarnings("unchecked")
-        @Override
-        public CallbackResult onAttribute(Object parent, Object container, Attribute attribute) {
-                //
-                // Do we have an object yet?
-                //
-                if (this.attributeMap == null) {
-                        this.attributeMap = new HashMap<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>>();
+    @Override
+    public CallbackResult onAttribute(Object parent, Object container, Attribute attribute) {
+        //
+        // Do we have an object yet?
+        //
+        if (this.attributeMap == null) {
+            this.attributeMap = new HashMap<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>>();
+        }
+        //
+        // Does the category exist?
+        //
+        if (this.attributeMap.containsKey(attribute.getCategory()) == false) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("New category: " + attribute.getCategory());
+            }
+            //
+            // No, create it
+            //
+            this.attributeMap.put(attribute.getCategory(), new HashMap<Identifier, Map<Identifier, Set<AttributeValue<?>>>>());
+        }
+        Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>> map = this.attributeMap.get(attribute.getCategory());
+        //
+        // Iterate the attributes values
+        //
+        for (AttributeValue<?> value : attribute.getValues()) {
+            //
+            // Does the datatype exist?
+            //
+            if (map.containsKey(value.getDataTypeId()) == false) {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("New Datatype: " + value.getDataTypeId());
                 }
                 //
-                // Does the category exist?
+                // Create a new datatype hash
                 //
-                if (this.attributeMap.containsKey(attribute.getCategory()) == false) {
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("New category: " + attribute.getCategory());
-                        }
-                        //
-                        // No, create it
-                        //
-                        this.attributeMap.put(attribute.getCategory(), new HashMap<Identifier, Map<Identifier, Set<AttributeValue<?>>>>());
+                map.put(value.getDataTypeId(), new HashMap<Identifier, Set<AttributeValue<?>>>());
+            }
+            //
+            // Does the attribute exist?
+            //
+            if (map.get(value.getDataTypeId()).containsKey(attribute.getAttributeId()) == false) {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("New attribute: " + attribute.getAttributeId());
                 }
-                Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>> map = this.attributeMap.get(attribute.getCategory());
                 //
-                // Iterate the attributes values
+                // Not yet
                 //
-                for (AttributeValue<?> value : attribute.getValues()) {
-                        //
-                        // Does the datatype exist?
-                        //
-                        if (map.containsKey(value.getDataTypeId()) == false) {
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("New Datatype: " + value.getDataTypeId());
-                                }
-                                //
-                                // Create a new datatype hash
-                                //
-                                map.put(value.getDataTypeId(), new HashMap<Identifier, Set<AttributeValue<?>>>());
-                        }
-                        //
-                        // Does the attribute exist?
-                        //
-                        if (map.get(value.getDataTypeId()).containsKey(attribute.getAttributeId()) == false) {
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("New attribute: " + attribute.getAttributeId());
-                                }
-                                //
-                                // Not yet
-                                //
-                                map.get(value.getDataTypeId()).put(attribute.getAttributeId(), new HashSet<AttributeValue<?>>());
-                        }
-                        //
-                        // Are there any actual values in it?
-                        //
-                        Object val = value.getValue();
-                        if (val == null || (val instanceof Collection && ((Collection<?>)val).isEmpty())) {
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("No actual attribute values: " + attribute.getAttributeId() + " " + value.getDataTypeId());
-                                }
-                                continue;
-                        }
-                        //
-                        // Put the value in if it is not contained the set yet.
-                        //
-                        if (logger.isDebugEnabled()) {
-                                logger.debug("Adding attribute value: " + value);
-                        }
-                        map.get(value.getDataTypeId()).get(attribute.getAttributeId()).add(value);
+                map.get(value.getDataTypeId()).put(attribute.getAttributeId(), new HashSet<AttributeValue<?>>());
+            }
+            //
+            // Are there any actual values in it?
+            //
+            Object val = value.getValue();
+            if (val == null || (val instanceof Collection && ((Collection<?>)val).isEmpty())) {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("No actual attribute values: " + attribute.getAttributeId() + " " + value.getDataTypeId());
                 }
-                return super.onAttribute(parent, container, attribute);
+                continue;
+            }
+            //
+            // Put the value in if it is not contained the set yet.
+            //
+            if (logger.isDebugEnabled()) {
+                logger.debug("Adding attribute value: " + value);
+            }
+            map.get(value.getDataTypeId()).get(attribute.getAttributeId()).add(value);
+        }
+        return super.onAttribute(parent, container, attribute);
+    }
+
+    @Override
+    public CallbackResult onCondition(RuleType rule, ConditionType condition) {
+        if (condition.getExpression() != null) {
+            this.evaluteExpression(condition.getExpression().getValue(), rule, condition);
+        }
+        return super.onCondition(rule, condition);
+    }
+
+    @Override
+    public CallbackResult onObligation(Object parent, ObligationExpressionType expression, Obligation obligation) {
+        //
+        // Has the map been created yet?
+        //
+        if (this.obligationMap == null) {
+            //
+            // No create it
+            //
+            this.obligationMap = new HashMap<Identifier, Map<EffectType, List<Obligation>>>();
+        }
+        //
+        // Does this obligation already exist?
+        //
+        if (this.obligationMap.containsKey(obligation.getId()) == false) {
+            //
+            // Nope, add it in
+            //
+            this.obligationMap.put(obligation.getId(), new HashMap<EffectType, List<Obligation>>());
+        }
+        //
+        // Does the list exist?
+        //
+        if (this.obligationMap.get(obligation.getId()).get(expression.getFulfillOn()) == null) {
+            //
+            // Nope, add the new fullfill on list
+            //
+            this.obligationMap.get(obligation.getId()).put(expression.getFulfillOn(), new ArrayList<Obligation>());
+        }
+        //
+        // Does the obligation exist?
+        //
+        if (this.obligationMap.get(obligation.getId()).get(expression.getFulfillOn()).contains(obligation) == false) {
+            //
+            // Nope, add it in
+            //
+            this.obligationMap.get(obligation.getId()).get(expression.getFulfillOn()).add(obligation);
         }
 
-        @Override
-        public CallbackResult onCondition(RuleType rule, ConditionType condition) {
-                if (condition.getExpression() != null) {
-                        this.evaluteExpression(condition.getExpression().getValue(), rule, condition);
-                }
-                return super.onCondition(rule, condition);
+        return super.onObligation(parent, expression, obligation);
+    }
+
+    @Override
+    public CallbackResult onAdvice(Object parent, AdviceExpressionType expression, Advice advice) {
+        if (this.adviceMap == null) {
+            this.adviceMap = new HashMap<Identifier, Map<EffectType, List<Advice>>>();
+        }
+        if (this.adviceMap.containsKey(advice.getId()) == false) {
+            this.adviceMap.put(advice.getId(), new HashMap<EffectType, List<Advice>>());
+        }
+        if (this.adviceMap.get(advice.getId()).get(expression.getAppliesTo()) == null) {
+            this.adviceMap.get(advice.getId()).put(expression.getAppliesTo(), new ArrayList<Advice>());
+        }
+        if (this.adviceMap.get(advice.getId()).get(expression.getAppliesTo()).contains(advice) == false) {
+            this.adviceMap.get(advice.getId()).get(expression.getAppliesTo()).add(advice);
         }
 
-        @Override
-        public CallbackResult onObligation(Object parent, ObligationExpressionType expression, Obligation obligation) {
-                //
-                // Has the map been created yet?
-                //
-                if (this.obligationMap == null) {
-                        //
-                        // No create it
-                        //
-                        this.obligationMap = new HashMap<Identifier, Map<EffectType, List<Obligation>>>();  
-                }
-                //
-                // Does this obligation already exist?
-                //
-                if (this.obligationMap.containsKey(obligation.getId()) == false) {
-                        //
-                        // Nope, add it in
-                        //
-                        this.obligationMap.put(obligation.getId(), new HashMap<EffectType, List<Obligation>>());
-                }
-                //
-                // Does the list exist?
-                //
-                if (this.obligationMap.get(obligation.getId()).get(expression.getFulfillOn()) == null) {
-                        //
-                        // Nope, add the new fullfill on list
-                        //
-                        this.obligationMap.get(obligation.getId()).put(expression.getFulfillOn(), new ArrayList<Obligation>());
-                }
-                //
-                // Does the obligation exist?
-                //
-                if (this.obligationMap.get(obligation.getId()).get(expression.getFulfillOn()).contains(obligation) == false) {
-                        //
-                        // Nope, add it in
-                        //
-                        this.obligationMap.get(obligation.getId()).get(expression.getFulfillOn()).add(obligation);			
-                }
-                
-                return super.onObligation(parent, expression, obligation);
+        return super.onAdvice(parent, expression, advice);
+    }
+
+    @Override
+    public CallbackResult onVariable(PolicyType policy, VariableDefinitionType variable) {
+        if (this.variableDefinitionMap == null) {
+            this.variableDefinitionMap = new HashMap<PolicyType, List<VariableDefinitionType>>();
         }
 
-        @Override
-        public CallbackResult onAdvice(Object parent, AdviceExpressionType expression, Advice advice) {
-                if (this.adviceMap == null) {
-                        this.adviceMap = new HashMap<Identifier, Map<EffectType, List<Advice>>>();
-                }
-                if (this.adviceMap.containsKey(advice.getId()) == false) {
-                        this.adviceMap.put(advice.getId(), new HashMap<EffectType, List<Advice>>());
-                }
-                if (this.adviceMap.get(advice.getId()).get(expression.getAppliesTo()) == null) {
-                        this.adviceMap.get(advice.getId()).put(expression.getAppliesTo(), new ArrayList<Advice>());
-                }
-                if (this.adviceMap.get(advice.getId()).get(expression.getAppliesTo()).contains(advice) == false) {
-                        this.adviceMap.get(advice.getId()).get(expression.getAppliesTo()).add(advice);
-                }
+        if (this.variableDefinitionMap.containsKey(policy) == false) {
+            this.variableDefinitionMap.put(policy, new ArrayList<VariableDefinitionType>());
+        }
+        this.variableDefinitionMap.get(policy).add(variable);
 
-                return super.onAdvice(parent, expression, advice);
+        if (variable.getExpression() != null) {
+            this.evaluteExpression(variable.getExpression().getValue(), policy, variable);
+        }
+        return super.onVariable(policy, variable);
+    }
+
+    protected void evaluteExpression(Object obj, Object parent, Object container) {
+        if (obj instanceof AttributeDesignatorType) {
+            AttributeDesignatorType designator = (AttributeDesignatorType) obj;
+            StdAttribute attribute = new StdAttribute(new IdentifierImpl(designator.getCategory()),
+                    new IdentifierImpl(designator.getAttributeId()),
+                    new StdAttributeValue<List<?>>(new IdentifierImpl(designator.getDataType()), Collections.emptyList()),
+                    designator.getIssuer(),
+                    false);
+            this.onAttribute(parent, container, attribute);
+        } else if (obj instanceof AttributeValueType) {
+            /*
+             * Highly unlikely that we would get this at the top level of a condition or variable
+             *
+            AttributeValueType value = (AttributeValueType) obj;
+            System.out.println("AttributeValueType datatype=" + value.getDataType());
+            System.out.println("AttributeValueType content=" + value.getContent());
+            */
+        } else if (obj instanceof VariableReferenceType) {
+            if (this.variableReferences == null) {
+                this.variableReferences = new ArrayList<VariableReferenceType>();
+            }
+            this.variableReferences.add((VariableReferenceType) obj);
+        } else if (obj instanceof ApplyType) {
+            ApplyType apply = (ApplyType) obj;
+            for (JAXBElement<?> element : apply.getExpression()) {
+                if (element.getValue() != null) {
+                    this.evaluteExpression(element.getValue(), parent, container);
+                }
+            }
+        } else if (obj instanceof FunctionType) {
+            /*
+             * Highly unlikely that we would get this at the top level of a condition or variable
+             *
+            FunctionType function = (FunctionType) obj;
+            System.out.println("FunctionType=" + function.getFunctionId());
+            */
+        } else if (obj instanceof AttributeSelectorType) {
+            AttributeSelectorType selector = (AttributeSelectorType)obj;
+            StdAttribute attribute = new StdAttribute(new IdentifierImpl(selector.getCategory()),
+                    new IdentifierImpl(selector.getContextSelectorId()),
+                    new StdAttributeValue<List<?>>(new IdentifierImpl(selector.getDataType()), Collections.emptyList()),
+                    null,
+                    false);
+            this.onAttribute(parent, container, attribute);
         }
 
-        @Override
-        public CallbackResult onVariable(PolicyType policy, VariableDefinitionType variable) {
-                if (this.variableDefinitionMap == null) {
-                        this.variableDefinitionMap = new HashMap<PolicyType, List<VariableDefinitionType>>();
-                }
-                
-                if (this.variableDefinitionMap.containsKey(policy) == false) {
-                        this.variableDefinitionMap.put(policy, new ArrayList<VariableDefinitionType>());
-                }
-                this.variableDefinitionMap.get(policy).add(variable);
-                
-                if (variable.getExpression() != null) {
-                        this.evaluteExpression(variable.getExpression().getValue(), policy, variable);
-                }
-                return super.onVariable(policy, variable);
-        }
-        
-        protected void evaluteExpression(Object obj, Object parent, Object container) {
-                if (obj instanceof AttributeDesignatorType) {
-                        AttributeDesignatorType designator = (AttributeDesignatorType) obj;
-                        StdAttribute attribute = new StdAttribute(new IdentifierImpl(designator.getCategory()),
-                                        new IdentifierImpl(designator.getAttributeId()),
-                                        new StdAttributeValue<List<?>>(new IdentifierImpl(designator.getDataType()), Collections.emptyList()),
-                                        designator.getIssuer(),
-                                        false);
-                        this.onAttribute(parent, container, attribute);
-                } else if (obj instanceof AttributeValueType) {
-                        /*
-                         * Highly unlikely that we would get this at the top level of a condition or variable
-                         * 
-                        AttributeValueType value = (AttributeValueType) obj;
-                        System.out.println("AttributeValueType datatype=" + value.getDataType());
-                        System.out.println("AttributeValueType content=" + value.getContent());
-                        */
-                } else if (obj instanceof VariableReferenceType) {
-                        if (this.variableReferences == null) {
-                                this.variableReferences = new ArrayList<VariableReferenceType>();
-                        }
-                        this.variableReferences.add((VariableReferenceType) obj);
-                } else if (obj instanceof ApplyType) {
-                        ApplyType apply = (ApplyType) obj;
-                        for (JAXBElement<?> element : apply.getExpression()) {
-                                if (element.getValue() != null) {
-                                        this.evaluteExpression(element.getValue(), parent, container);
-                                }
-                        }
-                } else if (obj instanceof FunctionType) {
-                        /*
-                         * Highly unlikely that we would get this at the top level of a condition or variable
-                         * 
-                        FunctionType function = (FunctionType) obj;
-                        System.out.println("FunctionType=" + function.getFunctionId());
-                        */
-                } else if (obj instanceof AttributeSelectorType) {
-                        AttributeSelectorType selector = (AttributeSelectorType)obj;
-                        StdAttribute attribute = new StdAttribute(new IdentifierImpl(selector.getCategory()),
-                                        new IdentifierImpl(selector.getContextSelectorId()),
-                                        new StdAttributeValue<List<?>>(new IdentifierImpl(selector.getDataType()), Collections.emptyList()),
-                                        null,
-                                        false);
-                        this.onAttribute(parent, container, attribute);
-                }
-                
-        }
+    }
 
-        /**
-         * @return - The attribute map. This is an unmodified map of the attributes found during scanning a policy.
-         */
-        public Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> getAttributeMap() {
-                if (this.attributeMap == null) {
-                        this.attributeMap = new HashMap<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>>();
-                }
-                return Collections.unmodifiableMap(this.attributeMap);
+    /**
+     * @return - The attribute map. This is an unmodified map of the attributes found during scanning a policy.
+     */
+    public Map<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>> getAttributeMap() {
+        if (this.attributeMap == null) {
+            this.attributeMap = new HashMap<Identifier, Map<Identifier, Map<Identifier, Set<AttributeValue<?>>>>>();
         }
+        return Collections.unmodifiableMap(this.attributeMap);
+    }
 
-        /**
-         * @return - The obligation map. This is an unmodified map of the obligations found during scanning a policy.
-         */
-        public Map<Identifier, Map<EffectType, List<Obligation>>> getObligationMap() {
-                if (this.obligationMap == null) {
-                        this.obligationMap = new HashMap<Identifier, Map<EffectType, List<Obligation>>>();
-                }
-                return Collections.unmodifiableMap(this.obligationMap);
+    /**
+     * @return - The obligation map. This is an unmodified map of the obligations found during scanning a policy.
+     */
+    public Map<Identifier, Map<EffectType, List<Obligation>>> getObligationMap() {
+        if (this.obligationMap == null) {
+            this.obligationMap = new HashMap<Identifier, Map<EffectType, List<Obligation>>>();
         }
+        return Collections.unmodifiableMap(this.obligationMap);
+    }
 
-        /**
-         * @return - The advice map. This is an unmodified map of the advice found during scanning a policy.
-         */
-        public Map<Identifier, Map<EffectType, List<Advice>>> getAdviceMap() {
-                if (this.adviceMap == null) {
-                        this.adviceMap = new HashMap<Identifier, Map<EffectType, List<Advice>>>();
-                }
-                return Collections.unmodifiableMap(this.adviceMap);
+    /**
+     * @return - The advice map. This is an unmodified map of the advice found during scanning a policy.
+     */
+    public Map<Identifier, Map<EffectType, List<Advice>>> getAdviceMap() {
+        if (this.adviceMap == null) {
+            this.adviceMap = new HashMap<Identifier, Map<EffectType, List<Advice>>>();
         }
+        return Collections.unmodifiableMap(this.adviceMap);
+    }
 
-        /**
-         * @return - The variable definition map. This is an unmodified map of the variable definitions found during scanning a policy.
-         */
-        public Map<PolicyType, List<VariableDefinitionType>> getVariableDefinitionMap() {
-                return Collections.unmodifiableMap(this.variableDefinitionMap);
-        }
-        
-        /**
-         * @return - The variable references list. This is an unmodified list of the variable references found during scanning a policy.
-         */
-        public List<VariableReferenceType> getVariableReferences() {
-                return Collections.unmodifiableList(this.variableReferences);
-        }
+    /**
+     * @return - The variable definition map. This is an unmodified map of the variable definitions found during scanning a policy.
+     */
+    public Map<PolicyType, List<VariableDefinitionType>> getVariableDefinitionMap() {
+        return Collections.unmodifiableMap(this.variableDefinitionMap);
+    }
+
+    /**
+     * @return - The variable references list. This is an unmodified list of the variable references found during scanning a policy.
+     */
+    public List<VariableReferenceType> getVariableReferences() {
+        return Collections.unmodifiableList(this.variableReferences);
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyScanner.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyScanner.java
index 2532a01..7dd6a89 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyScanner.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyScanner.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -82,841 +82,841 @@
 
 /**
  * class XACMLPolicyScanner
- * 
+ *
  * This class traverses the hierarchy of a XACML 3.0 policy. You can optionally pass a Callback class
- * and override any desired methods to retrieve information from a policy. 
- * 
+ * and override any desired methods to retrieve information from a policy.
+ *
  * @author pameladragosh
  *
  */
 public class XACMLPolicyScanner {
-        
+
+    /**
+     * Very simple enumeration used in the callback class. Return CONTINUE to instruct the XACMLPolicyScanner
+     * to continue scanning the policy. Otherwise, call STOP to terminate scanning the policy.
+     *
+     * @author pameladragosh
+     *
+     */
+    public enum CallbackResult {
+        //
+        // Continue scanning the policy
+        //
+        CONTINUE,
+        //
+        // Terminate scanning
+        //
+        STOP;
+    }
+
+    /**
+     *  This is a simple callback interface that can be implemented and passed to the XACMLPolicyScanner.
+     * When the XACMLPolicyScanner encounters a relevant element in the policy, it calls the appropriate
+     * method.
+     *
+     * @author pameladragosh
+     *
+     */
+    public interface Callback {
         /**
-         * Very simple enumeration used in the callback class. Return CONTINUE to instruct the XACMLPolicyScanner
-         * to continue scanning the policy. Otherwise, call STOP to terminate scanning the policy.
-         * 
-         * @author pameladragosh
+         * Called when the scanning begins with the root element.
          *
+         * @param root - The root PolicySet/Policy object.
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
          */
-        public enum CallbackResult {
-                //
-                // Continue scanning the policy
-                //
-                CONTINUE,
-                //
-                // Terminate scanning
-                //
-                STOP;
-        }
-        
+        public CallbackResult onBeginScan(Object root);
+
         /**
-         *  This is a simple callback interface that can be implemented and passed to the XACMLPolicyScanner.
-         * When the XACMLPolicyScanner encounters a relevant element in the policy, it calls the appropriate
-         * method.
-         * 
-         * @author pameladragosh
+         * Called when the scanning finishes with the root element.
          *
+         * @param root - The root PolicySet/Policy object.
          */
-        public interface Callback {
-                /**
-                 * Called when the scanning begins with the root element.
-                 * 
-                 * @param root - The root PolicySet/Policy object.
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onBeginScan(Object root);
+        public void onFinishScan(Object root);
 
-                /**
-                 * Called when the scanning finishes with the root element.
-                 * 
-                 * @param root - The root PolicySet/Policy object.
-                 */
-                public void onFinishScan(Object root);
-                
-                /**
-                 * Called when the scanning of the policy first encounters a PolicySet
-                 * 
-                 * @param parent - The parent PolicySet of the policySet. Can be null if this is the root PolicySet.
-                 * @param policySet - The PolicySet object.
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onPreVisitPolicySet(PolicySetType parent, PolicySetType policySet);
-                
-                /**
-                 * 
-                 * Called when the scanning of the PolicySet has finished.
-                 * 
-                 * @param parent - The parent PolicySet of the policySet. Can be null if this is the root PolicySet.
-                 * @param policySet - The PolicySet object.
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onPostVisitPolicySet(PolicySetType parent, PolicySetType policySet);
-                
-                /**
-                 * 
-                 * Called when the scanning of the policy first encounters a Policy
-                 * 
-                 * @param parent - The parent PolicySet of the policy. This can be null if this policy is the root.
-                 * @param policy - The policy.
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onPreVisitPolicy(PolicySetType parent, PolicyType policy);
-                
-                /**
-                 * 
-                 * Called when the scanning of the Policy has finished.
-                 * 
-                 * @param parent - The parent PolicySet of the policy. This can be null if this policy is the root.
-                 * @param policy - The policy.
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onPostVisitPolicy(PolicySetType parent, PolicyType policy);
-                
-                /**
-                 * 
-                 * Called when the scanning of the policy first encounters a Rule
-                 * 
-                 * @param parent - The parent policy of the rule
-                 * @param rule - The rule 
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onPreVisitRule(PolicyType parent, RuleType rule);
-                
-                /**
-                 * 
-                 * Called when the scanning of the Rule has finished.
-                 * 
-                 * @param parent - The parent policy of the rule
-                 * @param rule - The rule 
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onPostVisitRule(PolicyType parent, RuleType rule);
-                
-                /**
-                 * 
-                 * When an attribute has been encountered.
-                 * 
-                 * @param parent - The parent PolicySet/Policy/Rule for this attribute.
-                 * @param container - What part of the PolicySet/Policy/Rule this attribute is located. eg. Target, Condition
-                 * @param attribute - The attribute
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onAttribute(Object parent, Object container, Attribute attribute);
-                
-                /**
-                 * When an obligation has been encountered.
-                 * 
-                 * @param parent - The parent PolicySet/Policy/Rule for the obligation.
-                 * @param obligation - The obligation.
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onObligation(Object parent, ObligationExpressionType expression, Obligation obligation);
-                
-                /**
-                 * 
-                 * When an advice has been encountered.
-                 * 
-                 * @param parent - The parent PolicySet/Policy/Rule for the obligation.
-                 * @param advice -  The advice.
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onAdvice(Object parent, AdviceExpressionType expression, Advice advice);
-                
-                /**
-                 * 
-                 * When a variable definition has been encountered.
-                 * 
-                 * @param policy -  The Policy the variable is located in.
-                 * @param variable - The variable.
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onVariable(PolicyType policy, VariableDefinitionType variable);
-                
-                /**
-                 * 
-                 * When a condition has been encountered.
-                 * 
-                 * @param rule -  The Rule containing the condition.
-                 * @param condition - The condition
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onCondition(RuleType rule, ConditionType condition);
-                
-                /**
-                 * 
-                 * When a reference to another PolicySet is encountered.
-                 * 
-                 * @param reference - The Policy Set Reference ID
-                 * @param parent - The parent PolicySet that holds the reference
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onPolicySetIdReference(IdReferenceType reference, PolicySetType parent);
-                
-                /**
-                 * 
-                 * When a reference to another PolicySet is encountered.
-                 * 
-                 * @param reference - The Policy Set Reference ID
-                 * @param parent - The parent PolicySet that holds the reference
-                 * @return CallbackResult - CONTINUE or STOP scanning the policy.
-                 */
-                public CallbackResult onPolicyIdReference(IdReferenceType reference, PolicySetType parent);
-        }
-        
         /**
-         * 
-         * This is a simple implementation of the Callback. Extend this if you don't wish
-         * to implement all the callback functions available. Each method simply returns
-         * CallbackResult.CONTINUE.
-         * 
-         * @author pameladragosh
+         * Called when the scanning of the policy first encounters a PolicySet
          *
-         */
-        public static class SimpleCallback implements Callback {
-
-                @Override
-                public CallbackResult onBeginScan(Object root) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public void onFinishScan(Object root) {
-                }
-
-                @Override
-                public CallbackResult onPreVisitPolicySet(PolicySetType parent, PolicySetType policySet) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onPostVisitPolicySet(PolicySetType parent, PolicySetType policySet) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onPreVisitPolicy(PolicySetType parent, PolicyType policy) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onPostVisitPolicy(PolicySetType parent, PolicyType policy) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onPreVisitRule(PolicyType parent, RuleType rule) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onPostVisitRule(PolicyType parent, RuleType rule) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onAttribute(Object parent, Object container,
-                                Attribute attribute) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onObligation(Object parent, ObligationExpressionType expression, Obligation obligation) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onAdvice(Object parent, AdviceExpressionType expression, Advice advice) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onVariable(PolicyType policy, VariableDefinitionType o) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onCondition(RuleType rule, ConditionType condition) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onPolicySetIdReference(IdReferenceType reference, PolicySetType parent) {
-                        return CallbackResult.CONTINUE;
-                }
-
-                @Override
-                public CallbackResult onPolicyIdReference(IdReferenceType reference, PolicySetType parent) {
-                        return CallbackResult.CONTINUE;
-                }
-                
-        }
-        
-        private static final Log logger				= LogFactory.getLog(XACMLPolicyScanner.class);
-        private Object policyObject = null;
-        private Callback callback = null;
-        
-        public XACMLPolicyScanner(Path filename, Callback callback) {
-                try (InputStream is = Files.newInputStream(filename)) {
-                        this.policyObject = XACMLPolicyScanner.readPolicy(is);
-                } catch (IOException e) {
-                        logger.error("Failed to read policy", e);
-                }
-                this.callback = callback;
-        }
-        
-        public XACMLPolicyScanner(PolicySetType policySet, Callback callback) {
-                this.policyObject = policySet;
-                this.callback = callback;
-        }
-        
-        public XACMLPolicyScanner(PolicySetType policySet) {
-                this(policySet, null);
-        }
-        
-        public XACMLPolicyScanner(PolicyType policy, Callback callback) {
-                this.policyObject = policy;
-                this.callback = callback;
-        }
-        
-        public XACMLPolicyScanner(PolicyType policy) {
-                this(policy, null);
-        }
-        
-        /**
-         * Sets the callback interface to be used.
-         * 
-         * @param cb
-         */
-        public void setCallback(Callback cb) {
-                this.callback = cb;
-        }
-        
-        /**
-         * Saves the given callback object then calls the scan() method.
-         * 
-         * @param cb
-         * @return
-         */
-        public Object scan(Callback cb) {
-                this.callback = cb;
-                return this.scan();
-        }
-        
-        /**
-         * 
-         * This begins the scanning of the contained object.
-         * 
-         * @return - The PolicySet/Policy that was scanned.
-         */
-        public Object scan() {
-                if (this.policyObject == null) {
-                        return null;
-                }
-                if (this.callback != null) {
-                        if (this.callback.onBeginScan(this.policyObject) == CallbackResult.STOP) {
-                                return this.policyObject;
-                        }
-                }
-                if (this.policyObject instanceof PolicyType) {
-                        this.scanPolicy(null, (PolicyType) this.policyObject);
-                } else if (this.policyObject instanceof PolicySetType) {
-                        this.scanPolicySet(null, (PolicySetType) this.policyObject);
-                } else {
-                        logger.error("Unknown class type: " + this.policyObject.getClass().getCanonicalName());
-                }
-                if (this.callback != null) {
-                        this.callback.onFinishScan(this.policyObject);
-                }
-                return this.policyObject;
-        }
-        
-        /**
-         * This performs the scan of a PolicySet
-         * 
-         * @param parent - Its parent PolicySet. Can be null if this is the root.
+         * @param parent - The parent PolicySet of the policySet. Can be null if this is the root PolicySet.
          * @param policySet - The PolicySet object.
-         * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
          */
+        public CallbackResult onPreVisitPolicySet(PolicySetType parent, PolicySetType policySet);
+
         /**
-         * @param parent
-         * @param policySet
-         * @return
+         *
+         * Called when the scanning of the PolicySet has finished.
+         *
+         * @param parent - The parent PolicySet of the policySet. Can be null if this is the root PolicySet.
+         * @param policySet - The PolicySet object.
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
          */
-        protected CallbackResult scanPolicySet(PolicySetType parent, PolicySetType policySet) {
-                if (logger.isTraceEnabled()) {
-                        logger.trace("scanning policy set: " + policySet.getPolicySetId() + " " + policySet.getDescription());
-                }
-                if (this.callback != null) {
-                        if (this.callback.onPreVisitPolicySet(parent, policySet) == CallbackResult.STOP) {
-                                return CallbackResult.STOP;
-                        }
-                }
-                //
-                // Scan its info
-                //
-                if (this.scanTarget(policySet, policySet.getTarget()) == CallbackResult.STOP) {
-                        return CallbackResult.STOP;
-                }
-                if (this.scanObligations(policySet, policySet.getObligationExpressions()) == CallbackResult.STOP) {
-                        return CallbackResult.STOP;
-                }
-                if (this.scanAdvice(policySet, policySet.getAdviceExpressions()) == CallbackResult.STOP) {
-                        return CallbackResult.STOP;
-                }
-                //
-                // Iterate the policy sets and/or policies
-                //
-                List<JAXBElement<?>> list = policySet.getPolicySetOrPolicyOrPolicySetIdReference();
-                for (JAXBElement<?> element: list) {
-                        if (element.getName().getLocalPart().equals("PolicySet")) {
-                                if (this.scanPolicySet(policySet, (PolicySetType)element.getValue()) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                        } else if (element.getName().getLocalPart().equals("Policy")) {
-                                if (this.scanPolicy(policySet, (PolicyType)element.getValue()) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                        } else if (element.getValue() instanceof IdReferenceType) {
-                                if (element.getName().getLocalPart().equals("PolicySetIdReference")) {
-                                        
-                                } else if (element.getName().getLocalPart().equals("PolicyIdReference")) {
-                                        
-                                }
-                        } else {
-                                logger.warn("generating policy sets found unsupported element: " + element.getName().getNamespaceURI());
-                        }
-                }
-                if (this.callback != null) {
-                        if (this.callback.onPostVisitPolicySet(parent, policySet) == CallbackResult.STOP) {
-                                return CallbackResult.STOP;
-                        }
-                }
-                return CallbackResult.CONTINUE;
-        }
-        
+        public CallbackResult onPostVisitPolicySet(PolicySetType parent, PolicySetType policySet);
+
         /**
-         * 
-         * This performs scanning of the Policy object.
-         * 
-         * @param parent - The parent PolicySet of the policy. This can be null if this is a root Policy.
-         * @param policy - The policy being scanned.
-         * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+         *
+         * Called when the scanning of the policy first encounters a Policy
+         *
+         * @param parent - The parent PolicySet of the policy. This can be null if this policy is the root.
+         * @param policy - The policy.
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
          */
-        protected CallbackResult scanPolicy(PolicySetType parent, PolicyType policy) {
-                if (logger.isTraceEnabled()) {
-                        logger.trace("scanning policy: " + policy.getPolicyId() + " " + policy.getDescription());
-                }
-                if (this.callback != null) {
-                        if (this.callback.onPreVisitPolicy(parent, policy) == CallbackResult.STOP) {
-                                return CallbackResult.STOP;
-                        }
-                }
-                //
-                // Scan its info
-                //
-                if (this.scanTarget(policy, policy.getTarget()) == CallbackResult.STOP) {
-                        return CallbackResult.STOP;
-                }
-                if (this.scanVariables(policy, policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition()) == CallbackResult.STOP) {
-                        return CallbackResult.STOP;
-                }
-                if (this.scanObligations(policy, policy.getObligationExpressions()) == CallbackResult.STOP) {
-                        return CallbackResult.STOP;
-                }
-                if (this.scanAdvice(policy, policy.getAdviceExpressions()) == CallbackResult.STOP) {
-                        return CallbackResult.STOP;
-                }
-                //
-                // Iterate the rules
-                //
-                List<Object> list = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition();
-                for (Object o: list) {
-                        if (o instanceof RuleType) {
-                                RuleType rule = (RuleType) o;
-                                if (logger.isTraceEnabled()) {
-                                        logger.trace("scanning rule: " + rule.getRuleId() + " " + rule.getDescription());
-                                }
-                                if (this.callback != null) {
-                                        if (this.callback.onPreVisitRule(policy, rule) == CallbackResult.STOP) {
-                                                return CallbackResult.STOP;
-                                        }
-                                }
-                                if (this.scanTarget(rule, rule.getTarget()) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                                if (this.scanConditions(rule, rule.getCondition()) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                                if (this.scanObligations(rule, rule.getObligationExpressions()) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                                if (this.scanAdvice(rule, rule.getAdviceExpressions()) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                                if (this.callback != null) {
-                                        if (this.callback.onPostVisitRule(policy, rule) == CallbackResult.STOP) {
-                                                return CallbackResult.STOP;
-                                        }
-                                }
-                        } else if (o instanceof VariableDefinitionType) {
-                                if (this.callback != null) {
-                                        if (this.callback.onVariable(policy, (VariableDefinitionType) o) == CallbackResult.STOP) {
-                                                return CallbackResult.STOP;
-                                        }
-                                }
-                        } else {
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("scanning policy rules found unsupported object:" + o.toString());
-                                }
-                        }
-                }
-                if (this.callback != null) {
-                        if (this.callback.onPostVisitPolicy(parent, policy) == CallbackResult.STOP) {
-                                return CallbackResult.STOP;
-                        }
-                }
-                return CallbackResult.CONTINUE;
-        }
-        
+        public CallbackResult onPreVisitPolicy(PolicySetType parent, PolicyType policy);
+
         /**
-         * Scans the given target for attributes. Its sole purpose is to return attributes found.
-         * 
-         * @param parent - The parent PolicySet/Policy/Rule for the target.
-         * @param target - The target.
-         * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+         *
+         * Called when the scanning of the Policy has finished.
+         *
+         * @param parent - The parent PolicySet of the policy. This can be null if this policy is the root.
+         * @param policy - The policy.
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
          */
-        protected CallbackResult scanTarget(Object parent, TargetType target) {
-                if (target == null) {
-                        return CallbackResult.CONTINUE;
-                }
-                List<AnyOfType> anyOfList = target.getAnyOf();
-                if (anyOfList != null) {
-                        Iterator<AnyOfType> iterAnyOf = anyOfList.iterator();
-                        while (iterAnyOf.hasNext()) {
-                                AnyOfType anyOf = iterAnyOf.next();
-                                List<AllOfType> allOfList = anyOf.getAllOf();
-                                if (allOfList != null) {
-                                        Iterator<AllOfType> iterAllOf = allOfList.iterator();
-                                        while (iterAllOf.hasNext()) {
-                                                AllOfType allOf = iterAllOf.next();
-                                                List<MatchType> matchList = allOf.getMatch();
-                                                if (matchList != null) {
-                                                        Iterator<MatchType> iterMatch = matchList.iterator();
-                                                        while (iterMatch.hasNext()) {
-                                                                MatchType match = iterMatch.next();
-                                                                //
-                                                                // Finally down to the actual attribute
-                                                                //
-                                                                StdAttribute attribute = null;
-                                                                AttributeValueType value = match.getAttributeValue();
-                                                                if (match.getAttributeDesignator() != null && value != null) {
-                                                                        AttributeDesignatorType designator = match.getAttributeDesignator();
-                                                                        //
-                                                                        // The content may be tricky
-                                                                        //
-                                                                        attribute = new StdAttribute(new IdentifierImpl(designator.getCategory()),
-                                                                                                                                                        new IdentifierImpl(designator.getAttributeId()),
-                                                                                                                                                        new StdAttributeValue<List<?>>(new IdentifierImpl(value.getDataType()), value.getContent()),
-                                                                                                                                                        designator.getIssuer(),
-                                                                                                                                                        false);
-                                                                } else if (match.getAttributeSelector() != null && value != null) {
-                                                                        AttributeSelectorType selector = match.getAttributeSelector();
-                                                                        attribute = new StdAttribute(new IdentifierImpl(selector.getCategory()),
-                                                                                                                                                        new IdentifierImpl(selector.getContextSelectorId()),
-                                                                                                                                                        new StdAttributeValue<List<?>>(new IdentifierImpl(value.getDataType()), value.getContent()),
-                                                                                                                                                        null,
-                                                                                                                                                        false);
-                                                                } else {
-                                                                        logger.warn("NULL designator/selector or value for match.");
-                                                                }
-                                                                if (attribute != null && this.callback != null) {
-                                                                        if (this.callback.onAttribute(parent, target, attribute) == CallbackResult.STOP) {
-                                                                                return CallbackResult.STOP;
-                                                                        }
-                                                                }
-                                                        }
-                                                }
-                                        }
-                                }
-                        }
-                }
-                return CallbackResult.CONTINUE;
-        }
-        
+        public CallbackResult onPostVisitPolicy(PolicySetType parent, PolicyType policy);
+
         /**
-         * Scan the list of obligations.
-         * 
+         *
+         * Called when the scanning of the policy first encounters a Rule
+         *
+         * @param parent - The parent policy of the rule
+         * @param rule - The rule
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
+         */
+        public CallbackResult onPreVisitRule(PolicyType parent, RuleType rule);
+
+        /**
+         *
+         * Called when the scanning of the Rule has finished.
+         *
+         * @param parent - The parent policy of the rule
+         * @param rule - The rule
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
+         */
+        public CallbackResult onPostVisitRule(PolicyType parent, RuleType rule);
+
+        /**
+         *
+         * When an attribute has been encountered.
+         *
+         * @param parent - The parent PolicySet/Policy/Rule for this attribute.
+         * @param container - What part of the PolicySet/Policy/Rule this attribute is located. eg. Target, Condition
+         * @param attribute - The attribute
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
+         */
+        public CallbackResult onAttribute(Object parent, Object container, Attribute attribute);
+
+        /**
+         * When an obligation has been encountered.
+         *
          * @param parent - The parent PolicySet/Policy/Rule for the obligation.
-         * @param obligationExpressionsType - All the obligation expressions.
-         * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+         * @param obligation - The obligation.
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
          */
-        protected CallbackResult scanObligations(Object parent, ObligationExpressionsType obligationExpressionsType) {
-                if (obligationExpressionsType == null) {
-                        return CallbackResult.CONTINUE;
-                }
-                List<ObligationExpressionType> expressions = obligationExpressionsType.getObligationExpression();
-                if (expressions == null || expressions.size() == 0) {
-                        return CallbackResult.CONTINUE;
-                }
-                for (ObligationExpressionType expression : expressions) {
-                        StdMutableObligation ob = new StdMutableObligation(new IdentifierImpl(expression.getObligationId()));
-                        List<AttributeAssignmentExpressionType> assignments = expression.getAttributeAssignmentExpression();
-                        if (assignments != null) {
-                                for (AttributeAssignmentExpressionType assignment : assignments) {
-                                        // category is optional and may be null
-                                        IdentifierImpl categoryId = null;
-                                        if (assignment.getCategory() != null) {
-                                                categoryId = new IdentifierImpl(assignment.getCategory());
-                                        }
-                                        AttributeAssignment attribute = new StdAttributeAssignment(
-                                                                                                categoryId,
-                                                                                                new IdentifierImpl(assignment.getAttributeId()),
-                                                                                                assignment.getIssuer(),
-                                                                                                new StdAttributeValue<Object>(null, null)
-                                                                                                );
-                                        ob.addAttributeAssignment(attribute);
-                                }
-                        }
-                        if (this.callback != null) {
-                                if (this.callback.onObligation(parent, expression, ob) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                        }
-                }
-                return CallbackResult.CONTINUE;
-        }
+        public CallbackResult onObligation(Object parent, ObligationExpressionType expression, Obligation obligation);
 
         /**
-         * 
-         * Scans the list of advice expressions returning each individually.
-         * 
-         * @param parent - The parent PolicySet/Policy/Rule for the advice.
-         * @param adviceExpressionstype - The list of advice expressions.
-         * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+         *
+         * When an advice has been encountered.
+         *
+         * @param parent - The parent PolicySet/Policy/Rule for the obligation.
+         * @param advice -  The advice.
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
          */
-        protected CallbackResult scanAdvice(Object parent, AdviceExpressionsType adviceExpressionstype) {
-                if (adviceExpressionstype == null) {
-                        return CallbackResult.CONTINUE;
-                }
-                List<AdviceExpressionType> expressions = adviceExpressionstype.getAdviceExpression();
-                if (expressions == null || expressions.size() == 0) {
-                        return CallbackResult.CONTINUE;
-                }
-                for (AdviceExpressionType expression : expressions) {
-                        StdMutableAdvice ob = new StdMutableAdvice(new IdentifierImpl(expression.getAdviceId()));
-                        List<AttributeAssignmentExpressionType> assignments = expression.getAttributeAssignmentExpression();
-                        if (assignments != null) {
-                                for (AttributeAssignmentExpressionType assignment : assignments) {
-                                        IdentifierImpl categoryId = null;
-                                        if (assignment.getCategory() != null) {
-                                                categoryId = new IdentifierImpl(assignment.getCategory());
-                                        }
-                                        AttributeAssignment attribute = new StdAttributeAssignment(
-                                                                                                categoryId,
-                                                                                                new IdentifierImpl(assignment.getAttributeId()),
-                                                                                                assignment.getIssuer(),
-                                                                                                new StdAttributeValue<Object>(null, null)
-                                                                                                );
-                                        ob.addAttributeAssignment(attribute);
-                                }
-                        }
-                        if (this.callback != null) {
-                                if (this.callback.onAdvice(parent, expression, ob) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                        }
-                }
-                return CallbackResult.CONTINUE;
-        }
-        
-        /**
-         * Scans the list of variable definitions.
-         * 
-         * @param policy - Policy object containing the variable definition.
-         * @param list - List of variable definitions.
-         * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
-         */
-        protected CallbackResult scanVariables(PolicyType policy, List<Object> list) {
-                if (list == null) {
-                        return CallbackResult.CONTINUE;
-                }
-                for (Object o : list) {
-                        if (o instanceof VariableDefinitionType) {
-                                if (this.callback != null) {
-                                        if (this.callback.onVariable(policy, (VariableDefinitionType) o) == CallbackResult.STOP) {
-                                                return CallbackResult.STOP;
-                                        }
-                                }
-                        }
-                }
-                
-                return CallbackResult.CONTINUE;
-        }
-        
-        /**
-         * Scans the list of conditions.
-         * 
-         * @param rule
-         * @param condition
-         * @return
-         */
-        protected CallbackResult scanConditions(RuleType rule, ConditionType condition) {
-                if (condition != null) {
-                        if (this.callback != null) {
-                                if (this.callback.onCondition(rule, condition) == CallbackResult.STOP) {
-                                        return CallbackResult.STOP;
-                                }
-                        }
-                }
-                return CallbackResult.CONTINUE;
-        }
-        
-        /**
-         * Reads the XACML XML policy file in and returns the version contained in the root Policy/PolicySet element.
-         * 
-         * @param policy - The policy file.
-         * @return - The version string from the file (uninterpreted)
-         * @throws java.io.IOException
-         */
-        public static String	getVersion(Path policy) throws IOException {
-                Object data = null;
-                try (InputStream is = Files.newInputStream(policy)) {
-                        data = XACMLPolicyScanner.readPolicy(is);
-                } catch (IOException e) {
-                        logger.error("Failed to read policy", e);
-                        throw e;
-                }
-                if (data == null) {
-                        logger.warn("Version is null.");
-                        return null;
-                }
-                return getVersion(data);
-        }
-                
-        /**
-         * Reads the Policy/PolicySet element object and returns its current version.
-         * 
-         * @param data - Either a PolicySet or Policy XACML type object.
-         * @return - The integer version value. -1 if it doesn't exist or was un-parsable.
-         */
-        public static String	getVersion(Object data) {
-                String version = null;
-                try {
-                        if (data instanceof PolicySetType) {
-                                version = ((PolicySetType)data).getVersion();
-                        } else if (data instanceof PolicyType) {
-                                version = ((PolicyType)data).getVersion();
-                        } else {
-                                if (data != null) {
-                                        logger.error("Expecting a PolicySet/Policy/Rule object. Got: " + data.getClass().getCanonicalName());
-                                }
-                                return null;
-                        }
-                        if (version != null && version.length() > 0) {
-                                return version;
-                        } else {
-                                logger.warn("No version set in policy");
-                        }
-                } catch (NumberFormatException e) {
-                        logger.error("Invalid version contained in policy: " + version);
-                        return null;
-                }
-                return null;
-        }
-        
-        /**
-         * Returns the Policy or PolicySet ID.
-         * 
-         * @param data - A XACML 3.0 Policy or PolicySet element object.
-         * @return The policy/policyset's policy ID
-         */
-        public static String getID(Object data) {
-                if (data instanceof PolicySetType) {
-                        return ((PolicySetType)data).getPolicySetId();
-                } else if (data instanceof PolicyType) {
-                        return ((PolicyType)data).getPolicyId();
-                } else {
-                        logger.error("Expecting a PolicySet/Policy/Rule object. Got: " + data.getClass().getCanonicalName());
-                        return null;
-                }
-        }
+        public CallbackResult onAdvice(Object parent, AdviceExpressionType expression, Advice advice);
 
         /**
-         * readPolicy - does the work to read in policy data from a file.
-         * 
-         * @param policy - The path to the policy file.
-         * @return - The policy data object. This *should* be either a PolicySet or a Policy.
+         *
+         * When a variable definition has been encountered.
+         *
+         * @param policy -  The Policy the variable is located in.
+         * @param variable - The variable.
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
          */
-        public static Object readPolicy(InputStream is) {
-                try {
-                        //
-                        // Create a DOM parser
-                        //
-                        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-                    dbf.setNamespaceAware(true);
-                    DocumentBuilder db = dbf.newDocumentBuilder();
-                    //
-                    // Parse the policy file
-                    //
-                    Document doc = db.parse(is);
-                    //
-                    // Because there is no root defined in xacml,
-                    // find the first element
-                    //
-                        NodeList nodes = doc.getChildNodes();
-                        Node node = nodes.item(0);
-                        Element e = null;
-                        if (node.getNodeType() == Node.ELEMENT_NODE) {
-                                e = (Element) node;
+        public CallbackResult onVariable(PolicyType policy, VariableDefinitionType variable);
+
+        /**
+         *
+         * When a condition has been encountered.
+         *
+         * @param rule -  The Rule containing the condition.
+         * @param condition - The condition
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
+         */
+        public CallbackResult onCondition(RuleType rule, ConditionType condition);
+
+        /**
+         *
+         * When a reference to another PolicySet is encountered.
+         *
+         * @param reference - The Policy Set Reference ID
+         * @param parent - The parent PolicySet that holds the reference
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
+         */
+        public CallbackResult onPolicySetIdReference(IdReferenceType reference, PolicySetType parent);
+
+        /**
+         *
+         * When a reference to another PolicySet is encountered.
+         *
+         * @param reference - The Policy Set Reference ID
+         * @param parent - The parent PolicySet that holds the reference
+         * @return CallbackResult - CONTINUE or STOP scanning the policy.
+         */
+        public CallbackResult onPolicyIdReference(IdReferenceType reference, PolicySetType parent);
+    }
+
+    /**
+     *
+     * This is a simple implementation of the Callback. Extend this if you don't wish
+     * to implement all the callback functions available. Each method simply returns
+     * CallbackResult.CONTINUE.
+     *
+     * @author pameladragosh
+     *
+     */
+    public static class SimpleCallback implements Callback {
+
+        @Override
+        public CallbackResult onBeginScan(Object root) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public void onFinishScan(Object root) {
+        }
+
+        @Override
+        public CallbackResult onPreVisitPolicySet(PolicySetType parent, PolicySetType policySet) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onPostVisitPolicySet(PolicySetType parent, PolicySetType policySet) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onPreVisitPolicy(PolicySetType parent, PolicyType policy) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onPostVisitPolicy(PolicySetType parent, PolicyType policy) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onPreVisitRule(PolicyType parent, RuleType rule) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onPostVisitRule(PolicyType parent, RuleType rule) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onAttribute(Object parent, Object container,
+                                          Attribute attribute) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onObligation(Object parent, ObligationExpressionType expression, Obligation obligation) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onAdvice(Object parent, AdviceExpressionType expression, Advice advice) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onVariable(PolicyType policy, VariableDefinitionType o) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onCondition(RuleType rule, ConditionType condition) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onPolicySetIdReference(IdReferenceType reference, PolicySetType parent) {
+            return CallbackResult.CONTINUE;
+        }
+
+        @Override
+        public CallbackResult onPolicyIdReference(IdReferenceType reference, PolicySetType parent) {
+            return CallbackResult.CONTINUE;
+        }
+
+    }
+
+    private static final Log logger				= LogFactory.getLog(XACMLPolicyScanner.class);
+    private Object policyObject = null;
+    private Callback callback = null;
+
+    public XACMLPolicyScanner(Path filename, Callback callback) {
+        try (InputStream is = Files.newInputStream(filename)) {
+            this.policyObject = XACMLPolicyScanner.readPolicy(is);
+        } catch (IOException e) {
+            logger.error("Failed to read policy", e);
+        }
+        this.callback = callback;
+    }
+
+    public XACMLPolicyScanner(PolicySetType policySet, Callback callback) {
+        this.policyObject = policySet;
+        this.callback = callback;
+    }
+
+    public XACMLPolicyScanner(PolicySetType policySet) {
+        this(policySet, null);
+    }
+
+    public XACMLPolicyScanner(PolicyType policy, Callback callback) {
+        this.policyObject = policy;
+        this.callback = callback;
+    }
+
+    public XACMLPolicyScanner(PolicyType policy) {
+        this(policy, null);
+    }
+
+    /**
+     * Sets the callback interface to be used.
+     *
+     * @param cb
+     */
+    public void setCallback(Callback cb) {
+        this.callback = cb;
+    }
+
+    /**
+     * Saves the given callback object then calls the scan() method.
+     *
+     * @param cb
+     * @return
+     */
+    public Object scan(Callback cb) {
+        this.callback = cb;
+        return this.scan();
+    }
+
+    /**
+     *
+     * This begins the scanning of the contained object.
+     *
+     * @return - The PolicySet/Policy that was scanned.
+     */
+    public Object scan() {
+        if (this.policyObject == null) {
+            return null;
+        }
+        if (this.callback != null) {
+            if (this.callback.onBeginScan(this.policyObject) == CallbackResult.STOP) {
+                return this.policyObject;
+            }
+        }
+        if (this.policyObject instanceof PolicyType) {
+            this.scanPolicy(null, (PolicyType) this.policyObject);
+        } else if (this.policyObject instanceof PolicySetType) {
+            this.scanPolicySet(null, (PolicySetType) this.policyObject);
+        } else {
+            logger.error("Unknown class type: " + this.policyObject.getClass().getCanonicalName());
+        }
+        if (this.callback != null) {
+            this.callback.onFinishScan(this.policyObject);
+        }
+        return this.policyObject;
+    }
+
+    /**
+     * This performs the scan of a PolicySet
+     *
+     * @param parent - Its parent PolicySet. Can be null if this is the root.
+     * @param policySet - The PolicySet object.
+     * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+     */
+    /**
+     * @param parent
+     * @param policySet
+     * @return
+     */
+    protected CallbackResult scanPolicySet(PolicySetType parent, PolicySetType policySet) {
+        if (logger.isTraceEnabled()) {
+            logger.trace("scanning policy set: " + policySet.getPolicySetId() + " " + policySet.getDescription());
+        }
+        if (this.callback != null) {
+            if (this.callback.onPreVisitPolicySet(parent, policySet) == CallbackResult.STOP) {
+                return CallbackResult.STOP;
+            }
+        }
+        //
+        // Scan its info
+        //
+        if (this.scanTarget(policySet, policySet.getTarget()) == CallbackResult.STOP) {
+            return CallbackResult.STOP;
+        }
+        if (this.scanObligations(policySet, policySet.getObligationExpressions()) == CallbackResult.STOP) {
+            return CallbackResult.STOP;
+        }
+        if (this.scanAdvice(policySet, policySet.getAdviceExpressions()) == CallbackResult.STOP) {
+            return CallbackResult.STOP;
+        }
+        //
+        // Iterate the policy sets and/or policies
+        //
+        List<JAXBElement<?>> list = policySet.getPolicySetOrPolicyOrPolicySetIdReference();
+        for (JAXBElement<?> element: list) {
+            if (element.getName().getLocalPart().equals("PolicySet")) {
+                if (this.scanPolicySet(policySet, (PolicySetType)element.getValue()) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+            } else if (element.getName().getLocalPart().equals("Policy")) {
+                if (this.scanPolicy(policySet, (PolicyType)element.getValue()) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+            } else if (element.getValue() instanceof IdReferenceType) {
+                if (element.getName().getLocalPart().equals("PolicySetIdReference")) {
+
+                } else if (element.getName().getLocalPart().equals("PolicyIdReference")) {
+
+                }
+            } else {
+                logger.warn("generating policy sets found unsupported element: " + element.getName().getNamespaceURI());
+            }
+        }
+        if (this.callback != null) {
+            if (this.callback.onPostVisitPolicySet(parent, policySet) == CallbackResult.STOP) {
+                return CallbackResult.STOP;
+            }
+        }
+        return CallbackResult.CONTINUE;
+    }
+
+    /**
+     *
+     * This performs scanning of the Policy object.
+     *
+     * @param parent - The parent PolicySet of the policy. This can be null if this is a root Policy.
+     * @param policy - The policy being scanned.
+     * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+     */
+    protected CallbackResult scanPolicy(PolicySetType parent, PolicyType policy) {
+        if (logger.isTraceEnabled()) {
+            logger.trace("scanning policy: " + policy.getPolicyId() + " " + policy.getDescription());
+        }
+        if (this.callback != null) {
+            if (this.callback.onPreVisitPolicy(parent, policy) == CallbackResult.STOP) {
+                return CallbackResult.STOP;
+            }
+        }
+        //
+        // Scan its info
+        //
+        if (this.scanTarget(policy, policy.getTarget()) == CallbackResult.STOP) {
+            return CallbackResult.STOP;
+        }
+        if (this.scanVariables(policy, policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition()) == CallbackResult.STOP) {
+            return CallbackResult.STOP;
+        }
+        if (this.scanObligations(policy, policy.getObligationExpressions()) == CallbackResult.STOP) {
+            return CallbackResult.STOP;
+        }
+        if (this.scanAdvice(policy, policy.getAdviceExpressions()) == CallbackResult.STOP) {
+            return CallbackResult.STOP;
+        }
+        //
+        // Iterate the rules
+        //
+        List<Object> list = policy.getCombinerParametersOrRuleCombinerParametersOrVariableDefinition();
+        for (Object o: list) {
+            if (o instanceof RuleType) {
+                RuleType rule = (RuleType) o;
+                if (logger.isTraceEnabled()) {
+                    logger.trace("scanning rule: " + rule.getRuleId() + " " + rule.getDescription());
+                }
+                if (this.callback != null) {
+                    if (this.callback.onPreVisitRule(policy, rule) == CallbackResult.STOP) {
+                        return CallbackResult.STOP;
+                    }
+                }
+                if (this.scanTarget(rule, rule.getTarget()) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+                if (this.scanConditions(rule, rule.getCondition()) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+                if (this.scanObligations(rule, rule.getObligationExpressions()) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+                if (this.scanAdvice(rule, rule.getAdviceExpressions()) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+                if (this.callback != null) {
+                    if (this.callback.onPostVisitRule(policy, rule) == CallbackResult.STOP) {
+                        return CallbackResult.STOP;
+                    }
+                }
+            } else if (o instanceof VariableDefinitionType) {
+                if (this.callback != null) {
+                    if (this.callback.onVariable(policy, (VariableDefinitionType) o) == CallbackResult.STOP) {
+                        return CallbackResult.STOP;
+                    }
+                }
+            } else {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("scanning policy rules found unsupported object:" + o.toString());
+                }
+            }
+        }
+        if (this.callback != null) {
+            if (this.callback.onPostVisitPolicy(parent, policy) == CallbackResult.STOP) {
+                return CallbackResult.STOP;
+            }
+        }
+        return CallbackResult.CONTINUE;
+    }
+
+    /**
+     * Scans the given target for attributes. Its sole purpose is to return attributes found.
+     *
+     * @param parent - The parent PolicySet/Policy/Rule for the target.
+     * @param target - The target.
+     * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+     */
+    protected CallbackResult scanTarget(Object parent, TargetType target) {
+        if (target == null) {
+            return CallbackResult.CONTINUE;
+        }
+        List<AnyOfType> anyOfList = target.getAnyOf();
+        if (anyOfList != null) {
+            Iterator<AnyOfType> iterAnyOf = anyOfList.iterator();
+            while (iterAnyOf.hasNext()) {
+                AnyOfType anyOf = iterAnyOf.next();
+                List<AllOfType> allOfList = anyOf.getAllOf();
+                if (allOfList != null) {
+                    Iterator<AllOfType> iterAllOf = allOfList.iterator();
+                    while (iterAllOf.hasNext()) {
+                        AllOfType allOf = iterAllOf.next();
+                        List<MatchType> matchList = allOf.getMatch();
+                        if (matchList != null) {
+                            Iterator<MatchType> iterMatch = matchList.iterator();
+                            while (iterMatch.hasNext()) {
+                                MatchType match = iterMatch.next();
                                 //
-                                // Is it a 3.0 policy?
+                                // Finally down to the actual attribute
                                 //
-                                if (e.getNamespaceURI().equals("urn:oasis:names:tc:xacml:3.0:core:schema:wd-17")) {
-                                        //
-                                        // A policyset or policy could be the root
-                                        //
-                                        if (e.getNodeName().endsWith("Policy")) {
-                                                //
-                                                // Now we can create the context for the policy set
-                                                // and unmarshall the policy into a class.
-                                                //
-                                                JAXBContext context = JAXBContext.newInstance(PolicyType.class);
-                                                Unmarshaller um = context.createUnmarshaller();
-                                                JAXBElement<PolicyType> root = um.unmarshal(e, PolicyType.class);
-                                                //
-                                                // Here is our policy set class
-                                                //
-                                                return root.getValue();
-                                        } else if (e.getNodeName().endsWith("PolicySet")) {
-                                                //
-                                                // Now we can create the context for the policy set
-                                                // and unmarshall the policy into a class.
-                                                //
-                                                JAXBContext context = JAXBContext.newInstance(PolicySetType.class);
-                                                Unmarshaller um = context.createUnmarshaller();
-                                                JAXBElement<PolicySetType> root = um.unmarshal(e, PolicySetType.class);
-                                                //
-                                                // Here is our policy set class
-                                                //
-                                                return root.getValue();
-                                        } else {
-                                                if (logger.isDebugEnabled()) {
-                                                        logger.debug("Not supported yet: " + e.getNodeName());
-                                                }
-                                        }
+                                StdAttribute attribute = null;
+                                AttributeValueType value = match.getAttributeValue();
+                                if (match.getAttributeDesignator() != null && value != null) {
+                                    AttributeDesignatorType designator = match.getAttributeDesignator();
+                                    //
+                                    // The content may be tricky
+                                    //
+                                    attribute = new StdAttribute(new IdentifierImpl(designator.getCategory()),
+                                                                 new IdentifierImpl(designator.getAttributeId()),
+                                                                 new StdAttributeValue<List<?>>(new IdentifierImpl(value.getDataType()), value.getContent()),
+                                                                 designator.getIssuer(),
+                                                                 false);
+                                } else if (match.getAttributeSelector() != null && value != null) {
+                                    AttributeSelectorType selector = match.getAttributeSelector();
+                                    attribute = new StdAttribute(new IdentifierImpl(selector.getCategory()),
+                                                                 new IdentifierImpl(selector.getContextSelectorId()),
+                                                                 new StdAttributeValue<List<?>>(new IdentifierImpl(value.getDataType()), value.getContent()),
+                                                                 null,
+                                                                 false);
                                 } else {
-                                        logger.warn("unsupported namespace: " + e.getNamespaceURI());
+                                    logger.warn("NULL designator/selector or value for match.");
                                 }
-                        } else {
-                                if (logger.isDebugEnabled()) {
-                                        logger.debug("No root element contained in policy " + 
-                                                                " Name: " + node.getNodeName() + " type: " + node.getNodeType() + 
-                                                                " Value: " + node.getNodeValue());
+                                if (attribute != null && this.callback != null) {
+                                    if (this.callback.onAttribute(parent, target, attribute) == CallbackResult.STOP) {
+                                        return CallbackResult.STOP;
+                                    }
                                 }
+                            }
                         }
-                } catch (Exception e) {
-                        logger.error(e.getMessage());
+                    }
+                }
+            }
+        }
+        return CallbackResult.CONTINUE;
+    }
+
+    /**
+     * Scan the list of obligations.
+     *
+     * @param parent - The parent PolicySet/Policy/Rule for the obligation.
+     * @param obligationExpressionsType - All the obligation expressions.
+     * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+     */
+    protected CallbackResult scanObligations(Object parent, ObligationExpressionsType obligationExpressionsType) {
+        if (obligationExpressionsType == null) {
+            return CallbackResult.CONTINUE;
+        }
+        List<ObligationExpressionType> expressions = obligationExpressionsType.getObligationExpression();
+        if (expressions == null || expressions.size() == 0) {
+            return CallbackResult.CONTINUE;
+        }
+        for (ObligationExpressionType expression : expressions) {
+            StdMutableObligation ob = new StdMutableObligation(new IdentifierImpl(expression.getObligationId()));
+            List<AttributeAssignmentExpressionType> assignments = expression.getAttributeAssignmentExpression();
+            if (assignments != null) {
+                for (AttributeAssignmentExpressionType assignment : assignments) {
+                    // category is optional and may be null
+                    IdentifierImpl categoryId = null;
+                    if (assignment.getCategory() != null) {
+                        categoryId = new IdentifierImpl(assignment.getCategory());
+                    }
+                    AttributeAssignment attribute = new StdAttributeAssignment(
+                        categoryId,
+                        new IdentifierImpl(assignment.getAttributeId()),
+                        assignment.getIssuer(),
+                        new StdAttributeValue<Object>(null, null)
+                    );
+                    ob.addAttributeAssignment(attribute);
+                }
+            }
+            if (this.callback != null) {
+                if (this.callback.onObligation(parent, expression, ob) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+            }
+        }
+        return CallbackResult.CONTINUE;
+    }
+
+    /**
+     *
+     * Scans the list of advice expressions returning each individually.
+     *
+     * @param parent - The parent PolicySet/Policy/Rule for the advice.
+     * @param adviceExpressionstype - The list of advice expressions.
+     * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+     */
+    protected CallbackResult scanAdvice(Object parent, AdviceExpressionsType adviceExpressionstype) {
+        if (adviceExpressionstype == null) {
+            return CallbackResult.CONTINUE;
+        }
+        List<AdviceExpressionType> expressions = adviceExpressionstype.getAdviceExpression();
+        if (expressions == null || expressions.size() == 0) {
+            return CallbackResult.CONTINUE;
+        }
+        for (AdviceExpressionType expression : expressions) {
+            StdMutableAdvice ob = new StdMutableAdvice(new IdentifierImpl(expression.getAdviceId()));
+            List<AttributeAssignmentExpressionType> assignments = expression.getAttributeAssignmentExpression();
+            if (assignments != null) {
+                for (AttributeAssignmentExpressionType assignment : assignments) {
+                    IdentifierImpl categoryId = null;
+                    if (assignment.getCategory() != null) {
+                        categoryId = new IdentifierImpl(assignment.getCategory());
+                    }
+                    AttributeAssignment attribute = new StdAttributeAssignment(
+                        categoryId,
+                        new IdentifierImpl(assignment.getAttributeId()),
+                        assignment.getIssuer(),
+                        new StdAttributeValue<Object>(null, null)
+                    );
+                    ob.addAttributeAssignment(attribute);
+                }
+            }
+            if (this.callback != null) {
+                if (this.callback.onAdvice(parent, expression, ob) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+            }
+        }
+        return CallbackResult.CONTINUE;
+    }
+
+    /**
+     * Scans the list of variable definitions.
+     *
+     * @param policy - Policy object containing the variable definition.
+     * @param list - List of variable definitions.
+     * @return CallbackResult - CONTINUE to continue, STOP to terminate scanning.
+     */
+    protected CallbackResult scanVariables(PolicyType policy, List<Object> list) {
+        if (list == null) {
+            return CallbackResult.CONTINUE;
+        }
+        for (Object o : list) {
+            if (o instanceof VariableDefinitionType) {
+                if (this.callback != null) {
+                    if (this.callback.onVariable(policy, (VariableDefinitionType) o) == CallbackResult.STOP) {
+                        return CallbackResult.STOP;
+                    }
+                }
+            }
+        }
+
+        return CallbackResult.CONTINUE;
+    }
+
+    /**
+     * Scans the list of conditions.
+     *
+     * @param rule
+     * @param condition
+     * @return
+     */
+    protected CallbackResult scanConditions(RuleType rule, ConditionType condition) {
+        if (condition != null) {
+            if (this.callback != null) {
+                if (this.callback.onCondition(rule, condition) == CallbackResult.STOP) {
+                    return CallbackResult.STOP;
+                }
+            }
+        }
+        return CallbackResult.CONTINUE;
+    }
+
+    /**
+     * Reads the XACML XML policy file in and returns the version contained in the root Policy/PolicySet element.
+     *
+     * @param policy - The policy file.
+     * @return - The version string from the file (uninterpreted)
+     * @throws java.io.IOException
+     */
+    public static String	getVersion(Path policy) throws IOException {
+        Object data = null;
+        try (InputStream is = Files.newInputStream(policy)) {
+            data = XACMLPolicyScanner.readPolicy(is);
+        } catch (IOException e) {
+            logger.error("Failed to read policy", e);
+            throw e;
+        }
+        if (data == null) {
+            logger.warn("Version is null.");
+            return null;
+        }
+        return getVersion(data);
+    }
+
+    /**
+     * Reads the Policy/PolicySet element object and returns its current version.
+     *
+     * @param data - Either a PolicySet or Policy XACML type object.
+     * @return - The integer version value. -1 if it doesn't exist or was un-parsable.
+     */
+    public static String	getVersion(Object data) {
+        String version = null;
+        try {
+            if (data instanceof PolicySetType) {
+                version = ((PolicySetType)data).getVersion();
+            } else if (data instanceof PolicyType) {
+                version = ((PolicyType)data).getVersion();
+            } else {
+                if (data != null) {
+                    logger.error("Expecting a PolicySet/Policy/Rule object. Got: " + data.getClass().getCanonicalName());
                 }
                 return null;
+            }
+            if (version != null && version.length() > 0) {
+                return version;
+            } else {
+                logger.warn("No version set in policy");
+            }
+        } catch (NumberFormatException e) {
+            logger.error("Invalid version contained in policy: " + version);
+            return null;
         }
+        return null;
+    }
+
+    /**
+     * Returns the Policy or PolicySet ID.
+     *
+     * @param data - A XACML 3.0 Policy or PolicySet element object.
+     * @return The policy/policyset's policy ID
+     */
+    public static String getID(Object data) {
+        if (data instanceof PolicySetType) {
+            return ((PolicySetType)data).getPolicySetId();
+        } else if (data instanceof PolicyType) {
+            return ((PolicyType)data).getPolicyId();
+        } else {
+            logger.error("Expecting a PolicySet/Policy/Rule object. Got: " + data.getClass().getCanonicalName());
+            return null;
+        }
+    }
+
+    /**
+     * readPolicy - does the work to read in policy data from a file.
+     *
+     * @param policy - The path to the policy file.
+     * @return - The policy data object. This *should* be either a PolicySet or a Policy.
+     */
+    public static Object readPolicy(InputStream is) {
+        try {
+            //
+            // Create a DOM parser
+            //
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            //
+            // Parse the policy file
+            //
+            Document doc = db.parse(is);
+            //
+            // Because there is no root defined in xacml,
+            // find the first element
+            //
+            NodeList nodes = doc.getChildNodes();
+            Node node = nodes.item(0);
+            Element e = null;
+            if (node.getNodeType() == Node.ELEMENT_NODE) {
+                e = (Element) node;
+                //
+                // Is it a 3.0 policy?
+                //
+                if (e.getNamespaceURI().equals("urn:oasis:names:tc:xacml:3.0:core:schema:wd-17")) {
+                    //
+                    // A policyset or policy could be the root
+                    //
+                    if (e.getNodeName().endsWith("Policy")) {
+                        //
+                        // Now we can create the context for the policy set
+                        // and unmarshall the policy into a class.
+                        //
+                        JAXBContext context = JAXBContext.newInstance(PolicyType.class);
+                        Unmarshaller um = context.createUnmarshaller();
+                        JAXBElement<PolicyType> root = um.unmarshal(e, PolicyType.class);
+                        //
+                        // Here is our policy set class
+                        //
+                        return root.getValue();
+                    } else if (e.getNodeName().endsWith("PolicySet")) {
+                        //
+                        // Now we can create the context for the policy set
+                        // and unmarshall the policy into a class.
+                        //
+                        JAXBContext context = JAXBContext.newInstance(PolicySetType.class);
+                        Unmarshaller um = context.createUnmarshaller();
+                        JAXBElement<PolicySetType> root = um.unmarshal(e, PolicySetType.class);
+                        //
+                        // Here is our policy set class
+                        //
+                        return root.getValue();
+                    } else {
+                        if (logger.isDebugEnabled()) {
+                            logger.debug("Not supported yet: " + e.getNodeName());
+                        }
+                    }
+                } else {
+                    logger.warn("unsupported namespace: " + e.getNamespaceURI());
+                }
+            } else {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("No root element contained in policy " +
+                                 " Name: " + node.getNodeName() + " type: " + node.getNodeType() +
+                                 " Value: " + node.getNodeValue());
+                }
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage());
+        }
+        return null;
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyWriter.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyWriter.java
index e810ed1..ad08423 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyWriter.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLPolicyWriter.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -48,100 +48,100 @@
 
 /**
  * Helper static class for policy writing.
- * 
+ *
  * @author pameladragosh
  *
  */
 public class XACMLPolicyWriter {
-        private static final Log logger				= LogFactory.getLog(XACMLPolicyWriter.class);
+    private static final Log logger				= LogFactory.getLog(XACMLPolicyWriter.class);
 
-        /**
-         * Helper static class that does the work to write a policy set to a file on disk.
-         * 
-         * @author pameladragosh
-         *
-         */
-        public static Path writePolicyFile(Path filename, PolicySetType policySet) {
-                JAXBElement<PolicySetType> policySetElement = new ObjectFactory().createPolicySet(policySet);		
-                try {
-                        JAXBContext context = JAXBContext.newInstance(PolicySetType.class);
-                        Marshaller m = context.createMarshaller();
-                        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-                        m.marshal(policySetElement, filename.toFile());
-                        
-                        if (Files.exists(filename)) {
-                                return filename;
-                        } else {
-                                logger.error("File does not exist after marshalling.");
-                                return null;
-                        }
-                        
-                } catch (JAXBException e) {
-                        logger.error("writePolicyFile failed: " + e.getLocalizedMessage());
-                        return null;
-                }
-        }
+    /**
+     * Helper static class that does the work to write a policy set to a file on disk.
+     *
+     * @author pameladragosh
+     *
+     */
+    public static Path writePolicyFile(Path filename, PolicySetType policySet) {
+        JAXBElement<PolicySetType> policySetElement = new ObjectFactory().createPolicySet(policySet);
+        try {
+            JAXBContext context = JAXBContext.newInstance(PolicySetType.class);
+            Marshaller m = context.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+            m.marshal(policySetElement, filename.toFile());
 
-        /**
-         * Helper static class that does the work to write a policy set to an output stream.
-         * 
-         * @author pameladragosh
-         *
-         */
-        public static void writePolicyFile(OutputStream os, PolicySetType policySet) {
-                JAXBElement<PolicySetType> policySetElement = new ObjectFactory().createPolicySet(policySet);
-                try {
-                        JAXBContext context = JAXBContext.newInstance(PolicySetType.class);
-                        Marshaller m = context.createMarshaller();
-                        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-                        m.marshal(policySetElement, os);
-                } catch (JAXBException e) {
-                        logger.error("writePolicyFile failed: " + e.getLocalizedMessage());
-                }
-        }
+            if (Files.exists(filename)) {
+                return filename;
+            } else {
+                logger.error("File does not exist after marshalling.");
+                return null;
+            }
 
-        /**
-         * Helper static class that does the work to write a policy to a file on disk.
-         * 
-         * @author pameladragosh
-         *
-         */
-        public static Path writePolicyFile(Path filename, PolicyType policy) {
-                JAXBElement<PolicyType> policyElement = new ObjectFactory().createPolicy(policy);		
-                try {
-                        JAXBContext context = JAXBContext.newInstance(PolicyType.class);
-                        Marshaller m = context.createMarshaller();
-                        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-                        m.marshal(policyElement, filename.toFile());
-                        
-                        if (Files.exists(filename)) {
-                                return filename;
-                        } else {
-                                logger.error("File does not exist after marshalling.");
-                                return null;
-                        }
-                                                
-                } catch (JAXBException e) {
-                        logger.error("writePolicyFile failed: " + e.getLocalizedMessage());
-                        return null;
-                }		
+        } catch (JAXBException e) {
+            logger.error("writePolicyFile failed: " + e.getLocalizedMessage());
+            return null;
         }
-        /**
-         * Helper static class that does the work to write a policy set to an output stream.
-         * 
-         * @author pameladragosh
-         *
-         */
-        public static void writePolicyFile(OutputStream os, PolicyType policy) {
-                JAXBElement<PolicyType> policySetElement = new ObjectFactory().createPolicy(policy);		
-                try {
-                        JAXBContext context = JAXBContext.newInstance(PolicyType.class);
-                        Marshaller m = context.createMarshaller();
-                        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-                        m.marshal(policySetElement, os);
-                } catch (JAXBException e) {
-                        logger.error("writePolicyFile failed: " + e.getLocalizedMessage());
-                }
+    }
+
+    /**
+     * Helper static class that does the work to write a policy set to an output stream.
+     *
+     * @author pameladragosh
+     *
+     */
+    public static void writePolicyFile(OutputStream os, PolicySetType policySet) {
+        JAXBElement<PolicySetType> policySetElement = new ObjectFactory().createPolicySet(policySet);
+        try {
+            JAXBContext context = JAXBContext.newInstance(PolicySetType.class);
+            Marshaller m = context.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+            m.marshal(policySetElement, os);
+        } catch (JAXBException e) {
+            logger.error("writePolicyFile failed: " + e.getLocalizedMessage());
         }
+    }
+
+    /**
+     * Helper static class that does the work to write a policy to a file on disk.
+     *
+     * @author pameladragosh
+     *
+     */
+    public static Path writePolicyFile(Path filename, PolicyType policy) {
+        JAXBElement<PolicyType> policyElement = new ObjectFactory().createPolicy(policy);
+        try {
+            JAXBContext context = JAXBContext.newInstance(PolicyType.class);
+            Marshaller m = context.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+            m.marshal(policyElement, filename.toFile());
+
+            if (Files.exists(filename)) {
+                return filename;
+            } else {
+                logger.error("File does not exist after marshalling.");
+                return null;
+            }
+
+        } catch (JAXBException e) {
+            logger.error("writePolicyFile failed: " + e.getLocalizedMessage());
+            return null;
+        }
+    }
+    /**
+     * Helper static class that does the work to write a policy set to an output stream.
+     *
+     * @author pameladragosh
+     *
+     */
+    public static void writePolicyFile(OutputStream os, PolicyType policy) {
+        JAXBElement<PolicyType> policySetElement = new ObjectFactory().createPolicy(policy);
+        try {
+            JAXBContext context = JAXBContext.newInstance(PolicyType.class);
+            Marshaller m = context.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+            m.marshal(policySetElement, os);
+        } catch (JAXBException e) {
+            logger.error("writePolicyFile failed: " + e.getLocalizedMessage());
+        }
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLProperties.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLProperties.java
index 5972256..2e2a12d 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLProperties.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLProperties.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -47,234 +47,234 @@
 
 /**
  * XACMLProperties is a wrapper around a <code>Properties</code> object loaded from a standard location for XACML properties.
- * 
+ *
  * @author car
  * @version $Revision: 1.2 $
  */
 public class XACMLProperties {
-        private static final Log logger	= LogFactory.getLog(XACMLProperties.class);
-        
-        public static final String	XACML_PROPERTIES_NAME	= "xacml.properties";
-        public static final String	XACML_PROPERTIES_FILE	= System.getProperty("java.home") + File.separator + "lib" + File.separator + XACML_PROPERTIES_NAME;
-        
-        public static final String	PROP_DATATYPEFACTORY	= "xacml.dataTypeFactory";
-        public static final String	PROP_PDPENGINEFACTORY	= "xacml.pdpEngineFactory";
-        public static final String	PROP_PEPENGINEFACTORY	= "xacml.pepEngineFactory";
-        public static final String	PROP_PIPFINDERFACTORY	= "xacml.pipFinderFactory";
-        public static final String	PROP_TRACEENGINEFACTORY	= "xacml.traceEngineFactory";
-        
-        public static final String	PROP_ROOTPOLICIES		= "xacml.rootPolicies";
-        public static final String	PROP_REFERENCEDPOLICIES	= "xacml.referencedPolicies";
-        
-        public static final String	PROP_PDP_BEHAVIOR		= "xacml.pdp.behavior";
-        public static final String	PROP_PIP_ENGINES		= "xacml.pip.engines";
+    private static final Log logger	= LogFactory.getLog(XACMLProperties.class);
 
-        // Alternative types of PAP Engine
-        public static final String 	PROP_PAP_PAPENGINEFACTORY 	= "xacml.PAP.papEngineFactory";
-        public static final String 	PROP_AC_PAPENGINEFACTORY 	= "xacml.AC.papEngineFactory";
-        
-        private static volatile Properties	properties	= new Properties();
-        private static boolean 		needCache		= true;
-        
-        private static File getPropertiesFile() {
-                String propertiesFileName	= System.getProperty(XACML_PROPERTIES_NAME);
-                if (propertiesFileName == null) {
-                        propertiesFileName	= XACML_PROPERTIES_FILE;
-                }
-                return new File(propertiesFileName);
-        }
-        
-        protected XACMLProperties() {
-        }
+    public static final String	XACML_PROPERTIES_NAME	= "xacml.properties";
+    public static final String	XACML_PROPERTIES_FILE	= System.getProperty("java.home") + File.separator + "lib" + File.separator + XACML_PROPERTIES_NAME;
 
-        public static Properties getProperties() throws IOException {
+    public static final String	PROP_DATATYPEFACTORY	= "xacml.dataTypeFactory";
+    public static final String	PROP_PDPENGINEFACTORY	= "xacml.pdpEngineFactory";
+    public static final String	PROP_PEPENGINEFACTORY	= "xacml.pepEngineFactory";
+    public static final String	PROP_PIPFINDERFACTORY	= "xacml.pipFinderFactory";
+    public static final String	PROP_TRACEENGINEFACTORY	= "xacml.traceEngineFactory";
+
+    public static final String	PROP_ROOTPOLICIES		= "xacml.rootPolicies";
+    public static final String	PROP_REFERENCEDPOLICIES	= "xacml.referencedPolicies";
+
+    public static final String	PROP_PDP_BEHAVIOR		= "xacml.pdp.behavior";
+    public static final String	PROP_PIP_ENGINES		= "xacml.pip.engines";
+
+    // Alternative types of PAP Engine
+    public static final String 	PROP_PAP_PAPENGINEFACTORY 	= "xacml.PAP.papEngineFactory";
+    public static final String 	PROP_AC_PAPENGINEFACTORY 	= "xacml.AC.papEngineFactory";
+
+    private static volatile Properties	properties	= new Properties();
+    private static boolean 		needCache		= true;
+
+    private static File getPropertiesFile() {
+        String propertiesFileName	= System.getProperty(XACML_PROPERTIES_NAME);
+        if (propertiesFileName == null) {
+            propertiesFileName	= XACML_PROPERTIES_FILE;
+        }
+        return new File(propertiesFileName);
+    }
+
+    protected XACMLProperties() {
+    }
+
+    public static Properties getProperties() throws IOException {
+        if (needCache) {
+            synchronized(properties) {
                 if (needCache) {
-                        synchronized(properties) {
-                                if (needCache) {
-                                        File fileProperties	= getPropertiesFile();
-                                        if (fileProperties.exists() && fileProperties.canRead()) {
-                                                if (logger.isDebugEnabled()) {
-                                                        logger.debug("Loading properties from " + fileProperties.getAbsolutePath());
-                                                }
-                                                try (InputStream is = new FileInputStream(fileProperties)) {
-                                                        properties.load(is);
-                                                }
-                                        } else {
-                                                logger.warn("Properties file " + fileProperties.getAbsolutePath() + " cannot be read.");
-                                        }
-                                        needCache	= false;
-                                }
+                    File fileProperties	= getPropertiesFile();
+                    if (fileProperties.exists() && fileProperties.canRead()) {
+                        if (logger.isDebugEnabled()) {
+                            logger.debug("Loading properties from " + fileProperties.getAbsolutePath());
                         }
-                }
-                return properties;
-        }
-        
-        public static void reloadProperties() {
-                synchronized(properties) {
-                        properties = new Properties();
-                        needCache = true;
-                }
-        }
-        
-        public static String getProperty(String propertyName, String defaultValue) {
-                String value	= System.getProperty(propertyName);
-                if (value == null) {
-                        Properties properties	= null;
-                        try {
-                                properties	= getProperties();
-                                value	= properties.getProperty(propertyName);
-                        } catch (Exception ex) {
+                        try (InputStream is = new FileInputStream(fileProperties)) {
+                            properties.load(is);
                         }
+                    } else {
+                        logger.warn("Properties file " + fileProperties.getAbsolutePath() + " cannot be read.");
+                    }
+                    needCache	= false;
                 }
-                return (value == null ? defaultValue : value);
+            }
         }
-        
-        public static void setProperty(String propertyName, String propertyValue) {
-                try {
-                        getProperties().setProperty(propertyName, propertyValue);
-                } catch (Exception ex) {
-                }
-        }
-        
-        public static String getProperty(String propertyName) {
-                return getProperty(propertyName, null);
-        }
-        
-        /**
-         * Get the policy-related properties from the given set of properties.
-         * These may or may not include ".url" entries for each policy.
-         * The caller determines whether it should include them or not and sets checkURLs appropriately.
-         * If checkURLs is false and there are ".url" entries, they are put into the result set anyway.
-         * 
-         * @param current
-         * @param checkURLs
-         * @return
-         * @throws Exception
-         */
-        public static Properties getPolicyProperties(Properties current, boolean checkURLs) throws Exception {
-                Properties props = new Properties();
-                String[] lists = new String[2];
-                lists[0] = current.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
-                lists[1] = current.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
-                // require that PROP_ROOTPOLICIES exist, even when it is empty
-                if (lists[0] != null) {
-                        props.setProperty(XACMLProperties.PROP_ROOTPOLICIES, lists[0]);
-                } else {
-                        logger.error("Missing property: " + XACMLProperties.PROP_ROOTPOLICIES);
-                        throw new Exception("Missing property: " + XACMLProperties.PROP_ROOTPOLICIES);
-                }
-                // require that PROP_REFERENCEDPOLICIES exist, even when it is empty
-                if (lists[1] != null) {
-                        props.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, lists[1]);
-                } else {
-                        logger.error("Missing property: " + XACMLProperties.PROP_REFERENCEDPOLICIES);
-                        throw new Exception("Missing property: " + XACMLProperties.PROP_REFERENCEDPOLICIES);
-                }
-                Set<Object> keys = current.keySet();
-                for (String list : lists) {
-                        if (list == null || list.length() == 0) {
-                                continue;
-                        }
-                        Iterable<String> policies = Splitter.on(',').trimResults().omitEmptyStrings().split(list);
-                        if (policies == null) {
-                                continue;
-                        }
-                        for (String policy : policies) {
-                                for (Object key : keys) {
-                                        if (key.toString().startsWith(policy)) {
-                                                props.setProperty(key.toString(), current.getProperty(key.toString()));
-                                        }
-                                }
-                                if (checkURLs) {
-                                        // every policy must have a ".url" property
-                                        String urlString = (String) props.get(policy + ".url");
-                                        if (urlString == null) {
-                                                logger.error("Policy '" + policy + "' has no .url property");
-                                                throw new Exception("Policy '" + policy + "' has no .url property");
-                                        }
-                                        // the .url must be a valid URL
-                                        try {
-                                                // if this does not throw an exception the URL is ok
-                                                new URL(urlString);
-                                        } catch (MalformedURLException e) {
-                                                logger.error("Policy '" + policy + "' has bad .url property");
-                                                throw new Exception("Policy '" + policy + "' has bad .url property");
-                                        }
-                                }
-                        }
-                }
-                return props;
-        }
-        
-        /**
-         * 	Used only when we want just xacml.rootPolicies and xacml.referencedPolicies without any ".url" entries.
-         * 
-         * @return
-         * @throws Exception
-         */
-        public static Properties getPolicyProperties() throws Exception {
-                return getPolicyProperties(XACMLProperties.getPolicyProperties(), false);		
-        }
-        
-        public static Set<String>	getRootPolicyIDs(Properties props) {
-                Set<String> ids = new HashSet<String>();
-                String roots = props.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
-                if (roots == null) {
-                        return ids;
-                }
-                Iterable<String> policies = Splitter.on(',').trimResults().omitEmptyStrings().split(roots);
-                for (String id: policies) {
-                        ids.add(id);
-                }
-                return ids;
-        }
+        return properties;
+    }
 
-        public static Set<String>	getReferencedPolicyIDs(Properties props) {
-                Set<String> ids = new HashSet<String>();
-                String refs = props.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
-                if (refs == null) {
-                        return ids;
-                }
-                Iterable<String> policies = Splitter.on(',').trimResults().omitEmptyStrings().split(refs);
-                for (String id: policies) {
-                        ids.add(id);
-                }
-                return ids;
+    public static void reloadProperties() {
+        synchronized(properties) {
+            properties = new Properties();
+            needCache = true;
         }
+    }
 
-        public static Set<String>	getPolicyIDs(Properties props) {
-                Set<String> ids = XACMLProperties.getRootPolicyIDs(props);
-                ids.addAll(XACMLProperties.getReferencedPolicyIDs(props));
-                return ids;
+    public static String getProperty(String propertyName, String defaultValue) {
+        String value	= System.getProperty(propertyName);
+        if (value == null) {
+            Properties properties	= null;
+            try {
+                properties	= getProperties();
+                value	= properties.getProperty(propertyName);
+            } catch (Exception ex) {
+            }
         }
+        return (value == null ? defaultValue : value);
+    }
 
-        public static Properties getPipProperties(Properties current) throws Exception {
-                Properties props = new Properties();
-                String list = current.getProperty(XACMLProperties.PROP_PIP_ENGINES);
-                // require that PROP_PIP_ENGINES exist, even when it is empty
-                if (list != null) {
-                        props.setProperty(XACMLProperties.PROP_PIP_ENGINES, list);
-                } else {
-                        throw new Exception("Missing property: " + XACMLProperties.PROP_PIP_ENGINES);
-                }
-                if (list == null || list.length() == 0) {
-                        return props;
-                }
-                Iterable<String> pips = Splitter.on(',').trimResults().omitEmptyStrings().split(list);
-                if (pips == null) {
-                        return props;
-                }
-                Set<Object> keys = current.keySet();
-                for (String pip : pips) {
-                        for (Object key : keys) {
-                                if (key.toString().startsWith(pip)) {
-                                        props.setProperty(key.toString(), current.getProperty(key.toString()));
-                                }
-                        }
-                }
-                return props;
+    public static void setProperty(String propertyName, String propertyValue) {
+        try {
+            getProperties().setProperty(propertyName, propertyValue);
+        } catch (Exception ex) {
         }
-        public static Properties getPipProperties() throws Exception {
-                return getPipProperties(XACMLProperties.getPipProperties());		
+    }
+
+    public static String getProperty(String propertyName) {
+        return getProperty(propertyName, null);
+    }
+
+    /**
+     * Get the policy-related properties from the given set of properties.
+     * These may or may not include ".url" entries for each policy.
+     * The caller determines whether it should include them or not and sets checkURLs appropriately.
+     * If checkURLs is false and there are ".url" entries, they are put into the result set anyway.
+     *
+     * @param current
+     * @param checkURLs
+     * @return
+     * @throws Exception
+     */
+    public static Properties getPolicyProperties(Properties current, boolean checkURLs) throws Exception {
+        Properties props = new Properties();
+        String[] lists = new String[2];
+        lists[0] = current.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
+        lists[1] = current.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
+        // require that PROP_ROOTPOLICIES exist, even when it is empty
+        if (lists[0] != null) {
+            props.setProperty(XACMLProperties.PROP_ROOTPOLICIES, lists[0]);
+        } else {
+            logger.error("Missing property: " + XACMLProperties.PROP_ROOTPOLICIES);
+            throw new Exception("Missing property: " + XACMLProperties.PROP_ROOTPOLICIES);
         }
+        // require that PROP_REFERENCEDPOLICIES exist, even when it is empty
+        if (lists[1] != null) {
+            props.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, lists[1]);
+        } else {
+            logger.error("Missing property: " + XACMLProperties.PROP_REFERENCEDPOLICIES);
+            throw new Exception("Missing property: " + XACMLProperties.PROP_REFERENCEDPOLICIES);
+        }
+        Set<Object> keys = current.keySet();
+        for (String list : lists) {
+            if (list == null || list.length() == 0) {
+                continue;
+            }
+            Iterable<String> policies = Splitter.on(',').trimResults().omitEmptyStrings().split(list);
+            if (policies == null) {
+                continue;
+            }
+            for (String policy : policies) {
+                for (Object key : keys) {
+                    if (key.toString().startsWith(policy)) {
+                        props.setProperty(key.toString(), current.getProperty(key.toString()));
+                    }
+                }
+                if (checkURLs) {
+                    // every policy must have a ".url" property
+                    String urlString = (String) props.get(policy + ".url");
+                    if (urlString == null) {
+                        logger.error("Policy '" + policy + "' has no .url property");
+                        throw new Exception("Policy '" + policy + "' has no .url property");
+                    }
+                    // the .url must be a valid URL
+                    try {
+                        // if this does not throw an exception the URL is ok
+                        new URL(urlString);
+                    } catch (MalformedURLException e) {
+                        logger.error("Policy '" + policy + "' has bad .url property");
+                        throw new Exception("Policy '" + policy + "' has bad .url property");
+                    }
+                }
+            }
+        }
+        return props;
+    }
+
+    /**
+     * 	Used only when we want just xacml.rootPolicies and xacml.referencedPolicies without any ".url" entries.
+     *
+     * @return
+     * @throws Exception
+     */
+    public static Properties getPolicyProperties() throws Exception {
+        return getPolicyProperties(XACMLProperties.getPolicyProperties(), false);
+    }
+
+    public static Set<String>	getRootPolicyIDs(Properties props) {
+        Set<String> ids = new HashSet<String>();
+        String roots = props.getProperty(XACMLProperties.PROP_ROOTPOLICIES);
+        if (roots == null) {
+            return ids;
+        }
+        Iterable<String> policies = Splitter.on(',').trimResults().omitEmptyStrings().split(roots);
+        for (String id: policies) {
+            ids.add(id);
+        }
+        return ids;
+    }
+
+    public static Set<String>	getReferencedPolicyIDs(Properties props) {
+        Set<String> ids = new HashSet<String>();
+        String refs = props.getProperty(XACMLProperties.PROP_REFERENCEDPOLICIES);
+        if (refs == null) {
+            return ids;
+        }
+        Iterable<String> policies = Splitter.on(',').trimResults().omitEmptyStrings().split(refs);
+        for (String id: policies) {
+            ids.add(id);
+        }
+        return ids;
+    }
+
+    public static Set<String>	getPolicyIDs(Properties props) {
+        Set<String> ids = XACMLProperties.getRootPolicyIDs(props);
+        ids.addAll(XACMLProperties.getReferencedPolicyIDs(props));
+        return ids;
+    }
+
+    public static Properties getPipProperties(Properties current) throws Exception {
+        Properties props = new Properties();
+        String list = current.getProperty(XACMLProperties.PROP_PIP_ENGINES);
+        // require that PROP_PIP_ENGINES exist, even when it is empty
+        if (list != null) {
+            props.setProperty(XACMLProperties.PROP_PIP_ENGINES, list);
+        } else {
+            throw new Exception("Missing property: " + XACMLProperties.PROP_PIP_ENGINES);
+        }
+        if (list == null || list.length() == 0) {
+            return props;
+        }
+        Iterable<String> pips = Splitter.on(',').trimResults().omitEmptyStrings().split(list);
+        if (pips == null) {
+            return props;
+        }
+        Set<Object> keys = current.keySet();
+        for (String pip : pips) {
+            for (Object key : keys) {
+                if (key.toString().startsWith(pip)) {
+                    props.setProperty(key.toString(), current.getProperty(key.toString()));
+                }
+            }
+        }
+        return props;
+    }
+    public static Properties getPipProperties() throws Exception {
+        return getPipProperties(XACMLProperties.getPipProperties());
+    }
 }
diff --git a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLRepair.java b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLRepair.java
index 4416d27..e3f2d43 100644
--- a/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLRepair.java
+++ b/openaz-xacml/src/main/java/com/att/research/xacml/util/XACMLRepair.java
@@ -6,16 +6,16 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 /*
@@ -50,230 +50,230 @@
 /**
  * XACMLRepair is an application class that can load individual XACML documents or directories of XACML documents, make any needed
  * repairs on them, and write them back out to an output file or directory.
- * 
+ *
  * @author car
  * @version $Revision: 1.1 $
  */
 public class XACMLRepair {
-        private static final Log logger	= LogFactory.getLog(XACMLRepair.class);
-        
-        public static final String	PROP_DOCUMENT_REPAIR_CLASSNAME	= "xacml.documentRepairClassName";
-        
-        private List<File>	listInputFilesOrDirectories	= new ArrayList<File>();
-        private File outputFileOrDirectory;
-        private boolean forceOutput;
-        private String documentRepairClassName;
-        private DOMDocumentRepair domDocumentRepair;
-        private boolean verbose;
-        
-        private DOMDocumentRepair getDOMDocumentRepair() {
-                if (this.domDocumentRepair == null) {
-                        if (this.documentRepairClassName == null) {
-                                this.documentRepairClassName	= System.getProperty(PROP_DOCUMENT_REPAIR_CLASSNAME);
-                        }
-                        if (this.documentRepairClassName == null) {
-                                this.domDocumentRepair	= new DOMDocumentRepair();
-                        } else {
-                                try {
-                                        Class<?> classDocumentRepair	= Class.forName(this.documentRepairClassName);
-                                        if (!DOMDocumentRepair.class.isAssignableFrom(classDocumentRepair)) {
-                                                throw new IllegalArgumentException("Not a DOMDocumentRepair class");
-                                        }
-                                        this.domDocumentRepair	= (DOMDocumentRepair)(classDocumentRepair.newInstance());
-                                } catch (Exception ex) {
-                                        System.err.println("Warning: Could not find Class " + this.documentRepairClassName + ":" + ex.getMessage() + ": using " + DOMDocumentRepair.class.getCanonicalName());
-                                        this.domDocumentRepair	= new DOMDocumentRepair();
-                                }
-                        }
-                }
-                return this.domDocumentRepair;
-        }
-        
-        private boolean init(String[] args) {
-                for (int i = 0 ; i < args.length ; ) {
-                        if (args[i].equals("--input") || args[i].equals("-i")) {
-                                if (i+1 < args.length) {
-                                        i++;
-                                        while (i < args.length && !args[i].startsWith("-")) { 
-                                                this.listInputFilesOrDirectories.add(new File(args[i++]));
-                                        }
-                                } else {
-                                        System.err.println("Missing argument to " + args[i] + " command line option");
-                                        return false;
-                                }
-                        } else if (args[i].equals("--output") || args[i].equals("-o")) {
-                                if (i+1 < args.length){
-                                        this.outputFileOrDirectory	= new File(args[i+1]);
-                                        i	+= 2;
-                                } else {
-                                        System.err.println("Missing argument to " + args[i] + " command line option");
-                                        return false;
-                                }
-                        } else if (args[i].equals("--force") || args[i].equals("-f")) {
-                                if (i+1 < args.length) {
-                                        this.forceOutput	= true;
-                                        i	+= 1;
-                                } else {
-                                        System.err.println("Missing argument to " + args[i] + " command line option");
-                                        return false;					
-                                }
-                        } else if (args[i].equals("--repairClass")) {
-                                if (i+1 < args.length) {
-                                        this.documentRepairClassName	= args[i+1];
-                                        i	+= 2;
-                                } else {
-                                        System.err.println("Missing argument to " + args[i] + " command line option");
-                                        return false;
-                                }
-                        } else if (args[i].equals("--verbose") || args[i].equals("-i")) {
-                                this.verbose	= true;
-                                i	+= 1;
-                        } else {
-                                System.err.println("Unknown command line option " + args[i]);
-                                return false;
-                        }
-                }
-                this.getDOMDocumentRepair();
-                return true;
-        }
-        
-        private boolean run(InputStream inputStream, File fileOrig, OutputStream outputStream, File fileDest) throws Exception {
-                String msg	= "Repairing " + (fileOrig == null ? "stdin" : fileOrig.getAbsoluteFile());
-                if (this.verbose) {
-                        System.out.println(msg);
-                }
-                logger.info(msg);
-                Document documentFile	= null;
-                try {
-                        documentFile	= DOMUtil.loadDocument(inputStream);
-                } catch (DOMStructureException ex) {
-                        System.err.println((msg = "Error loading " + (fileOrig == null ? "from stdin" : fileOrig.getAbsoluteFile()) + ": " + ex.getMessage()));
-                        logger.error(msg);
-                        return false;
-                }
-                if (documentFile == null) {
-                        System.err.println((msg = "No document " + (fileOrig == null ? "from stdin" : fileOrig.getAbsoluteFile())));
-                        logger.error(msg);
-                        return false;
-                }
-                boolean bUpdated	= false;
-                DOMDocumentRepair domDocumentRepair	= this.getDOMDocumentRepair();
-                try {
-                        bUpdated	= domDocumentRepair.repair(documentFile);
-                } catch (DOMStructureException ex) {
-                        System.err.println((msg = "Error repairing " + (fileOrig == null ? "from stdin" : fileOrig.getAbsoluteFile()) + ": " + ex.getMessage()));
-                        logger.error(msg);
-                        return false;
-                } catch (DOMDocumentRepair.UnsupportedDocumentTypeException ex) {
-                        msg	= "Unknown document type in " + (fileOrig == null ? "stdin" : fileOrig.getAbsoluteFile()) + ": skipping";
-                        if (this.verbose) {
-                                System.err.println(msg);
-                        }
-                        logger.debug(msg);
-                        return false;
-                }
-                if (bUpdated) {
-                        msg = "Repairs made in " + (fileOrig == null ? "stdin" : fileOrig.getAbsoluteFile());
-                        if (verbose) {
-                                System.out.println(msg);
-                        }
-                        logger.debug(msg);
-                }
-                if (bUpdated || this.forceOutput) {
-                        System.out.println((msg = "Writing to " + (fileDest == null ? "stdout" : fileDest.getAbsoluteFile())));
-                        logger.info(msg);
-                        String newDocument	= DOMUtil.toString(documentFile);
-                        outputStream.write(newDocument.getBytes());
-                        outputStream.flush();
-                        return true;
-                } else {
-                        return false;
-                }
-        }
-        
-        private void run(InputStream inputStream, File fileOrig) throws Exception {
-                if (this.outputFileOrDirectory == null) {
-                        this.run(inputStream, fileOrig, System.out, null);
-                } else if (this.outputFileOrDirectory.exists()) {
-                        if (this.outputFileOrDirectory.isDirectory()) {
-                                File fileOutput	= new File(this.outputFileOrDirectory, fileOrig.getName());
-                                boolean bWritten	= false;
-                                try (FileOutputStream fileOutputStream	= new FileOutputStream(fileOutput) ) {
-                                        bWritten	= this.run(inputStream, fileOrig, fileOutputStream, fileOutput);
-                                }
-                                if (!bWritten) {
-                                        fileOutput.delete();
-                                }
-                        } else {
-                                FileOutputStream fileOutputStream	= null;
-                                boolean bWritten	= false;
-                                try {
-                                        fileOutputStream	= new FileOutputStream(this.outputFileOrDirectory);
-                                        bWritten	= this.run(inputStream, fileOrig, fileOutputStream, this.outputFileOrDirectory);
-                                } finally {
-                                        if (fileOutputStream != null) {
-                                                fileOutputStream.close();
-                                        }
-                                }
-                                if (!bWritten) {
-                                        this.outputFileOrDirectory.delete();
-                                }
-                        }
-                } else {
-                        
-                }
-        }
-        
-        private void run(File inputFile) throws Exception {
-                String msg;
-                if (!inputFile.exists()) {
-                        System.err.println((msg = "Input file " + inputFile.getAbsolutePath() + " does not exist."));
-                        logger.error(msg);
-                        return;
-                } else if (inputFile.isDirectory()) {
-                        File[] directoryContents	= inputFile.listFiles(new FilenameFilter() {
-                                @Override
-                                public boolean accept(File dir, String name) {
-                                        return name.endsWith(".xml");
-                                }				
-                        });
-                        if (directoryContents != null && directoryContents.length > 0) {
-                                for (File file: directoryContents) {
-                                        this.run(file);
-                                }
-                        }
-                } else {
-                        try (FileInputStream fileInputStream	= new FileInputStream(inputFile)) {
-                                this.run(fileInputStream, inputFile);
-                        }
-                }
-        }
-        
-        private void run() throws Exception {
-                if (this.listInputFilesOrDirectories.size() == 0) {
-                        this.run(System.in, (File)null);
-                } else {
-                        for (File inputFile: this.listInputFilesOrDirectories) {
-                                this.run(inputFile);
-                        }
-                }
-        }
-        
-        public XACMLRepair() {
-        }
+    private static final Log logger	= LogFactory.getLog(XACMLRepair.class);
 
-        public static void main(String[] args) {
-                XACMLRepair xacmlRepair	= new XACMLRepair();
+    public static final String	PROP_DOCUMENT_REPAIR_CLASSNAME	= "xacml.documentRepairClassName";
+
+    private List<File>	listInputFilesOrDirectories	= new ArrayList<File>();
+    private File outputFileOrDirectory;
+    private boolean forceOutput;
+    private String documentRepairClassName;
+    private DOMDocumentRepair domDocumentRepair;
+    private boolean verbose;
+
+    private DOMDocumentRepair getDOMDocumentRepair() {
+        if (this.domDocumentRepair == null) {
+            if (this.documentRepairClassName == null) {
+                this.documentRepairClassName	= System.getProperty(PROP_DOCUMENT_REPAIR_CLASSNAME);
+            }
+            if (this.documentRepairClassName == null) {
+                this.domDocumentRepair	= new DOMDocumentRepair();
+            } else {
                 try {
-                        if (xacmlRepair.init(args)) {
-                                xacmlRepair.run();
-                        }
+                    Class<?> classDocumentRepair	= Class.forName(this.documentRepairClassName);
+                    if (!DOMDocumentRepair.class.isAssignableFrom(classDocumentRepair)) {
+                        throw new IllegalArgumentException("Not a DOMDocumentRepair class");
+                    }
+                    this.domDocumentRepair	= (DOMDocumentRepair)(classDocumentRepair.newInstance());
                 } catch (Exception ex) {
-                        System.err.println("Exception: " + ex.getMessage());
-                        ex.printStackTrace(System.err);
-                        System.exit(1);;
+                    System.err.println("Warning: Could not find Class " + this.documentRepairClassName + ":" + ex.getMessage() + ": using " + DOMDocumentRepair.class.getCanonicalName());
+                    this.domDocumentRepair	= new DOMDocumentRepair();
                 }
-                System.exit(0);
+            }
         }
+        return this.domDocumentRepair;
+    }
+
+    private boolean init(String[] args) {
+        for (int i = 0 ; i < args.length ; ) {
+            if (args[i].equals("--input") || args[i].equals("-i")) {
+                if (i+1 < args.length) {
+                    i++;
+                    while (i < args.length && !args[i].startsWith("-")) {
+                        this.listInputFilesOrDirectories.add(new File(args[i++]));
+                    }
+                } else {
+                    System.err.println("Missing argument to " + args[i] + " command line option");
+                    return false;
+                }
+            } else if (args[i].equals("--output") || args[i].equals("-o")) {
+                if (i+1 < args.length) {
+                    this.outputFileOrDirectory	= new File(args[i+1]);
+                    i	+= 2;
+                } else {
+                    System.err.println("Missing argument to " + args[i] + " command line option");
+                    return false;
+                }
+            } else if (args[i].equals("--force") || args[i].equals("-f")) {
+                if (i+1 < args.length) {
+                    this.forceOutput	= true;
+                    i	+= 1;
+                } else {
+                    System.err.println("Missing argument to " + args[i] + " command line option");
+                    return false;
+                }
+            } else if (args[i].equals("--repairClass")) {
+                if (i+1 < args.length) {
+                    this.documentRepairClassName	= args[i+1];
+                    i	+= 2;
+                } else {
+                    System.err.println("Missing argument to " + args[i] + " command line option");
+                    return false;
+                }
+            } else if (args[i].equals("--verbose") || args[i].equals("-i")) {
+                this.verbose	= true;
+                i	+= 1;
+            } else {
+                System.err.println("Unknown command line option " + args[i]);
+                return false;
+            }
+        }
+        this.getDOMDocumentRepair();
+        return true;
+    }
+
+    private boolean run(InputStream inputStream, File fileOrig, OutputStream outputStream, File fileDest) throws Exception {
+        String msg	= "Repairing " + (fileOrig == null ? "stdin" : fileOrig.getAbsoluteFile());
+        if (this.verbose) {
+            System.out.println(msg);
+        }
+        logger.info(msg);
+        Document documentFile	= null;
+        try {
+            documentFile	= DOMUtil.loadDocument(inputStream);
+        } catch (DOMStructureException ex) {
+            System.err.println((msg = "Error loading " + (fileOrig == null ? "from stdin" : fileOrig.getAbsoluteFile()) + ": " + ex.getMessage()));
+            logger.error(msg);
+            return false;
+        }
+        if (documentFile == null) {
+            System.err.println((msg = "No document " + (fileOrig == null ? "from stdin" : fileOrig.getAbsoluteFile())));
+            logger.error(msg);
+            return false;
+        }
+        boolean bUpdated	= false;
+        DOMDocumentRepair domDocumentRepair	= this.getDOMDocumentRepair();
+        try {
+            bUpdated	= domDocumentRepair.repair(documentFile);
+        } catch (DOMStructureException ex) {
+            System.err.println((msg = "Error repairing " + (fileOrig == null ? "from stdin" : fileOrig.getAbsoluteFile()) + ": " + ex.getMessage()));
+            logger.error(msg);
+            return false;
+        } catch (DOMDocumentRepair.UnsupportedDocumentTypeException ex) {
+            msg	= "Unknown document type in " + (fileOrig == null ? "stdin" : fileOrig.getAbsoluteFile()) + ": skipping";
+            if (this.verbose) {
+                System.err.println(msg);
+            }
+            logger.debug(msg);
+            return false;
+        }
+        if (bUpdated) {
+            msg = "Repairs made in " + (fileOrig == null ? "stdin" : fileOrig.getAbsoluteFile());
+            if (verbose) {
+                System.out.println(msg);
+            }
+            logger.debug(msg);
+        }
+        if (bUpdated || this.forceOutput) {
+            System.out.println((msg = "Writing to " + (fileDest == null ? "stdout" : fileDest.getAbsoluteFile())));
+            logger.info(msg);
+            String newDocument	= DOMUtil.toString(documentFile);
+            outputStream.write(newDocument.getBytes());
+            outputStream.flush();
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private void run(InputStream inputStream, File fileOrig) throws Exception {
+        if (this.outputFileOrDirectory == null) {
+            this.run(inputStream, fileOrig, System.out, null);
+        } else if (this.outputFileOrDirectory.exists()) {
+            if (this.outputFileOrDirectory.isDirectory()) {
+                File fileOutput	= new File(this.outputFileOrDirectory, fileOrig.getName());
+                boolean bWritten	= false;
+                try (FileOutputStream fileOutputStream	= new FileOutputStream(fileOutput) ) {
+                    bWritten	= this.run(inputStream, fileOrig, fileOutputStream, fileOutput);
+                }
+                if (!bWritten) {
+                    fileOutput.delete();
+                }
+            } else {
+                FileOutputStream fileOutputStream	= null;
+                boolean bWritten	= false;
+                try {
+                    fileOutputStream	= new FileOutputStream(this.outputFileOrDirectory);
+                    bWritten	= this.run(inputStream, fileOrig, fileOutputStream, this.outputFileOrDirectory);
+                } finally {
+                    if (fileOutputStream != null) {
+                        fileOutputStream.close();
+                    }
+                }
+                if (!bWritten) {
+                    this.outputFileOrDirectory.delete();
+                }
+            }
+        } else {
+
+        }
+    }
+
+    private void run(File inputFile) throws Exception {
+        String msg;
+        if (!inputFile.exists()) {
+            System.err.println((msg = "Input file " + inputFile.getAbsolutePath() + " does not exist."));
+            logger.error(msg);
+            return;
+        } else if (inputFile.isDirectory()) {
+            File[] directoryContents	= inputFile.listFiles(new FilenameFilter() {
+                @Override
+                public boolean accept(File dir, String name) {
+                    return name.endsWith(".xml");
+                }
+            });
+            if (directoryContents != null && directoryContents.length > 0) {
+                for (File file: directoryContents) {
+                    this.run(file);
+                }
+            }
+        } else {
+            try (FileInputStream fileInputStream	= new FileInputStream(inputFile)) {
+                this.run(fileInputStream, inputFile);
+            }
+        }
+    }
+
+    private void run() throws Exception {
+        if (this.listInputFilesOrDirectories.size() == 0) {
+            this.run(System.in, (File)null);
+        } else {
+            for (File inputFile: this.listInputFilesOrDirectories) {
+                this.run(inputFile);
+            }
+        }
+    }
+
+    public XACMLRepair() {
+    }
+
+    public static void main(String[] args) {
+        XACMLRepair xacmlRepair	= new XACMLRepair();
+        try {
+            if (xacmlRepair.init(args)) {
+                xacmlRepair.run();
+            }
+        } catch (Exception ex) {
+            System.err.println("Exception: " + ex.getMessage());
+            ex.printStackTrace(System.err);
+            System.exit(1);;
+        }
+        System.exit(0);
+    }
 
 }
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceExpressionType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceExpressionType.java
index 30fbffc..ff144f3 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceExpressionType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceExpressionType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -41,9 +41,9 @@
 
 /**
  * <p>Java class for AdviceExpressionType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AdviceExpressionType">
  *   &lt;complexContent>
@@ -57,8 +57,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AdviceExpressionType", propOrder = {
@@ -76,25 +76,25 @@
 
     /**
      * Gets the value of the attributeAssignmentExpression property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributeAssignmentExpression property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributeAssignmentExpression().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link AttributeAssignmentExpressionType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributeAssignmentExpressionType> getAttributeAssignmentExpression() {
         if (attributeAssignmentExpression == null) {
@@ -105,11 +105,11 @@
 
     /**
      * Gets the value of the adviceId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getAdviceId() {
         return adviceId;
@@ -117,11 +117,11 @@
 
     /**
      * Sets the value of the adviceId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setAdviceId(String value) {
         this.adviceId = value;
@@ -129,11 +129,11 @@
 
     /**
      * Gets the value of the appliesTo property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType }
-     *     
+     *
      */
     public EffectType getAppliesTo() {
         return appliesTo;
@@ -141,11 +141,11 @@
 
     /**
      * Sets the value of the appliesTo property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType }
-     *     
+     *
      */
     public void setAppliesTo(EffectType value) {
         this.appliesTo = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceExpressionsType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceExpressionsType.java
index b3ddd29..60392b3 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceExpressionsType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceExpressionsType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for AdviceExpressionsType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AdviceExpressionsType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AdviceExpressionsType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the adviceExpression property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the adviceExpression property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAdviceExpression().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionType }
-     * 
-     * 
+     *
+     *
      */
     public List<AdviceExpressionType> getAdviceExpression() {
         if (adviceExpression == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceType.java
index 7fb78c3..5a149fd 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AdviceType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -41,9 +41,9 @@
 
 /**
  * <p>Java class for AdviceType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AdviceType">
  *   &lt;complexContent>
@@ -56,8 +56,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AdviceType", propOrder = {
@@ -73,25 +73,25 @@
 
     /**
      * Gets the value of the attributeAssignment property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributeAssignment property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributeAssignment().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link AttributeAssignmentType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributeAssignmentType> getAttributeAssignment() {
         if (attributeAssignment == null) {
@@ -102,11 +102,11 @@
 
     /**
      * Gets the value of the adviceId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getAdviceId() {
         return adviceId;
@@ -114,11 +114,11 @@
 
     /**
      * Sets the value of the adviceId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setAdviceId(String value) {
         this.adviceId = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AllOfType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AllOfType.java
index 71cf4f0..7fbe5dd 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AllOfType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AllOfType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for AllOfType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AllOfType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AllOfType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the match property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the match property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getMatch().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link MatchType }
-     * 
-     * 
+     *
+     *
      */
     public List<MatchType> getMatch() {
         if (match == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AnyOfType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AnyOfType.java
index a8bbb82..1c6bdd7 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AnyOfType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AnyOfType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for AnyOfType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AnyOfType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AnyOfType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the allOf property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the allOf property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAllOf().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType }
-     * 
-     * 
+     *
+     *
      */
     public List<AllOfType> getAllOf() {
         if (allOf == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ApplyType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ApplyType.java
index ae88dff..683e1fc 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ApplyType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ApplyType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -43,9 +43,9 @@
 
 /**
  * <p>Java class for ApplyType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ApplyType">
  *   &lt;complexContent>
@@ -59,8 +59,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ApplyType", propOrder = {
@@ -68,8 +68,7 @@
     "expression"
 })
 public class ApplyType
-    extends ExpressionType
-{
+    extends ExpressionType {
 
     @XmlElement(name = "Description")
     protected String description;
@@ -81,11 +80,11 @@
 
     /**
      * Gets the value of the description property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getDescription() {
         return description;
@@ -93,11 +92,11 @@
 
     /**
      * Sets the value of the description property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setDescription(String value) {
         this.description = value;
@@ -105,20 +104,20 @@
 
     /**
      * Gets the value of the expression property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the expression property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getExpression().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link FunctionType }{@code >}
@@ -128,8 +127,8 @@
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeSelectorType }{@code >}
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }{@code >}
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeValueType }{@code >}
-     * 
-     * 
+     *
+     *
      */
     public List<JAXBElement<?>> getExpression() {
         if (expression == null) {
@@ -140,11 +139,11 @@
 
     /**
      * Gets the value of the functionId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getFunctionId() {
         return functionId;
@@ -152,11 +151,11 @@
 
     /**
      * Sets the value of the functionId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setFunctionId(String value) {
         this.functionId = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AssociatedAdviceType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AssociatedAdviceType.java
index abc7003..b433c90 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AssociatedAdviceType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AssociatedAdviceType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for AssociatedAdviceType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AssociatedAdviceType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AssociatedAdviceType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the advice property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the advice property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAdvice().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceType }
-     * 
-     * 
+     *
+     *
      */
     public List<AdviceType> getAdvice() {
         if (advice == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeAssignmentExpressionType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeAssignmentExpressionType.java
index 33070c1..8286cfc 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeAssignmentExpressionType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeAssignmentExpressionType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for AttributeAssignmentExpressionType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AttributeAssignmentExpressionType">
  *   &lt;complexContent>
@@ -56,8 +56,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AttributeAssignmentExpressionType", propOrder = {
@@ -78,7 +78,7 @@
 
     /**
      * Gets the value of the expression property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType }{@code >}
@@ -88,7 +88,7 @@
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeSelectorType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType }{@code >}
-     *     
+     *
      */
     public JAXBElement<?> getExpression() {
         return expression;
@@ -96,7 +96,7 @@
 
     /**
      * Sets the value of the expression property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType }{@code >}
@@ -106,7 +106,7 @@
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeSelectorType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType }{@code >}
-     *     
+     *
      */
     public void setExpression(JAXBElement<?> value) {
         this.expression = ((JAXBElement<?> ) value);
@@ -114,11 +114,11 @@
 
     /**
      * Gets the value of the attributeId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getAttributeId() {
         return attributeId;
@@ -126,11 +126,11 @@
 
     /**
      * Sets the value of the attributeId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setAttributeId(String value) {
         this.attributeId = value;
@@ -138,11 +138,11 @@
 
     /**
      * Gets the value of the category property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getCategory() {
         return category;
@@ -150,11 +150,11 @@
 
     /**
      * Sets the value of the category property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setCategory(String value) {
         this.category = value;
@@ -162,11 +162,11 @@
 
     /**
      * Gets the value of the issuer property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getIssuer() {
         return issuer;
@@ -174,11 +174,11 @@
 
     /**
      * Sets the value of the issuer property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setIssuer(String value) {
         this.issuer = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeAssignmentType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeAssignmentType.java
index b4dbf24..5741f65 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeAssignmentType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeAssignmentType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for AttributeAssignmentType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AttributeAssignmentType">
  *   &lt;complexContent>
@@ -52,14 +52,13 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AttributeAssignmentType")
 public class AttributeAssignmentType
-    extends AttributeValueType
-{
+    extends AttributeValueType {
 
     @XmlAttribute(name = "AttributeId", required = true)
     @XmlSchemaType(name = "anyURI")
@@ -72,11 +71,11 @@
 
     /**
      * Gets the value of the attributeId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getAttributeId() {
         return attributeId;
@@ -84,11 +83,11 @@
 
     /**
      * Sets the value of the attributeId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setAttributeId(String value) {
         this.attributeId = value;
@@ -96,11 +95,11 @@
 
     /**
      * Gets the value of the category property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getCategory() {
         return category;
@@ -108,11 +107,11 @@
 
     /**
      * Sets the value of the category property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setCategory(String value) {
         this.category = value;
@@ -120,11 +119,11 @@
 
     /**
      * Gets the value of the issuer property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getIssuer() {
         return issuer;
@@ -132,11 +131,11 @@
 
     /**
      * Sets the value of the issuer property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setIssuer(String value) {
         this.issuer = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeDesignatorType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeDesignatorType.java
index 96c0ef5..102e1fe 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeDesignatorType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeDesignatorType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for AttributeDesignatorType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AttributeDesignatorType">
  *   &lt;complexContent>
@@ -53,14 +53,13 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AttributeDesignatorType")
 public class AttributeDesignatorType
-    extends ExpressionType
-{
+    extends ExpressionType {
 
     @XmlAttribute(name = "Category", required = true)
     @XmlSchemaType(name = "anyURI")
@@ -78,11 +77,11 @@
 
     /**
      * Gets the value of the category property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getCategory() {
         return category;
@@ -90,11 +89,11 @@
 
     /**
      * Sets the value of the category property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setCategory(String value) {
         this.category = value;
@@ -102,11 +101,11 @@
 
     /**
      * Gets the value of the attributeId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getAttributeId() {
         return attributeId;
@@ -114,11 +113,11 @@
 
     /**
      * Sets the value of the attributeId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setAttributeId(String value) {
         this.attributeId = value;
@@ -126,11 +125,11 @@
 
     /**
      * Gets the value of the dataType property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getDataType() {
         return dataType;
@@ -138,11 +137,11 @@
 
     /**
      * Sets the value of the dataType property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setDataType(String value) {
         this.dataType = value;
@@ -150,11 +149,11 @@
 
     /**
      * Gets the value of the issuer property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getIssuer() {
         return issuer;
@@ -162,11 +161,11 @@
 
     /**
      * Sets the value of the issuer property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setIssuer(String value) {
         this.issuer = value;
@@ -174,7 +173,7 @@
 
     /**
      * Gets the value of the mustBePresent property.
-     * 
+     *
      */
     public boolean isMustBePresent() {
         return mustBePresent;
@@ -182,7 +181,7 @@
 
     /**
      * Sets the value of the mustBePresent property.
-     * 
+     *
      */
     public void setMustBePresent(boolean value) {
         this.mustBePresent = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeSelectorType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeSelectorType.java
index 757f3ae..84eeb1c 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeSelectorType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeSelectorType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for AttributeSelectorType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AttributeSelectorType">
  *   &lt;complexContent>
@@ -53,14 +53,13 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AttributeSelectorType")
 public class AttributeSelectorType
-    extends ExpressionType
-{
+    extends ExpressionType {
 
     @XmlAttribute(name = "Category", required = true)
     @XmlSchemaType(name = "anyURI")
@@ -78,11 +77,11 @@
 
     /**
      * Gets the value of the category property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getCategory() {
         return category;
@@ -90,11 +89,11 @@
 
     /**
      * Sets the value of the category property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setCategory(String value) {
         this.category = value;
@@ -102,11 +101,11 @@
 
     /**
      * Gets the value of the contextSelectorId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getContextSelectorId() {
         return contextSelectorId;
@@ -114,11 +113,11 @@
 
     /**
      * Sets the value of the contextSelectorId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setContextSelectorId(String value) {
         this.contextSelectorId = value;
@@ -126,11 +125,11 @@
 
     /**
      * Gets the value of the path property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getPath() {
         return path;
@@ -138,11 +137,11 @@
 
     /**
      * Sets the value of the path property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setPath(String value) {
         this.path = value;
@@ -150,11 +149,11 @@
 
     /**
      * Gets the value of the dataType property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getDataType() {
         return dataType;
@@ -162,11 +161,11 @@
 
     /**
      * Sets the value of the dataType property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setDataType(String value) {
         this.dataType = value;
@@ -174,7 +173,7 @@
 
     /**
      * Gets the value of the mustBePresent property.
-     * 
+     *
      */
     public boolean isMustBePresent() {
         return mustBePresent;
@@ -182,7 +181,7 @@
 
     /**
      * Sets the value of the mustBePresent property.
-     * 
+     *
      */
     public void setMustBePresent(boolean value) {
         this.mustBePresent = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeType.java
index b708605..9631733 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -41,9 +41,9 @@
 
 /**
  * <p>Java class for AttributeType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AttributeType">
  *   &lt;complexContent>
@@ -58,8 +58,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AttributeType", propOrder = {
@@ -79,25 +79,25 @@
 
     /**
      * Gets the value of the attributeValue property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributeValue property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributeValue().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link AttributeValueType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributeValueType> getAttributeValue() {
         if (attributeValue == null) {
@@ -108,11 +108,11 @@
 
     /**
      * Gets the value of the attributeId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getAttributeId() {
         return attributeId;
@@ -120,11 +120,11 @@
 
     /**
      * Sets the value of the attributeId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setAttributeId(String value) {
         this.attributeId = value;
@@ -132,11 +132,11 @@
 
     /**
      * Gets the value of the issuer property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getIssuer() {
         return issuer;
@@ -144,11 +144,11 @@
 
     /**
      * Sets the value of the issuer property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setIssuer(String value) {
         this.issuer = value;
@@ -156,7 +156,7 @@
 
     /**
      * Gets the value of the includeInResult property.
-     * 
+     *
      */
     public boolean isIncludeInResult() {
         return includeInResult;
@@ -164,7 +164,7 @@
 
     /**
      * Sets the value of the includeInResult property.
-     * 
+     *
      */
     public void setIncludeInResult(boolean value) {
         this.includeInResult = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeValueType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeValueType.java
index f127f6a..f5cf42d 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeValueType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributeValueType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -49,9 +49,9 @@
 
 /**
  * <p>Java class for AttributeValueType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AttributeValueType">
  *   &lt;complexContent>
@@ -65,8 +65,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AttributeValueType", propOrder = {
@@ -88,27 +88,27 @@
 
     /**
      * Gets the value of the content property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the content property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getContent().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link Object }
      * {@link String }
      * {@link org.w3c.dom.Element }
-     * 
-     * 
+     *
+     *
      */
     public List<Object> getContent() {
         if (content == null) {
@@ -119,11 +119,11 @@
 
     /**
      * Gets the value of the dataType property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getDataType() {
         return dataType;
@@ -131,11 +131,11 @@
 
     /**
      * Sets the value of the dataType property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setDataType(String value) {
         this.dataType = value;
@@ -143,15 +143,15 @@
 
     /**
      * Gets a map that contains attributes that aren't bound to any typed property on this class.
-     * 
+     *
      * <p>
-     * the map is keyed by the name of the attribute and 
+     * the map is keyed by the name of the attribute and
      * the value is the string value of the attribute.
-     * 
+     *
      * the map returned by this method is live, and you can add new attribute
      * by updating the map directly. Because of this design, there's no setter.
-     * 
-     * 
+     *
+     *
      * @return
      *     always non-null
      */
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributesReferenceType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributesReferenceType.java
index fd96bdd..2edeccf 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributesReferenceType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributesReferenceType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -38,9 +38,9 @@
 
 /**
  * <p>Java class for AttributesReferenceType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AttributesReferenceType">
  *   &lt;complexContent>
@@ -50,8 +50,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AttributesReferenceType")
@@ -64,11 +64,11 @@
 
     /**
      * Gets the value of the referenceId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link Object }
-     *     
+     *
      */
     public Object getReferenceId() {
         return referenceId;
@@ -76,11 +76,11 @@
 
     /**
      * Sets the value of the referenceId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link Object }
-     *     
+     *
      */
     public void setReferenceId(Object value) {
         this.referenceId = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributesType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributesType.java
index 44db120..2f3e262 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributesType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/AttributesType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -44,9 +44,9 @@
 
 /**
  * <p>Java class for AttributesType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="AttributesType">
  *   &lt;complexContent>
@@ -61,8 +61,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AttributesType", propOrder = {
@@ -86,11 +86,11 @@
 
     /**
      * Gets the value of the content property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ContentType }
-     *     
+     *
      */
     public ContentType getContent() {
         return content;
@@ -98,11 +98,11 @@
 
     /**
      * Sets the value of the content property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ContentType }
-     *     
+     *
      */
     public void setContent(ContentType value) {
         this.content = value;
@@ -110,25 +110,25 @@
 
     /**
      * Gets the value of the attribute property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attribute property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttribute().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributeType> getAttribute() {
         if (attribute == null) {
@@ -139,11 +139,11 @@
 
     /**
      * Gets the value of the category property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getCategory() {
         return category;
@@ -151,11 +151,11 @@
 
     /**
      * Sets the value of the category property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setCategory(String value) {
         this.category = value;
@@ -163,11 +163,11 @@
 
     /**
      * Gets the value of the id property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getId() {
         return id;
@@ -175,11 +175,11 @@
 
     /**
      * Sets the value of the id property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setId(String value) {
         this.id = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/CombinerParameterType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/CombinerParameterType.java
index 641c3ec..74b0256 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/CombinerParameterType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/CombinerParameterType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for CombinerParameterType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="CombinerParameterType">
  *   &lt;complexContent>
@@ -52,8 +52,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "CombinerParameterType", propOrder = {
@@ -68,11 +68,11 @@
 
     /**
      * Gets the value of the attributeValue property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType }
-     *     
+     *
      */
     public AttributeValueType getAttributeValue() {
         return attributeValue;
@@ -80,11 +80,11 @@
 
     /**
      * Sets the value of the attributeValue property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType }
-     *     
+     *
      */
     public void setAttributeValue(AttributeValueType value) {
         this.attributeValue = value;
@@ -92,11 +92,11 @@
 
     /**
      * Gets the value of the parameterName property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getParameterName() {
         return parameterName;
@@ -104,11 +104,11 @@
 
     /**
      * Sets the value of the parameterName property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setParameterName(String value) {
         this.parameterName = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/CombinerParametersType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/CombinerParametersType.java
index 0a07c6f..8be9b38 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/CombinerParametersType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/CombinerParametersType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -40,9 +40,9 @@
 
 /**
  * <p>Java class for CombinerParametersType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="CombinerParametersType">
  *   &lt;complexContent>
@@ -54,8 +54,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "CombinerParametersType", propOrder = {
@@ -73,25 +73,25 @@
 
     /**
      * Gets the value of the combinerParameter property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the combinerParameter property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getCombinerParameter().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.CombinerParameterType }
-     * 
-     * 
+     *
+     *
      */
     public List<CombinerParameterType> getCombinerParameter() {
         if (combinerParameter == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ConditionType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ConditionType.java
index 07bb69f..609b13a 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ConditionType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ConditionType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for ConditionType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ConditionType">
  *   &lt;complexContent>
@@ -51,8 +51,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ConditionType", propOrder = {
@@ -65,7 +65,7 @@
 
     /**
      * Gets the value of the expression property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType }{@code >}
@@ -75,7 +75,7 @@
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeSelectorType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeValueType }{@code >}
-     *     
+     *
      */
     public JAXBElement<?> getExpression() {
         return expression;
@@ -83,7 +83,7 @@
 
     /**
      * Sets the value of the expression property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType }{@code >}
@@ -93,7 +93,7 @@
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeSelectorType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeValueType }{@code >}
-     *     
+     *
      */
     public void setExpression(JAXBElement<?> value) {
         this.expression = ((JAXBElement<?> ) value);
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ContentType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ContentType.java
index 409cefa..11f9ef3 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ContentType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ContentType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -42,9 +42,9 @@
 
 /**
  * <p>Java class for ContentType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ContentType">
  *   &lt;complexContent>
@@ -56,8 +56,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ContentType", propOrder = {
@@ -71,27 +71,27 @@
 
     /**
      * Gets the value of the content property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the content property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getContent().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link Object }
      * {@link String }
      * {@link org.w3c.dom.Element }
-     * 
-     * 
+     *
+     *
      */
     public List<Object> getContent() {
         if (content == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/DecisionType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/DecisionType.java
index c57b25a..f9b90d6 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/DecisionType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/DecisionType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -35,7 +35,7 @@
 
 /**
  * <p>Java class for DecisionType.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
  * <p>
  * <pre>
@@ -48,7 +48,7 @@
  *   &lt;/restriction>
  * &lt;/simpleType>
  * </pre>
- * 
+ *
  */
 @XmlType(name = "DecisionType")
 @XmlEnum
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/DefaultsType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/DefaultsType.java
index f668e0f..78daa7a 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/DefaultsType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/DefaultsType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for DefaultsType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="DefaultsType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "DefaultsType", propOrder = {
@@ -68,11 +68,11 @@
 
     /**
      * Gets the value of the xPathVersion property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getXPathVersion() {
         return xPathVersion;
@@ -80,11 +80,11 @@
 
     /**
      * Sets the value of the xPathVersion property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setXPathVersion(String value) {
         this.xPathVersion = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/EffectType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/EffectType.java
index cbb0962..3b963d1 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/EffectType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/EffectType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -35,7 +35,7 @@
 
 /**
  * <p>Java class for EffectType.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
  * <p>
  * <pre>
@@ -46,7 +46,7 @@
  *   &lt;/restriction>
  * &lt;/simpleType>
  * </pre>
- * 
+ *
  */
 @XmlType(name = "EffectType")
 @XmlEnum
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ExpressionType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ExpressionType.java
index 0014cc1..9816ca0 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ExpressionType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ExpressionType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -36,9 +36,9 @@
 
 /**
  * <p>Java class for ExpressionType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ExpressionType">
  *   &lt;complexContent>
@@ -47,8 +47,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ExpressionType")
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/FunctionType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/FunctionType.java
index 29a9ca9..6d2f4e3 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/FunctionType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/FunctionType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for FunctionType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="FunctionType">
  *   &lt;complexContent>
@@ -49,14 +49,13 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "FunctionType")
 public class FunctionType
-    extends ExpressionType
-{
+    extends ExpressionType {
 
     @XmlAttribute(name = "FunctionId", required = true)
     @XmlSchemaType(name = "anyURI")
@@ -64,11 +63,11 @@
 
     /**
      * Gets the value of the functionId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getFunctionId() {
         return functionId;
@@ -76,11 +75,11 @@
 
     /**
      * Sets the value of the functionId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setFunctionId(String value) {
         this.functionId = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/IdReferenceType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/IdReferenceType.java
index fc58f35..bea3565 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/IdReferenceType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/IdReferenceType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -38,9 +38,9 @@
 
 /**
  * <p>Java class for IdReferenceType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="IdReferenceType">
  *   &lt;simpleContent>
@@ -52,8 +52,8 @@
  *   &lt;/simpleContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "IdReferenceType", propOrder = {
@@ -73,11 +73,11 @@
 
     /**
      * Gets the value of the value property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getValue() {
         return value;
@@ -85,11 +85,11 @@
 
     /**
      * Sets the value of the value property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setValue(String value) {
         this.value = value;
@@ -97,11 +97,11 @@
 
     /**
      * Gets the value of the version property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getVersion() {
         return version;
@@ -109,11 +109,11 @@
 
     /**
      * Sets the value of the version property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setVersion(String value) {
         this.version = value;
@@ -121,11 +121,11 @@
 
     /**
      * Gets the value of the earliestVersion property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getEarliestVersion() {
         return earliestVersion;
@@ -133,11 +133,11 @@
 
     /**
      * Sets the value of the earliestVersion property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setEarliestVersion(String value) {
         this.earliestVersion = value;
@@ -145,11 +145,11 @@
 
     /**
      * Gets the value of the latestVersion property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getLatestVersion() {
         return latestVersion;
@@ -157,11 +157,11 @@
 
     /**
      * Sets the value of the latestVersion property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setLatestVersion(String value) {
         this.latestVersion = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MatchType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MatchType.java
index c870b73..cc29fd9 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MatchType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MatchType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -38,9 +38,9 @@
 
 /**
  * <p>Java class for MatchType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="MatchType">
  *   &lt;complexContent>
@@ -57,8 +57,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "MatchType", propOrder = {
@@ -80,11 +80,11 @@
 
     /**
      * Gets the value of the attributeValue property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link AttributeValueType }
-     *     
+     *
      */
     public AttributeValueType getAttributeValue() {
         return attributeValue;
@@ -92,11 +92,11 @@
 
     /**
      * Sets the value of the attributeValue property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link AttributeValueType }
-     *     
+     *
      */
     public void setAttributeValue(AttributeValueType value) {
         this.attributeValue = value;
@@ -104,11 +104,11 @@
 
     /**
      * Gets the value of the attributeDesignator property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link AttributeDesignatorType }
-     *     
+     *
      */
     public AttributeDesignatorType getAttributeDesignator() {
         return attributeDesignator;
@@ -116,11 +116,11 @@
 
     /**
      * Sets the value of the attributeDesignator property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link AttributeDesignatorType }
-     *     
+     *
      */
     public void setAttributeDesignator(AttributeDesignatorType value) {
         this.attributeDesignator = value;
@@ -128,11 +128,11 @@
 
     /**
      * Gets the value of the attributeSelector property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link AttributeSelectorType }
-     *     
+     *
      */
     public AttributeSelectorType getAttributeSelector() {
         return attributeSelector;
@@ -140,11 +140,11 @@
 
     /**
      * Sets the value of the attributeSelector property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link AttributeSelectorType }
-     *     
+     *
      */
     public void setAttributeSelector(AttributeSelectorType value) {
         this.attributeSelector = value;
@@ -152,11 +152,11 @@
 
     /**
      * Gets the value of the matchId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getMatchId() {
         return matchId;
@@ -164,11 +164,11 @@
 
     /**
      * Sets the value of the matchId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setMatchId(String value) {
         this.matchId = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MissingAttributeDetailType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MissingAttributeDetailType.java
index 48cbf5e..6e24770 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MissingAttributeDetailType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MissingAttributeDetailType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -41,9 +41,9 @@
 
 /**
  * <p>Java class for MissingAttributeDetailType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="MissingAttributeDetailType">
  *   &lt;complexContent>
@@ -59,8 +59,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "MissingAttributeDetailType", propOrder = {
@@ -84,25 +84,25 @@
 
     /**
      * Gets the value of the attributeValue property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributeValue property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributeValue().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributeValueType> getAttributeValue() {
         if (attributeValue == null) {
@@ -113,11 +113,11 @@
 
     /**
      * Gets the value of the category property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getCategory() {
         return category;
@@ -125,11 +125,11 @@
 
     /**
      * Sets the value of the category property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setCategory(String value) {
         this.category = value;
@@ -137,11 +137,11 @@
 
     /**
      * Gets the value of the attributeId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getAttributeId() {
         return attributeId;
@@ -149,11 +149,11 @@
 
     /**
      * Sets the value of the attributeId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setAttributeId(String value) {
         this.attributeId = value;
@@ -161,11 +161,11 @@
 
     /**
      * Gets the value of the dataType property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getDataType() {
         return dataType;
@@ -173,11 +173,11 @@
 
     /**
      * Sets the value of the dataType property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setDataType(String value) {
         this.dataType = value;
@@ -185,11 +185,11 @@
 
     /**
      * Gets the value of the issuer property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getIssuer() {
         return issuer;
@@ -197,11 +197,11 @@
 
     /**
      * Sets the value of the issuer property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setIssuer(String value) {
         this.issuer = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MultiRequestsType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MultiRequestsType.java
index d2ca3b8..34ae47f 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MultiRequestsType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/MultiRequestsType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for MultiRequestsType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="MultiRequestsType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "MultiRequestsType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the requestReference property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the requestReference property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getRequestReference().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link RequestReferenceType }
-     * 
-     * 
+     *
+     *
      */
     public List<RequestReferenceType> getRequestReference() {
         if (requestReference == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObjectFactory.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObjectFactory.java
index 4aebb48..4454a7b 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObjectFactory.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObjectFactory.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -35,18 +35,18 @@
 
 
 /**
- * This object contains factory methods for each 
- * Java content interface and Java element interface 
- * generated in the oasis.names.tc.xacml._3_0.core.schema.wd_17 package. 
- * <p>An ObjectFactory allows you to programatically 
- * construct new instances of the Java representation 
- * for XML content. The Java representation of XML 
- * content can consist of schema derived interfaces 
- * and classes representing the binding of schema 
- * type definitions, element declarations and model 
- * groups.  Factory methods for each of these are 
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the oasis.names.tc.xacml._3_0.core.schema.wd_17 package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups.  Factory methods for each of these are
  * provided in this class.
- * 
+ *
  */
 @XmlRegistry
 public class ObjectFactory {
@@ -109,14 +109,14 @@
 
     /**
      * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: oasis.names.tc.xacml._3_0.core.schema.wd_17
-     * 
+     *
      */
     public ObjectFactory() {
     }
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType }
-     * 
+     *
      */
     public TargetType createTargetType() {
         return new TargetType();
@@ -124,7 +124,7 @@
 
     /**
      * Create an instance of {@link PolicySetCombinerParametersType }
-     * 
+     *
      */
     public PolicySetCombinerParametersType createPolicySetCombinerParametersType() {
         return new PolicySetCombinerParametersType();
@@ -132,7 +132,7 @@
 
     /**
      * Create an instance of {@link MultiRequestsType }
-     * 
+     *
      */
     public MultiRequestsType createMultiRequestsType() {
         return new MultiRequestsType();
@@ -140,7 +140,7 @@
 
     /**
      * Create an instance of {@link ObligationsType }
-     * 
+     *
      */
     public ObligationsType createObligationsType() {
         return new ObligationsType();
@@ -148,7 +148,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType }
-     * 
+     *
      */
     public FunctionType createFunctionType() {
         return new FunctionType();
@@ -156,7 +156,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceType }
-     * 
+     *
      */
     public AdviceType createAdviceType() {
         return new AdviceType();
@@ -164,7 +164,7 @@
 
     /**
      * Create an instance of {@link AttributeSelectorType }
-     * 
+     *
      */
     public AttributeSelectorType createAttributeSelectorType() {
         return new AttributeSelectorType();
@@ -172,7 +172,7 @@
 
     /**
      * Create an instance of {@link RequestDefaultsType }
-     * 
+     *
      */
     public RequestDefaultsType createRequestDefaultsType() {
         return new RequestDefaultsType();
@@ -180,7 +180,7 @@
 
     /**
      * Create an instance of {@link PolicyIssuerType }
-     * 
+     *
      */
     public PolicyIssuerType createPolicyIssuerType() {
         return new PolicyIssuerType();
@@ -188,7 +188,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusType }
-     * 
+     *
      */
     public StatusType createStatusType() {
         return new StatusType();
@@ -196,7 +196,7 @@
 
     /**
      * Create an instance of {@link StatusDetailType }
-     * 
+     *
      */
     public StatusDetailType createStatusDetailType() {
         return new StatusDetailType();
@@ -204,7 +204,7 @@
 
     /**
      * Create an instance of {@link VariableReferenceType }
-     * 
+     *
      */
     public VariableReferenceType createVariableReferenceType() {
         return new VariableReferenceType();
@@ -212,7 +212,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType }
-     * 
+     *
      */
     public MatchType createMatchType() {
         return new MatchType();
@@ -220,7 +220,7 @@
 
     /**
      * Create an instance of {@link PolicyCombinerParametersType }
-     * 
+     *
      */
     public PolicyCombinerParametersType createPolicyCombinerParametersType() {
         return new PolicyCombinerParametersType();
@@ -228,7 +228,7 @@
 
     /**
      * Create an instance of {@link AttributeDesignatorType }
-     * 
+     *
      */
     public AttributeDesignatorType createAttributeDesignatorType() {
         return new AttributeDesignatorType();
@@ -236,7 +236,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.DefaultsType }
-     * 
+     *
      */
     public DefaultsType createDefaultsType() {
         return new DefaultsType();
@@ -244,7 +244,7 @@
 
     /**
      * Create an instance of {@link RuleCombinerParametersType }
-     * 
+     *
      */
     public RuleCombinerParametersType createRuleCombinerParametersType() {
         return new RuleCombinerParametersType();
@@ -252,7 +252,7 @@
 
     /**
      * Create an instance of {@link AssociatedAdviceType }
-     * 
+     *
      */
     public AssociatedAdviceType createAssociatedAdviceType() {
         return new AssociatedAdviceType();
@@ -260,7 +260,7 @@
 
     /**
      * Create an instance of {@link CombinerParametersType }
-     * 
+     *
      */
     public CombinerParametersType createCombinerParametersType() {
         return new CombinerParametersType();
@@ -268,7 +268,7 @@
 
     /**
      * Create an instance of {@link AttributesType }
-     * 
+     *
      */
     public AttributesType createAttributesType() {
         return new AttributesType();
@@ -276,7 +276,7 @@
 
     /**
      * Create an instance of {@link AttributesReferenceType }
-     * 
+     *
      */
     public AttributesReferenceType createAttributesReferenceType() {
         return new AttributesReferenceType();
@@ -284,7 +284,7 @@
 
     /**
      * Create an instance of {@link AttributeAssignmentType }
-     * 
+     *
      */
     public AttributeAssignmentType createAttributeAssignmentType() {
         return new AttributeAssignmentType();
@@ -292,7 +292,7 @@
 
     /**
      * Create an instance of {@link ObligationType }
-     * 
+     *
      */
     public ObligationType createObligationType() {
         return new ObligationType();
@@ -300,7 +300,7 @@
 
     /**
      * Create an instance of {@link ObligationExpressionType }
-     * 
+     *
      */
     public ObligationExpressionType createObligationExpressionType() {
         return new ObligationExpressionType();
@@ -308,7 +308,7 @@
 
     /**
      * Create an instance of {@link MissingAttributeDetailType }
-     * 
+     *
      */
     public MissingAttributeDetailType createMissingAttributeDetailType() {
         return new MissingAttributeDetailType();
@@ -316,7 +316,7 @@
 
     /**
      * Create an instance of {@link AdviceExpressionType }
-     * 
+     *
      */
     public AdviceExpressionType createAdviceExpressionType() {
         return new AdviceExpressionType();
@@ -324,7 +324,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ContentType }
-     * 
+     *
      */
     public ContentType createContentType() {
         return new ContentType();
@@ -332,7 +332,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType }
-     * 
+     *
      */
     public RuleType createRuleType() {
         return new RuleType();
@@ -340,7 +340,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType }
-     * 
+     *
      */
     public PolicyType createPolicyType() {
         return new PolicyType();
@@ -348,7 +348,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ConditionType }
-     * 
+     *
      */
     public ConditionType createConditionType() {
         return new ConditionType();
@@ -356,7 +356,7 @@
 
     /**
      * Create an instance of {@link VariableDefinitionType }
-     * 
+     *
      */
     public VariableDefinitionType createVariableDefinitionType() {
         return new VariableDefinitionType();
@@ -364,7 +364,7 @@
 
     /**
      * Create an instance of {@link ObligationExpressionsType }
-     * 
+     *
      */
     public ObligationExpressionsType createObligationExpressionsType() {
         return new ObligationExpressionsType();
@@ -372,7 +372,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ResponseType }
-     * 
+     *
      */
     public ResponseType createResponseType() {
         return new ResponseType();
@@ -380,7 +380,7 @@
 
     /**
      * Create an instance of {@link StatusCodeType }
-     * 
+     *
      */
     public StatusCodeType createStatusCodeType() {
         return new StatusCodeType();
@@ -388,7 +388,7 @@
 
     /**
      * Create an instance of {@link CombinerParameterType }
-     * 
+     *
      */
     public CombinerParameterType createCombinerParameterType() {
         return new CombinerParameterType();
@@ -396,7 +396,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.RequestType }
-     * 
+     *
      */
     public RequestType createRequestType() {
         return new RequestType();
@@ -404,7 +404,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }
-     * 
+     *
      */
     public ApplyType createApplyType() {
         return new ApplyType();
@@ -412,7 +412,7 @@
 
     /**
      * Create an instance of {@link PolicyIdentifierListType }
-     * 
+     *
      */
     public PolicyIdentifierListType createPolicyIdentifierListType() {
         return new PolicyIdentifierListType();
@@ -420,7 +420,7 @@
 
     /**
      * Create an instance of {@link RequestReferenceType }
-     * 
+     *
      */
     public RequestReferenceType createRequestReferenceType() {
         return new RequestReferenceType();
@@ -428,7 +428,7 @@
 
     /**
      * Create an instance of {@link IdReferenceType }
-     * 
+     *
      */
     public IdReferenceType createIdReferenceType() {
         return new IdReferenceType();
@@ -436,7 +436,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType }
-     * 
+     *
      */
     public AnyOfType createAnyOfType() {
         return new AnyOfType();
@@ -444,7 +444,7 @@
 
     /**
      * Create an instance of {@link PolicySetType }
-     * 
+     *
      */
     public PolicySetType createPolicySetType() {
         return new PolicySetType();
@@ -452,7 +452,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeType }
-     * 
+     *
      */
     public AttributeType createAttributeType() {
         return new AttributeType();
@@ -460,7 +460,7 @@
 
     /**
      * Create an instance of {@link AttributeValueType }
-     * 
+     *
      */
     public AttributeValueType createAttributeValueType() {
         return new AttributeValueType();
@@ -468,7 +468,7 @@
 
     /**
      * Create an instance of {@link AttributeAssignmentExpressionType }
-     * 
+     *
      */
     public AttributeAssignmentExpressionType createAttributeAssignmentExpressionType() {
         return new AttributeAssignmentExpressionType();
@@ -476,7 +476,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType }
-     * 
+     *
      */
     public AllOfType createAllOfType() {
         return new AllOfType();
@@ -484,7 +484,7 @@
 
     /**
      * Create an instance of {@link AdviceExpressionsType }
-     * 
+     *
      */
     public AdviceExpressionsType createAdviceExpressionsType() {
         return new AdviceExpressionsType();
@@ -492,7 +492,7 @@
 
     /**
      * Create an instance of {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ResultType }
-     * 
+     *
      */
     public ResultType createResultType() {
         return new ResultType();
@@ -500,7 +500,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link IdReferenceType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicySetIdReference")
     public JAXBElement<IdReferenceType> createPolicySetIdReference(IdReferenceType value) {
@@ -509,7 +509,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link IdReferenceType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicyIdReference")
     public JAXBElement<IdReferenceType> createPolicyIdReference(IdReferenceType value) {
@@ -518,7 +518,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributesType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Attributes")
     public JAXBElement<AttributesType> createAttributes(AttributesType value) {
@@ -527,7 +527,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ConditionType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Condition")
     public JAXBElement<ConditionType> createCondition(ConditionType value) {
@@ -536,7 +536,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link StatusCodeType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "StatusCode")
     public JAXBElement<StatusCodeType> createStatusCode(StatusCodeType value) {
@@ -545,7 +545,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeAssignmentExpressionType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AttributeAssignmentExpression")
     public JAXBElement<AttributeAssignmentExpressionType> createAttributeAssignmentExpression(AttributeAssignmentExpressionType value) {
@@ -554,7 +554,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link RuleCombinerParametersType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "RuleCombinerParameters")
     public JAXBElement<RuleCombinerParametersType> createRuleCombinerParameters(RuleCombinerParametersType value) {
@@ -563,7 +563,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AssociatedAdviceType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AssociatedAdvice")
     public JAXBElement<AssociatedAdviceType> createAssociatedAdvice(AssociatedAdviceType value) {
@@ -572,7 +572,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.DecisionType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Decision")
     public JAXBElement<DecisionType> createDecision(DecisionType value) {
@@ -581,7 +581,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link ObligationExpressionType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "ObligationExpression")
     public JAXBElement<ObligationExpressionType> createObligationExpression(ObligationExpressionType value) {
@@ -590,7 +590,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.DefaultsType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicySetDefaults")
     public JAXBElement<DefaultsType> createPolicySetDefaults(DefaultsType value) {
@@ -599,7 +599,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AdviceExpressionsType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AdviceExpressions")
     public JAXBElement<AdviceExpressionsType> createAdviceExpressions(AdviceExpressionsType value) {
@@ -608,7 +608,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Attribute")
     public JAXBElement<AttributeType> createAttribute(AttributeType value) {
@@ -617,7 +617,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeDesignatorType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AttributeDesignator", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", substitutionHeadName = "Expression")
     public JAXBElement<AttributeDesignatorType> createAttributeDesignator(AttributeDesignatorType value) {
@@ -626,7 +626,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AnyOf")
     public JAXBElement<AnyOfType> createAnyOf(AnyOfType value) {
@@ -635,7 +635,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link ObligationsType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Obligations")
     public JAXBElement<ObligationsType> createObligations(ObligationsType value) {
@@ -644,7 +644,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ResultType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Result")
     public JAXBElement<ResultType> createResult(ResultType value) {
@@ -653,7 +653,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link MultiRequestsType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "MultiRequests")
     public JAXBElement<MultiRequestsType> createMultiRequests(MultiRequestsType value) {
@@ -662,7 +662,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link ObligationType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Obligation")
     public JAXBElement<ObligationType> createObligation(ObligationType value) {
@@ -671,7 +671,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Policy")
     public JAXBElement<PolicyType> createPolicy(PolicyType value) {
@@ -680,7 +680,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link StatusDetailType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "StatusDetail")
     public JAXBElement<StatusDetailType> createStatusDetail(StatusDetailType value) {
@@ -689,7 +689,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link String }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "StatusMessage")
     public JAXBElement<String> createStatusMessage(String value) {
@@ -698,7 +698,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link PolicySetType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicySet")
     public JAXBElement<PolicySetType> createPolicySet(PolicySetType value) {
@@ -707,7 +707,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link PolicyIssuerType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicyIssuer")
     public JAXBElement<PolicyIssuerType> createPolicyIssuer(PolicyIssuerType value) {
@@ -716,7 +716,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link VariableReferenceType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "VariableReference", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", substitutionHeadName = "Expression")
     public JAXBElement<VariableReferenceType> createVariableReference(VariableReferenceType value) {
@@ -725,7 +725,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link CombinerParameterType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "CombinerParameter")
     public JAXBElement<CombinerParameterType> createCombinerParameter(CombinerParameterType value) {
@@ -734,7 +734,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeValueType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AttributeValue", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", substitutionHeadName = "Expression")
     public JAXBElement<AttributeValueType> createAttributeValue(AttributeValueType value) {
@@ -743,7 +743,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link ObligationExpressionsType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "ObligationExpressions")
     public JAXBElement<ObligationExpressionsType> createObligationExpressions(ObligationExpressionsType value) {
@@ -752,7 +752,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link PolicySetCombinerParametersType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicySetCombinerParameters")
     public JAXBElement<PolicySetCombinerParametersType> createPolicySetCombinerParameters(PolicySetCombinerParametersType value) {
@@ -761,7 +761,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.RequestType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Request")
     public JAXBElement<RequestType> createRequest(RequestType value) {
@@ -770,7 +770,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link MissingAttributeDetailType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "MissingAttributeDetail")
     public JAXBElement<MissingAttributeDetailType> createMissingAttributeDetail(MissingAttributeDetailType value) {
@@ -779,7 +779,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link RequestReferenceType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "RequestReference")
     public JAXBElement<RequestReferenceType> createRequestReference(RequestReferenceType value) {
@@ -788,7 +788,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.DefaultsType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicyDefaults")
     public JAXBElement<DefaultsType> createPolicyDefaults(DefaultsType value) {
@@ -797,7 +797,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link PolicyIdentifierListType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicyIdentifierList")
     public JAXBElement<PolicyIdentifierListType> createPolicyIdentifierList(PolicyIdentifierListType value) {
@@ -806,7 +806,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link String }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "XPathVersion")
     public JAXBElement<String> createXPathVersion(String value) {
@@ -815,7 +815,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Target")
     public JAXBElement<TargetType> createTarget(TargetType value) {
@@ -824,7 +824,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeAssignmentType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AttributeAssignment")
     public JAXBElement<AttributeAssignmentType> createAttributeAssignment(AttributeAssignmentType value) {
@@ -833,7 +833,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ContentType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Content")
     public JAXBElement<ContentType> createContent(ContentType value) {
@@ -842,7 +842,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link CombinerParametersType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "CombinerParameters")
     public JAXBElement<CombinerParametersType> createCombinerParameters(CombinerParametersType value) {
@@ -851,7 +851,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link ExpressionType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Expression")
     public JAXBElement<ExpressionType> createExpression(ExpressionType value) {
@@ -860,7 +860,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Apply", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", substitutionHeadName = "Expression")
     public JAXBElement<ApplyType> createApply(ApplyType value) {
@@ -869,7 +869,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link VariableDefinitionType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "VariableDefinition")
     public JAXBElement<VariableDefinitionType> createVariableDefinition(VariableDefinitionType value) {
@@ -878,7 +878,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Function", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", substitutionHeadName = "Expression")
     public JAXBElement<FunctionType> createFunction(FunctionType value) {
@@ -887,7 +887,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Match")
     public JAXBElement<MatchType> createMatch(MatchType value) {
@@ -896,7 +896,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link String }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Description")
     public JAXBElement<String> createDescription(String value) {
@@ -905,7 +905,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AdviceExpressionType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AdviceExpression")
     public JAXBElement<AdviceExpressionType> createAdviceExpression(AdviceExpressionType value) {
@@ -914,7 +914,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link RequestDefaultsType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "RequestDefaults")
     public JAXBElement<RequestDefaultsType> createRequestDefaults(RequestDefaultsType value) {
@@ -923,7 +923,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributeSelectorType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AttributeSelector", substitutionHeadNamespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", substitutionHeadName = "Expression")
     public JAXBElement<AttributeSelectorType> createAttributeSelector(AttributeSelectorType value) {
@@ -932,7 +932,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link PolicyCombinerParametersType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "PolicyCombinerParameters")
     public JAXBElement<PolicyCombinerParametersType> createPolicyCombinerParameters(PolicyCombinerParametersType value) {
@@ -941,7 +941,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Advice")
     public JAXBElement<AdviceType> createAdvice(AdviceType value) {
@@ -950,7 +950,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Rule")
     public JAXBElement<RuleType> createRule(RuleType value) {
@@ -959,7 +959,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ResponseType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Response")
     public JAXBElement<ResponseType> createResponse(ResponseType value) {
@@ -968,7 +968,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Status")
     public JAXBElement<StatusType> createStatus(StatusType value) {
@@ -977,7 +977,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AllOf")
     public JAXBElement<AllOfType> createAllOf(AllOfType value) {
@@ -986,7 +986,7 @@
 
     /**
      * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link AttributesReferenceType }{@code >}}
-     * 
+     *
      */
     @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "AttributesReference")
     public JAXBElement<AttributesReferenceType> createAttributesReference(AttributesReferenceType value) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationExpressionType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationExpressionType.java
index f46af0b..4baccbe 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationExpressionType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationExpressionType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -41,9 +41,9 @@
 
 /**
  * <p>Java class for ObligationExpressionType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ObligationExpressionType">
  *   &lt;complexContent>
@@ -57,8 +57,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ObligationExpressionType", propOrder = {
@@ -76,25 +76,25 @@
 
     /**
      * Gets the value of the attributeAssignmentExpression property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributeAssignmentExpression property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributeAssignmentExpression().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link AttributeAssignmentExpressionType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributeAssignmentExpressionType> getAttributeAssignmentExpression() {
         if (attributeAssignmentExpression == null) {
@@ -105,11 +105,11 @@
 
     /**
      * Gets the value of the obligationId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getObligationId() {
         return obligationId;
@@ -117,11 +117,11 @@
 
     /**
      * Sets the value of the obligationId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setObligationId(String value) {
         this.obligationId = value;
@@ -129,11 +129,11 @@
 
     /**
      * Gets the value of the fulfillOn property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType }
-     *     
+     *
      */
     public EffectType getFulfillOn() {
         return fulfillOn;
@@ -141,11 +141,11 @@
 
     /**
      * Sets the value of the fulfillOn property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType }
-     *     
+     *
      */
     public void setFulfillOn(EffectType value) {
         this.fulfillOn = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationExpressionsType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationExpressionsType.java
index 6a46898..2e97524 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationExpressionsType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationExpressionsType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for ObligationExpressionsType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ObligationExpressionsType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ObligationExpressionsType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the obligationExpression property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the obligationExpression property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getObligationExpression().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionType }
-     * 
-     * 
+     *
+     *
      */
     public List<ObligationExpressionType> getObligationExpression() {
         if (obligationExpression == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationType.java
index 75e7e80..4c5bc61 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -41,9 +41,9 @@
 
 /**
  * <p>Java class for ObligationType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ObligationType">
  *   &lt;complexContent>
@@ -56,8 +56,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ObligationType", propOrder = {
@@ -73,25 +73,25 @@
 
     /**
      * Gets the value of the attributeAssignment property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributeAssignment property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributeAssignment().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link AttributeAssignmentType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributeAssignmentType> getAttributeAssignment() {
         if (attributeAssignment == null) {
@@ -102,11 +102,11 @@
 
     /**
      * Gets the value of the obligationId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getObligationId() {
         return obligationId;
@@ -114,11 +114,11 @@
 
     /**
      * Sets the value of the obligationId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setObligationId(String value) {
         this.obligationId = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationsType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationsType.java
index adc0479..8ff9ee8 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationsType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ObligationsType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for ObligationsType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ObligationsType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ObligationsType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the obligation property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the obligation property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getObligation().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationType }
-     * 
-     * 
+     *
+     *
      */
     public List<ObligationType> getObligation() {
         if (obligation == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyCombinerParametersType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyCombinerParametersType.java
index 1eb6a25..204c1a6 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyCombinerParametersType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyCombinerParametersType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for PolicyCombinerParametersType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="PolicyCombinerParametersType">
  *   &lt;complexContent>
@@ -49,14 +49,13 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "PolicyCombinerParametersType")
 public class PolicyCombinerParametersType
-    extends CombinerParametersType
-{
+    extends CombinerParametersType {
 
     @XmlAttribute(name = "PolicyIdRef", required = true)
     @XmlSchemaType(name = "anyURI")
@@ -64,11 +63,11 @@
 
     /**
      * Gets the value of the policyIdRef property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getPolicyIdRef() {
         return policyIdRef;
@@ -76,11 +75,11 @@
 
     /**
      * Sets the value of the policyIdRef property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setPolicyIdRef(String value) {
         this.policyIdRef = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyIdentifierListType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyIdentifierListType.java
index e3c188f..e1a2e6b 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyIdentifierListType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyIdentifierListType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -41,9 +41,9 @@
 
 /**
  * <p>Java class for PolicyIdentifierListType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="PolicyIdentifierListType">
  *   &lt;complexContent>
@@ -56,8 +56,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "PolicyIdentifierListType", propOrder = {
@@ -73,26 +73,26 @@
 
     /**
      * Gets the value of the policyIdReferenceOrPolicySetIdReference property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the policyIdReferenceOrPolicySetIdReference property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getPolicyIdReferenceOrPolicySetIdReference().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.IdReferenceType }{@code >}
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.IdReferenceType }{@code >}
-     * 
-     * 
+     *
+     *
      */
     public List<JAXBElement<IdReferenceType>> getPolicyIdReferenceOrPolicySetIdReference() {
         if (policyIdReferenceOrPolicySetIdReference == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyIssuerType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyIssuerType.java
index 1897c0d..a701146 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyIssuerType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyIssuerType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for PolicyIssuerType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="PolicyIssuerType">
  *   &lt;complexContent>
@@ -54,8 +54,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "PolicyIssuerType", propOrder = {
@@ -71,11 +71,11 @@
 
     /**
      * Gets the value of the content property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ContentType }
-     *     
+     *
      */
     public ContentType getContent() {
         return content;
@@ -83,11 +83,11 @@
 
     /**
      * Sets the value of the content property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ContentType }
-     *     
+     *
      */
     public void setContent(ContentType value) {
         this.content = value;
@@ -95,25 +95,25 @@
 
     /**
      * Gets the value of the attribute property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attribute property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttribute().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributeType> getAttribute() {
         if (attribute == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicySetCombinerParametersType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicySetCombinerParametersType.java
index 8057717..24d2879 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicySetCombinerParametersType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicySetCombinerParametersType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for PolicySetCombinerParametersType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="PolicySetCombinerParametersType">
  *   &lt;complexContent>
@@ -49,14 +49,13 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "PolicySetCombinerParametersType")
 public class PolicySetCombinerParametersType
-    extends CombinerParametersType
-{
+    extends CombinerParametersType {
 
     @XmlAttribute(name = "PolicySetIdRef", required = true)
     @XmlSchemaType(name = "anyURI")
@@ -64,11 +63,11 @@
 
     /**
      * Gets the value of the policySetIdRef property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getPolicySetIdRef() {
         return policySetIdRef;
@@ -76,11 +75,11 @@
 
     /**
      * Sets the value of the policySetIdRef property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setPolicySetIdRef(String value) {
         this.policySetIdRef = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicySetType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicySetType.java
index c22e746..76bad4e 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicySetType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicySetType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -45,9 +45,9 @@
 
 /**
  * <p>Java class for PolicySetType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="PolicySetType">
  *   &lt;complexContent>
@@ -77,8 +77,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "PolicySetType", propOrder = {
@@ -127,11 +127,11 @@
 
     /**
      * Gets the value of the description property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getDescription() {
         return description;
@@ -139,11 +139,11 @@
 
     /**
      * Sets the value of the description property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setDescription(String value) {
         this.description = value;
@@ -151,11 +151,11 @@
 
     /**
      * Gets the value of the policyIssuer property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link PolicyIssuerType }
-     *     
+     *
      */
     public PolicyIssuerType getPolicyIssuer() {
         return policyIssuer;
@@ -163,11 +163,11 @@
 
     /**
      * Sets the value of the policyIssuer property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link PolicyIssuerType }
-     *     
+     *
      */
     public void setPolicyIssuer(PolicyIssuerType value) {
         this.policyIssuer = value;
@@ -175,11 +175,11 @@
 
     /**
      * Gets the value of the policySetDefaults property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.DefaultsType }
-     *     
+     *
      */
     public DefaultsType getPolicySetDefaults() {
         return policySetDefaults;
@@ -187,11 +187,11 @@
 
     /**
      * Sets the value of the policySetDefaults property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.DefaultsType }
-     *     
+     *
      */
     public void setPolicySetDefaults(DefaultsType value) {
         this.policySetDefaults = value;
@@ -199,11 +199,11 @@
 
     /**
      * Gets the value of the target property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType }
-     *     
+     *
      */
     public TargetType getTarget() {
         return target;
@@ -211,11 +211,11 @@
 
     /**
      * Sets the value of the target property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType }
-     *     
+     *
      */
     public void setTarget(TargetType value) {
         this.target = value;
@@ -223,20 +223,20 @@
 
     /**
      * Gets the value of the policySetOrPolicyOrPolicySetIdReference property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the policySetOrPolicyOrPolicySetIdReference property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getPolicySetOrPolicyOrPolicySetIdReference().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link IdReferenceType }{@code >}
@@ -246,8 +246,8 @@
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link PolicySetCombinerParametersType }{@code >}
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType }{@code >}
      * {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicySetType }{@code >}
-     * 
-     * 
+     *
+     *
      */
     public List<JAXBElement<?>> getPolicySetOrPolicyOrPolicySetIdReference() {
         if (policySetOrPolicyOrPolicySetIdReference == null) {
@@ -258,11 +258,11 @@
 
     /**
      * Gets the value of the obligationExpressions property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link ObligationExpressionsType }
-     *     
+     *
      */
     public ObligationExpressionsType getObligationExpressions() {
         return obligationExpressions;
@@ -270,11 +270,11 @@
 
     /**
      * Sets the value of the obligationExpressions property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link ObligationExpressionsType }
-     *     
+     *
      */
     public void setObligationExpressions(ObligationExpressionsType value) {
         this.obligationExpressions = value;
@@ -282,11 +282,11 @@
 
     /**
      * Gets the value of the adviceExpressions property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link AdviceExpressionsType }
-     *     
+     *
      */
     public AdviceExpressionsType getAdviceExpressions() {
         return adviceExpressions;
@@ -294,11 +294,11 @@
 
     /**
      * Sets the value of the adviceExpressions property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link AdviceExpressionsType }
-     *     
+     *
      */
     public void setAdviceExpressions(AdviceExpressionsType value) {
         this.adviceExpressions = value;
@@ -306,11 +306,11 @@
 
     /**
      * Gets the value of the policySetId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getPolicySetId() {
         return policySetId;
@@ -318,11 +318,11 @@
 
     /**
      * Sets the value of the policySetId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setPolicySetId(String value) {
         this.policySetId = value;
@@ -330,11 +330,11 @@
 
     /**
      * Gets the value of the version property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getVersion() {
         return version;
@@ -342,11 +342,11 @@
 
     /**
      * Sets the value of the version property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setVersion(String value) {
         this.version = value;
@@ -354,11 +354,11 @@
 
     /**
      * Gets the value of the policyCombiningAlgId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getPolicyCombiningAlgId() {
         return policyCombiningAlgId;
@@ -366,11 +366,11 @@
 
     /**
      * Sets the value of the policyCombiningAlgId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setPolicyCombiningAlgId(String value) {
         this.policyCombiningAlgId = value;
@@ -378,11 +378,11 @@
 
     /**
      * Gets the value of the maxDelegationDepth property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link java.math.BigInteger }
-     *     
+     *
      */
     public BigInteger getMaxDelegationDepth() {
         return maxDelegationDepth;
@@ -390,11 +390,11 @@
 
     /**
      * Sets the value of the maxDelegationDepth property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link java.math.BigInteger }
-     *     
+     *
      */
     public void setMaxDelegationDepth(BigInteger value) {
         this.maxDelegationDepth = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyType.java
index e0f1899..7cf3a2f 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/PolicyType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -43,9 +43,9 @@
 
 /**
  * <p>Java class for PolicyType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="PolicyType">
  *   &lt;complexContent>
@@ -72,8 +72,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "PolicyType", propOrder = {
@@ -119,11 +119,11 @@
 
     /**
      * Gets the value of the description property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getDescription() {
         return description;
@@ -131,11 +131,11 @@
 
     /**
      * Sets the value of the description property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setDescription(String value) {
         this.description = value;
@@ -143,11 +143,11 @@
 
     /**
      * Gets the value of the policyIssuer property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link PolicyIssuerType }
-     *     
+     *
      */
     public PolicyIssuerType getPolicyIssuer() {
         return policyIssuer;
@@ -155,11 +155,11 @@
 
     /**
      * Sets the value of the policyIssuer property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link PolicyIssuerType }
-     *     
+     *
      */
     public void setPolicyIssuer(PolicyIssuerType value) {
         this.policyIssuer = value;
@@ -167,11 +167,11 @@
 
     /**
      * Gets the value of the policyDefaults property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link DefaultsType }
-     *     
+     *
      */
     public DefaultsType getPolicyDefaults() {
         return policyDefaults;
@@ -179,11 +179,11 @@
 
     /**
      * Sets the value of the policyDefaults property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link DefaultsType }
-     *     
+     *
      */
     public void setPolicyDefaults(DefaultsType value) {
         this.policyDefaults = value;
@@ -191,11 +191,11 @@
 
     /**
      * Gets the value of the target property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link TargetType }
-     *     
+     *
      */
     public TargetType getTarget() {
         return target;
@@ -203,11 +203,11 @@
 
     /**
      * Sets the value of the target property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link TargetType }
-     *     
+     *
      */
     public void setTarget(TargetType value) {
         this.target = value;
@@ -215,28 +215,28 @@
 
     /**
      * Gets the value of the combinerParametersOrRuleCombinerParametersOrVariableDefinition property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the combinerParametersOrRuleCombinerParametersOrVariableDefinition property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getCombinerParametersOrRuleCombinerParametersOrVariableDefinition().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link RuleCombinerParametersType }
      * {@link CombinerParametersType }
      * {@link VariableDefinitionType }
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType }
-     * 
-     * 
+     *
+     *
      */
     public List<Object> getCombinerParametersOrRuleCombinerParametersOrVariableDefinition() {
         if (combinerParametersOrRuleCombinerParametersOrVariableDefinition == null) {
@@ -247,11 +247,11 @@
 
     /**
      * Gets the value of the obligationExpressions property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link ObligationExpressionsType }
-     *     
+     *
      */
     public ObligationExpressionsType getObligationExpressions() {
         return obligationExpressions;
@@ -259,11 +259,11 @@
 
     /**
      * Sets the value of the obligationExpressions property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link ObligationExpressionsType }
-     *     
+     *
      */
     public void setObligationExpressions(ObligationExpressionsType value) {
         this.obligationExpressions = value;
@@ -271,11 +271,11 @@
 
     /**
      * Gets the value of the adviceExpressions property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link AdviceExpressionsType }
-     *     
+     *
      */
     public AdviceExpressionsType getAdviceExpressions() {
         return adviceExpressions;
@@ -283,11 +283,11 @@
 
     /**
      * Sets the value of the adviceExpressions property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link AdviceExpressionsType }
-     *     
+     *
      */
     public void setAdviceExpressions(AdviceExpressionsType value) {
         this.adviceExpressions = value;
@@ -295,11 +295,11 @@
 
     /**
      * Gets the value of the policyId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getPolicyId() {
         return policyId;
@@ -307,11 +307,11 @@
 
     /**
      * Sets the value of the policyId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setPolicyId(String value) {
         this.policyId = value;
@@ -319,11 +319,11 @@
 
     /**
      * Gets the value of the version property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getVersion() {
         return version;
@@ -331,11 +331,11 @@
 
     /**
      * Sets the value of the version property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setVersion(String value) {
         this.version = value;
@@ -343,11 +343,11 @@
 
     /**
      * Gets the value of the ruleCombiningAlgId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getRuleCombiningAlgId() {
         return ruleCombiningAlgId;
@@ -355,11 +355,11 @@
 
     /**
      * Sets the value of the ruleCombiningAlgId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setRuleCombiningAlgId(String value) {
         this.ruleCombiningAlgId = value;
@@ -367,11 +367,11 @@
 
     /**
      * Gets the value of the maxDelegationDepth property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link java.math.BigInteger }
-     *     
+     *
      */
     public BigInteger getMaxDelegationDepth() {
         return maxDelegationDepth;
@@ -379,11 +379,11 @@
 
     /**
      * Sets the value of the maxDelegationDepth property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link java.math.BigInteger }
-     *     
+     *
      */
     public void setMaxDelegationDepth(BigInteger value) {
         this.maxDelegationDepth = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestDefaultsType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestDefaultsType.java
index fd522f9..09df73e 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestDefaultsType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestDefaultsType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for RequestDefaultsType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="RequestDefaultsType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "RequestDefaultsType", propOrder = {
@@ -68,11 +68,11 @@
 
     /**
      * Gets the value of the xPathVersion property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getXPathVersion() {
         return xPathVersion;
@@ -80,11 +80,11 @@
 
     /**
      * Sets the value of the xPathVersion property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setXPathVersion(String value) {
         this.xPathVersion = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestReferenceType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestReferenceType.java
index efde79f..a165baa 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestReferenceType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestReferenceType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for RequestReferenceType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="RequestReferenceType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "RequestReferenceType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the attributesReference property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributesReference property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributesReference().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link AttributesReferenceType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributesReferenceType> getAttributesReference() {
         if (attributesReference == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestType.java
index 5782cf0..2dc1494 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RequestType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -40,9 +40,9 @@
 
 /**
  * <p>Java class for RequestType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="RequestType">
  *   &lt;complexContent>
@@ -58,8 +58,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "RequestType", propOrder = {
@@ -82,11 +82,11 @@
 
     /**
      * Gets the value of the requestDefaults property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link RequestDefaultsType }
-     *     
+     *
      */
     public RequestDefaultsType getRequestDefaults() {
         return requestDefaults;
@@ -94,11 +94,11 @@
 
     /**
      * Sets the value of the requestDefaults property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link RequestDefaultsType }
-     *     
+     *
      */
     public void setRequestDefaults(RequestDefaultsType value) {
         this.requestDefaults = value;
@@ -106,25 +106,25 @@
 
     /**
      * Gets the value of the attributes property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributes property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributes().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link AttributesType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributesType> getAttributes() {
         if (attributes == null) {
@@ -135,11 +135,11 @@
 
     /**
      * Gets the value of the multiRequests property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link MultiRequestsType }
-     *     
+     *
      */
     public MultiRequestsType getMultiRequests() {
         return multiRequests;
@@ -147,11 +147,11 @@
 
     /**
      * Sets the value of the multiRequests property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link MultiRequestsType }
-     *     
+     *
      */
     public void setMultiRequests(MultiRequestsType value) {
         this.multiRequests = value;
@@ -159,7 +159,7 @@
 
     /**
      * Gets the value of the returnPolicyIdList property.
-     * 
+     *
      */
     public boolean isReturnPolicyIdList() {
         return returnPolicyIdList;
@@ -167,7 +167,7 @@
 
     /**
      * Sets the value of the returnPolicyIdList property.
-     * 
+     *
      */
     public void setReturnPolicyIdList(boolean value) {
         this.returnPolicyIdList = value;
@@ -175,7 +175,7 @@
 
     /**
      * Gets the value of the combinedDecision property.
-     * 
+     *
      */
     public boolean isCombinedDecision() {
         return combinedDecision;
@@ -183,7 +183,7 @@
 
     /**
      * Sets the value of the combinedDecision property.
-     * 
+     *
      */
     public void setCombinedDecision(boolean value) {
         this.combinedDecision = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ResponseType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ResponseType.java
index 81d657d..1559a7f 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ResponseType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ResponseType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for ResponseType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ResponseType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ResponseType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the result property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the result property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getResult().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ResultType }
-     * 
-     * 
+     *
+     *
      */
     public List<ResultType> getResult() {
         if (result == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ResultType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ResultType.java
index 472d585..aa4d345 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ResultType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/ResultType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for ResultType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="ResultType">
  *   &lt;complexContent>
@@ -58,8 +58,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "ResultType", propOrder = {
@@ -87,11 +87,11 @@
 
     /**
      * Gets the value of the decision property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link DecisionType }
-     *     
+     *
      */
     public DecisionType getDecision() {
         return decision;
@@ -99,11 +99,11 @@
 
     /**
      * Sets the value of the decision property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link DecisionType }
-     *     
+     *
      */
     public void setDecision(DecisionType value) {
         this.decision = value;
@@ -111,11 +111,11 @@
 
     /**
      * Gets the value of the status property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link StatusType }
-     *     
+     *
      */
     public StatusType getStatus() {
         return status;
@@ -123,11 +123,11 @@
 
     /**
      * Sets the value of the status property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link StatusType }
-     *     
+     *
      */
     public void setStatus(StatusType value) {
         this.status = value;
@@ -135,11 +135,11 @@
 
     /**
      * Gets the value of the obligations property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link ObligationsType }
-     *     
+     *
      */
     public ObligationsType getObligations() {
         return obligations;
@@ -147,11 +147,11 @@
 
     /**
      * Sets the value of the obligations property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link ObligationsType }
-     *     
+     *
      */
     public void setObligations(ObligationsType value) {
         this.obligations = value;
@@ -159,11 +159,11 @@
 
     /**
      * Gets the value of the associatedAdvice property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link AssociatedAdviceType }
-     *     
+     *
      */
     public AssociatedAdviceType getAssociatedAdvice() {
         return associatedAdvice;
@@ -171,11 +171,11 @@
 
     /**
      * Sets the value of the associatedAdvice property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link AssociatedAdviceType }
-     *     
+     *
      */
     public void setAssociatedAdvice(AssociatedAdviceType value) {
         this.associatedAdvice = value;
@@ -183,25 +183,25 @@
 
     /**
      * Gets the value of the attributes property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the attributes property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAttributes().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link AttributesType }
-     * 
-     * 
+     *
+     *
      */
     public List<AttributesType> getAttributes() {
         if (attributes == null) {
@@ -212,11 +212,11 @@
 
     /**
      * Gets the value of the policyIdentifierList property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link PolicyIdentifierListType }
-     *     
+     *
      */
     public PolicyIdentifierListType getPolicyIdentifierList() {
         return policyIdentifierList;
@@ -224,11 +224,11 @@
 
     /**
      * Sets the value of the policyIdentifierList property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link PolicyIdentifierListType }
-     *     
+     *
      */
     public void setPolicyIdentifierList(PolicyIdentifierListType value) {
         this.policyIdentifierList = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RuleCombinerParametersType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RuleCombinerParametersType.java
index 16347b5..5503113 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RuleCombinerParametersType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RuleCombinerParametersType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -36,9 +36,9 @@
 
 /**
  * <p>Java class for RuleCombinerParametersType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="RuleCombinerParametersType">
  *   &lt;complexContent>
@@ -48,25 +48,24 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "RuleCombinerParametersType")
 public class RuleCombinerParametersType
-    extends CombinerParametersType
-{
+    extends CombinerParametersType {
 
     @XmlAttribute(name = "RuleIdRef", required = true)
     protected String ruleIdRef;
 
     /**
      * Gets the value of the ruleIdRef property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getRuleIdRef() {
         return ruleIdRef;
@@ -74,11 +73,11 @@
 
     /**
      * Sets the value of the ruleIdRef property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setRuleIdRef(String value) {
         this.ruleIdRef = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RuleType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RuleType.java
index 501fa22..65fc754 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RuleType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/RuleType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -37,9 +37,9 @@
 
 /**
  * <p>Java class for RuleType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="RuleType">
  *   &lt;complexContent>
@@ -57,8 +57,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "RuleType", propOrder = {
@@ -87,11 +87,11 @@
 
     /**
      * Gets the value of the description property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getDescription() {
         return description;
@@ -99,11 +99,11 @@
 
     /**
      * Sets the value of the description property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setDescription(String value) {
         this.description = value;
@@ -111,11 +111,11 @@
 
     /**
      * Gets the value of the target property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link TargetType }
-     *     
+     *
      */
     public TargetType getTarget() {
         return target;
@@ -123,11 +123,11 @@
 
     /**
      * Sets the value of the target property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link TargetType }
-     *     
+     *
      */
     public void setTarget(TargetType value) {
         this.target = value;
@@ -135,11 +135,11 @@
 
     /**
      * Gets the value of the condition property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link ConditionType }
-     *     
+     *
      */
     public ConditionType getCondition() {
         return condition;
@@ -147,11 +147,11 @@
 
     /**
      * Sets the value of the condition property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link ConditionType }
-     *     
+     *
      */
     public void setCondition(ConditionType value) {
         this.condition = value;
@@ -159,11 +159,11 @@
 
     /**
      * Gets the value of the obligationExpressions property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link ObligationExpressionsType }
-     *     
+     *
      */
     public ObligationExpressionsType getObligationExpressions() {
         return obligationExpressions;
@@ -171,11 +171,11 @@
 
     /**
      * Sets the value of the obligationExpressions property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link ObligationExpressionsType }
-     *     
+     *
      */
     public void setObligationExpressions(ObligationExpressionsType value) {
         this.obligationExpressions = value;
@@ -183,11 +183,11 @@
 
     /**
      * Gets the value of the adviceExpressions property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link AdviceExpressionsType }
-     *     
+     *
      */
     public AdviceExpressionsType getAdviceExpressions() {
         return adviceExpressions;
@@ -195,11 +195,11 @@
 
     /**
      * Sets the value of the adviceExpressions property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link AdviceExpressionsType }
-     *     
+     *
      */
     public void setAdviceExpressions(AdviceExpressionsType value) {
         this.adviceExpressions = value;
@@ -207,11 +207,11 @@
 
     /**
      * Gets the value of the ruleId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getRuleId() {
         return ruleId;
@@ -219,11 +219,11 @@
 
     /**
      * Sets the value of the ruleId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setRuleId(String value) {
         this.ruleId = value;
@@ -231,11 +231,11 @@
 
     /**
      * Gets the value of the effect property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link EffectType }
-     *     
+     *
      */
     public EffectType getEffect() {
         return effect;
@@ -243,11 +243,11 @@
 
     /**
      * Sets the value of the effect property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link EffectType }
-     *     
+     *
      */
     public void setEffect(EffectType value) {
         this.effect = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusCodeType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusCodeType.java
index d4a4811..bb7f958 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusCodeType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusCodeType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -38,9 +38,9 @@
 
 /**
  * <p>Java class for StatusCodeType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="StatusCodeType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "StatusCodeType", propOrder = {
@@ -70,11 +70,11 @@
 
     /**
      * Gets the value of the statusCode property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusCodeType }
-     *     
+     *
      */
     public StatusCodeType getStatusCode() {
         return statusCode;
@@ -82,11 +82,11 @@
 
     /**
      * Sets the value of the statusCode property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.StatusCodeType }
-     *     
+     *
      */
     public void setStatusCode(StatusCodeType value) {
         this.statusCode = value;
@@ -94,11 +94,11 @@
 
     /**
      * Gets the value of the value property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getValue() {
         return value;
@@ -106,11 +106,11 @@
 
     /**
      * Sets the value of the value property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setValue(String value) {
         this.value = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusDetailType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusDetailType.java
index b00ccc1..f66ca1d 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusDetailType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusDetailType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -41,9 +41,9 @@
 
 /**
  * <p>Java class for StatusDetailType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="StatusDetailType">
  *   &lt;complexContent>
@@ -55,8 +55,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "StatusDetailType", propOrder = {
@@ -69,26 +69,26 @@
 
     /**
      * Gets the value of the any property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the any property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAny().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link Object }
      * {@link org.w3c.dom.Element }
-     * 
-     * 
+     *
+     *
      */
     public List<Object> getAny() {
         if (any == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusType.java
index cd0f138..cd4b84c 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/StatusType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -36,9 +36,9 @@
 
 /**
  * <p>Java class for StatusType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="StatusType">
  *   &lt;complexContent>
@@ -52,8 +52,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "StatusType", propOrder = {
@@ -72,11 +72,11 @@
 
     /**
      * Gets the value of the statusCode property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link StatusCodeType }
-     *     
+     *
      */
     public StatusCodeType getStatusCode() {
         return statusCode;
@@ -84,11 +84,11 @@
 
     /**
      * Sets the value of the statusCode property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link StatusCodeType }
-     *     
+     *
      */
     public void setStatusCode(StatusCodeType value) {
         this.statusCode = value;
@@ -96,11 +96,11 @@
 
     /**
      * Gets the value of the statusMessage property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getStatusMessage() {
         return statusMessage;
@@ -108,11 +108,11 @@
 
     /**
      * Sets the value of the statusMessage property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setStatusMessage(String value) {
         this.statusMessage = value;
@@ -120,11 +120,11 @@
 
     /**
      * Gets the value of the statusDetail property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link StatusDetailType }
-     *     
+     *
      */
     public StatusDetailType getStatusDetail() {
         return statusDetail;
@@ -132,11 +132,11 @@
 
     /**
      * Sets the value of the statusDetail property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link StatusDetailType }
-     *     
+     *
      */
     public void setStatusDetail(StatusDetailType value) {
         this.statusDetail = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/TargetType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/TargetType.java
index 0b34dfc..137ab04 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/TargetType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/TargetType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -39,9 +39,9 @@
 
 /**
  * <p>Java class for TargetType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="TargetType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "TargetType", propOrder = {
@@ -67,25 +67,25 @@
 
     /**
      * Gets the value of the anyOf property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
      * not a snapshot. Therefore any modification you make to the
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the anyOf property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
      * <pre>
      *    getAnyOf().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType }
-     * 
-     * 
+     *
+     *
      */
     public List<AnyOfType> getAnyOf() {
         if (anyOf == null) {
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/VariableDefinitionType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/VariableDefinitionType.java
index 54dc0d3..9ac5806 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/VariableDefinitionType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/VariableDefinitionType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -38,9 +38,9 @@
 
 /**
  * <p>Java class for VariableDefinitionType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="VariableDefinitionType">
  *   &lt;complexContent>
@@ -53,8 +53,8 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "VariableDefinitionType", propOrder = {
@@ -69,7 +69,7 @@
 
     /**
      * Gets the value of the expression property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType }{@code >}
@@ -79,7 +79,7 @@
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeSelectorType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType }{@code >}
-     *     
+     *
      */
     public JAXBElement<?> getExpression() {
         return expression;
@@ -87,7 +87,7 @@
 
     /**
      * Sets the value of the expression property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.FunctionType }{@code >}
@@ -97,7 +97,7 @@
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeSelectorType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType }{@code >}
      *     {@link javax.xml.bind.JAXBElement }{@code <}{@link oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType }{@code >}
-     *     
+     *
      */
     public void setExpression(JAXBElement<?> value) {
         this.expression = ((JAXBElement<?> ) value);
@@ -105,11 +105,11 @@
 
     /**
      * Gets the value of the variableId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getVariableId() {
         return variableId;
@@ -117,11 +117,11 @@
 
     /**
      * Sets the value of the variableId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setVariableId(String value) {
         this.variableId = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/VariableReferenceType.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/VariableReferenceType.java
index 27114a4..72ee9ed 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/VariableReferenceType.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/VariableReferenceType.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 
@@ -36,9 +36,9 @@
 
 /**
  * <p>Java class for VariableReferenceType complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="VariableReferenceType">
  *   &lt;complexContent>
@@ -48,25 +48,24 @@
  *   &lt;/complexContent>
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "VariableReferenceType")
 public class VariableReferenceType
-    extends ExpressionType
-{
+    extends ExpressionType {
 
     @XmlAttribute(name = "VariableId", required = true)
     protected String variableId;
 
     /**
      * Gets the value of the variableId property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getVariableId() {
         return variableId;
@@ -74,11 +73,11 @@
 
     /**
      * Sets the value of the variableId property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setVariableId(String value) {
         this.variableId = value;
diff --git a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/package-info.java b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/package-info.java
index 7cad659..7d739e7 100644
--- a/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/package-info.java
+++ b/openaz-xacml/src/main/java/oasis/names/tc/xacml/_3_0/core/schema/wd_17/package-info.java
@@ -6,23 +6,23 @@
  *  to you 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. 
- *  
+ *  under the License.
+ *
  */
 
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2013.05.23 at 02:47:00 PM EDT 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2013.05.23 at 02:47:00 PM EDT
 //
 
 @javax.xml.bind.annotation.XmlSchema(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)